зеркало из https://github.com/mozilla/gecko-dev.git
traceObject(). only used when leak detector built.
This commit is contained in:
Родитель
5b8256210a
Коммит
e417745871
|
@ -1538,19 +1538,31 @@ function dumpExpr( expr ) {
|
|||
|
||||
var leakDetector = null;
|
||||
|
||||
function getLeakDetector()
|
||||
{
|
||||
leakDetector = createInstance("component://netscape/xpcom/leakdetector", "nsILeakDetector");
|
||||
if (leakDetector == null) {
|
||||
dump("Could not create leak detector, leak detection probably\n");
|
||||
dump("not compiled into this browser\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Dumps current set of memory leaks.
|
||||
function dumpMemoryLeaks() {
|
||||
if (leakDetector == null) {
|
||||
leakDetector = createInstance("component://netscape/xpcom/leakdetector", "nsILeakDetector");
|
||||
if (leakDetector == null) {
|
||||
dump("Could not create leak detector, leak detection probably\n");
|
||||
dump("not compiled into this browser\n");
|
||||
}
|
||||
}
|
||||
if (leakDetector == null)
|
||||
getLeakDetector();
|
||||
if (leakDetector != null)
|
||||
leakDetector.dumpLeaks();
|
||||
}
|
||||
|
||||
function traceObject(object)
|
||||
{
|
||||
if (leakDetector == null)
|
||||
getLeakDetector();
|
||||
if (leakDetector != null)
|
||||
leakDetector.traceObject(object);
|
||||
}
|
||||
|
||||
var consoleListener = {
|
||||
observe: function (aMsgObject)
|
||||
{
|
||||
|
|
|
@ -525,6 +525,7 @@ oncommand="goPreferences('pref-themes.xul','chrome://communicator/content/pref/p
|
|||
<menuitem value="&BloatDumpAllCmd.label;" oncommand="window._content.location.href='about:bloat'"/>
|
||||
<menuitem value="&BloatClearCmd.label;" oncommand="window._content.location.href='about:bloat?clear'"/>
|
||||
<menuitem value="&BloatLeaksCmd.label;" oncommand="dumpMemoryLeaks();"/>
|
||||
<menuitem value="&BloatTraceCmd.label;" oncommand="traceObject(document);"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
|
|
@ -301,6 +301,7 @@
|
|||
<!ENTITY BloatDumpAllCmd.label "Bloat: Dump All Stats">
|
||||
<!ENTITY BloatClearCmd.label "Bloat: Clear Stats">
|
||||
<!ENTITY BloatLeaksCmd.label "Bloat: Dump Memory Leaks">
|
||||
<!ENTITY BloatTraceCmd.label "Bloat: Trace Document">
|
||||
<!ENTITY URIDispatchingCmd.label "URI Dispatching">
|
||||
<!ENTITY URIDispatchingEnableCmd.label "Enable Dispatching">
|
||||
<!ENTITY URIDispatchingDisableCmd.label "Disable Dispatching">
|
||||
|
|
Загрузка…
Ссылка в новой задаче