Bug 1219482 - Replace PRLogModuleInfo with LazyLogModule in uriloader subdirectory. r=erahm

--HG--
extra : rebase_source : 0c655b9602599b35fe4abecfc7011178574264af
This commit is contained in:
sajitk 2016-01-28 10:38:00 -05:00
parent aff6f586b9
commit 34f6287d12
12 changed files with 15 additions and 33 deletions

View File

@ -281,6 +281,7 @@ int main(int argc, _CONST char* argv[])
int result;
{
ScopedLogging log;
mozilla::LogModule::Init();
char **_argv;
/*

View File

@ -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
//
PRLogModuleInfo* gDocLoaderLog = nullptr;
mozilla::LazyLogModule gDocLoaderLog("DocLoader");
#if defined(DEBUG)
@ -115,10 +115,6 @@ nsDocLoader::nsDocLoader()
mDontFlushLayout(false),
mIsFlushingLayout(false)
{
if (nullptr == gDocLoaderLog) {
gDocLoaderLog = PR_NewLogModule("DocLoader");
}
ClearInternalProgress();
MOZ_LOG(gDocLoaderLog, LogLevel::Debug,

View File

@ -50,7 +50,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/Preferences.h"
PRLogModuleInfo* nsURILoader::mLog = nullptr;
mozilla::LazyLogModule nsURILoader::mLog("URILoader");
#define LOG(args) MOZ_LOG(nsURILoader::mLog, mozilla::LogLevel::Debug, args)
#define LOG_ERROR(args) MOZ_LOG(nsURILoader::mLog, mozilla::LogLevel::Error, args)
@ -754,9 +754,6 @@ nsDocumentOpenInfo::TryContentListener(nsIURIContentListener* aListener,
nsURILoader::nsURILoader()
{
if (!mLog) {
mLog = PR_NewLogModule("URILoader");
}
}
nsURILoader::~nsURILoader()

View File

@ -49,9 +49,9 @@ protected:
nsCOMArray<nsIWeakReference> m_listeners;
/**
* NSPR logging. The module is called "URILoader"
* Logging. The module is called "URILoader"
*/
static PRLogModuleInfo* mLog;
static mozilla::LazyLogModule mLog;
friend class nsDocumentOpenInfo;
};

View File

@ -122,7 +122,7 @@ enum {
, NS_FOLDER_VALUE_CUSTOM = 2
};
PRLogModuleInfo* nsExternalHelperAppService::mLog = nullptr;
LazyLogModule nsExternalHelperAppService::mLog("HelperAppService");
// Using level 3 here because the OSHelperAppServices use a log level
// of LogLevel::Debug (4), and we want less detailed output here
@ -657,12 +657,6 @@ 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);

View File

@ -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 PRLogModuleInfo* mLog;
static mozilla::LazyLogModule mLog;
// friend, so that it can access the nspr log module.
friend class nsExternalAppHandler;

View File

@ -46,7 +46,7 @@ using mozilla::dom::ContentChild;
// this enables LogLevel::Debug level information and places all output in
// the file offlineupdate.log
//
extern PRLogModuleInfo *gOfflineCacheUpdateLog;
extern mozilla::LazyLogModule gOfflineCacheUpdateLog;
#undef LOG
#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)

View File

@ -15,7 +15,7 @@
#include "mozilla/Logging.h"
//
// To enable logging (see prlog.h for full details):
// To enable logging (see mozilla/Logging.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 PRLogModuleInfo *gOfflineCacheUpdateLog;
extern mozilla::LazyLogModule gOfflineCacheUpdateLog;
#undef LOG
#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)

View File

@ -31,7 +31,7 @@ using mozilla::dom::TabParent;
// this enables LogLevel::Debug level information and places all output in
// the file offlineupdate.log
//
extern PRLogModuleInfo *gOfflineCacheUpdateLog;
extern mozilla::LazyLogModule gOfflineCacheUpdateLog;
#undef LOG
#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)

View File

@ -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 PRLogModuleInfo *gOfflineCacheUpdateLog;
extern LazyLogModule gOfflineCacheUpdateLog;
#undef LOG
#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)

View File

@ -77,7 +77,7 @@ typedef mozilla::docshell::OfflineCacheUpdateGlue OfflineCacheUpdateGlue;
// this enables LogLevel::Debug level information and places all output in
// the file offlineupdate.log
//
PRLogModuleInfo *gOfflineCacheUpdateLog;
LazyLogModule gOfflineCacheUpdateLog("nsOfflineCacheUpdate");
#undef LOG
#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args)
@ -257,9 +257,6 @@ nsOfflineCacheUpdateService::~nsOfflineCacheUpdateService()
nsresult
nsOfflineCacheUpdateService::Init()
{
if (!gOfflineCacheUpdateLog)
gOfflineCacheUpdateLog = PR_NewLogModule("nsOfflineCacheUpdate");
// Observe xpcom-shutdown event
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();

View File

@ -36,7 +36,7 @@
using namespace mozilla;
//
// To enable logging (see prlog.h for full details):
// To enable logging (see mozilla/Logging.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 PRLogModuleInfo *gPrefetchLog;
static LazyLogModule gPrefetchLog("nsPrefetch");
#undef LOG
#define LOG(args) MOZ_LOG(gPrefetchLog, mozilla::LogLevel::Debug, args)
@ -333,9 +333,6 @@ nsPrefetchService::~nsPrefetchService()
nsresult
nsPrefetchService::Init()
{
if (!gPrefetchLog)
gPrefetchLog = PR_NewLogModule("nsPrefetch");
nsresult rv;
// read prefs and hook up pref observer