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

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

Issue 535753002: ServiceWorker: Implement navigator.serviceWorker.getRegistration [2/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/child/child_thread.h" 9 #include "content/child/child_thread.h"
10 #include "content/child/service_worker/service_worker_dispatcher.h" 10 #include "content/child/service_worker/service_worker_dispatcher.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 provider_id_, pattern, script_url, callbacks); 61 provider_id_, pattern, script_url, callbacks);
62 } 62 }
63 63
64 void WebServiceWorkerProviderImpl::unregisterServiceWorker( 64 void WebServiceWorkerProviderImpl::unregisterServiceWorker(
65 const WebURL& pattern, 65 const WebURL& pattern,
66 WebServiceWorkerUnregistrationCallbacks* callbacks) { 66 WebServiceWorkerUnregistrationCallbacks* callbacks) {
67 GetDispatcher()->UnregisterServiceWorker( 67 GetDispatcher()->UnregisterServiceWorker(
68 provider_id_, pattern, callbacks); 68 provider_id_, pattern, callbacks);
69 } 69 }
70 70
71 void WebServiceWorkerProviderImpl::getRegistration(
72 const blink::WebURL& document_url,
73 WebServiceWorkerRegistrationCallbacks* callbacks) {
74 GetDispatcher()->GetRegistration(provider_id_, document_url, callbacks);
75 }
76
71 void WebServiceWorkerProviderImpl::RemoveScriptClient() { 77 void WebServiceWorkerProviderImpl::RemoveScriptClient() {
72 // Remove the script client, but only if the dispatcher is still there. 78 // Remove the script client, but only if the dispatcher is still there.
73 // (For cleanup path we don't need to bother creating a new dispatcher) 79 // (For cleanup path we don't need to bother creating a new dispatcher)
74 ServiceWorkerDispatcher* dispatcher = 80 ServiceWorkerDispatcher* dispatcher =
75 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 81 ServiceWorkerDispatcher::GetThreadSpecificInstance();
76 if (dispatcher) 82 if (dispatcher)
77 dispatcher->RemoveScriptClient(provider_id_); 83 dispatcher->RemoveScriptClient(provider_id_);
78 } 84 }
79 85
80 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { 86 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() {
81 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( 87 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance(
82 thread_safe_sender_.get()); 88 thread_safe_sender_.get());
83 } 89 }
84 90
85 } // namespace content 91 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698