mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 901597, part 1 - Move CC logging logic into nsCCParams. r=smaug
This commit is contained in:
parent
8807edd27d
commit
3fd4ecc704
@ -237,6 +237,11 @@ struct nsCycleCollectorParams
|
||||
mAllTracesAtShutdown (PR_GetEnv("MOZ_CC_ALL_TRACES_AT_SHUTDOWN") != nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
bool LogThisCC(bool aIsShutdown)
|
||||
{
|
||||
return mLogAll || (aIsShutdown && mLogShutdown);
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef COLLECT_TIME_DEBUG
|
||||
@ -3306,14 +3311,12 @@ nsCycleCollector::BeginCollection(ccType aCCType,
|
||||
MOZ_ASSERT(!mListener, "Forgot to clear a previous listener?");
|
||||
mListener = aManualListener;
|
||||
aManualListener = nullptr;
|
||||
if (!mListener) {
|
||||
if (mParams.mLogAll || (isShutdown && mParams.mLogShutdown)) {
|
||||
nsRefPtr<nsCycleCollectorLogger> logger = new nsCycleCollectorLogger();
|
||||
if (isShutdown && mParams.mAllTracesAtShutdown) {
|
||||
logger->SetAllTraces();
|
||||
}
|
||||
mListener = logger.forget();
|
||||
if (!mListener && mParams.LogThisCC(isShutdown)) {
|
||||
nsRefPtr<nsCycleCollectorLogger> logger = new nsCycleCollectorLogger();
|
||||
if (isShutdown && mParams.mAllTracesAtShutdown) {
|
||||
logger->SetAllTraces();
|
||||
}
|
||||
mListener = logger.forget();
|
||||
}
|
||||
|
||||
bool forceGC = isShutdown;
|
||||
|
Loading…
Reference in New Issue
Block a user