Compare commits
2
Commits
2664
...
ghost-windows
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c216c5d80b | ||
|
|
8aeaca8570 |
No files matched your search
@@ -2300,13 +2300,11 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsGlobalWindow::RiskyUnlink()
|
||||
{
|
||||
NS_CYCLE_COLLECTION_INNERNAME.Unlink(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsGlobalWindow)
|
||||
if (tmp->mCachedXBLPrototypeHandlers) {
|
||||
|
||||
@@ -597,11 +597,9 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsGlobalWindow,
|
||||
nsIDOMEventTarget)
|
||||
|
||||
#ifdef DEBUG
|
||||
// Call Unlink on this window. This may cause bad things to happen, so use
|
||||
// with caution.
|
||||
void RiskyUnlink();
|
||||
#endif
|
||||
|
||||
virtual JSObject*
|
||||
GetCachedXBLPrototypeHandler(nsXBLPrototypeHandler* aKey) override;
|
||||
|
||||
@@ -829,7 +829,6 @@ nsWindowMemoryReporter::KillCheckTimer()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* static */ void
|
||||
nsWindowMemoryReporter::UnlinkGhostWindows()
|
||||
{
|
||||
@@ -866,4 +865,3 @@ nsWindowMemoryReporter::UnlinkGhostWindows()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -150,13 +150,11 @@ public:
|
||||
|
||||
static void Init();
|
||||
|
||||
#ifdef DEBUG
|
||||
/**
|
||||
* Unlink all known ghost windows, to enable investigating what caused them
|
||||
* to become ghost windows in the first place.
|
||||
*/
|
||||
static void UnlinkGhostWindows();
|
||||
#endif
|
||||
|
||||
static nsWindowMemoryReporter* Get();
|
||||
void ObserveDOMWindowDetached(nsGlobalWindow* aWindow);
|
||||
|
||||
@@ -2664,12 +2664,8 @@ nsXPCComponents_Utils::SchedulePreciseShrinkingGC(ScheduledGCCallback* aCallback
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Utils::UnlinkGhostWindows()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
nsWindowMemoryReporter::UnlinkGhostWindows();
|
||||
return NS_OK;
|
||||
#else
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
||||
@@ -304,6 +304,9 @@ function onLoad()
|
||||
"collection followed by a cycle collection, and causes the " +
|
||||
"process to reduce memory usage in other ways, e.g. by " +
|
||||
"flushing various caches.";
|
||||
const UGDesc = "Unlink any known ghost windows, to enable investigating " +
|
||||
"what caused them. This is only for debugging leaks, and " +
|
||||
"can cause bad things to happen if called.";
|
||||
|
||||
const GCAndCCLogDesc = "Save garbage collection log and concise cycle " +
|
||||
"collection log.\n" +
|
||||
@@ -357,6 +360,7 @@ function onLoad()
|
||||
appendButton(row3, GCDesc, doGC, "GC");
|
||||
appendButton(row3, CCDesc, doCC, "CC");
|
||||
appendButton(row3, MMDesc, doMMU, "Minimize memory usage");
|
||||
appendButton(row3, UGDesc, doUGW, "Unlink ghost windows");
|
||||
|
||||
let row4 = appendElement(ops, "div", "opsRow");
|
||||
|
||||
@@ -429,6 +433,12 @@ function doMMU()
|
||||
() => updateMainAndFooter("Memory minimization completed", HIDE_FOOTER));
|
||||
}
|
||||
|
||||
function doUGW()
|
||||
{
|
||||
Cu.unlinkGhostWindows();
|
||||
updateMainAndFooter("Unlink ghost windows completed", HIDE_FOOTER);
|
||||
}
|
||||
|
||||
function doMeasure()
|
||||
{
|
||||
updateAboutMemoryFromReporters();
|
||||
|
||||
Reference in new issue
Block a user