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
parent c401408f10
commit ead86f9af0
2 changed files with 22 additions and 16 deletions

View File

@@ -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
}