Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: content/child/service_worker/web_service_worker_registration_impl.cc

Issue 515493002: ServiceWorker: Clean up WebServiceWorkerRegistrationImpl (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/service_worker/web_service_worker_registration_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/child/service_worker/web_service_worker_registration_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698