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

Side by Side Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 871853002: ServiceWorker: add ServiceWorkerClients.claim() support (2/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove assignment within conditional expression Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/service_worker/service_worker_dispatcher.h" 5 #include "content/child/service_worker/service_worker_dispatcher.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/threading/thread_local.h" 9 #include "base/threading/thread_local.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 if (attrs.active.handle_id != kInvalidServiceWorkerHandleId) 339 if (attrs.active.handle_id != kInvalidServiceWorkerHandleId)
340 worker_to_provider_[attrs.active.handle_id] = provider->second; 340 worker_to_provider_[attrs.active.handle_id] = provider->second;
341 } 341 }
342 342
343 void ServiceWorkerDispatcher::OnDisassociateRegistration( 343 void ServiceWorkerDispatcher::OnDisassociateRegistration(
344 int thread_id, 344 int thread_id,
345 int provider_id) { 345 int provider_id) {
346 ProviderContextMap::iterator provider = provider_contexts_.find(provider_id); 346 ProviderContextMap::iterator provider = provider_contexts_.find(provider_id);
347 if (provider == provider_contexts_.end()) 347 if (provider == provider_contexts_.end())
348 return; 348 return;
349 provider->second->OnDisassociateRegistration();
350 worker_to_provider_.erase(provider->second->installing_handle_id()); 349 worker_to_provider_.erase(provider->second->installing_handle_id());
351 worker_to_provider_.erase(provider->second->waiting_handle_id()); 350 worker_to_provider_.erase(provider->second->waiting_handle_id());
352 worker_to_provider_.erase(provider->second->active_handle_id()); 351 worker_to_provider_.erase(provider->second->active_handle_id());
353 worker_to_provider_.erase(provider->second->controller_handle_id()); 352 worker_to_provider_.erase(provider->second->controller_handle_id());
353 provider->second->OnDisassociateRegistration();
354 } 354 }
355 355
356 void ServiceWorkerDispatcher::OnRegistered( 356 void ServiceWorkerDispatcher::OnRegistered(
357 int thread_id, 357 int thread_id,
358 int request_id, 358 int request_id,
359 const ServiceWorkerRegistrationObjectInfo& info, 359 const ServiceWorkerRegistrationObjectInfo& info,
360 const ServiceWorkerVersionAttributes& attrs) { 360 const ServiceWorkerVersionAttributes& attrs) {
361 TRACE_EVENT_ASYNC_STEP_INTO0("ServiceWorker", 361 TRACE_EVENT_ASYNC_STEP_INTO0("ServiceWorker",
362 "ServiceWorkerDispatcher::RegisterServiceWorker", 362 "ServiceWorkerDispatcher::RegisterServiceWorker",
363 request_id, 363 request_id,
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 attrs.installing, thread_safe_sender_.get()); 729 attrs.installing, thread_safe_sender_.get());
730 ServiceWorkerHandleReference::Adopt( 730 ServiceWorkerHandleReference::Adopt(
731 attrs.waiting, thread_safe_sender_.get()); 731 attrs.waiting, thread_safe_sender_.get());
732 ServiceWorkerHandleReference::Adopt( 732 ServiceWorkerHandleReference::Adopt(
733 attrs.active, thread_safe_sender_.get()); 733 attrs.active, thread_safe_sender_.get());
734 } 734 }
735 return registration; 735 return registration;
736 } 736 }
737 737
738 } // namespace content 738 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version.cc ('k') | content/common/service_worker/service_worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698