Chromium Code Reviews (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out

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

Issue 2045153003: Speculatively launch Service Workers on mouse/touch events. [4/5] (Closed) Base URL:
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_metrics.h
diff --git a/content/browser/service_worker/service_worker_metrics.h b/content/browser/service_worker/service_worker_metrics.h
index 1506fcbb4ad3421cbabcaea7d490571db50eae40..5024f1281f022c29b46f2eabe3dc4f5fb5764f84 100644
--- a/content/browser/service_worker/service_worker_metrics.h
+++ b/content/browser/service_worker/service_worker_metrics.h
@@ -136,6 +136,9 @@ class ServiceWorkerMetrics {
// Converts an event type to a string. Used for tracing.
static const char* EventTypeToString(EventType event_type);
+ // Returns true when the event is for a navigation hint.
+ static bool IsNavigationHintEvent(EventType event_type);
// Excludes NTP scope from UMA for now as it tends to dominate the stats and
// makes the results largely skewed. Some metrics don't follow this policy
// and hence don't call this function.
@@ -198,6 +201,13 @@ class ServiceWorkerMetrics {
size_t handled_events,
size_t fired_events);
+ // Records the precision of the speculative launch of Service Workers for
+ // each navigation hint type when the worker is stopped. If there was no
+ // event fetched to the worker, |event_fired| is false. This means that the
nhiroki 2016/07/28 05:38:37 fetched to -> fired on?
horo 2016/07/28 08:15:48 Done.
+ // speculative launch was meaningless.
nhiroki 2016/07/28 05:38:37 'meaningless' sounds somewhat negative. How about
horo 2016/07/28 08:15:48 Done.
+ static void RecordNavigationHintPrecision(EventType start_worker_purpose,
+ bool event_fired);
// Records how often a dispatched event times out.
static void RecordEventTimeout(EventType event);

Powered by Google App Engine
This is Rietveld 408576698