mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Bug 604026 - Sync event loops in workers should be created only if compatible with the worker shutdown status
This commit is contained in:
parent
df880ae53f
commit
98546534b0
17 changed files with 102 additions and 56 deletions
|
|
@ -568,15 +568,20 @@ WorkerMainThreadRunnable::WorkerMainThreadRunnable(WorkerPrivate* aWorkerPrivate
|
|||
}
|
||||
|
||||
void
|
||||
WorkerMainThreadRunnable::Dispatch(ErrorResult& aRv)
|
||||
WorkerMainThreadRunnable::Dispatch(Status aFailStatus, ErrorResult& aRv)
|
||||
{
|
||||
mWorkerPrivate->AssertIsOnWorkerThread();
|
||||
|
||||
TimeStamp startTime = TimeStamp::NowLoRes();
|
||||
|
||||
AutoSyncLoopHolder syncLoop(mWorkerPrivate);
|
||||
AutoSyncLoopHolder syncLoop(mWorkerPrivate, aFailStatus);
|
||||
|
||||
mSyncLoopTarget = syncLoop.EventTarget();
|
||||
mSyncLoopTarget = syncLoop.GetEventTarget();
|
||||
if (!mSyncLoopTarget) {
|
||||
// SyncLoop creation can fail if the worker is shutting down.
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
DebugOnly<nsresult> rv = mWorkerPrivate->DispatchToMainThread(this);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv),
|
||||
|
|
@ -621,7 +626,7 @@ bool
|
|||
WorkerCheckAPIExposureOnMainThreadRunnable::Dispatch()
|
||||
{
|
||||
ErrorResult rv;
|
||||
WorkerMainThreadRunnable::Dispatch(rv);
|
||||
WorkerMainThreadRunnable::Dispatch(Terminating, rv);
|
||||
bool ok = !rv.Failed();
|
||||
rv.SuppressException();
|
||||
return ok;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue