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

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: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated nhiroki's comment 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..11522bd3324e680dff54bd659127ec6f12402fed 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
+ // main/sub frame fetch event fired on the worker, |frame_fetch_event_fired|
+ // is false. This means that the speculative launch wasn't helpful.
+ static void RecordNavigationHintPrecision(EventType start_worker_purpose,
+ bool frame_fetch_event_fired);
+
// Records how often a dispatched event times out.
static void RecordEventTimeout(EventType event);
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698