Bug 673252 - Allow +++DOCSHELL and +++DOMWINDOW printfs to be silenced via MOZ_QUIET environment variable. r=bz

This commit is contained in:
Justin Lebar 2011-08-04 11:43:50 -04:00
Родитель 91118b2f26
Коммит 8c0b7d5fbc
2 изменённых файлов: 22 добавлений и 16 удалений

Просмотреть файл

@ -66,6 +66,7 @@
#include "nsNetUtil.h"
#include "nsRect.h"
#include "prprf.h"
#include "prenv.h"
#include "nsIMarkupDocumentViewer.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
@ -780,9 +781,9 @@ nsDocShell::nsDocShell():
#ifdef DEBUG
// We're counting the number of |nsDocShells| to help find leaks
++gNumberOfDocShells;
#endif
#ifdef DEBUG
printf("++DOCSHELL %p == %ld\n", (void*) this, gNumberOfDocShells);
if (!PR_GetEnv("MOZ_QUIET")) {
printf("++DOCSHELL %p == %ld\n", (void*) this, gNumberOfDocShells);
}
#endif
}
@ -808,9 +809,9 @@ nsDocShell::~nsDocShell()
#ifdef DEBUG
// We're counting the number of |nsDocShells| to help find leaks
--gNumberOfDocShells;
#endif
#ifdef DEBUG
printf("--DOCSHELL %p == %ld\n", (void*) this, gNumberOfDocShells);
if (!PR_GetEnv("MOZ_QUIET")) {
printf("--DOCSHELL %p == %ld\n", (void*) this, gNumberOfDocShells);
}
#endif
}

Просмотреть файл

@ -235,6 +235,7 @@
#define FORCE_PR_LOG 1
#endif
#include "prlog.h"
#include "prenv.h"
#include "mozilla/dom/indexedDB/IDBFactory.h"
#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
@ -932,9 +933,11 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
mSerial = ++gSerialCounter;
#ifdef DEBUG
printf("++DOMWINDOW == %d (%p) [serial = %d] [outer = %p]\n", gRefCnt,
static_cast<void*>(static_cast<nsIScriptGlobalObject*>(this)),
gSerialCounter, static_cast<void*>(aOuterWindow));
if (!PR_GetEnv("MOZ_QUIET")) {
printf("++DOMWINDOW == %d (%p) [serial = %d] [outer = %p]\n", gRefCnt,
static_cast<void*>(static_cast<nsIScriptGlobalObject*>(this)),
gSerialCounter, static_cast<void*>(aOuterWindow));
}
#endif
#ifdef PR_LOGGING
@ -976,14 +979,16 @@ nsGlobalWindow::~nsGlobalWindow()
NS_IF_RELEASE(gEntropyCollector);
}
#ifdef DEBUG
nsCAutoString url;
if (mLastOpenedURI) {
mLastOpenedURI->GetSpec(url);
}
if (!PR_GetEnv("MOZ_QUIET")) {
nsCAutoString url;
if (mLastOpenedURI) {
mLastOpenedURI->GetSpec(url);
}
printf("--DOMWINDOW == %d (%p) [serial = %d] [outer = %p] [url = %s]\n",
gRefCnt, static_cast<void*>(static_cast<nsIScriptGlobalObject*>(this)),
mSerial, static_cast<void*>(mOuterWindow.get()), url.get());
printf("--DOMWINDOW == %d (%p) [serial = %d] [outer = %p] [url = %s]\n",
gRefCnt, static_cast<void*>(static_cast<nsIScriptGlobalObject*>(this)),
mSerial, static_cast<void*>(mOuterWindow.get()), url.get());
}
#endif
#ifdef PR_LOGGING