Bug 1734997 - Allow some timeouts not to clamp in workers r=smaug

Depends on D133494

Differential Revision: https://phabricator.services.mozilla.com/D142948
This commit is contained in:
Sean Feng 2022-04-21 18:47:53 +00:00
parent 5042a856cf
commit 7e68246bb0

View File

@ -4735,7 +4735,10 @@ int32_t WorkerPrivate::SetTimeout(JSContext* aCx, TimeoutHandler* aHandler,
newInfo->mOnChromeWorker = mIsChromeWorker;
newInfo->mIsInterval = aIsInterval;
newInfo->mId = timerId;
newInfo->AccumulateNestingLevel(data->mCurrentTimerNestingLevel);
if (newInfo->mReason == Timeout::Reason::eTimeoutOrInterval ||
newInfo->mReason == Timeout::Reason::eIdleCallbackTimeout) {
newInfo->AccumulateNestingLevel(data->mCurrentTimerNestingLevel);
}
if (MOZ_UNLIKELY(timerId == INT32_MAX)) {
NS_WARNING("Timeout ids overflowed!");