Bug 1423412 P1 Actually mark window/worker ClientSource objects controlled when loaded with a controlling service worker. r=baku r=jld
This commit is contained in:
@@ -570,6 +570,7 @@ class ScriptLoaderRunnable final : public nsIRunnable,
|
||||
nsCOMPtr<nsIEventTarget> mSyncLoopTarget;
|
||||
nsTArray<ScriptLoadInfo> mLoadInfos;
|
||||
RefPtr<CacheCreator> mCacheCreator;
|
||||
Maybe<ServiceWorkerDescriptor> mController;
|
||||
bool mIsMainScript;
|
||||
WorkerScriptType mWorkerScriptType;
|
||||
bool mCanceled;
|
||||
@@ -1216,6 +1217,10 @@ private:
|
||||
// XHR Params Allowed
|
||||
mWorkerPrivate->SetXHRParamsAllowed(parent->XHRParamsAllowed());
|
||||
}
|
||||
|
||||
if (chanLoadInfo) {
|
||||
mController = chanLoadInfo->GetController();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@@ -1982,8 +1987,11 @@ ScriptExecutorRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
|
||||
}
|
||||
|
||||
// If this is a top level script that succeeded, then mark the
|
||||
// Client execution ready.
|
||||
// Client execution ready and possible controlled by a service worker.
|
||||
if (mIsWorkerScript) {
|
||||
if (mScriptLoader.mController.isSome()) {
|
||||
aWorkerPrivate->Control(mScriptLoader.mController.ref());
|
||||
}
|
||||
aWorkerPrivate->ExecutionReady();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user