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

Unified Diff: content/browser/service_worker/service_worker_version.h

Issue 1584653009: Change RunAfterStartWorker to not start the worker if it is already running. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix race condition if worker is already running Created 4 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/browser/service_worker/service_worker_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index 96c54453043cc695265eb67c440b6f02a2f8f172..2b7009d48d6e57f74dcb814e85136822c1270c88 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -178,8 +178,10 @@ class CONTENT_EXPORT ServiceWorkerVersion
// Starts the worker if it isn't already running, and calls |task| when the
// worker is running, or |error_callback| if starting the worker failed.
- void RunAfterStartWorker(const StatusCallback& error_callback,
- const base::Closure& task);
+ // If the worker is already running, |task| is executed synchronously (before
+ // this method returns).
+ void RunAfterStartWorker(const base::Closure& task,
+ const StatusCallback& error_callback);
// Call this while the worker is running before dispatching an event to the
// worker. This informs ServiceWorkerVersion about the event in progress.

Powered by Google App Engine
This is Rietveld 408576698