traceObject(). only used when leak detector built.

This commit is contained in:
beard%netscape.com 2000-08-31 14:43:17 +00:00
Родитель 5b8256210a
Коммит e417745871
3 изменённых файлов: 21 добавлений и 7 удалений

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

@ -1538,19 +1538,31 @@ function dumpExpr( expr ) {
var leakDetector = null; 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. // Dumps current set of memory leaks.
function dumpMemoryLeaks() { function dumpMemoryLeaks() {
if (leakDetector == null) { if (leakDetector == null)
leakDetector = createInstance("component://netscape/xpcom/leakdetector", "nsILeakDetector"); getLeakDetector();
if (leakDetector == null) {
dump("Could not create leak detector, leak detection probably\n");
dump("not compiled into this browser\n");
}
}
if (leakDetector != null) if (leakDetector != null)
leakDetector.dumpLeaks(); leakDetector.dumpLeaks();
} }
function traceObject(object)
{
if (leakDetector == null)
getLeakDetector();
if (leakDetector != null)
leakDetector.traceObject(object);
}
var consoleListener = { var consoleListener = {
observe: function (aMsgObject) 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="&BloatDumpAllCmd.label;" oncommand="window._content.location.href='about:bloat'"/>
<menuitem value="&BloatClearCmd.label;" oncommand="window._content.location.href='about:bloat?clear'"/> <menuitem value="&BloatClearCmd.label;" oncommand="window._content.location.href='about:bloat?clear'"/>
<menuitem value="&BloatLeaksCmd.label;" oncommand="dumpMemoryLeaks();"/> <menuitem value="&BloatLeaksCmd.label;" oncommand="dumpMemoryLeaks();"/>
<menuitem value="&BloatTraceCmd.label;" oncommand="traceObject(document);"/>
</menupopup> </menupopup>
</menu> </menu>
</menubar> </menubar>

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

@ -301,6 +301,7 @@
<!ENTITY BloatDumpAllCmd.label "Bloat: Dump All Stats"> <!ENTITY BloatDumpAllCmd.label "Bloat: Dump All Stats">
<!ENTITY BloatClearCmd.label "Bloat: Clear Stats"> <!ENTITY BloatClearCmd.label "Bloat: Clear Stats">
<!ENTITY BloatLeaksCmd.label "Bloat: Dump Memory Leaks"> <!ENTITY BloatLeaksCmd.label "Bloat: Dump Memory Leaks">
<!ENTITY BloatTraceCmd.label "Bloat: Trace Document">
<!ENTITY URIDispatchingCmd.label "URI Dispatching"> <!ENTITY URIDispatchingCmd.label "URI Dispatching">
<!ENTITY URIDispatchingEnableCmd.label "Enable Dispatching"> <!ENTITY URIDispatchingEnableCmd.label "Enable Dispatching">
<!ENTITY URIDispatchingDisableCmd.label "Disable Dispatching"> <!ENTITY URIDispatchingDisableCmd.label "Disable Dispatching">