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

Unified Diff: content/child/service_worker/web_service_worker_registration_impl.cc

Issue 896533004: [WONT COMMIT] ServiceWorker: Move unregister function from WebSWProvider to WebSWRegistration (2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/child/service_worker/web_service_worker_registration_impl.cc
diff --git a/content/child/service_worker/web_service_worker_registration_impl.cc b/content/child/service_worker/web_service_worker_registration_impl.cc
index 12db5310dad9ac71ac55eb2383b601ff0ce5d071..1bc426171dcbf5b5b82629d66629b7e3c2c42de8 100644
--- a/content/child/service_worker/web_service_worker_registration_impl.cc
+++ b/content/child/service_worker/web_service_worker_registration_impl.cc
@@ -20,8 +20,10 @@ WebServiceWorkerRegistrationImpl::QueuedTask::QueuedTask(
}
WebServiceWorkerRegistrationImpl::WebServiceWorkerRegistrationImpl(
+ int provider_id,
scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref)
- : handle_ref_(handle_ref.Pass()),
+ : provider_id_(provider_id),
+ handle_ref_(handle_ref.Pass()),
proxy_(NULL) {
DCHECK(handle_ref_);
DCHECK_NE(kInvalidServiceWorkerRegistrationHandleId,
@@ -112,6 +114,14 @@ blink::WebURL WebServiceWorkerRegistrationImpl::scope() const {
return handle_ref_->scope();
}
+void WebServiceWorkerRegistrationImpl::unregister(
+ UnregisterCallbacks* callbacks) {
+ ServiceWorkerDispatcher* dispatcher =
+ ServiceWorkerDispatcher::GetThreadSpecificInstance();
+ DCHECK(dispatcher);
+ dispatcher->UnregisterServiceWorker(provider_id_, scope(), callbacks);
kinuko 2015/02/03 08:02:11 If a registration outlives the document (and its p
nhiroki 2015/02/03 12:59:37 Good point. I understand that WebSWRegistration mu
+}
+
int64 WebServiceWorkerRegistrationImpl::registration_id() const {
return handle_ref_->registration_id();
}

Powered by Google App Engine
This is Rietveld 408576698