OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_registration_impl.h" | 5 #include "content/child/service_worker/web_service_worker_registration_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 blink::WebServiceWorkerRegistrationProxy* | 117 blink::WebServiceWorkerRegistrationProxy* |
118 WebServiceWorkerRegistrationImpl::Proxy() { | 118 WebServiceWorkerRegistrationImpl::Proxy() { |
119 return proxy_; | 119 return proxy_; |
120 } | 120 } |
121 | 121 |
122 blink::WebURL WebServiceWorkerRegistrationImpl::Scope() const { | 122 blink::WebURL WebServiceWorkerRegistrationImpl::Scope() const { |
123 return handle_ref_->scope(); | 123 return handle_ref_->scope(); |
124 } | 124 } |
125 | 125 |
| 126 blink::WebServiceWorkerUpdateViaCache |
| 127 WebServiceWorkerRegistrationImpl::UpdateViaCache() const { |
| 128 return handle_ref_->update_via_cache(); |
| 129 } |
| 130 |
126 void WebServiceWorkerRegistrationImpl::Update( | 131 void WebServiceWorkerRegistrationImpl::Update( |
127 blink::WebServiceWorkerProvider* provider, | 132 blink::WebServiceWorkerProvider* provider, |
128 std::unique_ptr<WebServiceWorkerUpdateCallbacks> callbacks) { | 133 std::unique_ptr<WebServiceWorkerUpdateCallbacks> callbacks) { |
129 WebServiceWorkerProviderImpl* provider_impl = | 134 WebServiceWorkerProviderImpl* provider_impl = |
130 static_cast<WebServiceWorkerProviderImpl*>(provider); | 135 static_cast<WebServiceWorkerProviderImpl*>(provider); |
131 ServiceWorkerDispatcher* dispatcher = | 136 ServiceWorkerDispatcher* dispatcher = |
132 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 137 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
133 DCHECK(dispatcher); | 138 DCHECK(dispatcher); |
134 dispatcher->UpdateServiceWorker(provider_impl->provider_id(), | 139 dispatcher->UpdateServiceWorker(provider_impl->provider_id(), |
135 RegistrationId(), std::move(callbacks)); | 140 RegistrationId(), std::move(callbacks)); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 206 } |
202 | 207 |
203 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { | 208 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { |
204 ServiceWorkerDispatcher* dispatcher = | 209 ServiceWorkerDispatcher* dispatcher = |
205 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 210 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
206 if (dispatcher) | 211 if (dispatcher) |
207 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); | 212 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); |
208 } | 213 } |
209 | 214 |
210 } // namespace content | 215 } // namespace content |
OLD | NEW |