From 58dea0dee970b463c8e1eb67ad40eb125b89a5f6 Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Thu, 7 May 2015 12:52:44 -0700 Subject: [PATCH] Bug 1162336 - Part 1: Remove instances of #ifdef PR_LOGGING in netwerk. r=froydnj PR_LOGGING is now always defined, we can remove #ifdefs checking for it. --- netwerk/base/BackgroundFileSaver.cpp | 7 ------- netwerk/base/Predictor.cpp | 6 ------ netwerk/base/nsAsyncRedirectVerifyHelper.cpp | 4 ---- netwerk/base/nsAsyncStreamCopier.cpp | 4 ---- netwerk/base/nsAutodialWin.cpp | 4 ---- netwerk/base/nsChannelClassifier.cpp | 4 ---- netwerk/base/nsDirectoryIndexStream.cpp | 8 -------- netwerk/base/nsInputStreamPump.cpp | 4 ---- netwerk/base/nsLoadGroup.cpp | 19 ------------------- netwerk/base/nsPACMan.cpp | 2 -- netwerk/base/nsProtocolProxyService.cpp | 2 -- netwerk/base/nsRequestObserverProxy.cpp | 4 ---- netwerk/base/nsSocketTransport2.cpp | 8 ++------ netwerk/base/nsSocketTransportService2.cpp | 4 ---- netwerk/base/nsSocketTransportService2.h | 2 -- netwerk/base/nsStandardURL.cpp | 8 -------- netwerk/cache/nsCache.cpp | 3 --- netwerk/cache/nsCache.h | 9 --------- netwerk/cache/nsCacheService.cpp | 8 -------- netwerk/cache/nsCacheService.h | 2 -- netwerk/cache/nsDiskCacheDevice.cpp | 2 -- netwerk/cache/nsDiskCacheDeviceSQL.cpp | 2 -- netwerk/cache2/CacheFile.cpp | 3 --- netwerk/cache2/CacheFileContextEvictor.cpp | 4 ---- netwerk/cache2/CacheFileIOManager.cpp | 7 ------- netwerk/cache2/CacheIndex.cpp | 2 -- netwerk/cache2/CacheIndex.h | 2 -- netwerk/cache2/CacheLog.cpp | 2 -- netwerk/cache2/CacheLog.h | 4 ---- netwerk/cache2/CacheStorageService.cpp | 4 ---- netwerk/cookie/nsCookieService.cpp | 14 -------------- netwerk/dns/GetAddrInfo.cpp | 5 ----- netwerk/dns/nsHostResolver.cpp | 10 +--------- netwerk/protocol/ftp/nsFTPChannel.cpp | 2 -- .../protocol/ftp/nsFtpConnectionThread.cpp | 2 -- .../protocol/ftp/nsFtpControlConnection.cpp | 2 -- netwerk/protocol/ftp/nsFtpProtocolHandler.cpp | 5 +---- netwerk/protocol/ftp/nsFtpProtocolHandler.h | 2 -- netwerk/protocol/http/HttpBaseChannel.cpp | 3 +-- netwerk/protocol/http/HttpLog.h | 2 -- netwerk/protocol/http/nsHttp.cpp | 2 -- netwerk/protocol/http/nsHttpChannel.cpp | 4 ---- netwerk/protocol/http/nsHttpHandler.cpp | 2 -- netwerk/protocol/http/nsHttpNTLMAuth.cpp | 2 -- netwerk/protocol/http/nsHttpTransaction.cpp | 9 +-------- netwerk/protocol/res/nsResProtocolHandler.cpp | 6 ------ .../rtsp/controller/RtspControllerChild.cpp | 2 -- .../rtsp/controller/RtspControllerParent.cpp | 2 -- .../websocket/BaseWebSocketChannel.cpp | 4 ---- .../websocket/WebSocketChannelParent.cpp | 2 -- netwerk/protocol/websocket/WebSocketLog.h | 2 -- .../protocol/wyciwyg/WyciwygChannelParent.cpp | 2 -- netwerk/protocol/wyciwyg/nsWyciwyg.cpp | 2 -- netwerk/protocol/wyciwyg/nsWyciwyg.h | 2 -- .../wyciwyg/nsWyciwygProtocolHandler.cpp | 2 -- netwerk/sctp/datachannel/DataChannel.cpp | 19 +------------------ netwerk/sctp/datachannel/DataChannelLog.h | 2 -- netwerk/socket/nsSOCKSIOLayer.cpp | 12 +----------- .../converters/nsFTPDirListingConv.cpp | 4 ---- .../linux/nsNotifyAddrListener_Linux.cpp | 6 ------ netwerk/system/win32/nsNotifyAddrListener.cpp | 7 +------ netwerk/test/TestBlockingSocket.cpp | 6 ------ netwerk/test/TestIOThreads.cpp | 4 ---- netwerk/test/TestOverlappedIO.cpp | 6 ------ netwerk/test/TestProtocols.cpp | 4 ---- netwerk/test/TestServ.cpp | 4 ---- netwerk/test/TestSocketIO.cpp | 6 ------ netwerk/test/TestSocketTransport.cpp | 4 ---- netwerk/test/TestStreamChannel.cpp | 6 ------ netwerk/test/TestStreamLoader.cpp | 4 ---- netwerk/test/TestStreamPump.cpp | 6 ------ netwerk/test/TestStreamTransport.cpp | 4 ---- netwerk/test/TestUpload.cpp | 4 ---- netwerk/wifi/nsWifiAccessPoint.cpp | 2 -- netwerk/wifi/nsWifiMonitor.cpp | 4 ---- netwerk/wifi/nsWifiMonitor.h | 2 -- netwerk/wifi/nsWifiMonitorGonk.cpp | 4 ---- 77 files changed, 9 insertions(+), 347 deletions(-) diff --git a/netwerk/base/BackgroundFileSaver.cpp b/netwerk/base/BackgroundFileSaver.cpp index a3985996abc2..c77f41f8c720 100644 --- a/netwerk/base/BackgroundFileSaver.cpp +++ b/netwerk/base/BackgroundFileSaver.cpp @@ -33,14 +33,9 @@ namespace mozilla { namespace net { // NSPR_LOG_MODULES=BackgroundFileSaver:5 -#if defined(PR_LOGGING) PRLogModuleInfo *BackgroundFileSaver::prlog = nullptr; #define LOG(args) PR_LOG(BackgroundFileSaver::prlog, PR_LOG_DEBUG, args) #define LOG_ENABLED() PR_LOG_TEST(BackgroundFileSaver::prlog, 4) -#else -#define LOG(args) -#define LOG_ENABLED() (false) -#endif //////////////////////////////////////////////////////////////////////////////// //// Globals @@ -115,10 +110,8 @@ BackgroundFileSaver::BackgroundFileSaver() , mActualTargetKeepPartial(false) , mDigestContext(nullptr) { -#if defined(PR_LOGGING) if (!prlog) prlog = PR_NewLogModule("BackgroundFileSaver"); -#endif LOG(("Created BackgroundFileSaver [this = %p]", this)); } diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp index a5d4de80e67f..9e750d295468 100644 --- a/netwerk/base/Predictor.cpp +++ b/netwerk/base/Predictor.cpp @@ -53,12 +53,8 @@ namespace net { Predictor *Predictor::sSelf = nullptr; -#if defined(PR_LOGGING) static PRLogModuleInfo *gPredictorLog = nullptr; #define PREDICTOR_LOG(args) PR_LOG(gPredictorLog, 4, args) -#else -#define PREDICTOR_LOG(args) -#endif #define RETURN_IF_FAILED(_rv) \ do { \ @@ -315,9 +311,7 @@ Predictor::Predictor() ,mMaxResourcesPerEntry(PREDICTOR_MAX_RESOURCES_DEFAULT) ,mStartupCount(1) { -#if defined(PR_LOGGING) gPredictorLog = PR_NewLogModule("NetworkPredictor"); -#endif MOZ_ASSERT(!sSelf, "multiple Predictor instances!"); sSelf = this; diff --git a/netwerk/base/nsAsyncRedirectVerifyHelper.cpp b/netwerk/base/nsAsyncRedirectVerifyHelper.cpp index 3858864bdf59..6a61a6910cc9 100644 --- a/netwerk/base/nsAsyncRedirectVerifyHelper.cpp +++ b/netwerk/base/nsAsyncRedirectVerifyHelper.cpp @@ -14,7 +14,6 @@ #include "nsIAsyncVerifyRedirectCallback.h" #undef LOG -#ifdef PR_LOGGING static PRLogModuleInfo * GetRedirectLog() { @@ -24,9 +23,6 @@ GetRedirectLog() return sLog; } #define LOG(args) PR_LOG(GetRedirectLog(), PR_LOG_DEBUG, args) -#else -#define LOG(args) -#endif NS_IMPL_ISUPPORTS(nsAsyncRedirectVerifyHelper, nsIAsyncVerifyRedirectCallback, diff --git a/netwerk/base/nsAsyncStreamCopier.cpp b/netwerk/base/nsAsyncStreamCopier.cpp index 7287c53788aa..ad8584383c08 100644 --- a/netwerk/base/nsAsyncStreamCopier.cpp +++ b/netwerk/base/nsAsyncStreamCopier.cpp @@ -13,12 +13,10 @@ using namespace mozilla; #undef LOG -#if defined(PR_LOGGING) // // NSPR_LOG_MODULES=nsStreamCopier:5 // static PRLogModuleInfo *gStreamCopierLog = nullptr; -#endif #define LOG(args) PR_LOG(gStreamCopierLog, PR_LOG_DEBUG, args) /** @@ -69,10 +67,8 @@ nsAsyncStreamCopier::nsAsyncStreamCopier() , mIsPending(false) , mShouldSniffBuffering(false) { -#if defined(PR_LOGGING) if (!gStreamCopierLog) gStreamCopierLog = PR_NewLogModule("nsStreamCopier"); -#endif LOG(("Creating nsAsyncStreamCopier @%x\n", this)); } diff --git a/netwerk/base/nsAutodialWin.cpp b/netwerk/base/nsAutodialWin.cpp index d5a083565aeb..e34c27a30c0f 100644 --- a/netwerk/base/nsAutodialWin.cpp +++ b/netwerk/base/nsAutodialWin.cpp @@ -29,9 +29,7 @@ // the file nspr.log // -#ifdef PR_LOGGING static PRLogModuleInfo* gLog = nullptr; -#endif #undef LOGD #undef LOGE @@ -64,10 +62,8 @@ nsAutodial::~nsAutodial() // Returns NS_ERROR_FAILURE if error or NS_OK if success. nsresult nsAutodial::Init() { -#ifdef PR_LOGGING if (!gLog) gLog = PR_NewLogModule("Autodial"); -#endif mDefaultEntryName[0] = '\0'; mNumRASConnectionEntries = 0; diff --git a/netwerk/base/nsChannelClassifier.cpp b/netwerk/base/nsChannelClassifier.cpp index 5c7a36db352f..7859e1abe1ab 100644 --- a/netwerk/base/nsChannelClassifier.cpp +++ b/netwerk/base/nsChannelClassifier.cpp @@ -36,12 +36,10 @@ using mozilla::ArrayLength; using mozilla::Preferences; -#if defined(PR_LOGGING) // // NSPR_LOG_MODULES=nsChannelClassifier:5 // static PRLogModuleInfo *gChannelClassifierLog; -#endif #undef LOG #define LOG(args) PR_LOG(gChannelClassifierLog, PR_LOG_DEBUG, args) @@ -52,10 +50,8 @@ nsChannelClassifier::nsChannelClassifier() : mIsAllowListed(false), mSuspendedChannel(false) { -#if defined(PR_LOGGING) if (!gChannelClassifierLog) gChannelClassifierLog = PR_NewLogModule("nsChannelClassifier"); -#endif } nsresult diff --git a/netwerk/base/nsDirectoryIndexStream.cpp b/netwerk/base/nsDirectoryIndexStream.cpp index f7560f6b48d0..2748892b16d7 100644 --- a/netwerk/base/nsDirectoryIndexStream.cpp +++ b/netwerk/base/nsDirectoryIndexStream.cpp @@ -18,9 +18,7 @@ #include "nsDirectoryIndexStream.h" #include "prlog.h" #include "prtime.h" -#ifdef PR_LOGGING static PRLogModuleInfo* gLog; -#endif #include "nsISimpleEnumerator.h" #ifdef THREADSAFE_I18N @@ -46,10 +44,8 @@ static PRLogModuleInfo* gLog; nsDirectoryIndexStream::nsDirectoryIndexStream() : mOffset(0), mStatus(NS_OK), mPos(0) { -#ifdef PR_LOGGING if (! gLog) gLog = PR_NewLogModule("nsDirectoryIndexStream"); -#endif PR_LOG(gLog, PR_LOG_DEBUG, ("nsDirectoryIndexStream[%p]: created", this)); @@ -96,7 +92,6 @@ nsDirectoryIndexStream::Init(nsIFile* aDir) if (!isDir) return NS_ERROR_ILLEGAL_VALUE; -#ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) { nsAutoCString path; aDir->GetNativePath(path); @@ -104,7 +99,6 @@ nsDirectoryIndexStream::Init(nsIFile* aDir) ("nsDirectoryIndexStream[%p]: initialized on %s", this, path.get())); } -#endif // Sigh. We have to allocate on the heap because there are no // assignment operators defined. @@ -245,7 +239,6 @@ nsDirectoryIndexStream::Read(char* aBuf, uint32_t aCount, uint32_t* aReadCount) nsIFile* current = mArray.ObjectAt(mPos); ++mPos; -#ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) { nsAutoCString path; current->GetNativePath(path); @@ -253,7 +246,6 @@ nsDirectoryIndexStream::Read(char* aBuf, uint32_t aCount, uint32_t* aReadCount) ("nsDirectoryIndexStream[%p]: iterated %s", this, path.get())); } -#endif // rjc: don't return hidden files/directories! // bbaetz: why not? diff --git a/netwerk/base/nsInputStreamPump.cpp b/netwerk/base/nsInputStreamPump.cpp index 83e789401e76..8feb0bc564f4 100644 --- a/netwerk/base/nsInputStreamPump.cpp +++ b/netwerk/base/nsInputStreamPump.cpp @@ -21,12 +21,10 @@ static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID); -#if defined(PR_LOGGING) // // NSPR_LOG_MODULES=nsStreamPump:5 // static PRLogModuleInfo *gStreamPumpLog = nullptr; -#endif #undef LOG #define LOG(args) PR_LOG(gStreamPumpLog, PR_LOG_DEBUG, args) @@ -47,10 +45,8 @@ nsInputStreamPump::nsInputStreamPump() , mRetargeting(false) , mMonitor("nsInputStreamPump") { -#if defined(PR_LOGGING) if (!gStreamPumpLog) gStreamPumpLog = PR_NewLogModule("nsStreamPump"); -#endif } nsInputStreamPump::~nsInputStreamPump() diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp index 8047f6407dac..4d9a07d97c23 100644 --- a/netwerk/base/nsLoadGroup.cpp +++ b/netwerk/base/nsLoadGroup.cpp @@ -27,7 +27,6 @@ using namespace mozilla; using namespace mozilla::net; -#if defined(PR_LOGGING) // // Log module for nsILoadGroup logging... // @@ -40,7 +39,6 @@ using namespace mozilla::net; // the file nspr.log // static PRLogModuleInfo* gLoadGroupLog = nullptr; -#endif #undef LOG #define LOG(args) PR_LOG(gLoadGroupLog, PR_LOG_DEBUG, args) @@ -123,11 +121,9 @@ nsLoadGroup::nsLoadGroup(nsISupports* outer) { NS_INIT_AGGREGATED(outer); -#if defined(PR_LOGGING) // Initialize the global PRLogModule for nsILoadGroup logging if (nullptr == gLoadGroupLog) gLoadGroupLog = PR_NewLogModule("LoadGroup"); -#endif LOG(("LOADGROUP [%x]: Created.\n", this)); } @@ -261,12 +257,10 @@ nsLoadGroup::Cancel(nsresult status) continue; } -#if defined(PR_LOGGING) nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Canceling request %x %s.\n", this, request, nameStr.get())); -#endif // // Remove the request from the load group... This may cause @@ -329,12 +323,10 @@ nsLoadGroup::Suspend() if (!request) continue; -#if defined(PR_LOGGING) nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Suspending request %x %s.\n", this, request, nameStr.get())); -#endif // Suspend the request... rv = request->Suspend(); @@ -381,12 +373,10 @@ nsLoadGroup::Resume() if (!request) continue; -#if defined(PR_LOGGING) nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Resuming request %x %s.\n", this, request, nameStr.get())); -#endif // Resume the request... rv = request->Resume(); @@ -470,14 +460,12 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports* ctxt) { nsresult rv; -#if defined(PR_LOGGING) { nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Adding request %x %s (count=%d).\n", this, request, nameStr.get(), mRequests.EntryCount())); } -#endif /* PR_LOGGING */ NS_ASSERTION(!PL_DHashTableSearch(&mRequests, request), "Entry added to loadgroup twice, don't do that"); @@ -486,11 +474,8 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports* ctxt) // Do not add the channel, if the loadgroup is being canceled... // if (mIsCanceling) { - -#if defined(PR_LOGGING) LOG(("LOADGROUP [%x]: AddChannel() ABORTED because LoadGroup is" " being canceled!!\n", this)); -#endif /* PR_LOGGING */ return NS_BINDING_ABORTED; } @@ -572,14 +557,12 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt, NS_ENSURE_ARG_POINTER(request); nsresult rv; -#if defined(PR_LOGGING) { nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Removing request %x %s status %x (count=%d).\n", this, request, nameStr.get(), aStatus, mRequests.EntryCount() - 1)); } -#endif // Make sure we have a owning reference to the request we're about // to remove. @@ -662,12 +645,10 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt, rv = observer->OnStopRequest(request, ctxt, aStatus); -#if defined(PR_LOGGING) if (NS_FAILED(rv)) { LOG(("LOADGROUP [%x]: OnStopRequest for request %x FAILED.\n", this, request)); } -#endif } // If that was the last request -> remove ourselves from loadgroup diff --git a/netwerk/base/nsPACMan.cpp b/netwerk/base/nsPACMan.cpp index 31546b092078..ba0826e85971 100644 --- a/netwerk/base/nsPACMan.cpp +++ b/netwerk/base/nsPACMan.cpp @@ -25,8 +25,6 @@ using namespace mozilla; using namespace mozilla::net; -#if defined(PR_LOGGING) -#endif #undef LOG #define LOG(args) PR_LOG(GetProxyLog(), PR_LOG_DEBUG, args) diff --git a/netwerk/base/nsProtocolProxyService.cpp b/netwerk/base/nsProtocolProxyService.cpp index 2ee1de6f77b9..91099c5a8819 100644 --- a/netwerk/base/nsProtocolProxyService.cpp +++ b/netwerk/base/nsProtocolProxyService.cpp @@ -48,8 +48,6 @@ namespace mozilla { using namespace mozilla; #include "prlog.h" -#if defined(PR_LOGGING) -#endif #undef LOG #define LOG(args) PR_LOG(net::GetProxyLog(), PR_LOG_DEBUG, args) diff --git a/netwerk/base/nsRequestObserverProxy.cpp b/netwerk/base/nsRequestObserverProxy.cpp index 0ffbba46bdb4..af0c46cf3644 100644 --- a/netwerk/base/nsRequestObserverProxy.cpp +++ b/netwerk/base/nsRequestObserverProxy.cpp @@ -13,9 +13,7 @@ using namespace mozilla; -#if defined(PR_LOGGING) static PRLogModuleInfo *gRequestObserverProxyLog; -#endif #undef LOG #define LOG(args) PR_LOG(gRequestObserverProxyLog, PR_LOG_DEBUG, args) @@ -176,10 +174,8 @@ nsRequestObserverProxy::Init(nsIRequestObserver *observer, nsISupports *context) { NS_ENSURE_ARG_POINTER(observer); -#if defined(PR_LOGGING) if (!gRequestObserverProxyLog) gRequestObserverProxyLog = PR_NewLogModule("nsRequestObserverProxy"); -#endif mObserver = new nsMainThreadPtrHolder(observer); mContext = new nsMainThreadPtrHolder(context); diff --git a/netwerk/base/nsSocketTransport2.cpp b/netwerk/base/nsSocketTransport2.cpp index d8c3405cc0c7..aeebb3a6069c 100644 --- a/netwerk/base/nsSocketTransport2.cpp +++ b/netwerk/base/nsSocketTransport2.cpp @@ -1251,7 +1251,6 @@ nsSocketTransport::InitiateSocket() // connected - Bug 853423. if (mConnectionFlags & nsISocketTransport::DISABLE_RFC1918 && IsIPAddrLocal(&mNetAddr)) { -#ifdef PR_LOGGING if (SOCKET_LOG_ENABLED()) { nsAutoCString netAddrCString; netAddrCString.SetCapacity(kIPv6CStrBufSize); @@ -1265,7 +1264,6 @@ nsSocketTransport::InitiateSocket() mHost.get(), mPort, mProxyHost.get(), mProxyPort, netAddrCString.get())); } -#endif mCondition = NS_ERROR_CONNECTION_REFUSED; OnSocketDetached(nullptr); return mCondition; @@ -1372,13 +1370,11 @@ nsSocketTransport::InitiateSocket() mPollTimeout = mTimeouts[TIMEOUT_CONNECT]; SendStatus(NS_NET_STATUS_CONNECTING_TO); -#if defined(PR_LOGGING) if (SOCKET_LOG_ENABLED()) { char buf[kNetAddrMaxCStrBufSize]; NetAddrToString(&mNetAddr, buf, sizeof(buf)); SOCKET_LOG((" trying address: %s\n", buf)); } -#endif // // Initiate the connect() to the host... @@ -2807,7 +2803,7 @@ nsSocketTransport::TraceOutBuf(const char *buf, int32_t n) static void LogNSPRError(const char* aPrefix, const void *aObjPtr) { -#if defined(PR_LOGGING) && defined(DEBUG) +#if defined(DEBUG) PRErrorCode errCode = PR_GetError(); int errLen = PR_GetErrorTextLength(); nsAutoCString errStr; @@ -2847,7 +2843,7 @@ nsSocketTransport::PRFileDescAutoLock::SetKeepaliveEnabled(bool aEnable) static void LogOSError(const char *aPrefix, const void *aObjPtr) { -#if defined(PR_LOGGING) && defined(DEBUG) +#if defined(DEBUG) MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "wrong thread"); #ifdef XP_WIN diff --git a/netwerk/base/nsSocketTransportService2.cpp b/netwerk/base/nsSocketTransportService2.cpp index 959ee0f558d9..0c4d4b9f6853 100644 --- a/netwerk/base/nsSocketTransportService2.cpp +++ b/netwerk/base/nsSocketTransportService2.cpp @@ -29,9 +29,7 @@ using namespace mozilla; using namespace mozilla::net; -#if defined(PR_LOGGING) PRLogModuleInfo *gSocketTransportLog = nullptr; -#endif nsSocketTransportService *gSocketTransportService = nullptr; PRThread *gSocketThread = nullptr; @@ -80,9 +78,7 @@ nsSocketTransportService::nsSocketTransportService() , mTelemetryEnabledPref(false) , mProbedMaxCount(false) { -#if defined(PR_LOGGING) gSocketTransportLog = PR_NewLogModule("nsSocketTransport"); -#endif NS_ASSERTION(NS_IsMainThread(), "wrong thread"); diff --git a/netwerk/base/nsSocketTransportService2.h b/netwerk/base/nsSocketTransportService2.h index 777de4d5d1ff..a20f669318e2 100644 --- a/netwerk/base/nsSocketTransportService2.h +++ b/netwerk/base/nsSocketTransportService2.h @@ -25,12 +25,10 @@ struct PRPollDesc; //----------------------------------------------------------------------------- -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=nsSocketTransport:5 // extern PRLogModuleInfo *gSocketTransportLog; -#endif #define SOCKET_LOG(args) PR_LOG(gSocketTransportLog, PR_LOG_DEBUG, args) #define SOCKET_LOG_ENABLED() PR_LOG_TEST(gSocketTransportLog, PR_LOG_DEBUG) diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index b4a7bf3f3d32..4c736c5099df 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -37,12 +37,10 @@ bool nsStandardURL::gEscapeUTF8 = true; bool nsStandardURL::gAlwaysEncodeInUTF8 = true; char nsStandardURL::gHostLimitDigits[] = { '/', '\\', '?', '#', 0 }; -#if defined(PR_LOGGING) // // setenv NSPR_LOG_MODULES nsStandardURL:5 // static PRLogModuleInfo *gStandardURLLog; -#endif // The Chromium code defines its own LOG macro which we don't want #undef LOG @@ -254,10 +252,8 @@ nsStandardURL::nsStandardURL(bool aSupportsFileURL, bool aTrackURL) , mMutable(true) , mSupportsFileURL(aSupportsFileURL) { -#if defined(PR_LOGGING) if (!gStandardURLLog) gStandardURLLog = PR_NewLogModule("nsStandardURL"); -#endif LOG(("Creating nsStandardURL @%p\n", this)); @@ -1206,7 +1202,6 @@ nsStandardURL::SetSpec(const nsACString &input) return rv; } -#if defined(PR_LOGGING) if (LOG_ENABLED()) { LOG((" spec = %s\n", mSpec.get())); LOG((" port = %d\n", mPort)); @@ -1223,7 +1218,6 @@ nsStandardURL::SetSpec(const nsACString &input) LOG((" query = (%u,%d)\n", mQuery.mPos, mQuery.mLen)); LOG((" ref = (%u,%d)\n", mRef.mPos, mRef.mLen)); } -#endif return rv; } @@ -2710,14 +2704,12 @@ nsStandardURL::GetFile(nsIFile **result) if (NS_FAILED(rv)) return rv; -#if defined(PR_LOGGING) if (LOG_ENABLED()) { nsAutoCString path; mFile->GetNativePath(path); LOG(("nsStandardURL::GetFile [this=%p spec=%s resulting_path=%s]\n", this, mSpec.get(), path.get())); } -#endif // clone the file, so the caller can modify it. // XXX nsIFileURL.idl specifies that the consumer must _not_ modify the diff --git a/netwerk/cache/nsCache.cpp b/netwerk/cache/nsCache.cpp index d8ee2f1ffe1c..9b05d2205af9 100644 --- a/netwerk/cache/nsCache.cpp +++ b/netwerk/cache/nsCache.cpp @@ -14,7 +14,6 @@ * Cache Service Utility Functions */ -#if defined(PR_LOGGING) PRLogModuleInfo * gCacheLog = nullptr; @@ -39,8 +38,6 @@ CacheLogPrintPath(PRLogModuleLevel level, const char * format, nsIFile * item) } } -#endif - uint32_t SecondsFromPRTime(PRTime prTime) diff --git a/netwerk/cache/nsCache.h b/netwerk/cache/nsCache.h index 1c733dd7f1aa..3744331b2630 100644 --- a/netwerk/cache/nsCache.h +++ b/netwerk/cache/nsCache.h @@ -19,7 +19,6 @@ #include "nsError.h" // PR_LOG args = "format string", arg, arg, ... -#if defined(PR_LOGGING) extern PRLogModuleInfo * gCacheLog; void CacheLogInit(); void CacheLogPrintPath(PRLogModuleLevel level, @@ -32,14 +31,6 @@ void CacheLogPrintPath(PRLogModuleLevel level, #define CACHE_LOG_DEBUG(args) PR_LOG(gCacheLog, PR_LOG_DEBUG, args) #define CACHE_LOG_PATH(level, format, item) \ CacheLogPrintPath(level, format, item) -#else -#define CACHE_LOG_INIT() {} -#define CACHE_LOG_ALWAYS(args) {} -#define CACHE_LOG_ERROR(args) {} -#define CACHE_LOG_WARNING(args) {} -#define CACHE_LOG_DEBUG(args) {} -#define CACHE_LOG_PATH(level, format, item) {} -#endif extern uint32_t SecondsFromPRTime(PRTime prTime); diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp index 0dabb15369ee..e2fcb7f33e6d 100644 --- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -296,9 +296,7 @@ public: NS_IMETHOD Run() { nsCacheServiceAutoLock autoLock(LOCK_TELEM(NSBLOCKONCACHETHREADEVENT_RUN)); -#ifdef PR_LOGGING CACHE_LOG_DEBUG(("nsBlockOnCacheThreadEvent [%p]\n", this)); -#endif nsCacheService::gService->mCondVar.Notify(); return NS_OK; } @@ -1252,9 +1250,7 @@ nsCacheService::Shutdown() mCustomOfflineDevices.Enumerate(&nsCacheService::ShutdownCustomCacheDeviceEnum, nullptr); -#ifdef PR_LOGGING LogCacheStatistics(); -#endif mClearingEntries = false; mCacheIOThread.swap(cacheIOThread); @@ -1771,12 +1767,10 @@ nsCacheService::CreateCustomOfflineDevice(nsIFile *aProfileDir, { NS_ENSURE_ARG(aProfileDir); -#if defined(PR_LOGGING) nsAutoCString profilePath; aProfileDir->GetNativePath(profilePath); CACHE_LOG_ALWAYS(("Creating custom offline device, %s, %d", profilePath.BeginReading(), aQuota)); -#endif if (!mInitialized) return NS_ERROR_NOT_AVAILABLE; if (!mEnableOfflineDevice) return NS_ERROR_NOT_AVAILABLE; @@ -3117,7 +3111,6 @@ void nsCacheService::GetAppCacheDirectory(nsIFile ** result) } -#if defined(PR_LOGGING) void nsCacheService::LogCacheStatistics() { @@ -3137,7 +3130,6 @@ nsCacheService::LogCacheStatistics() CACHE_LOG_ALWAYS((" Deactivated Unbound Entries = %d\n", mDeactivatedUnboundEntries)); } -#endif nsresult nsCacheService::SetDiskSmartSize() diff --git a/netwerk/cache/nsCacheService.h b/netwerk/cache/nsCacheService.h index e6234e35b859..81c9e312d312 100644 --- a/netwerk/cache/nsCacheService.h +++ b/netwerk/cache/nsCacheService.h @@ -325,9 +325,7 @@ private: PLDHashOperator ShutdownCustomCacheDeviceEnum(const nsAString& aProfileDir, nsRefPtr& aDevice, void* aUserArg); -#if defined(PR_LOGGING) void LogCacheStatistics(); -#endif nsresult SetDiskSmartSize_Locked(); diff --git a/netwerk/cache/nsDiskCacheDevice.cpp b/netwerk/cache/nsDiskCacheDevice.cpp index 771414107f9f..04debdb8100e 100644 --- a/netwerk/cache/nsDiskCacheDevice.cpp +++ b/netwerk/cache/nsDiskCacheDevice.cpp @@ -65,9 +65,7 @@ public: NS_IMETHOD Run() { nsCacheServiceAutoLock lock(LOCK_TELEM(NSDISKCACHEDEVICEDEACTIVATEENTRYEVENT_RUN)); -#ifdef PR_LOGGING CACHE_LOG_DEBUG(("nsDiskCacheDeviceDeactivateEntryEvent[%p]\n", this)); -#endif if (!mCanceled) { (void) mDevice->DeactivateEntry_Private(mEntry, mBinding); } diff --git a/netwerk/cache/nsDiskCacheDeviceSQL.cpp b/netwerk/cache/nsDiskCacheDeviceSQL.cpp index a2b9e16adf19..0f17de7c1428 100644 --- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp +++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp @@ -225,11 +225,9 @@ nsOfflineCacheEvictionFunction::Apply() LOG(("nsOfflineCacheEvictionFunction::Apply\n")); for (int32_t i = 0; i < mItems.Count(); i++) { -#if defined(PR_LOGGING) nsAutoCString path; mItems[i]->GetNativePath(path); LOG((" removing %s\n", path.get())); -#endif mItems[i]->Remove(false); } diff --git a/netwerk/cache2/CacheFile.cpp b/netwerk/cache2/CacheFile.cpp index afea2c18fb74..6f2e58d34cd9 100644 --- a/netwerk/cache2/CacheFile.cpp +++ b/netwerk/cache2/CacheFile.cpp @@ -1877,10 +1877,7 @@ CacheFile::FailUpdateListeners( nsRefPtr& aChunk, void* aClosure) { -#ifdef PR_LOGGING CacheFile *file = static_cast(aClosure); -#endif - LOG(("CacheFile::FailUpdateListeners() [this=%p, idx=%u]", file, aIdx)); diff --git a/netwerk/cache2/CacheFileContextEvictor.cpp b/netwerk/cache2/CacheFileContextEvictor.cpp index c4980f07c14b..ad04d4dbf826 100644 --- a/netwerk/cache2/CacheFileContextEvictor.cpp +++ b/netwerk/cache2/CacheFileContextEvictor.cpp @@ -246,10 +246,8 @@ CacheFileContextEvictor::PersistEvictionInfoToDisk( return rv; } -#ifdef PR_LOGGING nsAutoCString path; file->GetNativePath(path); -#endif PRFileDesc *fd; rv = file->OpenNSPRFileDesc(PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE, 0600, @@ -285,10 +283,8 @@ CacheFileContextEvictor::RemoveEvictInfoFromDisk( return rv; } -#ifdef PR_LOGGING nsAutoCString path; file->GetNativePath(path); -#endif rv = file->Remove(false); if (NS_WARN_IF(NS_FAILED(rv))) { diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp index eb764921fb44..d7438fe9d3f8 100644 --- a/netwerk/cache2/CacheFileIOManager.cpp +++ b/netwerk/cache2/CacheFileIOManager.cpp @@ -2968,10 +2968,8 @@ CacheFileIOManager::CacheIndexStateChangedInternal() nsresult CacheFileIOManager::TrashDirectory(nsIFile *aFile) { -#ifdef PR_LOGGING nsAutoCString path; aFile->GetNativePath(path); -#endif LOG(("CacheFileIOManager::TrashDirectory() [file=%s]", path.get())); nsresult rv; @@ -3201,10 +3199,8 @@ CacheFileIOManager::RemoveTrashInternal() if (isDir) { NS_WARNING("Found a directory in a trash directory! It will be removed " "recursively, but this can block IO thread for a while!"); -#ifdef PR_LOGGING nsAutoCString path; file->GetNativePath(path); -#endif LOG(("CacheFileIOManager::RemoveTrashInternal() - Found a directory in a trash " "directory! It will be removed recursively, but this can block IO " "thread for a while! [file=%s]", path.get())); @@ -3761,11 +3757,8 @@ CacheFileIOManager::SyncRemoveDir(nsIFile *aFile, const char *aDir) } } -#ifdef PR_LOGGING nsAutoCString path; file->GetNativePath(path); -#endif - LOG(("CacheFileIOManager::SyncRemoveDir() - Removing directory %s", path.get())); diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp index 71ad1611b522..cc8454072ff0 100644 --- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -3082,7 +3082,6 @@ CacheIndex::RemoveNonFreshEntries(CacheIndexEntry *aEntry, void* aClosure) return PL_DHASH_REMOVE; } -#ifdef PR_LOGGING // static char const * CacheIndex::StateString(EState aState) @@ -3100,7 +3099,6 @@ CacheIndex::StateString(EState aState) MOZ_ASSERT(false, "Unexpected state!"); return "?"; } -#endif void CacheIndex::ChangeState(EState aNewState) diff --git a/netwerk/cache2/CacheIndex.h b/netwerk/cache2/CacheIndex.h index 5b9b3442818e..4e6ac3d525de 100644 --- a/netwerk/cache2/CacheIndex.h +++ b/netwerk/cache2/CacheIndex.h @@ -906,9 +906,7 @@ private: SHUTDOWN = 6 }; -#ifdef PR_LOGGING static char const * StateString(EState aState); -#endif void ChangeState(EState aNewState); // Allocates and releases buffer used for reading and writing index. diff --git a/netwerk/cache2/CacheLog.cpp b/netwerk/cache2/CacheLog.cpp index 85741b48f8fa..e7710b5af5b8 100644 --- a/netwerk/cache2/CacheLog.cpp +++ b/netwerk/cache2/CacheLog.cpp @@ -7,7 +7,6 @@ namespace mozilla { namespace net { -#if defined(PR_LOGGING) // Log module for cache2 (2013) cache implementation logging... // // To enable logging (see prlog.h for full details): @@ -24,7 +23,6 @@ PRLogModuleInfo* GetCache2Log() sLog = PR_NewLogModule("cache2"); return sLog; } -#endif } // net } // mozilla diff --git a/netwerk/cache2/CacheLog.h b/netwerk/cache2/CacheLog.h index b6046b1ebab2..599c7309a39b 100644 --- a/netwerk/cache2/CacheLog.h +++ b/netwerk/cache2/CacheLog.h @@ -10,12 +10,8 @@ namespace mozilla { namespace net { -#if defined(PR_LOGGING) extern PRLogModuleInfo* GetCache2Log(); #define LOG(x) PR_LOG(GetCache2Log(), PR_LOG_DEBUG, x) -#else -#define LOG(x) -#endif /* PR_LOGGING */ } // net } // mozilla diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index c80de37c11cf..a40bd6ecc65b 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -1206,9 +1206,7 @@ CacheStorageService::PurgeOverMemoryLimit() void CacheStorageService::MemoryPool::PurgeOverMemoryLimit() { -#ifdef PR_LOGGING TimeStamp start(TimeStamp::Now()); -#endif uint32_t const memoryLimit = Limit(); if (mMemorySize > memoryLimit) { @@ -1444,12 +1442,10 @@ CacheStorageService::CheckStorageEntry(CacheStorage const* aStorage, AppendMemoryStorageID(contextKey); } -#ifdef PR_LOGGING nsAutoCString uriSpec; aURI->GetAsciiSpec(uriSpec); LOG(("CacheStorageService::CheckStorageEntry [uri=%s, eid=%s, contextKey=%s]", uriSpec.get(), aIdExtension.BeginReading(), contextKey.get())); -#endif { mozilla::MutexAutoLock lock(mLock); diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index e9aac403f9e6..5f8067c2ed61 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -190,7 +190,6 @@ struct nsListIter #define SET_COOKIE true #define GET_COOKIE false -#ifdef PR_LOGGING static PRLogModuleInfo * GetCookieLog() { @@ -322,13 +321,6 @@ LogSuccess(bool aSetCookie, nsIURI *aHostURI, const nsAFlatCString &aCookieStrin LogSuccess(aSetCookie, aHostURI, aCookieString.get(), aCookie, aReplacing); } -#else -#define COOKIE_LOGFAILURE(a, b, c, d) PR_BEGIN_MACRO /* nothing */ PR_END_MACRO -#define COOKIE_LOGSUCCESS(a, b, c, d, e) PR_BEGIN_MACRO /* nothing */ PR_END_MACRO -#define COOKIE_LOGEVICTED(a, b) PR_BEGIN_MACRO /* nothing */ PR_END_MACRO -#define COOKIE_LOGSTRING(a, b) PR_BEGIN_MACRO /* nothing */ PR_END_MACRO -#endif - #ifdef DEBUG #define NS_ASSERT_SUCCESS(res) \ PR_BEGIN_MACRO \ @@ -362,14 +354,12 @@ public: int32_t result = -1; aError->GetResult(&result); -#ifdef PR_LOGGING nsAutoCString message; aError->GetMessage(message); COOKIE_LOGSTRING(PR_LOG_WARNING, ("DBListenerErrorHandler::HandleError(): Error %d occurred while " "performing operation '%s' with message '%s'; rebuilding database.", result, GetOpType(), message.get())); -#endif // Rebuild the database. gCookieService->HandleCorruptDB(mDBState); @@ -3778,12 +3768,10 @@ nsCookieService::PurgeCookies(int64_t aCurrentTimeInUsec) NS_ASSERTION(mDBState->hostTable.Count() > 0, "table is empty"); EnsureReadComplete(); -#ifdef PR_LOGGING uint32_t initialCookieCount = mDBState->cookieCount; COOKIE_LOGSTRING(PR_LOG_DEBUG, ("PurgeCookies(): beginning purge with %ld cookies and %lld oldest age", mDBState->cookieCount, aCurrentTimeInUsec - mDBState->cookieOldestTime)); -#endif nsAutoTArray purgeList; @@ -3801,9 +3789,7 @@ nsCookieService::PurgeCookies(int64_t aCurrentTimeInUsec) aCurrentTimeInUsec - mCookiePurgeAge, purgeList, removedList, paramsArray); mDBState->hostTable.EnumerateEntries(purgeCookiesCallback, &data); -#ifdef PR_LOGGING uint32_t postExpiryCookieCount = mDBState->cookieCount; -#endif // now we have a list of iterators for cookies over the age limit. // sort them by age, and then we'll see how many to remove... diff --git a/netwerk/dns/GetAddrInfo.cpp b/netwerk/dns/GetAddrInfo.cpp index c17f9f54ab05..1a3346758642 100644 --- a/netwerk/dns/GetAddrInfo.cpp +++ b/netwerk/dns/GetAddrInfo.cpp @@ -23,16 +23,11 @@ #endif #include "prlog.h" -#if defined(PR_LOGGING) static PRLogModuleInfo *gGetAddrInfoLog = PR_NewLogModule("GetAddrInfo"); #define LOG(msg, ...) \ PR_LOG(gGetAddrInfoLog, PR_LOG_DEBUG, ("[DNS]: " msg, ##__VA_ARGS__)) #define LOG_WARNING(msg, ...) \ PR_LOG(gGetAddrInfoLog, PR_LOG_WARNING, ("[DNS]: " msg, ##__VA_ARGS__)) -#else -#define LOG(args) -#define LOG_WARNING(args) -#endif #if DNSQUERY_AVAILABLE // There is a bug in windns.h where the type of parameter ppQueryResultsSet for diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp index 54ebfdd94083..6c85a415b250 100644 --- a/netwerk/dns/nsHostResolver.cpp +++ b/netwerk/dns/nsHostResolver.cpp @@ -69,12 +69,8 @@ PR_STATIC_ASSERT (HighThreadThreshold <= MAX_RESOLVER_THREADS); //---------------------------------------------------------------------------- -#if defined(PR_LOGGING) static PRLogModuleInfo *gHostResolverLog = nullptr; #define LOG(args) PR_LOG(gHostResolverLog, PR_LOG_DEBUG, args) -#else -#define LOG(args) -#endif #define LOG_HOST(host, interface) host, \ (interface && interface[0] != '\0') ? " on interface " : "", \ @@ -443,7 +439,7 @@ HostDB_ClearEntry(PLDHashTable *table, LOG(("Clearing cache db entry for host [%s%s%s].\n", LOG_HOST(hr->host, hr->netInterface))); -#if defined(DEBUG) && defined(PR_LOGGING) +#if defined(DEBUG) { MutexAutoLock lock(hr->addr_info_lock); if (!hr->addr_info) { @@ -1052,12 +1048,10 @@ nsHostResolver::ConditionallyCreateThread(nsHostRecord *rec) return NS_ERROR_OUT_OF_MEMORY; } } -#if defined(PR_LOGGING) else { LOG((" Unable to find a thread for looking up host [%s%s%s].\n", LOG_HOST(rec->host, rec->netInterface))); } -#endif return NS_OK; } @@ -1497,10 +1491,8 @@ nsHostResolver::Create(uint32_t maxCacheEntries, uint32_t defaultGracePeriod, nsHostResolver **result) { -#if defined(PR_LOGGING) if (!gHostResolverLog) gHostResolverLog = PR_NewLogModule("nsHostResolver"); -#endif nsHostResolver *res = new nsHostResolver(maxCacheEntries, defaultCacheEntryLifetime, defaultGracePeriod); diff --git a/netwerk/protocol/ftp/nsFTPChannel.cpp b/netwerk/protocol/ftp/nsFTPChannel.cpp index 984dc0d1a99e..75e58dbf2805 100644 --- a/netwerk/protocol/ftp/nsFTPChannel.cpp +++ b/netwerk/protocol/ftp/nsFTPChannel.cpp @@ -10,9 +10,7 @@ #include "nsThreadUtils.h" #include "mozilla/Attributes.h" -#if defined(PR_LOGGING) extern PRLogModuleInfo* gFTPLog; -#endif /* PR_LOGGING */ // There are two transport connections established for an // ftp connection. One is used for the command channel , and diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp index 5ec4cd8d20fa..95816280f949 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp @@ -45,9 +45,7 @@ #include "NetStatistics.h" #endif -#if defined(PR_LOGGING) extern PRLogModuleInfo* gFTPLog; -#endif #define LOG(args) PR_LOG(gFTPLog, PR_LOG_DEBUG, args) #define LOG_ALWAYS(args) PR_LOG(gFTPLog, PR_LOG_ALWAYS, args) diff --git a/netwerk/protocol/ftp/nsFtpControlConnection.cpp b/netwerk/protocol/ftp/nsFtpControlConnection.cpp index 7f35df2a2375..43f6a4f19467 100644 --- a/netwerk/protocol/ftp/nsFtpControlConnection.cpp +++ b/netwerk/protocol/ftp/nsFtpControlConnection.cpp @@ -15,9 +15,7 @@ #include "nsNetCID.h" #include -#if defined(PR_LOGGING) extern PRLogModuleInfo* gFTPLog; -#endif #define LOG(args) PR_LOG(gFTPLog, PR_LOG_DEBUG, args) #define LOG_ALWAYS(args) PR_LOG(gFTPLog, PR_LOG_ALWAYS, args) diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp index f471be71fb5b..ee13366aa910 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp @@ -34,7 +34,6 @@ using namespace mozilla::net; //----------------------------------------------------------------------------- -#if defined(PR_LOGGING) // // Log module for FTP Protocol logging... // @@ -47,7 +46,6 @@ using namespace mozilla::net; // the file nspr.log // PRLogModuleInfo* gFTPLog = nullptr; -#endif #undef LOG #define LOG(args) PR_LOG(gFTPLog, PR_LOG_DEBUG, args) @@ -69,10 +67,9 @@ nsFtpProtocolHandler::nsFtpProtocolHandler() , mControlQoSBits(0x00) , mDataQoSBits(0x00) { -#if defined(PR_LOGGING) if (!gFTPLog) gFTPLog = PR_NewLogModule("nsFtp"); -#endif + LOG(("FTP:creating handler @%x\n", this)); gFtpHandler = this; diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.h b/netwerk/protocol/ftp/nsFtpProtocolHandler.h index 7972e1538f3a..6e00ae850b40 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.h +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.h @@ -82,8 +82,6 @@ private: extern nsFtpProtocolHandler *gFtpHandler; -#ifdef PR_LOGGING extern PRLogModuleInfo* gFTPLog; -#endif #endif // !nsFtpProtocolHandler_h__ diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 1c61d9ef0b6d..9f3b3d092e4e 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -2356,7 +2356,6 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI, // Transfer existing redirect information. Add all of our existing // redirects to the new channel. for (int32_t i = 0; i < mRedirects.Count(); ++i) { -#ifdef PR_LOGGING nsCOMPtr uri; mRedirects[i]->GetURI(getter_AddRefs(uri)); nsCString spec; @@ -2365,7 +2364,7 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI, } LOG(("HttpBaseChannel::SetupReplacementChannel adding redirect \'%s\' " "[this=%p]", spec.get(), this)); -#endif + httpInternal->AddRedirect(mRedirects[i]); } diff --git a/netwerk/protocol/http/HttpLog.h b/netwerk/protocol/http/HttpLog.h index e750f9dc4cbc..cb5f17276885 100644 --- a/netwerk/protocol/http/HttpLog.h +++ b/netwerk/protocol/http/HttpLog.h @@ -23,7 +23,6 @@ // Get rid of Chromium's LOG definition #undef LOG -#if defined(PR_LOGGING) // // Log module for HTTP Protocol logging... // @@ -36,7 +35,6 @@ // the file http.log // extern PRLogModuleInfo *gHttpLog; -#endif // http logging #define LOG1(args) PR_LOG(gHttpLog, 1, args) diff --git a/netwerk/protocol/http/nsHttp.cpp b/netwerk/protocol/http/nsHttp.cpp index 43f014ab0c62..b61630eac6ba 100644 --- a/netwerk/protocol/http/nsHttp.cpp +++ b/netwerk/protocol/http/nsHttp.cpp @@ -13,9 +13,7 @@ #include "mozilla/HashFunctions.h" #include "nsCRT.h" -#if defined(PR_LOGGING) PRLogModuleInfo *gHttpLog = nullptr; -#endif namespace mozilla { namespace net { diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index e364fa20e1f5..35c5b397f349 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -6558,12 +6558,10 @@ nsHttpChannel::MaybeInvalidateCacheEntryForSubsequentGet() } // Invalidate the request-uri. -#ifdef PR_LOGGING nsAutoCString key; mURI->GetAsciiSpec(key); LOG(("MaybeInvalidateCacheEntryForSubsequentGet [this=%p uri=%s]\n", this, key.get())); -#endif DoInvalidateCacheEntry(mURI); @@ -6606,11 +6604,9 @@ nsHttpChannel::DoInvalidateCacheEntry(nsIURI* aURI) nsresult rv; -#ifdef PR_LOGGING nsAutoCString key; aURI->GetAsciiSpec(key); LOG(("DoInvalidateCacheEntry [channel=%p key=%s]", this, key.get())); -#endif nsCOMPtr cacheStorageService = do_GetService("@mozilla.org/netwerk/cache-storage-service;1", &rv); diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 8943c2306fd8..37a0e562c85c 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -214,9 +214,7 @@ nsHttpHandler::nsHttpHandler() , mTCPKeepaliveLongLivedIdleTimeS(600) , mEnforceH1Framing(FRAMECHECK_BARELY) { -#if defined(PR_LOGGING) gHttpLog = PR_NewLogModule("nsHttp"); -#endif LOG(("Creating nsHttpHandler [this=%p].\n", this)); diff --git a/netwerk/protocol/http/nsHttpNTLMAuth.cpp b/netwerk/protocol/http/nsHttpNTLMAuth.cpp index 2e26d870f0fd..4b5a703dfe44 100644 --- a/netwerk/protocol/http/nsHttpNTLMAuth.cpp +++ b/netwerk/protocol/http/nsHttpNTLMAuth.cpp @@ -274,10 +274,8 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel *channel, *identityInvalid = true; } #endif // XP_WIN -#ifdef PR_LOGGING if (!module) LOG(("Native sys-ntlm auth module not found.\n")); -#endif } #ifdef XP_WIN diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index 8721608662b8..0321ded49ff9 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -63,7 +63,6 @@ namespace net { // helpers //----------------------------------------------------------------------------- -#if defined(PR_LOGGING) static void LogHeaders(const char *lineStart) { @@ -81,7 +80,6 @@ LogHeaders(const char *lineStart) lineStart = endOfLine + 2; } } -#endif //----------------------------------------------------------------------------- // nsHttpTransaction @@ -320,13 +318,11 @@ nsHttpTransaction::Init(uint32_t caps, mReqHeaderBuf.Truncate(); requestHead->Flatten(mReqHeaderBuf, pruneProxyHeaders); -#if defined(PR_LOGGING) if (LOG3_ENABLED()) { LOG3(("http request [\n")); LogHeaders(mReqHeaderBuf.get()); LOG3(("]\n")); } -#endif // If the request body does not include headers or if there is no request // body, then we must add the header/body separator manually. @@ -1474,7 +1470,6 @@ nsHttpTransaction::HandleContentStart() MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); if (mResponseHead) { -#if defined(PR_LOGGING) if (LOG3_ENABLED()) { LOG3(("http response [\n")); nsAutoCString headers; @@ -1482,7 +1477,7 @@ nsHttpTransaction::HandleContentStart() LogHeaders(headers.get()); LOG3(("]\n")); } -#endif + // Save http version, mResponseHead isn't available anymore after // TakeResponseHead() is called mHttpVersion = mResponseHead->Version(); @@ -1561,10 +1556,8 @@ nsHttpTransaction::HandleContentStart() // Ignore server specified Content-Length. mContentLength = -1; } -#if defined(PR_LOGGING) else if (mContentLength == int64_t(-1)) LOG(("waiting for the server to close the connection.\n")); -#endif } if (mRestartInProgressVerifier.IsSetup() && !mRestartInProgressVerifier.Verify(mContentLength, mResponseHead)) { diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp index ec1bddca224f..231366eb136a 100644 --- a/netwerk/protocol/res/nsResProtocolHandler.cpp +++ b/netwerk/protocol/res/nsResProtocolHandler.cpp @@ -23,7 +23,6 @@ static NS_DEFINE_CID(kResURLCID, NS_RESURL_CID); static nsResProtocolHandler *gResHandler = nullptr; -#if defined(PR_LOGGING) // // Log module for Resource Protocol logging... // @@ -36,7 +35,6 @@ static nsResProtocolHandler *gResHandler = nullptr; // the file log.txt // static PRLogModuleInfo *gResLog; -#endif #define kAPP NS_LITERAL_CSTRING("app") #define kGRE NS_LITERAL_CSTRING("gre") @@ -104,9 +102,7 @@ nsResURL::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) nsResProtocolHandler::nsResProtocolHandler() : mSubstitutions(16) { -#if defined(PR_LOGGING) gResLog = PR_NewLogModule("nsResProtocol"); -#endif NS_ASSERTION(!gResHandler, "res handler already created!"); gResHandler = this; @@ -451,13 +447,11 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result) rv = baseURI->Resolve(nsDependentCString(p, path.Length()-1), result); -#if defined(PR_LOGGING) if (PR_LOG_TEST(gResLog, PR_LOG_DEBUG)) { nsAutoCString spec; uri->GetAsciiSpec(spec); PR_LOG(gResLog, PR_LOG_DEBUG, ("%s\n -> %s\n", spec.get(), PromiseFlatCString(result).get())); } -#endif return rv; } diff --git a/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp b/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp index 22db46251465..f0ee73897c56 100644 --- a/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp +++ b/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp @@ -70,10 +70,8 @@ RtspControllerChild::RtspControllerChild(nsIChannel *channel) , mPlayTimer(nullptr) , mPauseTimer(nullptr) { -#if defined(PR_LOGGING) if (!gRtspChildLog) gRtspChildLog = PR_NewLogModule("nsRtspChild"); -#endif AddIPDLReference(); gNeckoChild->SendPRtspControllerConstructor(this); } diff --git a/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp b/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp index 0c8d7ed58694..22eacc279e09 100644 --- a/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp +++ b/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp @@ -62,10 +62,8 @@ RtspControllerParent::RtspControllerParent() : mIPCOpen(true) , mTotalTracks(0) { -#if defined(PR_LOGGING) if (!gRtspLog) gRtspLog = PR_NewLogModule("nsRtsp"); -#endif } RtspControllerParent::~RtspControllerParent() diff --git a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp index 9880d80a0a43..010f45eae522 100644 --- a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp +++ b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp @@ -13,9 +13,7 @@ #include "nsProxyRelease.h" #include "nsStandardURL.h" -#if defined(PR_LOGGING) PRLogModuleInfo *webSocketLog = nullptr; -#endif namespace mozilla { namespace net { @@ -29,10 +27,8 @@ BaseWebSocketChannel::BaseWebSocketChannel() , mPingInterval(0) , mPingResponseTimeout(10000) { -#if defined(PR_LOGGING) if (!webSocketLog) webSocketLog = PR_NewLogModule("nsWebSocket"); -#endif } //----------------------------------------------------------------------------- diff --git a/netwerk/protocol/websocket/WebSocketChannelParent.cpp b/netwerk/protocol/websocket/WebSocketChannelParent.cpp index 2c92b8221478..dbbb944f4677 100644 --- a/netwerk/protocol/websocket/WebSocketChannelParent.cpp +++ b/netwerk/protocol/websocket/WebSocketChannelParent.cpp @@ -33,10 +33,8 @@ WebSocketChannelParent::WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvi { // Websocket channels can't have a private browsing override MOZ_ASSERT_IF(!aLoadContext, aOverrideStatus == kPBOverride_Unset); -#if defined(PR_LOGGING) if (!webSocketLog) webSocketLog = PR_NewLogModule("nsWebSocket"); -#endif mObserver = new OfflineObserver(this); } diff --git a/netwerk/protocol/websocket/WebSocketLog.h b/netwerk/protocol/websocket/WebSocketLog.h index b0730acba130..6e5008be113d 100644 --- a/netwerk/protocol/websocket/WebSocketLog.h +++ b/netwerk/protocol/websocket/WebSocketLog.h @@ -11,9 +11,7 @@ #include "prlog.h" #include "mozilla/net/NeckoChild.h" -#ifdef PR_LOGGING extern PRLogModuleInfo* webSocketLog; -#endif #undef LOG #define LOG(args) PR_LOG(webSocketLog, PR_LOG_DEBUG, args) diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp index 9f0b4f6bc2eb..023f4396af17 100644 --- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp +++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp @@ -25,10 +25,8 @@ WyciwygChannelParent::WyciwygChannelParent() : mIPCClosed(false) , mReceivedAppData(false) { -#if defined(PR_LOGGING) if (!gWyciwygLog) gWyciwygLog = PR_NewLogModule("nsWyciwygChannel"); -#endif } WyciwygChannelParent::~WyciwygChannelParent() diff --git a/netwerk/protocol/wyciwyg/nsWyciwyg.cpp b/netwerk/protocol/wyciwyg/nsWyciwyg.cpp index 32449fdc50a1..bc3179e11697 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwyg.cpp +++ b/netwerk/protocol/wyciwyg/nsWyciwyg.cpp @@ -5,7 +5,5 @@ #include "nsWyciwyg.h" #include "nscore.h" -#if defined(PR_LOGGING) PRLogModuleInfo *gWyciwygLog = nullptr; -#endif diff --git a/netwerk/protocol/wyciwyg/nsWyciwyg.h b/netwerk/protocol/wyciwyg/nsWyciwyg.h index 60b3b4509151..a2849df0ffa1 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwyg.h +++ b/netwerk/protocol/wyciwyg/nsWyciwyg.h @@ -12,7 +12,6 @@ #include "prlog.h" -#if defined(PR_LOGGING) // // Log module for HTTP Protocol logging... // @@ -25,7 +24,6 @@ // the file wyciwyg.log // extern PRLogModuleInfo *gWyciwygLog; -#endif // http logging #define LOG1(args) PR_LOG(gWyciwygLog, 1, args) diff --git a/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp b/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp index 8e0fc769fa0b..7aaa89575cf8 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp +++ b/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp @@ -23,10 +23,8 @@ using namespace mozilla::net; nsWyciwygProtocolHandler::nsWyciwygProtocolHandler() { -#if defined(PR_LOGGING) if (!gWyciwygLog) gWyciwygLog = PR_NewLogModule("nsWyciwygChannel"); -#endif LOG(("Creating nsWyciwygProtocolHandler [this=%p].\n", this)); } diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index 0e8b9ea114a9..e1e4f5f4113d 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -50,7 +50,6 @@ #include "DataChannel.h" #include "DataChannelProtocol.h" -#ifdef PR_LOGGING PRLogModuleInfo* GetDataChannelLog() { @@ -68,7 +67,6 @@ GetSCTPLog() sLog = PR_NewLogModule("SCTP"); return sLog; } -#endif // Let us turn on and off important assertions in non-debug builds #ifdef DEBUG @@ -174,7 +172,6 @@ receive_cb(struct socket* sock, union sctp_sockstore addr, return connection->ReceiveCallback(sock, data, datalen, rcv, flags); } -#ifdef PR_LOGGING static void debug_printf(const char *format, ...) { @@ -193,7 +190,6 @@ debug_printf(const char *format, ...) va_end(ap); } } -#endif DataChannelConnection::DataChannelConnection(DataConnectionListener *listener) : mLock("netwerk::sctp::DataChannelConnection") @@ -325,11 +321,7 @@ DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, bool aUs #ifdef MOZ_PEERCONNECTION usrsctp_init(0, DataChannelConnection::SctpDtlsOutput, -#ifdef PR_LOGGING debug_printf -#else - nullptr -#endif ); #else NS_ASSERTION(!aUsingDtls, "Trying to use SCTP/DTLS without mtransport"); @@ -338,20 +330,15 @@ DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, bool aUs LOG(("sctp_init(%u)", aPort)); usrsctp_init(aPort, nullptr, -#ifdef PR_LOGGING debug_printf -#else - nullptr -#endif ); } -#ifdef PR_LOGGING // Set logging to SCTP:PR_LOG_DEBUG to get SCTP debugs if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_ALWAYS)) { usrsctp_sysctl_set_sctp_debug_on(SCTP_DEBUG_ALL); } -#endif + usrsctp_sysctl_set_sctp_blackhole(2); // ECN is currently not supported by the Firefox code usrsctp_sysctl_set_sctp_ecn_enable(0); @@ -666,7 +653,6 @@ void DataChannelConnection::SctpDtlsInput(TransportFlow *flow, const unsigned char *data, size_t len) { -#ifdef PR_LOGGING if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) { char *buf; @@ -675,7 +661,6 @@ DataChannelConnection::SctpDtlsInput(TransportFlow *flow, usrsctp_freedumpbuffer(buf); } } -#endif // Pass the data to SCTP usrsctp_conninput(static_cast(this), data, len, 0); } @@ -698,7 +683,6 @@ DataChannelConnection::SctpDtlsOutput(void *addr, void *buffer, size_t length, DataChannelConnection *peer = static_cast(addr); int res; -#ifdef PR_LOGGING if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) { char *buf; @@ -707,7 +691,6 @@ DataChannelConnection::SctpDtlsOutput(void *addr, void *buffer, size_t length, usrsctp_freedumpbuffer(buf); } } -#endif // We're async proxying even if on the STSThread because this is called // with internal SCTP locks held in some cases (such as in usrsctp_connect()). // SCTP has an option for Apple, on IP connections only, to release at least diff --git a/netwerk/sctp/datachannel/DataChannelLog.h b/netwerk/sctp/datachannel/DataChannelLog.h index 447a948b24d4..1fb1b3861747 100644 --- a/netwerk/sctp/datachannel/DataChannelLog.h +++ b/netwerk/sctp/datachannel/DataChannelLog.h @@ -10,10 +10,8 @@ #include "base/basictypes.h" #include "prlog.h" -#ifdef PR_LOGGING extern PRLogModuleInfo* GetDataChannelLog(); extern PRLogModuleInfo* GetSCTPLog(); -#endif #undef LOG #define LOG(args) PR_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args) diff --git a/netwerk/socket/nsSOCKSIOLayer.cpp b/netwerk/socket/nsSOCKSIOLayer.cpp index d07df13ecf27..b25f5213518a 100644 --- a/netwerk/socket/nsSOCKSIOLayer.cpp +++ b/netwerk/socket/nsSOCKSIOLayer.cpp @@ -28,16 +28,10 @@ static PRIOMethods nsSOCKSIOLayerMethods; static bool firstTime = true; static bool ipv6Supported = true; -#if defined(PR_LOGGING) static PRLogModuleInfo *gSOCKSLog; #define LOGDEBUG(args) PR_LOG(gSOCKSLog, PR_LOG_DEBUG, args) #define LOGERROR(args) PR_LOG(gSOCKSLog, PR_LOG_ERROR , args) -#else -#define LOGDEBUG(args) -#define LOGERROR(args) -#endif - class nsSOCKSSocketInfo : public nsISOCKSSocketInfo , public nsIDNSListener { @@ -429,12 +423,11 @@ nsSOCKSSocketInfo::ConnectToProxy(PRFileDesc *fd) return PR_FAILURE; } -#if defined(PR_LOGGING) char buf[kIPv6CStrBufSize]; NetAddrToString(&mInternalProxyAddr, buf, sizeof(buf)); LOGDEBUG(("socks: trying proxy server, %s:%hu", buf, ntohs(mInternalProxyAddr.inet.port))); -#endif + NetAddr proxy = mInternalProxyAddr; FixupAddressFamily(fd, &proxy); PRNetAddr prProxy; @@ -1311,10 +1304,7 @@ nsSOCKSIOLayerAddToSocket(int32_t family, firstTime = false; -#if defined(PR_LOGGING) gSOCKSLog = PR_NewLogModule("SOCKS"); -#endif - } LOGDEBUG(("Entering nsSOCKSIOLayerAddToSocket().")); diff --git a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp index 9c4df3b9e89c..2aa0dae50a69 100644 --- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp +++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp @@ -19,7 +19,6 @@ #include "ParseFTPList.h" #include -#if defined(PR_LOGGING) // // Log module for FTP dir listing stream converter logging... // @@ -33,7 +32,6 @@ // PRLogModuleInfo* gFTPDirListConvLog = nullptr; -#endif /* PR_LOGGING */ // nsISupports implementation NS_IMPL_ISUPPORTS(nsFTPDirListingConv, @@ -193,7 +191,6 @@ nsFTPDirListingConv::~nsFTPDirListingConv() { nsresult nsFTPDirListingConv::Init() { -#if defined(PR_LOGGING) // // Initialize the global PRLogModule for FTP Protocol logging // if necessary... @@ -201,7 +198,6 @@ nsFTPDirListingConv::Init() { if (nullptr == gFTPDirListConvLog) { gFTPDirListConvLog = PR_NewLogModule("nsFTPDirListingConv"); } -#endif /* PR_LOGGING */ return NS_OK; } diff --git a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp index 912327f526d2..00adcb773f7c 100644 --- a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp +++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp @@ -38,12 +38,8 @@ using namespace mozilla; -#if defined(PR_LOGGING) static PRLogModuleInfo *gNotifyAddrLog = nullptr; #define LOG(args) PR_LOG(gNotifyAddrLog, PR_LOG_DEBUG, args) -#else -#define LOG(args) -#endif #define NETWORK_NOTIFY_CHANGED_PREF "network.notify.changed" @@ -303,10 +299,8 @@ class NuwaMarkLinkMonitorThreadRunner : public nsRunnable nsresult nsNotifyAddrListener::Init(void) { -#if defined(PR_LOGGING) if (!gNotifyAddrLog) gNotifyAddrLog = PR_NewLogModule("nsNotifyAddr"); -#endif nsCOMPtr observerService = mozilla::services::GetObserverService(); diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp index 4f8c7f525319..2701275f79aa 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.cpp +++ b/netwerk/system/win32/nsNotifyAddrListener.cpp @@ -19,6 +19,7 @@ #include #include #include "plstr.h" +#include "prlog.h" #include "nsThreadUtils.h" #include "nsIObserverService.h" #include "nsServiceManagerUtils.h" @@ -34,12 +35,8 @@ using namespace mozilla; -#if defined(PR_LOGGING) static PRLogModuleInfo *gNotifyAddrLog = nullptr; #define LOG(args) PR_LOG(gNotifyAddrLog, PR_LOG_DEBUG, args) -#else -#define LOG(args) -#endif static HMODULE sNetshell; static decltype(NcFreeNetconProperties)* sNcFreeNetconProperties; @@ -219,10 +216,8 @@ nsNotifyAddrListener::Observe(nsISupports *subject, nsresult nsNotifyAddrListener::Init(void) { -#if defined(PR_LOGGING) if (!gNotifyAddrLog) gNotifyAddrLog = PR_NewLogModule("nsNotifyAddr"); -#endif nsCOMPtr observerService = mozilla::services::GetObserverService(); diff --git a/netwerk/test/TestBlockingSocket.cpp b/netwerk/test/TestBlockingSocket.cpp index e4812faf61f0..2830dbc903b2 100644 --- a/netwerk/test/TestBlockingSocket.cpp +++ b/netwerk/test/TestBlockingSocket.cpp @@ -19,12 +19,10 @@ //////////////////////////////////////////////////////////////////////////////// -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// @@ -104,19 +102,15 @@ main(int argc, char* argv[]) nsCOMPtr servMan; NS_InitXPCOM2(getter_AddRefs(servMan), nullptr, nullptr); -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif nsCOMPtr file; rv = NS_NewNativeLocalFile(nsDependentCString(fileName), false, getter_AddRefs(file)); if (NS_FAILED(rv)) return -1; rv = RunBlockingTest(nsDependentCString(hostName), port, file); -#if defined(PR_LOGGING) if (NS_FAILED(rv)) LOG(("RunBlockingTest failed [rv=%x]\n", rv)); -#endif // give background threads a chance to finish whatever work they may // be doing. diff --git a/netwerk/test/TestIOThreads.cpp b/netwerk/test/TestIOThreads.cpp index f2ca8aeb6934..20daefe8ff9a 100644 --- a/netwerk/test/TestIOThreads.cpp +++ b/netwerk/test/TestIOThreads.cpp @@ -11,12 +11,10 @@ #include "nsNetCID.h" #include "prlog.h" -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) class nsIOEvent : public nsIRunnable { @@ -59,9 +57,7 @@ int main(int argc, char **argv) nsresult rv; -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif rv = NS_InitXPCOM2(nullptr, nullptr, nullptr); if (NS_FAILED(rv)) diff --git a/netwerk/test/TestOverlappedIO.cpp b/netwerk/test/TestOverlappedIO.cpp index 98012c962596..a09897dcb230 100644 --- a/netwerk/test/TestOverlappedIO.cpp +++ b/netwerk/test/TestOverlappedIO.cpp @@ -26,12 +26,8 @@ #include "nsCOMPtr.h" #include "nsIByteArrayInputStream.h" -#if defined(PR_LOGGING) static PRLogModuleInfo *gTestSocketIOLog; #define LOG(args) PR_LOG(gTestSocketIOLog, PR_LOG_DEBUG, args) -#else -#define LOG(args) -#endif static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID); static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); @@ -233,9 +229,7 @@ main(int argc, char* argv[]) signal(SIGSEGV, sighandler); -#if defined(PR_LOGGING) gTestSocketIOLog = PR_NewLogModule("TestSocketIO"); -#endif if (argc < 3) usage(argv); diff --git a/netwerk/test/TestProtocols.cpp b/netwerk/test/TestProtocols.cpp index 92222ed9805d..ecce8a20c6d9 100644 --- a/netwerk/test/TestProtocols.cpp +++ b/netwerk/test/TestProtocols.cpp @@ -61,12 +61,10 @@ using namespace mozilla; namespace TestProtocols { -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); @@ -835,9 +833,7 @@ main(int argc, char* argv[]) return -1; } -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif /* The following code only deals with XPCOM registration stuff. and setting diff --git a/netwerk/test/TestServ.cpp b/netwerk/test/TestServ.cpp index 2a8e705051f4..aed92f26c3a9 100644 --- a/netwerk/test/TestServ.cpp +++ b/netwerk/test/TestServ.cpp @@ -13,12 +13,10 @@ #include "nsCOMPtr.h" #include "prlog.h" -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) class MySocketListener : public nsIServerSocketListener @@ -119,9 +117,7 @@ main(int argc, char* argv[]) return -1; } -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif /* * The following code only deals with XPCOM registration stuff. and setting diff --git a/netwerk/test/TestSocketIO.cpp b/netwerk/test/TestSocketIO.cpp index bbeb2d055995..61d2f7b423f8 100644 --- a/netwerk/test/TestSocketIO.cpp +++ b/netwerk/test/TestSocketIO.cpp @@ -25,12 +25,8 @@ #include "nsCOMPtr.h" #include "nsIByteArrayInputStream.h" -#if defined(PR_LOGGING) static PRLogModuleInfo *gTestSocketIOLog; #define LOG(args) PR_LOG(gTestSocketIOLog, PR_LOG_DEBUG, args) -#else -#define LOG(args) -#endif static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID); static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); @@ -227,9 +223,7 @@ main(int argc, char* argv[]) signal(SIGSEGV, sighandler); -#if defined(PR_LOGGING) gTestSocketIOLog = PR_NewLogModule("TestSocketIO"); -#endif if (argc < 3) usage(argv); diff --git a/netwerk/test/TestSocketTransport.cpp b/netwerk/test/TestSocketTransport.cpp index 907e14964f32..d657aba50739 100644 --- a/netwerk/test/TestSocketTransport.cpp +++ b/netwerk/test/TestSocketTransport.cpp @@ -27,12 +27,10 @@ //////////////////////////////////////////////////////////////////////////////// -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// @@ -223,9 +221,7 @@ main(int argc, char* argv[]) if (registrar) registrar->AutoRegister(nullptr); -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif // Make sure the DNS service is initialized on the main thread nsCOMPtr dns = diff --git a/netwerk/test/TestStreamChannel.cpp b/netwerk/test/TestStreamChannel.cpp index 1636f7b0d9ca..8452f8eb7924 100644 --- a/netwerk/test/TestStreamChannel.cpp +++ b/netwerk/test/TestStreamChannel.cpp @@ -25,15 +25,11 @@ //////////////////////////////////////////////////////////////////////////////// -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) -#else -#define LOG(args) -#endif //////////////////////////////////////////////////////////////////////////////// @@ -184,9 +180,7 @@ main(int argc, char* argv[]) if (registrar) registrar->AutoRegister(nullptr); -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif nsCOMPtr file; rv = NS_NewNativeLocalFile(nsDependentCString(fileName), false, getter_AddRefs(file)); diff --git a/netwerk/test/TestStreamLoader.cpp b/netwerk/test/TestStreamLoader.cpp index 42d18172d378..e43bf94bc550 100644 --- a/netwerk/test/TestStreamLoader.cpp +++ b/netwerk/test/TestStreamLoader.cpp @@ -6,12 +6,10 @@ #include "mozilla/Attributes.h" #include "nsIScriptSecurityManager.h" -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) class MyStreamLoaderObserver final : public nsIStreamLoaderObserver @@ -52,9 +50,7 @@ int main(int argc, char **argv) return -1; } -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif nsresult rv = NS_InitXPCOM2(nullptr, nullptr, nullptr); if (NS_FAILED(rv)) diff --git a/netwerk/test/TestStreamPump.cpp b/netwerk/test/TestStreamPump.cpp index ffbfa74e6e0d..6a006e48e278 100644 --- a/netwerk/test/TestStreamPump.cpp +++ b/netwerk/test/TestStreamPump.cpp @@ -27,15 +27,11 @@ //////////////////////////////////////////////////////////////////////////////// -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) -#else -#define LOG(args) -#endif //////////////////////////////////////////////////////////////////////////////// @@ -155,9 +151,7 @@ main(int argc, char* argv[]) if (registrar) registrar->AutoRegister(nullptr); -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif nsCOMPtr file; rv = NS_NewNativeLocalFile(nsDependentCString(fileName), false, getter_AddRefs(file)); diff --git a/netwerk/test/TestStreamTransport.cpp b/netwerk/test/TestStreamTransport.cpp index 9fbcc109b312..c8e12e4dd03a 100644 --- a/netwerk/test/TestStreamTransport.cpp +++ b/netwerk/test/TestStreamTransport.cpp @@ -25,12 +25,10 @@ //////////////////////////////////////////////////////////////////////////////// -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// @@ -280,9 +278,7 @@ main(int argc, char* argv[]) if (registrar) registrar->AutoRegister(nullptr); -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif nsCOMPtr srcFile; rv = NS_NewNativeLocalFile(nsDependentCString(fileName), false, getter_AddRefs(srcFile)); diff --git a/netwerk/test/TestUpload.cpp b/netwerk/test/TestUpload.cpp index e5be007285db..b01cf13b2763 100644 --- a/netwerk/test/TestUpload.cpp +++ b/netwerk/test/TestUpload.cpp @@ -16,12 +16,10 @@ #include "nsIUploadChannel.h" #include "prlog.h" -#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) //----------------------------------------------------------------------------- @@ -110,9 +108,7 @@ main(int argc, char* argv[]) char* uriSpec = argv[1]; char* fileName = argv[2]; -#if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); -#endif { nsCOMPtr servMan; diff --git a/netwerk/wifi/nsWifiAccessPoint.cpp b/netwerk/wifi/nsWifiAccessPoint.cpp index 55a6df5dadfc..a2f1d17fb4c6 100644 --- a/netwerk/wifi/nsWifiAccessPoint.cpp +++ b/netwerk/wifi/nsWifiAccessPoint.cpp @@ -7,9 +7,7 @@ #include "nsMemory.h" #include "prlog.h" -#if defined(PR_LOGGING) extern PRLogModuleInfo *gWifiMonitorLog; -#endif #define LOG(args) PR_LOG(gWifiMonitorLog, PR_LOG_DEBUG, args) diff --git a/netwerk/wifi/nsWifiMonitor.cpp b/netwerk/wifi/nsWifiMonitor.cpp index 465792836899..394287d2ab82 100644 --- a/netwerk/wifi/nsWifiMonitor.cpp +++ b/netwerk/wifi/nsWifiMonitor.cpp @@ -20,9 +20,7 @@ using namespace mozilla; -#if defined(PR_LOGGING) PRLogModuleInfo *gWifiMonitorLog; -#endif NS_IMPL_ISUPPORTS(nsWifiMonitor, nsIRunnable, @@ -34,9 +32,7 @@ nsWifiMonitor::nsWifiMonitor() , mThreadComplete(false) , mReentrantMonitor("nsWifiMonitor.mReentrantMonitor") { -#if defined(PR_LOGGING) gWifiMonitorLog = PR_NewLogModule("WifiMonitor"); -#endif nsCOMPtr obsSvc = mozilla::services::GetObserverService(); if (obsSvc) diff --git a/netwerk/wifi/nsWifiMonitor.h b/netwerk/wifi/nsWifiMonitor.h index 1077abbdc013..3e462facada4 100644 --- a/netwerk/wifi/nsWifiMonitor.h +++ b/netwerk/wifi/nsWifiMonitor.h @@ -26,9 +26,7 @@ #include "win_wifiScanner.h" #endif -#if defined(PR_LOGGING) extern PRLogModuleInfo *gWifiMonitorLog; -#endif #define LOG(args) PR_LOG(gWifiMonitorLog, PR_LOG_DEBUG, args) class nsWifiAccessPoint; diff --git a/netwerk/wifi/nsWifiMonitorGonk.cpp b/netwerk/wifi/nsWifiMonitorGonk.cpp index 043df56bf9b7..513f430ca8eb 100644 --- a/netwerk/wifi/nsWifiMonitorGonk.cpp +++ b/netwerk/wifi/nsWifiMonitorGonk.cpp @@ -22,9 +22,7 @@ using namespace mozilla; -#if defined(PR_LOGGING) PRLogModuleInfo *gWifiMonitorLog; -#endif NS_IMPL_ISUPPORTS(nsWifiMonitor, nsIWifiMonitor, @@ -33,9 +31,7 @@ NS_IMPL_ISUPPORTS(nsWifiMonitor, nsWifiMonitor::nsWifiMonitor() { -#if defined(PR_LOGGING) gWifiMonitorLog = PR_NewLogModule("WifiMonitor"); -#endif nsCOMPtr obsSvc = mozilla::services::GetObserverService(); if (obsSvc) {