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