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

Unified Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 1478103002: [WIP] [service worker] Fix detach controller and fallback to network mechanism (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix controller Created 5 years, 1 month 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 | content/child/service_worker/service_worker_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « no previous file | content/child/service_worker/service_worker_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698