зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1331434 - Part 7: Handle custom cleanup after throwing in /dom/workers, r=baku
MozReview-Commit-ID: 1hKUDi9Oxg7
This commit is contained in:
Родитель
aecd0f6f4c
Коммит
67c4d0b3c1
|
@ -2028,10 +2028,10 @@ ScriptExecutorRunnable::ShutdownScriptLoader(JSContext* aCx,
|
|||
if (mScriptLoader.mRv.Failed()) {
|
||||
if (aMutedError && mScriptLoader.mRv.IsJSException()) {
|
||||
LogExceptionToConsole(aCx, aWorkerPrivate);
|
||||
mScriptLoader.mRv.Throw(NS_ERROR_DOM_NETWORK_ERR);
|
||||
mScriptLoader.mRv.ThrowWithCustomCleanup(NS_ERROR_DOM_NETWORK_ERR);
|
||||
}
|
||||
} else {
|
||||
mScriptLoader.mRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
mScriptLoader.mRv.ThrowWithCustomCleanup(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -587,14 +587,17 @@ WorkerMainThreadRunnable::Dispatch(Status aFailStatus, ErrorResult& aRv)
|
|||
MOZ_ASSERT(NS_SUCCEEDED(rv),
|
||||
"Should only fail after xpcom-shutdown-threads and we're gone by then");
|
||||
|
||||
if (!syncLoop.Run()) {
|
||||
aRv.ThrowUncatchableException();
|
||||
}
|
||||
bool success = syncLoop.Run();
|
||||
|
||||
Telemetry::Accumulate(Telemetry::SYNC_WORKER_OPERATION, mTelemetryKey,
|
||||
static_cast<uint32_t>((TimeStamp::NowLoRes() - startTime)
|
||||
.ToMilliseconds()));
|
||||
.ToMilliseconds()));
|
||||
|
||||
Unused << startTime; // Shut the compiler up.
|
||||
|
||||
if (!success) {
|
||||
aRv.ThrowUncatchableException();
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -881,6 +881,7 @@ WorkerDebuggerGlobalScope::GetGlobal(JSContext* aCx,
|
|||
WorkerGlobalScope* scope = mWorkerPrivate->GetOrCreateGlobalScope(aCx);
|
||||
if (!scope) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
aGlobal.set(scope->GetWrapper());
|
||||
|
|
Загрузка…
Ссылка в новой задаче