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

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

Issue 1146913004: Service Worker: Add ServiceWorkerContainer.getRegistrations() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 context_->provider_id(), pattern, callbacks); 64 context_->provider_id(), pattern, callbacks);
65 } 65 }
66 66
67 void WebServiceWorkerProviderImpl::getRegistration( 67 void WebServiceWorkerProviderImpl::getRegistration(
68 const blink::WebURL& document_url, 68 const blink::WebURL& document_url,
69 WebServiceWorkerRegistrationCallbacks* callbacks) { 69 WebServiceWorkerRegistrationCallbacks* callbacks) {
70 GetDispatcher()->GetRegistration( 70 GetDispatcher()->GetRegistration(
71 context_->provider_id(), document_url, callbacks); 71 context_->provider_id(), document_url, callbacks);
72 } 72 }
73 73
74 void WebServiceWorkerProviderImpl::getRegistrations(
75 const blink::WebURL& document_url,
76 WebServiceWorkerGetRegistrationsCallbacks* callbacks) {
77 GetDispatcher()->GetRegistrations(
78 context_->provider_id(), document_url, callbacks);
79 }
80
74 void WebServiceWorkerProviderImpl::getRegistrationForReady( 81 void WebServiceWorkerProviderImpl::getRegistrationForReady(
75 WebServiceWorkerGetRegistrationForReadyCallbacks* callbacks) { 82 WebServiceWorkerGetRegistrationForReadyCallbacks* callbacks) {
76 GetDispatcher()->GetRegistrationForReady(context_->provider_id(), callbacks); 83 GetDispatcher()->GetRegistrationForReady(context_->provider_id(), callbacks);
77 } 84 }
78 85
79 void WebServiceWorkerProviderImpl::RemoveProviderClient() { 86 void WebServiceWorkerProviderImpl::RemoveProviderClient() {
80 // Remove the provider client, but only if the dispatcher is still there. 87 // Remove the provider client, but only if the dispatcher is still there.
81 // (For cleanup path we don't need to bother creating a new dispatcher) 88 // (For cleanup path we don't need to bother creating a new dispatcher)
82 ServiceWorkerDispatcher* dispatcher = 89 ServiceWorkerDispatcher* dispatcher =
83 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 90 ServiceWorkerDispatcher::GetThreadSpecificInstance();
84 if (dispatcher) 91 if (dispatcher)
85 dispatcher->RemoveProviderClient(context_->provider_id()); 92 dispatcher->RemoveProviderClient(context_->provider_id());
86 } 93 }
87 94
88 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { 95 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() {
89 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( 96 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance(
90 thread_safe_sender_.get()); 97 thread_safe_sender_.get());
91 } 98 }
92 99
93 } // namespace content 100 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698