diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index b7f782de70a6..68775674ed11 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -194,6 +194,11 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID); #define DEBUG_PAGE_CACHE #endif +#ifdef XP_WIN +#include +#define getpid _getpid +#endif + using namespace mozilla; using namespace mozilla::dom; @@ -795,8 +800,11 @@ nsDocShell::nsDocShell(): // We're counting the number of |nsDocShells| to help find leaks ++gNumberOfDocShells; if (!PR_GetEnv("MOZ_QUIET")) { - printf("++DOCSHELL %p == %ld [id = %llu]\n", (void*) this, - gNumberOfDocShells, SafeCast(mHistoryID)); + printf_stderr("++DOCSHELL %p == %ld [pid = %d] [id = %llu]\n", + (void*) this, + gNumberOfDocShells, + getpid(), + SafeCast(mHistoryID)); } #endif } @@ -824,8 +832,11 @@ nsDocShell::~nsDocShell() // We're counting the number of |nsDocShells| to help find leaks --gNumberOfDocShells; if (!PR_GetEnv("MOZ_QUIET")) { - printf("--DOCSHELL %p == %ld [id = %llu]\n", (void*) this, - gNumberOfDocShells, SafeCast(mHistoryID)); + printf_stderr("--DOCSHELL %p == %ld [pid = %d] [id = %llu]\n", + (void*) this, + gNumberOfDocShells, + getpid(), + SafeCast(mHistoryID)); } #endif } diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 8431f2d00175..f37871724d24 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -237,6 +237,11 @@ class nsIScriptTimeoutHandler; static PRLogModuleInfo* gDOMLeakPRLog; #endif +#ifdef XP_WIN +#include +#define getpid _getpid +#endif + static const char kStorageEnabled[] = "dom.storage.enabled"; using namespace mozilla; @@ -1121,10 +1126,12 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow) #ifdef DEBUG if (!PR_GetEnv("MOZ_QUIET")) { - printf("++DOMWINDOW == %d (%p) [serial = %d] [outer = %p]\n", gRefCnt, - static_cast(static_cast(this)), - gSerialCounter, - static_cast(static_cast(aOuterWindow))); + printf_stderr("++DOMWINDOW == %d (%p) [pid = %d] [serial = %d] [outer = %p]\n", + gRefCnt, + static_cast(static_cast(this)), + getpid(), + gSerialCounter, + static_cast(static_cast(aOuterWindow))); } #endif @@ -1197,9 +1204,13 @@ nsGlobalWindow::~nsGlobalWindow() } nsGlobalWindow* outer = static_cast(mOuterWindow.get()); - printf("--DOMWINDOW == %d (%p) [serial = %d] [outer = %p] [url = %s]\n", - gRefCnt, static_cast(static_cast(this)), - mSerial, static_cast(static_cast(outer)), url.get()); + printf_stderr("--DOMWINDOW == %d (%p) [pid = %d] [serial = %d] [outer = %p] [url = %s]\n", + gRefCnt, + static_cast(static_cast(this)), + getpid(), + mSerial, + static_cast(static_cast(outer)), + url.get()); } #endif