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

Unified Diff: content/browser/service_worker/service_worker_internals_ui.cc

Issue 1029553002: [DevTools] Introduce Unregister/Start/Stop/Inspect buttons to ServiceWorkersView [1/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indent Created 5 years, 9 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
« no previous file with comments | « content/browser/service_worker/service_worker_context_wrapper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_internals_ui.cc
diff --git a/content/browser/service_worker/service_worker_internals_ui.cc b/content/browser/service_worker/service_worker_internals_ui.cc
index 3eacff7f4ca054f7c7cd178f085e0d0885ff9b94..ea432f0cbe58f63710ff16e0e13ead441c3f030a 100644
--- a/content/browser/service_worker/service_worker_internals_ui.cc
+++ b/content/browser/service_worker/service_worker_internals_ui.cc
@@ -122,28 +122,6 @@ void UnregisterWithScope(
context->context()->UnregisterServiceWorker(scope, callback);
}
-void WorkerStarted(const scoped_refptr<ServiceWorkerRegistration>& registration,
- const ServiceWorkerInternalsUI::StatusCallback& callback,
- ServiceWorkerStatusCode status) {
- callback.Run(status);
-}
-
-void StartActiveWorker(
- const ServiceWorkerInternalsUI::StatusCallback& callback,
- ServiceWorkerStatusCode status,
- const scoped_refptr<ServiceWorkerRegistration>& registration) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- if (status == SERVICE_WORKER_OK) {
- // Pass the reference of |registration| to WorkerStarted callback to prevent
- // it from being deleted while starting the worker. If the refcount of
- // |registration| is 1, it will be deleted after WorkerStarted is called.
- registration->active_version()->StartWorker(
- base::Bind(WorkerStarted, registration, callback));
- return;
- }
- callback.Run(SERVICE_WORKER_ERROR_NOT_FOUND);
-}
-
void FindRegistrationForPattern(
scoped_refptr<ServiceWorkerContextWrapper> context,
const GURL& scope,
@@ -655,11 +633,9 @@ void ServiceWorkerInternalsUI::StartWorker(const ListValue* args) {
!cmd_args->GetString("scope", &scope_string)) {
return;
}
-
base::Callback<void(ServiceWorkerStatusCode)> callback =
base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
- FindRegistrationForPattern(
- context, GURL(scope_string), base::Bind(StartActiveWorker, callback));
+ context->StartServiceWorker(GURL(scope_string), callback);
}
} // namespace content
« no previous file with comments | « content/browser/service_worker/service_worker_context_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698