зеркало из https://github.com/mozilla/gecko-dev.git
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.
This commit is contained in:
Родитель
c4a62dc463
Коммит
58dea0dee9
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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<nsIRequestObserver>(observer);
|
||||
mContext = new nsMainThreadPtrHolder<nsISupports>(context);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -325,9 +325,7 @@ private:
|
|||
PLDHashOperator ShutdownCustomCacheDeviceEnum(const nsAString& aProfileDir,
|
||||
nsRefPtr<nsOfflineCacheDevice>& aDevice,
|
||||
void* aUserArg);
|
||||
#if defined(PR_LOGGING)
|
||||
void LogCacheStatistics();
|
||||
#endif
|
||||
|
||||
nsresult SetDiskSmartSize_Locked();
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1877,10 +1877,7 @@ CacheFile::FailUpdateListeners(
|
|||
nsRefPtr<CacheFileChunk>& aChunk,
|
||||
void* aClosure)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
CacheFile *file = static_cast<CacheFile*>(aClosure);
|
||||
#endif
|
||||
|
||||
LOG(("CacheFile::FailUpdateListeners() [this=%p, idx=%u]",
|
||||
file, aIdx));
|
||||
|
||||
|
|
|
@ -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))) {
|
||||
|
|
|
@ -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()));
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<nsListIter, kMaxNumberOfCookies> 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...
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -15,9 +15,7 @@
|
|||
#include "nsNetCID.h"
|
||||
#include <algorithm>
|
||||
|
||||
#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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -82,8 +82,6 @@ private:
|
|||
|
||||
extern nsFtpProtocolHandler *gFtpHandler;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gFTPLog;
|
||||
#endif
|
||||
|
||||
#endif // !nsFtpProtocolHandler_h__
|
||||
|
|
|
@ -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<nsIURI> 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]);
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
#include "mozilla/HashFunctions.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
PRLogModuleInfo *gHttpLog = nullptr;
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
|
|
@ -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<nsICacheStorageService> cacheStorageService =
|
||||
do_GetService("@mozilla.org/netwerk/cache-storage-service;1", &rv);
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <public>
|
||||
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -62,10 +62,8 @@ RtspControllerParent::RtspControllerParent()
|
|||
: mIPCOpen(true)
|
||||
, mTotalTracks(0)
|
||||
{
|
||||
#if defined(PR_LOGGING)
|
||||
if (!gRtspLog)
|
||||
gRtspLog = PR_NewLogModule("nsRtsp");
|
||||
#endif
|
||||
}
|
||||
|
||||
RtspControllerParent::~RtspControllerParent()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -25,10 +25,8 @@ WyciwygChannelParent::WyciwygChannelParent()
|
|||
: mIPCClosed(false)
|
||||
, mReceivedAppData(false)
|
||||
{
|
||||
#if defined(PR_LOGGING)
|
||||
if (!gWyciwygLog)
|
||||
gWyciwygLog = PR_NewLogModule("nsWyciwygChannel");
|
||||
#endif
|
||||
}
|
||||
|
||||
WyciwygChannelParent::~WyciwygChannelParent()
|
||||
|
|
|
@ -5,7 +5,5 @@
|
|||
#include "nsWyciwyg.h"
|
||||
#include "nscore.h"
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
PRLogModuleInfo *gWyciwygLog = nullptr;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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<void *>(this), data, len, 0);
|
||||
}
|
||||
|
@ -698,7 +683,6 @@ DataChannelConnection::SctpDtlsOutput(void *addr, void *buffer, size_t length,
|
|||
DataChannelConnection *peer = static_cast<DataChannelConnection *>(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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()."));
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "ParseFTPList.h"
|
||||
#include <algorithm>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
|
|
@ -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<nsIObserverService> observerService =
|
||||
mozilla::services::GetObserverService();
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <netioapi.h>
|
||||
#include <iprtrmib.h>
|
||||
#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<nsIObserverService> observerService =
|
||||
mozilla::services::GetObserverService();
|
||||
|
|
|
@ -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<nsIServiceManager> servMan;
|
||||
NS_InitXPCOM2(getter_AddRefs(servMan), nullptr, nullptr);
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
gTestLog = PR_NewLogModule("Test");
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIFile> 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.
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<nsIDNSService> dns =
|
||||
|
|
|
@ -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<nsIFile> file;
|
||||
rv = NS_NewNativeLocalFile(nsDependentCString(fileName), false, getter_AddRefs(file));
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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<nsIFile> file;
|
||||
rv = NS_NewNativeLocalFile(nsDependentCString(fileName), false, getter_AddRefs(file));
|
||||
|
|
|
@ -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<nsIFile> srcFile;
|
||||
rv = NS_NewNativeLocalFile(nsDependentCString(fileName), false, getter_AddRefs(srcFile));
|
||||
|
|
|
@ -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<nsIServiceManager> servMan;
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче