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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "content/child/service_worker/service_worker_dispatcher.h" | 10 #include "content/child/service_worker/service_worker_dispatcher.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Sync the controllee's use counter with the service worker's one. | 57 // Sync the controllee's use counter with the service worker's one. |
58 for (uint32_t feature : context_->used_features()) | 58 for (uint32_t feature : context_->used_features()) |
59 client->countFeature(feature); | 59 client->countFeature(feature); |
60 client->setController(WebServiceWorkerImpl::CreateHandle(controller), | 60 client->setController(WebServiceWorkerImpl::CreateHandle(controller), |
61 false /* shouldNotifyControllerChange */); | 61 false /* shouldNotifyControllerChange */); |
62 } | 62 } |
63 | 63 |
64 void WebServiceWorkerProviderImpl::registerServiceWorker( | 64 void WebServiceWorkerProviderImpl::registerServiceWorker( |
65 const WebURL& pattern, | 65 const WebURL& pattern, |
66 const WebURL& script_url, | 66 const WebURL& script_url, |
| 67 bool use_cache, |
67 std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks) { | 68 std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks) { |
68 GetDispatcher()->RegisterServiceWorker(context_->provider_id(), pattern, | 69 GetDispatcher()->RegisterServiceWorker(context_->provider_id(), pattern, |
69 script_url, std::move(callbacks)); | 70 script_url, use_cache, |
| 71 std::move(callbacks)); |
70 } | 72 } |
71 | 73 |
72 void WebServiceWorkerProviderImpl::getRegistration( | 74 void WebServiceWorkerProviderImpl::getRegistration( |
73 const blink::WebURL& document_url, | 75 const blink::WebURL& document_url, |
74 std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks> callbacks) { | 76 std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks> callbacks) { |
75 GetDispatcher()->GetRegistration(context_->provider_id(), document_url, | 77 GetDispatcher()->GetRegistration(context_->provider_id(), document_url, |
76 std::move(callbacks)); | 78 std::move(callbacks)); |
77 } | 79 } |
78 | 80 |
79 void WebServiceWorkerProviderImpl::getRegistrations( | 81 void WebServiceWorkerProviderImpl::getRegistrations( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 114 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
113 if (dispatcher) | 115 if (dispatcher) |
114 dispatcher->RemoveProviderClient(context_->provider_id()); | 116 dispatcher->RemoveProviderClient(context_->provider_id()); |
115 } | 117 } |
116 | 118 |
117 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { | 119 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { |
118 return ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 120 return ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
119 } | 121 } |
120 | 122 |
121 } // namespace content | 123 } // namespace content |
OLD | NEW |