From 2dea8712c0f35d1fea0ae59d0d4a4bbf18eb5415 Mon Sep 17 00:00:00 2001 From: Edmund Wong Date: Sun, 19 Sep 2010 00:20:29 +0100 Subject: [PATCH] Bug 597403 Remove nsILeakDetector leftovers r=Callek --- suite/debugQA/content/debugQAMenuOverlay.js | 54 -------------------- suite/debugQA/content/debugQAMenuOverlay.xul | 9 ---- 2 files changed, 63 deletions(-) diff --git a/suite/debugQA/content/debugQAMenuOverlay.js b/suite/debugQA/content/debugQAMenuOverlay.js index a079763ff6..58fe177706 100644 --- a/suite/debugQA/content/debugQAMenuOverlay.js +++ b/suite/debugQA/content/debugQAMenuOverlay.js @@ -39,18 +39,11 @@ * * ***** END LICENSE BLOCK ***** */ -var gLeakDetector = null; -var gLeakDetectorVerbose = false; - // "about:bloat" is available only when // (the application is) compiled with |--enable-logrefcnt|. if ("@mozilla.org/network/protocol/about;1?what=bloat" in Components.classes) window.addEventListener("load", onLoadBloat, false); -// The Leak Detector (class) can be undefined in a given (application) build. -if ("@mozilla.org/xpcom/leakdetector;1" in Components.classes) - window.addEventListener("load", onLoadLeakDetector, false); - // Unhide (and enable) the Bloat menu and its associated (shared) separator. function onLoadBloat() { @@ -72,50 +65,3 @@ function onLoadBloat() document.getElementById("bloatAndLeakSeparator").hidden = false; document.getElementById("bloatMenu").hidden = false; } - -// Initialize the Leak Detector, -// and unhide its menu and its associated (shared) separator. -function onLoadLeakDetector() -{ - window.removeEventListener("load", onLoadLeakDetector, false); - - // Ignore windows which don't get the Debug menu, like 'View Source'. - if (!document.getElementById("debugMenu")) - return; - - gLeakDetector = Components.classes["@mozilla.org/xpcom/leakdetector;1"] - .createInstance(Components.interfaces.nsILeakDetector); - - document.getElementById("bloatAndLeakSeparator").hidden = false; - document.getElementById("leakMenu").hidden = false; -} - -// Dumps current set of memory leaks. -function dumpMemoryLeaks() -{ - gLeakDetector.dumpLeaks(); -} - -// Traces all objects reachable from the chrome document. -function traceChrome() -{ - gLeakDetector.traceObject(document, gLeakDetectorVerbose); -} - -// Traces all objects reachable from the content document. -function traceDocument() -{ - // keep the chrome document out of the dump. - gLeakDetector.markObject(document, true); - gLeakDetector.traceObject(content, gLeakDetectorVerbose); - gLeakDetector.markObject(document, false); -} - -/** - * Controls whether or not we do verbose tracing. - * @param verbose Either |"true"| or |""|. - */ -function traceVerbose(verbose) -{ - gLeakDetectorVerbose = (verbose == "true"); -} diff --git a/suite/debugQA/content/debugQAMenuOverlay.xul b/suite/debugQA/content/debugQAMenuOverlay.xul index d3523ce4b3..71f5dd5ccf 100644 --- a/suite/debugQA/content/debugQAMenuOverlay.xul +++ b/suite/debugQA/content/debugQAMenuOverlay.xul @@ -183,15 +183,6 @@ -