OLD | NEW |
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 provider_id_, pattern, script_url, callbacks); | 76 provider_id_, pattern, script_url, callbacks); |
77 } | 77 } |
78 | 78 |
79 void WebServiceWorkerProviderImpl::unregisterServiceWorker( | 79 void WebServiceWorkerProviderImpl::unregisterServiceWorker( |
80 const WebURL& pattern, | 80 const WebURL& pattern, |
81 WebServiceWorkerRegistrationCallbacks* callbacks) { | 81 WebServiceWorkerRegistrationCallbacks* callbacks) { |
82 GetDispatcher()->UnregisterServiceWorker( | 82 GetDispatcher()->UnregisterServiceWorker( |
83 provider_id_, pattern, callbacks); | 83 provider_id_, pattern, callbacks); |
84 } | 84 } |
85 | 85 |
| 86 void WebServiceWorkerProviderImpl::getRegistration( |
| 87 const blink::WebURL& document_url, |
| 88 WebServiceWorkerRegistrationCallbacks* callbacks) { |
| 89 GetDispatcher()->GetRegistration(provider_id_, document_url, callbacks); |
| 90 } |
| 91 |
86 void WebServiceWorkerProviderImpl::RemoveScriptClient() { | 92 void WebServiceWorkerProviderImpl::RemoveScriptClient() { |
87 // Remove the script client, but only if the dispatcher is still there. | 93 // Remove the script client, but only if the dispatcher is still there. |
88 // (For cleanup path we don't need to bother creating a new dispatcher) | 94 // (For cleanup path we don't need to bother creating a new dispatcher) |
89 ServiceWorkerDispatcher* dispatcher = | 95 ServiceWorkerDispatcher* dispatcher = |
90 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 96 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
91 if (dispatcher) | 97 if (dispatcher) |
92 dispatcher->RemoveScriptClient(provider_id_); | 98 dispatcher->RemoveScriptClient(provider_id_); |
93 } | 99 } |
94 | 100 |
95 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { | 101 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { |
96 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( | 102 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( |
97 thread_safe_sender_.get()); | 103 thread_safe_sender_.get()); |
98 } | 104 } |
99 | 105 |
100 } // namespace content | 106 } // namespace content |
OLD | NEW |