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

Unified Diff: content/child/service_worker/service_worker_dispatcher.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 side-by-side diff with in-line comments
Download patch
Index: content/child/service_worker/service_worker_dispatcher.cc
diff --git a/content/child/service_worker/service_worker_dispatcher.cc b/content/child/service_worker/service_worker_dispatcher.cc
index 2c921a286befb455d142c4dbb8b8413f31f463c7..37d8484fa046615603fbae22145902b5a492043f 100644
--- a/content/child/service_worker/service_worker_dispatcher.cc
+++ b/content/child/service_worker/service_worker_dispatcher.cc
@@ -136,7 +136,7 @@ void ServiceWorkerDispatcher::UpdateServiceWorker(int provider_id,
provider_id, registration_id));
}
-void ServiceWorkerDispatcher::UnregisterServiceWorker(
+void ServiceWorkerDispatcher::DeprecatedUnregisterServiceWorker(
int provider_id,
const GURL& pattern,
WebServiceWorkerUnregistrationCallbacks* callbacks) {
@@ -159,8 +159,22 @@ void ServiceWorkerDispatcher::UnregisterServiceWorker(
"ServiceWorkerDispatcher::UnregisterServiceWorker",
request_id,
"Scope", pattern.spec());
+ thread_safe_sender_->Send(
+ new ServiceWorkerHostMsg_DeprecatedUnregisterServiceWorker(
+ CurrentWorkerId(), request_id, provider_id, pattern));
+}
+
+void ServiceWorkerDispatcher::UnregisterServiceWorker(
+ int provider_id,
+ int64 registration_id,
+ WebServiceWorkerUnregistrationCallbacks* callbacks) {
+ DCHECK(callbacks);
+ int request_id = pending_unregistration_callbacks_.Add(callbacks);
+ TRACE_EVENT_ASYNC_BEGIN1("ServiceWorker",
+ "ServiceWorkerDispatcher::UnregisterServiceWorker",
+ request_id, "Registration ID", registration_id);
thread_safe_sender_->Send(new ServiceWorkerHostMsg_UnregisterServiceWorker(
- CurrentWorkerId(), request_id, provider_id, pattern));
+ CurrentWorkerId(), request_id, provider_id, registration_id));
}
void ServiceWorkerDispatcher::GetRegistration(

Powered by Google App Engine
This is Rietveld 408576698