Bug 795897 - Force NSPR logging for cache module in release build, r=jduell
authorMichal Novotny <michal.novotny@gmail.com>
Thu, 22 Nov 2012 02:14:00 +0100
changeset 123071 ea05f68a0c2c8709cc7712b08a371b84dd4a82dc
parent 123070 d6f7194f530fb324343dd0432c756e4a15eb0466
child 123072 35d619dc17076aeed310ef81484e36a7278bab61
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs795897
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 795897 - Force NSPR logging for cache module in release build, r=jduell
netwerk/cache/nsCache.h
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsDiskCacheBinding.cpp
netwerk/cache/nsDiskCacheDevice.cpp
netwerk/cache/nsDiskCacheEntry.cpp
netwerk/cache/nsDiskCacheMap.cpp
netwerk/cache/nsDiskCacheStreams.cpp
netwerk/cache/nsMemoryCacheDevice.cpp
--- a/netwerk/cache/nsCache.h
+++ b/netwerk/cache/nsCache.h
@@ -10,22 +10,26 @@
 
 #ifndef _nsCache_h_
 #define _nsCache_h_
 
 #if defined(MOZ_LOGGING)
 #define FORCE_PR_LOG
 #endif
 
+#if defined(PR_LOG)
+#error "If nsCache.h #included it must come before any files that #include prlog.h"
+#endif
+
+#include "prlog.h"
 #include "nsISupports.h"
 #include "nsIFile.h"
 #include "nsAString.h"
 #include "prtime.h"
 #include "nsError.h"
-#include "prlog.h"
 
 // PR_LOG args = "format string", arg, arg, ...
 #if defined(PR_LOGGING)
 extern PRLogModuleInfo * gCacheLog;
 void   CacheLogInit();
 void   CacheLogPrintPath(PRLogModuleLevel level,
                          const char *     format,
                          nsIFile *        item);
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -1,24 +1,24 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
+#include "nsCache.h"
 #include "nspr.h"
 #include "nsCacheEntry.h"
 #include "nsCacheEntryDescriptor.h"
 #include "nsCacheMetaData.h"
 #include "nsCacheRequest.h"
 #include "nsThreadUtils.h"
 #include "nsError.h"
 #include "nsICacheService.h"
-#include "nsCache.h"
 #include "nsCacheService.h"
 #include "nsCacheDevice.h"
 #include "nsHashKeys.h"
 
 using namespace mozilla;
 
 nsCacheEntry::nsCacheEntry(const nsACString &   key,
                            bool                 streamBased,
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include "nsCache.h"
 #include <limits.h>
 
 #include "nscore.h"
 #include "nsDiskCacheBinding.h"
 #include "nsCacheService.h"
 
 
 
--- a/netwerk/cache/nsDiskCacheDevice.cpp
+++ b/netwerk/cache/nsDiskCacheDevice.cpp
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include "nsCache.h"
 #include <limits.h>
 
 // include files for ftruncate (or equivalent)
 #if defined(XP_UNIX)
 #include <unistd.h>
 #elif defined(XP_WIN)
 #include <windows.h>
 #elif defined(XP_OS2)
@@ -27,17 +28,16 @@
 #include "nsDiskCacheDevice.h"
 #include "nsDiskCacheEntry.h"
 #include "nsDiskCacheMap.h"
 #include "nsDiskCacheStreams.h"
 
 #include "nsDiskCache.h"
 
 #include "nsCacheService.h"
-#include "nsCache.h"
 
 #include "nsDeleteDir.h"
 
 #include "nsICacheVisitor.h"
 #include "nsReadableUtils.h"
 #include "nsIInputStream.h"
 #include "nsIOutputStream.h"
 #include "nsCRT.h"
--- a/netwerk/cache/nsDiskCacheEntry.cpp
+++ b/netwerk/cache/nsDiskCacheEntry.cpp
@@ -1,21 +1,20 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include "nsCache.h"
 #include "nsDiskCache.h"
 #include "nsDiskCacheEntry.h"
 #include "nsDiskCacheBinding.h"
 #include "nsCRT.h"
 
-#include "nsCache.h"
-
 #include "nsISerializable.h"
 #include "nsSerializationHelper.h"
 
 /******************************************************************************
  *  nsDiskCacheEntry
  *****************************************************************************/
 
 /**
--- a/netwerk/cache/nsDiskCacheMap.cpp
+++ b/netwerk/cache/nsDiskCacheMap.cpp
@@ -1,22 +1,21 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim:set ts=4 sw=4 sts=4 cin et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include "nsCache.h"
 #include "nsDiskCacheMap.h"
 #include "nsDiskCacheBinding.h"
 #include "nsDiskCacheEntry.h"
 #include "nsDiskCacheDevice.h"
 #include "nsCacheService.h"
 
-#include "nsCache.h"
-
 #include <string.h>
 #include "nsPrintfCString.h"
 
 #include "nsISerializable.h"
 #include "nsSerializationHelper.h"
 
 #include "mozilla/Telemetry.h"
 
--- a/netwerk/cache/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/nsDiskCacheStreams.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
+#include "nsCache.h"
 #include "nsDiskCache.h"
 #include "nsDiskCacheDevice.h"
 #include "nsDiskCacheStreams.h"
 #include "nsCacheService.h"
 #include "mozilla/FileUtils.h"
 #include "nsIDiskCacheStreamInternal.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Telemetry.h"
--- a/netwerk/cache/nsMemoryCacheDevice.cpp
+++ b/netwerk/cache/nsMemoryCacheDevice.cpp
@@ -1,21 +1,21 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include "nsCache.h"
 #include "nsMemoryCacheDevice.h"
 #include "nsCacheService.h"
 #include "nsICacheService.h"
 #include "nsIStorageStream.h"
 #include "nsICacheVisitor.h"
 #include "nsCRT.h"
-#include "nsCache.h"
 #include "nsReadableUtils.h"
 #include "mozilla/Telemetry.h"
 
 // The memory cache implements the "LRU-SP" caching algorithm
 // described in "LRU-SP: A Size-Adjusted and Popularity-Aware LRU Replacement
 // Algorithm for Web Caching" by Kai Cheng and Yahiko Kambayashi.
 
 // We keep kQueueCount LRU queues, which should be about ceil(log2(mHardLimit))