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 "content/child/service_worker/service_worker_dispatcher.h" | 7 #include "content/child/service_worker/service_worker_dispatcher.h" |
8 #include "content/child/service_worker/service_worker_registration_handle_refere
nce.h" | 8 #include "content/child/service_worker/service_worker_registration_handle_refere
nce.h" |
9 #include "content/common/service_worker/service_worker_types.h" | 9 #include "content/common/service_worker/service_worker_types.h" |
10 #include "third_party/WebKit/public/platform/WebServiceWorkerRegistrationProxy.h
" | 10 #include "third_party/WebKit/public/platform/WebServiceWorkerRegistrationProxy.h
" |
(...skipping 13 matching lines...) Expand all Loading... |
24 dispatcher->AddServiceWorkerRegistration(handle_ref_->handle_id(), this); | 24 dispatcher->AddServiceWorkerRegistration(handle_ref_->handle_id(), this); |
25 } | 25 } |
26 | 26 |
27 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { | 27 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { |
28 ServiceWorkerDispatcher* dispatcher = | 28 ServiceWorkerDispatcher* dispatcher = |
29 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 29 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
30 if (dispatcher) | 30 if (dispatcher) |
31 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); | 31 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); |
32 } | 32 } |
33 | 33 |
| 34 void WebServiceWorkerRegistrationImpl::SetInstalling( |
| 35 blink::WebServiceWorker* service_worker) { |
| 36 DCHECK(proxy_); |
| 37 proxy_->setInstalling(service_worker); |
| 38 } |
| 39 |
| 40 void WebServiceWorkerRegistrationImpl::SetWaiting( |
| 41 blink::WebServiceWorker* service_worker) { |
| 42 DCHECK(proxy_); |
| 43 proxy_->setWaiting(service_worker); |
| 44 } |
| 45 |
| 46 void WebServiceWorkerRegistrationImpl::SetActive( |
| 47 blink::WebServiceWorker* service_worker) { |
| 48 DCHECK(proxy_); |
| 49 proxy_->setActive(service_worker); |
| 50 } |
| 51 |
34 void WebServiceWorkerRegistrationImpl::OnUpdateFound() { | 52 void WebServiceWorkerRegistrationImpl::OnUpdateFound() { |
35 DCHECK(proxy_); | 53 DCHECK(proxy_); |
36 proxy_->dispatchUpdateFoundEvent(); | 54 proxy_->dispatchUpdateFoundEvent(); |
37 } | 55 } |
38 | 56 |
39 void WebServiceWorkerRegistrationImpl::setProxy( | 57 void WebServiceWorkerRegistrationImpl::setProxy( |
40 blink::WebServiceWorkerRegistrationProxy* proxy) { | 58 blink::WebServiceWorkerRegistrationProxy* proxy) { |
41 proxy_ = proxy; | 59 proxy_ = proxy; |
42 } | 60 } |
43 | 61 |
44 blink::WebServiceWorkerRegistrationProxy* | 62 blink::WebServiceWorkerRegistrationProxy* |
45 WebServiceWorkerRegistrationImpl::proxy() { | 63 WebServiceWorkerRegistrationImpl::proxy() { |
46 return proxy_; | 64 return proxy_; |
47 } | 65 } |
48 | 66 |
49 void WebServiceWorkerRegistrationImpl::setInstalling( | |
50 blink::WebServiceWorker* service_worker) { | |
51 DCHECK(proxy_); | |
52 proxy_->setInstalling(service_worker); | |
53 } | |
54 | |
55 void WebServiceWorkerRegistrationImpl::setWaiting( | |
56 blink::WebServiceWorker* service_worker) { | |
57 DCHECK(proxy_); | |
58 proxy_->setWaiting(service_worker); | |
59 } | |
60 | |
61 void WebServiceWorkerRegistrationImpl::setActive( | |
62 blink::WebServiceWorker* service_worker) { | |
63 DCHECK(proxy_); | |
64 proxy_->setActive(service_worker); | |
65 } | |
66 | |
67 blink::WebURL WebServiceWorkerRegistrationImpl::scope() const { | 67 blink::WebURL WebServiceWorkerRegistrationImpl::scope() const { |
68 return handle_ref_->scope(); | 68 return handle_ref_->scope(); |
69 } | 69 } |
70 | 70 |
71 } // namespace content | 71 } // namespace content |
OLD | NEW |