| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // track of the controller's use counter. | 58 // track of the controller's use counter. |
| 59 for (uint32_t feature : context_->used_features()) | 59 for (uint32_t feature : context_->used_features()) |
| 60 client->CountFeature(feature); | 60 client->CountFeature(feature); |
| 61 client->SetController(WebServiceWorkerImpl::CreateHandle(controller), | 61 client->SetController(WebServiceWorkerImpl::CreateHandle(controller), |
| 62 false /* shouldNotifyControllerChange */); | 62 false /* shouldNotifyControllerChange */); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void WebServiceWorkerProviderImpl::RegisterServiceWorker( | 65 void WebServiceWorkerProviderImpl::RegisterServiceWorker( |
| 66 const WebURL& pattern, | 66 const WebURL& pattern, |
| 67 const WebURL& script_url, | 67 const WebURL& script_url, |
| 68 blink::WebServiceWorkerUpdateViaCache update_via_cache, |
| 68 std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks) { | 69 std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks) { |
| 69 GetDispatcher()->RegisterServiceWorker(context_->provider_id(), pattern, | 70 GetDispatcher()->RegisterServiceWorker(context_->provider_id(), pattern, |
| 70 script_url, std::move(callbacks)); | 71 script_url, update_via_cache, |
| 72 std::move(callbacks)); |
| 71 } | 73 } |
| 72 | 74 |
| 73 void WebServiceWorkerProviderImpl::GetRegistration( | 75 void WebServiceWorkerProviderImpl::GetRegistration( |
| 74 const blink::WebURL& document_url, | 76 const blink::WebURL& document_url, |
| 75 std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks> callbacks) { | 77 std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks> callbacks) { |
| 76 GetDispatcher()->GetRegistration(context_->provider_id(), document_url, | 78 GetDispatcher()->GetRegistration(context_->provider_id(), document_url, |
| 77 std::move(callbacks)); | 79 std::move(callbacks)); |
| 78 } | 80 } |
| 79 | 81 |
| 80 void WebServiceWorkerProviderImpl::GetRegistrations( | 82 void WebServiceWorkerProviderImpl::GetRegistrations( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 115 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
| 114 if (dispatcher) | 116 if (dispatcher) |
| 115 dispatcher->RemoveProviderClient(context_->provider_id()); | 117 dispatcher->RemoveProviderClient(context_->provider_id()); |
| 116 } | 118 } |
| 117 | 119 |
| 118 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { | 120 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { |
| 119 return ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 121 return ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
| 120 } | 122 } |
| 121 | 123 |
| 122 } // namespace content | 124 } // namespace content |
| OLD | NEW |