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

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

Issue 2045153003: Speculatively launch Service Workers on mouse/touch events. [4/5] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test Created 4 years, 5 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 db5392c1fcd62226bbc6a6b777293a67979c1e15..bb9cb5d21cf75b67a01030ba04506289bc48da07 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -651,6 +651,10 @@ class CONTENT_EXPORT ServiceWorkerVersion
// event ended).
void OnBeginEvent();
+ // Resets |start_worker_first_purpose_| and fires and clears all start
+ // callbacks.
+ void FinishStartWorker(ServiceWorkerStatusCode status);
+
const int64_t version_id_;
const int64_t registration_id_;
const GURL script_url_;
@@ -727,6 +731,10 @@ class CONTENT_EXPORT ServiceWorkerVersion
bool stop_when_devtools_detached_ = false;
+ // Keeps the first purpose of starting the worker for UMA. Cleared in
+ // FinishStartWorker().
+ std::unique_ptr<ServiceWorkerMetrics::EventType> start_worker_first_purpose_;
nhiroki 2016/07/28 05:38:37 base::Optional<ServiceWorkerMetrics::EventType> co
horo 2016/07/28 08:15:48 Done.
+
base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);

Powered by Google App Engine
This is Rietveld 408576698