mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
Bug 1864459 - WorkerPrivate::IsEligibleForCC should consider if there are any pending events. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D193984
This commit is contained in:
parent
acb150212e
commit
369c69cb51
@ -4334,7 +4334,13 @@ bool WorkerPrivate::IsEligibleForCC() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HasShutdownTasks = !mShutdownTasks.IsEmpty();
|
||||
bool hasShutdownTasks = !mShutdownTasks.IsEmpty();
|
||||
bool hasPendingEvents = false;
|
||||
if (mThread) {
|
||||
hasPendingEvents =
|
||||
NS_SUCCEEDED(mThread->HasPendingEvents(&hasPendingEvents)) &&
|
||||
hasPendingEvents;
|
||||
}
|
||||
|
||||
LOGV(("mMainThreadEventTarget: %s",
|
||||
mMainThreadEventTarget->IsEmpty() ? "empty" : "non-empty"));
|
||||
@ -4343,12 +4349,13 @@ bool WorkerPrivate::IsEligibleForCC() {
|
||||
LOGV(("mMainThreadDebuggerEventTarget: %s",
|
||||
mMainThreadDebuggeeEventTarget->IsEmpty() ? "empty" : "non-empty"));
|
||||
LOGV(("mCCFlagSaysEligible: %s", mCCFlagSaysEligible ? "true" : "false"));
|
||||
LOGV(("HasShutdownTasks: %s", HasShutdownTasks ? "true" : "false"));
|
||||
LOGV(("hasShutdownTasks: %s", hasShutdownTasks ? "true" : "false"));
|
||||
LOGV(("hasPendingEvents: %s", hasPendingEvents ? "true" : "false"));
|
||||
|
||||
return mMainThreadEventTarget->IsEmpty() &&
|
||||
mMainThreadEventTargetForMessaging->IsEmpty() &&
|
||||
mMainThreadDebuggeeEventTarget->IsEmpty() && mCCFlagSaysEligible &&
|
||||
!HasShutdownTasks;
|
||||
!hasShutdownTasks && !hasPendingEvents;
|
||||
}
|
||||
|
||||
void WorkerPrivate::CancelAllTimeouts() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user