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

Unified Diff: components/page_load_metrics/browser/page_load_metrics_observer.h

Issue 1913693002: Histogram the amount of time spent on HTTP(S) page loads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Equality operations are hard, let's go trybotting Created 4 years, 7 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: components/page_load_metrics/browser/page_load_metrics_observer.h
diff --git a/components/page_load_metrics/browser/page_load_metrics_observer.h b/components/page_load_metrics/browser/page_load_metrics_observer.h
index b5e951f5cba965244f62b00df04e25c7acaaa9b6..f41085d53dc8c6bf1396636d372cabe4c21e2286 100644
--- a/components/page_load_metrics/browser/page_load_metrics_observer.h
+++ b/components/page_load_metrics/browser/page_load_metrics_observer.h
@@ -105,7 +105,8 @@ class PageLoadMetricsObserver {
// initiated, or the empty URL if there was no committed page load at the time
// the navigation was initiated.
virtual void OnStart(content::NavigationHandle* navigation_handle,
- const GURL& currently_committed_url) {}
+ const GURL& currently_committed_url,
+ bool started_in_foreground) {}
// OnRedirect is triggered when a page load redirects to another URL.
// The navigation handle holds relevant data for the navigation, but will
@@ -134,6 +135,15 @@ class PageLoadMetricsObserver {
virtual void OnTimingUpdate(const PageLoadTiming& timing,
const PageLoadExtraInfo& extra_info) {}
+ // OnHidden is triggered when a page leaves the foreground. It does not fire
+ // when a foreground page is permanently closed; for that, listen to
+ // OnComplete instead.
+ virtual void OnHidden() {}
+
+ // OnShown is triggered when a page is brought to the foreground. It does not
+ // fire when the page first loads; for that, listen for OnStart instead.
+ virtual void OnShown() {}
+
// OnComplete is triggered when we are ready to record metrics for this page
// load. This will happen some time after commit. The PageLoadTiming struct
// contains timing data and the PageLoadExtraInfo struct contains other useful

Powered by Google App Engine
This is Rietveld 408576698