Chromium Code Reviews| Index: content/child/service_worker/service_worker_dispatcher.cc |
| diff --git a/content/child/service_worker/service_worker_dispatcher.cc b/content/child/service_worker/service_worker_dispatcher.cc |
| index 9022cddd655ef6cc58e9a286621e28a1856e41b0..f6156a666273b1b36863ea88b174ed3f31519b5e 100644 |
| --- a/content/child/service_worker/service_worker_dispatcher.cc |
| +++ b/content/child/service_worker/service_worker_dispatcher.cc |
| @@ -688,8 +688,12 @@ void ServiceWorkerDispatcher::OnSetControllerServiceWorker( |
| // provider context if it exists. |
| scoped_ptr<ServiceWorkerHandleReference> handle_ref = Adopt(info); |
| ProviderContextMap::iterator provider = provider_contexts_.find(provider_id); |
| - if (provider != provider_contexts_.end()) |
| - provider->second->OnSetControllerServiceWorker(handle_ref.Pass()); |
| + if (provider != provider_contexts_.end()) { |
| + if (info.handle_id == kInvalidServiceWorkerVersionId) |
|
horo
2015/11/27 10:03:26
Please add comment about when this happens.
I thin
falken
2015/12/01 03:46:06
We also call NotifyControllerLost when we fail to
falken
2015/12/01 05:08:00
Actually it happens in several other cases, lookin
horo
2015/12/02 03:10:42
Thank you for the detailed explanation.
|
| + provider->second->OnSetControllerServiceWorker(nullptr); |
|
nhiroki
2015/11/27 09:46:01
How about throwing away invalid reference handle c
falken
2015/12/01 03:46:06
Seems like a good idea, working on a patch to do t
|
| + else |
| + provider->second->OnSetControllerServiceWorker(handle_ref.Pass()); |
| + } |
| ProviderClientMap::iterator found = provider_clients_.find(provider_id); |
| if (found != provider_clients_.end()) { |