netwerk/cache/nsCache.h

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /**
     8  * Cache Service Utility Functions
     9  */
    11 #ifndef _nsCache_h_
    12 #define _nsCache_h_
    14 #if defined(MOZ_LOGGING)
    15 #define FORCE_PR_LOG
    16 #endif
    18 #if defined(PR_LOG)
    19 #error "If nsCache.h #included it must come before any files that #include prlog.h"
    20 #endif
    22 #include "prlog.h"
    23 #include "nsISupports.h"
    24 #include "nsIFile.h"
    25 #include "nsAString.h"
    26 #include "prtime.h"
    27 #include "nsError.h"
    29 // PR_LOG args = "format string", arg, arg, ...
    30 #if defined(PR_LOGGING)
    31 extern PRLogModuleInfo * gCacheLog;
    32 void   CacheLogInit();
    33 void   CacheLogPrintPath(PRLogModuleLevel level,
    34                          const char *     format,
    35                          nsIFile *        item);
    36 #define CACHE_LOG_INIT()        CacheLogInit()
    37 #define CACHE_LOG_ALWAYS(args)  PR_LOG(gCacheLog, PR_LOG_ALWAYS, args)
    38 #define CACHE_LOG_ERROR(args)   PR_LOG(gCacheLog, PR_LOG_ERROR, args)
    39 #define CACHE_LOG_WARNING(args) PR_LOG(gCacheLog, PR_LOG_WARNING, args)
    40 #define CACHE_LOG_DEBUG(args)   PR_LOG(gCacheLog, PR_LOG_DEBUG, args)
    41 #define CACHE_LOG_PATH(level, format, item) \
    42                                 CacheLogPrintPath(level, format, item)
    43 #else
    44 #define CACHE_LOG_INIT()        {}
    45 #define CACHE_LOG_ALWAYS(args)  {}
    46 #define CACHE_LOG_ERROR(args)   {}
    47 #define CACHE_LOG_WARNING(args) {}
    48 #define CACHE_LOG_DEBUG(args)   {}
    49 #define CACHE_LOG_PATH(level, format, item)  {}
    50 #endif
    53 extern uint32_t  SecondsFromPRTime(PRTime prTime);
    54 extern PRTime    PRTimeFromSeconds(uint32_t seconds);
    57 extern nsresult  ClientIDFromCacheKey(const nsACString&  key, char ** result);
    58 extern nsresult  ClientKeyFromCacheKey(const nsCString& key, nsACString &result);
    61 #endif // _nsCache_h

mercurial