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

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

Issue 1181973004: ServiceWorker: Route unregister() through WebServiceWorkerRegistration for refactoring (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove ifdef Created 5 years, 6 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
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/child/service_worker/web_service_worker_impl.h" 9 #include "content/child/service_worker/web_service_worker_impl.h"
10 #include "content/child/service_worker/web_service_worker_provider_impl.h" 10 #include "content/child/service_worker/web_service_worker_provider_impl.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 blink::WebServiceWorkerProvider* provider) { 117 blink::WebServiceWorkerProvider* provider) {
118 WebServiceWorkerProviderImpl* provider_impl = 118 WebServiceWorkerProviderImpl* provider_impl =
119 static_cast<WebServiceWorkerProviderImpl*>(provider); 119 static_cast<WebServiceWorkerProviderImpl*>(provider);
120 ServiceWorkerDispatcher* dispatcher = 120 ServiceWorkerDispatcher* dispatcher =
121 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 121 ServiceWorkerDispatcher::GetThreadSpecificInstance();
122 DCHECK(dispatcher); 122 DCHECK(dispatcher);
123 dispatcher->UpdateServiceWorker(provider_impl->provider_id(), 123 dispatcher->UpdateServiceWorker(provider_impl->provider_id(),
124 registration_id()); 124 registration_id());
125 } 125 }
126 126
127 void WebServiceWorkerRegistrationImpl::unregister(
128 blink::WebServiceWorkerProvider* provider,
129 WebServiceWorkerUnregistrationCallbacks* callbacks) {
130 WebServiceWorkerProviderImpl* provider_impl =
131 static_cast<WebServiceWorkerProviderImpl*>(provider);
132 ServiceWorkerDispatcher* dispatcher =
133 ServiceWorkerDispatcher::GetThreadSpecificInstance();
134 DCHECK(dispatcher);
135 dispatcher->UnregisterServiceWorker(provider_impl->provider_id(),
136 registration_id(), callbacks);
137 }
138
127 int64 WebServiceWorkerRegistrationImpl::registration_id() const { 139 int64 WebServiceWorkerRegistrationImpl::registration_id() const {
128 return handle_ref_->registration_id(); 140 return handle_ref_->registration_id();
129 } 141 }
130 142
131 } // namespace content 143 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698