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

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: Add comments Created 4 years, 8 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 23abda5a0819bf6dd95859243ac50748fd64db4d..05b5370386ee7e333b0df2211b2affa65b460600 100644
--- a/components/page_load_metrics/browser/page_load_metrics_observer.h
+++ b/components/page_load_metrics/browser/page_load_metrics_observer.h
@@ -120,7 +120,8 @@ class PageLoadMetricsObserver {
// the navigation, but will be destroyed soon after this call. Don't hold a
// reference to it.
// Note that this does not get called for same page navigations.
- virtual void OnCommit(content::NavigationHandle* navigation_handle) {}
+ virtual void OnCommit(content::NavigationHandle* navigation_handle,
+ bool started_in_foreground) {}
Charlie Harrison 2016/04/25 13:20:08 It makes more sense to thread this in OnStart. In
felt 2016/04/25 21:30:04 Do you mean making PageLoadMetricsObserver no long
Charlie Harrison 2016/04/25 21:49:11 Yeah that's what I meant. I wouldn't be opposed to
Bryan McQuade 2016/04/25 22:00:04 I'm open to either providing a getter for the curr
felt 2016/04/26 01:46:28 I personally prefer moving the boolean to OnStart,
// OnFailedProvisionalLoad is triggered when a provisional load failed and did
// not commit. Note that provisional loads that result in downloads or 204s
@@ -128,6 +129,15 @@ class PageLoadMetricsObserver {
virtual void OnFailedProvisionalLoad(
content::NavigationHandle* navigation_handle) {}
+ // 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 OnCommit instead.
Bryan McQuade 2016/04/25 22:00:04 if we move the boolean to OnStart let's update thi
felt 2016/04/26 01:46:29 Done.
+ 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