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

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

Issue 1175823002: ServiceWorker: Implement ServiceWorkerRegistration.update() (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 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/web_service_worker_provider_impl.h" 5 #include "content/child/service_worker/web_service_worker_provider_impl.h"
6 6
7 #include "content/child/service_worker/service_worker_dispatcher.h" 7 #include "content/child/service_worker/service_worker_dispatcher.h"
8 #include "content/child/service_worker/service_worker_handle_reference.h" 8 #include "content/child/service_worker/service_worker_handle_reference.h"
9 #include "content/child/service_worker/service_worker_provider_context.h" 9 #include "content/child/service_worker/service_worker_provider_context.h"
10 #include "content/child/service_worker/web_service_worker_impl.h" 10 #include "content/child/service_worker/web_service_worker_impl.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 WebServiceWorkerGetRegistrationsCallbacks* callbacks) { 75 WebServiceWorkerGetRegistrationsCallbacks* callbacks) {
76 GetDispatcher()->GetRegistrations( 76 GetDispatcher()->GetRegistrations(
77 context_->provider_id(), callbacks); 77 context_->provider_id(), callbacks);
78 } 78 }
79 79
80 void WebServiceWorkerProviderImpl::getRegistrationForReady( 80 void WebServiceWorkerProviderImpl::getRegistrationForReady(
81 WebServiceWorkerGetRegistrationForReadyCallbacks* callbacks) { 81 WebServiceWorkerGetRegistrationForReadyCallbacks* callbacks) {
82 GetDispatcher()->GetRegistrationForReady(context_->provider_id(), callbacks); 82 GetDispatcher()->GetRegistrationForReady(context_->provider_id(), callbacks);
83 } 83 }
84 84
85 int WebServiceWorkerProviderImpl::provider_id() const {
86 return context_->provider_id();
87 }
88
85 void WebServiceWorkerProviderImpl::RemoveProviderClient() { 89 void WebServiceWorkerProviderImpl::RemoveProviderClient() {
86 // Remove the provider client, but only if the dispatcher is still there. 90 // Remove the provider client, but only if the dispatcher is still there.
87 // (For cleanup path we don't need to bother creating a new dispatcher) 91 // (For cleanup path we don't need to bother creating a new dispatcher)
88 ServiceWorkerDispatcher* dispatcher = 92 ServiceWorkerDispatcher* dispatcher =
89 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 93 ServiceWorkerDispatcher::GetThreadSpecificInstance();
90 if (dispatcher) 94 if (dispatcher)
91 dispatcher->RemoveProviderClient(context_->provider_id()); 95 dispatcher->RemoveProviderClient(context_->provider_id());
92 } 96 }
93 97
94 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { 98 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() {
95 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( 99 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance(
96 thread_safe_sender_.get()); 100 thread_safe_sender_.get());
97 } 101 }
98 102
99 } // namespace content 103 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698