PlzWorker: Use ServiceWorkerNavigationHandle.
This aligns PlzWorker to be more like PlzNavigate for service worker related objects. This will allow moving service worker to the UI thread by allowing PlzWorker to use ServiceWorkerNavigationLoaderInterceptor like navigations do. Previously, navigations stored ServiceWorkerProviderHost info in ServiceWorkerNavigationHandle, while PlzWorker did it itself: WorkerScriptFetchInitiator::CreateScriptLoaderOnIO created the provider host and passed the host to WorkerScriptLoaderFactory, and eventually WorkerScriptLoader::CommitCompleted called host->CompleteWebWorkerPreparation. The host's info was passed to WorkerScriptFetchInitiator::Start's callback, so the caller could pass it to the worker in the renderer. Now, DedicatedWorkerHost or SharedWorkerHost hold the handle and take the info from it to pass to the renderer on commit. WorkerScriptLoader::CommitCompleted gets a pointer to the handle and calls CompleteWebWorkerPreparation on its host. Refactoring-only. As a result of the refactoring, we no longer make a ServiceWorkerProviderHost for workers whose URL is not a service worker supported scheme (essentially https or chrome-extension). Previously we would make the host but it wouldn't be used because it would have a blank URL as UpdateUrls() was never called on it by the interceptor. Bug: 985259 Change-Id: I999c69f0cb3bc6f37ef854c96322b0774ec84a47 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1712510Reviewed-by:Kinuko Yasuda <kinuko@chromium.org> Reviewed-by:
Hiroki Nakagawa <nhiroki@chromium.org> Commit-Queue: Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#680036}
Showing
Please register or sign in to comment