From 9cc0b33a5059116226b995d1dcde317d67d00b30 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Fri, 29 Jan 2016 10:15:26 -0800 Subject: [PATCH] Backed out changeset a1439ce8da77 (bug 1219482) to hopefully fix the intermittent hazard failures CLOSED TREE --- b2g/app/nsBrowserApp.cpp | 1 - uriloader/base/nsDocLoader.cpp | 6 +++++- uriloader/base/nsURILoader.cpp | 5 ++++- uriloader/base/nsURILoader.h | 4 ++-- uriloader/exthandler/nsExternalHelperAppService.cpp | 8 +++++++- uriloader/exthandler/nsExternalHelperAppService.h | 2 +- uriloader/prefetch/OfflineCacheUpdateChild.cpp | 2 +- uriloader/prefetch/OfflineCacheUpdateGlue.cpp | 4 ++-- uriloader/prefetch/OfflineCacheUpdateParent.cpp | 2 +- uriloader/prefetch/nsOfflineCacheUpdate.cpp | 2 +- uriloader/prefetch/nsOfflineCacheUpdateService.cpp | 5 ++++- uriloader/prefetch/nsPrefetchService.cpp | 7 +++++-- 12 files changed, 33 insertions(+), 15 deletions(-) diff --git a/b2g/app/nsBrowserApp.cpp b/b2g/app/nsBrowserApp.cpp index ae115bd922d..e7fcc431a5e 100644 --- a/b2g/app/nsBrowserApp.cpp +++ b/b2g/app/nsBrowserApp.cpp @@ -281,7 +281,6 @@ int main(int argc, _CONST char* argv[]) int result; { ScopedLogging log; - mozilla::LogModule::Init(); char **_argv; /* diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index 5e5700f9aeb..46e2f0fe373 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -50,7 +50,7 @@ static NS_DEFINE_CID(kThisImplCID, NS_THIS_DOCLOADER_IMPL_CID); // 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) @@ -115,6 +115,10 @@ nsDocLoader::nsDocLoader() mDontFlushLayout(false), mIsFlushingLayout(false) { + if (nullptr == gDocLoaderLog) { + gDocLoaderLog = PR_NewLogModule("DocLoader"); + } + ClearInternalProgress(); MOZ_LOG(gDocLoaderLog, LogLevel::Debug, diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index ad8a30a69c1..41dac98dfd3 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -50,7 +50,7 @@ #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) @@ -754,6 +754,9 @@ nsDocumentOpenInfo::TryContentListener(nsIURIContentListener* aListener, nsURILoader::nsURILoader() { + if (!mLog) { + mLog = PR_NewLogModule("URILoader"); + } } nsURILoader::~nsURILoader() diff --git a/uriloader/base/nsURILoader.h b/uriloader/base/nsURILoader.h index 1921d2e881c..c909300078a 100644 --- a/uriloader/base/nsURILoader.h +++ b/uriloader/base/nsURILoader.h @@ -49,9 +49,9 @@ protected: nsCOMArray 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; }; diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index a2333453c22..cb2059679c8 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -122,7 +122,7 @@ enum { , 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 @@ -657,6 +657,12 @@ nsresult nsExternalHelperAppService::Init() 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); diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h index ddf7a6d80f5..287066372d4 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.h +++ b/uriloader/exthandler/nsExternalHelperAppService.h @@ -146,7 +146,7 @@ protected: * 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; diff --git a/uriloader/prefetch/OfflineCacheUpdateChild.cpp b/uriloader/prefetch/OfflineCacheUpdateChild.cpp index c293537178a..dcb4eeb0f71 100644 --- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp @@ -46,7 +46,7 @@ using mozilla::dom::ContentChild; // 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) diff --git a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp index f4d889bb558..3aa89bca483 100644 --- a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp @@ -15,7 +15,7 @@ #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 @@ -23,7 +23,7 @@ // 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) diff --git a/uriloader/prefetch/OfflineCacheUpdateParent.cpp b/uriloader/prefetch/OfflineCacheUpdateParent.cpp index 4866073f41a..b83416ec02b 100644 --- a/uriloader/prefetch/OfflineCacheUpdateParent.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateParent.cpp @@ -31,7 +31,7 @@ using mozilla::dom::TabParent; // 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) diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.cpp b/uriloader/prefetch/nsOfflineCacheUpdate.cpp index 96d960842a6..f5c24ce2f50 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp @@ -61,7 +61,7 @@ static const int32_t kCustomProfileQuota = 512000; // 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) diff --git a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp index d2d2e083e5a..8711f818b72 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp @@ -77,7 +77,7 @@ typedef mozilla::docshell::OfflineCacheUpdateGlue OfflineCacheUpdateGlue; // 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) @@ -257,6 +257,9 @@ nsOfflineCacheUpdateService::~nsOfflineCacheUpdateService() nsresult nsOfflineCacheUpdateService::Init() { + if (!gOfflineCacheUpdateLog) + gOfflineCacheUpdateLog = PR_NewLogModule("nsOfflineCacheUpdate"); + // Observe xpcom-shutdown event nsCOMPtr observerService = mozilla::services::GetObserverService(); diff --git a/uriloader/prefetch/nsPrefetchService.cpp b/uriloader/prefetch/nsPrefetchService.cpp index b97798904d8..c1b56c8e691 100644 --- a/uriloader/prefetch/nsPrefetchService.cpp +++ b/uriloader/prefetch/nsPrefetchService.cpp @@ -36,7 +36,7 @@ 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 @@ -44,7 +44,7 @@ using namespace mozilla; // 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) @@ -333,6 +333,9 @@ nsPrefetchService::~nsPrefetchService() nsresult nsPrefetchService::Init() { + if (!gPrefetchLog) + gPrefetchLog = PR_NewLogModule("nsPrefetch"); + nsresult rv; // read prefs and hook up pref observer