Backed out changeset a1439ce8da77 (bug 1219482) to hopefully fix the intermittent hazard failures CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 29 Jan 2016 10:15:26 -0800
changeset 320579 155ce4441e22c9098c4949201d1b975a109951d0
parent 320578 c67d0eb738ed0ff59fca1cfc63efa46d49fc4d73
child 320580 7c16728755d3ce97463ab4030ae68b2a14ece625
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1219482
milestone47.0a1
backs outa1439ce8da77fe1387f4766dbe35761f24859399
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
Backed out changeset a1439ce8da77 (bug 1219482) to hopefully fix the intermittent hazard failures CLOSED TREE
b2g/app/nsBrowserApp.cpp
uriloader/base/nsDocLoader.cpp
uriloader/base/nsURILoader.cpp
uriloader/base/nsURILoader.h
uriloader/exthandler/nsExternalHelperAppService.cpp
uriloader/exthandler/nsExternalHelperAppService.h
uriloader/prefetch/OfflineCacheUpdateChild.cpp
uriloader/prefetch/OfflineCacheUpdateGlue.cpp
uriloader/prefetch/OfflineCacheUpdateParent.cpp
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
uriloader/prefetch/nsPrefetchService.cpp
--- a/b2g/app/nsBrowserApp.cpp
+++ b/b2g/app/nsBrowserApp.cpp
@@ -276,17 +276,16 @@ int main(int argc, _CONST char* argv[])
 #else
   #error "Unknown platform"  // having this here keeps cppcheck happy
 #endif
   }
 
   int result;
   {
     ScopedLogging log;
-    mozilla::LogModule::Init();
     char **_argv;
 
     /*
      * Duplicate argument vector to conform non-const argv of
      * do_main() since XRE_main() is very stupid with non-const argv.
      */
     _argv = new char *[argc + 1];
     for (int i = 0; i < argc; i++) {
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -45,17 +45,17 @@ static NS_DEFINE_CID(kThisImplCID, NS_TH
 // To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=DocLoader:5
 //    set NSPR_LOG_FILE=nspr.log
 //
 // this enables LogLevel::Debug level information and places all output in
 // the file nspr.log
 //
-mozilla::LazyLogModule gDocLoaderLog("DocLoader");
+PRLogModuleInfo* gDocLoaderLog = nullptr;
 
 
 #if defined(DEBUG)
 void GetURIStringFromRequest(nsIRequest* request, nsACString &name)
 {
     if (request)
         request->GetName(name);
     else
@@ -110,16 +110,20 @@ nsDocLoader::nsDocLoader()
     mMaxTotalProgress(0),
     mRequestInfoHash(&sRequestInfoHashOps, sizeof(nsRequestInfo)),
     mCompletedTotalProgress(0),
     mIsLoadingDocument(false),
     mIsRestoringDocument(false),
     mDontFlushLayout(false),
     mIsFlushingLayout(false)
 {
+  if (nullptr == gDocLoaderLog) {
+      gDocLoaderLog = PR_NewLogModule("DocLoader");
+  }
+
   ClearInternalProgress();
 
   MOZ_LOG(gDocLoaderLog, LogLevel::Debug,
          ("DocLoader:%p: created.\n", this));
 }
 
 nsresult
 nsDocLoader::SetDocLoaderParent(nsDocLoader *aParent)
--- a/uriloader/base/nsURILoader.cpp
+++ b/uriloader/base/nsURILoader.cpp
@@ -45,17 +45,17 @@
 #include "nsNetCID.h"
 
 #include "nsMimeTypes.h"
 
 #include "nsDocLoader.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Preferences.h"
 
-mozilla::LazyLogModule nsURILoader::mLog("URILoader");
+PRLogModuleInfo* nsURILoader::mLog = nullptr;
 
 #define LOG(args) MOZ_LOG(nsURILoader::mLog, mozilla::LogLevel::Debug, args)
 #define LOG_ERROR(args) MOZ_LOG(nsURILoader::mLog, mozilla::LogLevel::Error, args)
 #define LOG_ENABLED() MOZ_LOG_TEST(nsURILoader::mLog, mozilla::LogLevel::Debug)
 
 #define NS_PREF_DISABLE_BACKGROUND_HANDLING \
     "security.exthelperapp.disable_background_handling"
 
@@ -749,16 +749,19 @@ nsDocumentOpenInfo::TryContentListener(n
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
 // Implementation of nsURILoader
 ///////////////////////////////////////////////////////////////////////////////////////////////
 
 nsURILoader::nsURILoader()
 {
+  if (!mLog) {
+    mLog = PR_NewLogModule("URILoader");
+  }
 }
 
 nsURILoader::~nsURILoader()
 {
 }
 
 NS_IMPL_ADDREF(nsURILoader)
 NS_IMPL_RELEASE(nsURILoader)
--- a/uriloader/base/nsURILoader.h
+++ b/uriloader/base/nsURILoader.h
@@ -44,16 +44,16 @@ protected:
   /**
    * we shouldn't need to have an owning ref count on registered
    * content listeners because they are supposed to unregister themselves
    * when they go away. This array stores weak references
    */
   nsCOMArray<nsIWeakReference> m_listeners;
 
   /**
-   * Logging.  The module is called "URILoader"
+   * NSPR logging.  The module is called "URILoader"
    */
-  static mozilla::LazyLogModule mLog;
+  static PRLogModuleInfo* mLog;
   
   friend class nsDocumentOpenInfo;
 };
 
 #endif /* nsURILoader_h__ */
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -117,17 +117,17 @@ using namespace mozilla::ipc;
 #define NS_PREF_DOWNLOAD_DIR        "browser.download.dir"
 #define NS_PREF_DOWNLOAD_FOLDERLIST "browser.download.folderList"
 enum {
   NS_FOLDER_VALUE_DESKTOP = 0
 , NS_FOLDER_VALUE_DOWNLOADS = 1
 , NS_FOLDER_VALUE_CUSTOM = 2
 };
 
-LazyLogModule nsExternalHelperAppService::mLog("HelperAppService");
+PRLogModuleInfo* nsExternalHelperAppService::mLog = nullptr;
 
 // Using level 3 here because the OSHelperAppServices use a log level
 // of LogLevel::Debug (4), and we want less detailed output here
 // Using 3 instead of LogLevel::Warning because we don't output warnings
 #undef LOG
 #define LOG(args) MOZ_LOG(nsExternalHelperAppService::mLog, mozilla::LogLevel::Info, args)
 #define LOG_ENABLED() MOZ_LOG_TEST(nsExternalHelperAppService::mLog, mozilla::LogLevel::Info)
 
@@ -652,16 +652,22 @@ nsExternalHelperAppService::nsExternalHe
 }
 nsresult nsExternalHelperAppService::Init()
 {
   // Add an observer for profile change
   nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
   if (!obs)
     return NS_ERROR_FAILURE;
 
+  if (!mLog) {
+    mLog = PR_NewLogModule("HelperAppService");
+    if (!mLog)
+      return NS_ERROR_OUT_OF_MEMORY;
+  }
+
   nsresult rv = obs->AddObserver(this, "profile-before-change", true);
   NS_ENSURE_SUCCESS(rv, rv);
   return obs->AddObserver(this, "last-pb-context-exited", true);
 }
 
 nsExternalHelperAppService::~nsExternalHelperAppService()
 {
 }
--- a/uriloader/exthandler/nsExternalHelperAppService.h
+++ b/uriloader/exthandler/nsExternalHelperAppService.h
@@ -141,17 +141,17 @@ protected:
   bool GetTypeFromExtras(const nsACString& aExtension,
                                        nsACString& aMIMEType);
 
   /**
    * NSPR Logging Module. Usage: set NSPR_LOG_MODULES=HelperAppService:level,
    * where level should be 2 for errors, 3 for debug messages from the cross-
    * platform nsExternalHelperAppService, and 4 for os-specific debug messages.
    */
-  static mozilla::LazyLogModule mLog;
+  static PRLogModuleInfo* mLog;
 
   // friend, so that it can access the nspr log module.
   friend class nsExternalAppHandler;
 
   /**
    * Helper function for ExpungeTemporaryFiles and ExpungeTemporaryPrivateFiles
    */
   static void ExpungeTemporaryFilesHelper(nsCOMArray<nsIFile> &fileList);
--- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp
@@ -41,17 +41,17 @@ using mozilla::dom::ContentChild;
 // To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables LogLevel::Debug level information and places all output in
 // the file offlineupdate.log
 //
-extern mozilla::LazyLogModule gOfflineCacheUpdateLog;
+extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)
 
 #undef LOG_ENABLED
 #define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug)
 
 namespace mozilla {
--- a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp
@@ -10,25 +10,25 @@
 #include "nsIApplicationCache.h"
 #include "nsIApplicationCacheChannel.h"
 #include "nsIApplicationCacheContainer.h"
 #include "nsIChannel.h"
 #include "nsIDocument.h"
 #include "mozilla/Logging.h"
 
 //
-// To enable logging (see mozilla/Logging.h for full details):
+// To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables LogLevel::Info level information and places all output in
 // the file offlineupdate.log
 //
-extern mozilla::LazyLogModule gOfflineCacheUpdateLog;
+extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)
 
 #undef LOG_ENABLED
 #define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug)
 
 namespace mozilla {
--- a/uriloader/prefetch/OfflineCacheUpdateParent.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateParent.cpp
@@ -26,17 +26,17 @@ using mozilla::dom::TabParent;
 // To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables LogLevel::Debug level information and places all output in
 // the file offlineupdate.log
 //
-extern mozilla::LazyLogModule gOfflineCacheUpdateLog;
+extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)
 
 #undef LOG_ENABLED
 #define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug)
 
 namespace mozilla {
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -56,17 +56,17 @@ static const int32_t  kCustomProfileQuot
 // To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables LogLevel::Debug level information and places all output in
 // the file offlineupdate.log
 //
-extern LazyLogModule gOfflineCacheUpdateLog;
+extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)
 
 #undef LOG_ENABLED
 #define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug)
 
 class AutoFreeArray {
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -72,17 +72,17 @@ typedef mozilla::docshell::OfflineCacheU
 // To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables LogLevel::Debug level information and places all output in
 // the file offlineupdate.log
 //
-LazyLogModule gOfflineCacheUpdateLog("nsOfflineCacheUpdate");
+PRLogModuleInfo *gOfflineCacheUpdateLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)
 
 #undef LOG_ENABLED
 #define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug)
 
 //-----------------------------------------------------------------------------
@@ -252,16 +252,19 @@ nsOfflineCacheUpdateService::nsOfflineCa
 nsOfflineCacheUpdateService::~nsOfflineCacheUpdateService()
 {
     gOfflineCacheUpdateService = nullptr;
 }
 
 nsresult
 nsOfflineCacheUpdateService::Init()
 {
+    if (!gOfflineCacheUpdateLog)
+        gOfflineCacheUpdateLog = PR_NewLogModule("nsOfflineCacheUpdate");
+
     // Observe xpcom-shutdown event
     nsCOMPtr<nsIObserverService> observerService =
       mozilla::services::GetObserverService();
     if (!observerService)
       return NS_ERROR_FAILURE;
 
     nsresult rv = observerService->AddObserver(this,
                                                NS_XPCOM_SHUTDOWN_OBSERVER_ID,
--- a/uriloader/prefetch/nsPrefetchService.cpp
+++ b/uriloader/prefetch/nsPrefetchService.cpp
@@ -31,25 +31,25 @@
 #include "nsIDOMNode.h"
 #include "nsINode.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla;
 
 //
-// To enable logging (see mozilla/Logging.h for full details):
+// To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsPrefetch:5
 //    set NSPR_LOG_FILE=prefetch.log
 //
 // this enables LogLevel::Debug level information and places all output in
 // the file http.log
 //
-static LazyLogModule gPrefetchLog("nsPrefetch");
+static PRLogModuleInfo *gPrefetchLog;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gPrefetchLog, mozilla::LogLevel::Debug, args)
 
 #undef LOG_ENABLED
 #define LOG_ENABLED() MOZ_LOG_TEST(gPrefetchLog, mozilla::LogLevel::Debug)
 
 #define PREFETCH_PREF "network.prefetch-next"
@@ -328,16 +328,19 @@ nsPrefetchService::~nsPrefetchService()
     // cannot reach destructor if prefetch in progress (listener owns reference
     // to this service)
     EmptyQueue();
 }
 
 nsresult
 nsPrefetchService::Init()
 {
+    if (!gPrefetchLog)
+        gPrefetchLog = PR_NewLogModule("nsPrefetch");
+
     nsresult rv;
 
     // read prefs and hook up pref observer
     mDisabled = !Preferences::GetBool(PREFETCH_PREF, !mDisabled);
     Preferences::AddWeakObserver(this, PREFETCH_PREF);
 
     mMaxParallelism = Preferences::GetInt(PARALLELISM_PREF, mMaxParallelism);
     if (mMaxParallelism < 1) {