Issue #2251 - Expose ghost window unlinking to release builds.

This commit is contained in:
FranklinDM 2024-02-12 16:54:50 +08:00 committed by roytam1
commit 97a40adc75
5 changed files with 0 additions and 12 deletions

View file

@ -2302,13 +2302,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) {

View file

@ -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;

View file

@ -829,7 +829,6 @@ nsWindowMemoryReporter::KillCheckTimer()
}
}
#ifdef DEBUG
/* static */ void
nsWindowMemoryReporter::UnlinkGhostWindows()
{
@ -866,4 +865,3 @@ nsWindowMemoryReporter::UnlinkGhostWindows()
}
}
}
#endif

View file

@ -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);

View file

@ -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