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

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

Issue 2774513003: PlzNavigate: ensure we create a ServiceWorkerProviderHost (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1fb1130b493ef61f803b9a9205f9924391c1a082..d8a667c555454f71233e43c56697639dbaf8ceb1 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -1016,10 +1016,15 @@ void ServiceWorkerDispatcherHost::OnProviderCreated(
if (navigation_handle_core != nullptr)
provider_host = navigation_handle_core->RetrievePreCreatedHost();
- // If no host is found, the navigation has been cancelled in the meantime.
- // Just return as the navigation will be stopped in the renderer as well.
- if (provider_host == nullptr)
+ // If no host is found, create one.
+ if (provider_host == nullptr) {
michaeln 2017/03/23 22:25:07 Do we know how this happens? The only way to get
clamy 2017/04/05 12:23:48 My personal hunch (I haven't been able to reproduc
+ GetContext()->AddProviderHost(
+ ServiceWorkerProviderHost::Create(render_process_id_, std::move(info),
+ GetContext()->AsWeakPtr(), this));
return;
+ }
+
+ // 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698