Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: content/browser/service_worker/service_worker_dispatcher_host.cc

Issue 2653493009: Add two interfaces for ServiceWorkerProviderContext/ProviderHost (Closed)
Patch Set: Addressed comments from falken Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_dispatcher_host.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
index 8fe3b3df9f7142fae6ab3956d49fa1b8e2ed5ca5..537f97cd56a533ca0eaece7cf094c457f2854e67 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -967,7 +967,7 @@ void ServiceWorkerDispatcherHost::OnProviderCreated(
// Otherwise, completed the initialization of the pre-created host.
DCHECK_EQ(SERVICE_WORKER_PROVIDER_FOR_WINDOW, info.type);
provider_host->CompleteNavigationInitialized(render_process_id_,
- info.route_id, this);
+ std::move(info), this);
GetContext()->AddProviderHost(std::move(provider_host));
} else {
if (ServiceWorkerUtils::IsBrowserAssignedProviderId(info.provider_id)) {
@@ -980,26 +980,6 @@ void ServiceWorkerDispatcherHost::OnProviderCreated(
}
}
-void ServiceWorkerDispatcherHost::OnProviderDestroyed(int provider_id) {
- TRACE_EVENT0("ServiceWorker",
- "ServiceWorkerDispatcherHost::OnProviderDestroyed");
- if (!GetContext())
- return;
- if (!GetContext()->GetProviderHost(render_process_id_, provider_id)) {
- // PlzNavigate: in some cancellation of navigation cases, it is possible
- // for the pre-created hoist to have been destroyed before being claimed by
- // the renderer. The provider is then destroyed in the renderer, and no
- // matching host will be found.
- if (!IsBrowserSideNavigationEnabled() ||
- !ServiceWorkerUtils::IsBrowserAssignedProviderId(provider_id)) {
- bad_message::ReceivedBadMessage(
- this, bad_message::SWDH_PROVIDER_DESTROYED_NO_HOST);
- }
- return;
- }
- GetContext()->RemoveProviderHost(render_process_id_, provider_id);
-}
-
void ServiceWorkerDispatcherHost::OnSetHostedVersionId(int provider_id,
int64_t version_id,
int embedded_worker_id) {

Powered by Google App Engine
This is Rietveld 408576698