Chromium Code Reviews| 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); |