Index: components/page_load_metrics/browser/metrics_web_contents_observer.h |
diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.h b/components/page_load_metrics/browser/metrics_web_contents_observer.h |
index 45780c10314b8299d30896b9c7e4127739fec65b..c271f6afd0d4b8af4384e62c9e5f0ece7ee0266c 100644 |
--- a/components/page_load_metrics/browser/metrics_web_contents_observer.h |
+++ b/components/page_load_metrics/browser/metrics_web_contents_observer.h |
@@ -12,6 +12,7 @@ |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_observer.h" |
#include "content/public/browser/web_contents_user_data.h" |
+#include "net/base/net_errors.h" |
namespace content { |
class NavigationHandle; |
@@ -24,6 +25,32 @@ class Message; |
namespace page_load_metrics { |
+enum PageLoadEvent { |
+ PAGE_LOAD_STARTED, |
+ |
+ // A provisional load is a load before it commits. |
Randy Smith (Not in Mondays)
2015/10/01 17:18:08
Define commits? I.e. (assuming I have the right d
Charlie Harrison
2015/10/01 17:58:17
Done.
|
+ // A load failed before it was committed for any reason, e.g. from a user |
+ // abort or a network timeout. |
+ PAGE_LOAD_FAILED_PROVISIONAL, |
Randy Smith (Not in Mondays)
2015/10/01 17:18:08
suggestion: I think "FAILED_BEFORE_COMMIT" would b
Charlie Harrison
2015/10/01 17:58:17
Done.
|
+ |
+ // A subset of PAGE_LOAD_FAILED_PROVISIONAL, this counts the specific failures |
+ // due to user aborts. |
+ PAGE_LOAD_ABORTED_PROVISIONAL, |
+ |
+ // When a load is aborted anytime before the page's first layout, we increase |
+ // this count. This includes all failed provisional loads. |
+ PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT, |
+ |
+ // We increase this count if a page load successfully has a layout. |
Randy Smith (Not in Mondays)
2015/10/01 17:18:09
nit: "these counts"
Charlie Harrison
2015/10/01 17:58:17
Done.
|
+ // Differentiate between loads that were backgrounded before first layout. |
Randy Smith (Not in Mondays)
2015/10/01 17:18:08
Just confirming: If a page is backgrounded and the
Charlie Harrison
2015/10/01 17:58:17
Yupp, I edited the comment.
|
+ PAGE_LOAD_SUCCESSFUL_FIRST_LAYOUT_FG, |
+ PAGE_LOAD_SUCCESSFUL_FIRST_LAYOUT_BG, |
Randy Smith (Not in Mondays)
2015/10/01 17:18:08
We historically discourage abbreviations in chromi
|
+ |
+ // Add values before this final count. Make sure you also update |
+ // histograms.xml. |
Randy Smith (Not in Mondays)
2015/10/01 17:18:09
Actually, the note about the link to histograms.xm
Charlie Harrison
2015/10/01 17:58:17
Done.
|
+ PAGE_LOAD_LAST_ENTRY |
+}; |
+ |
class PageLoadTracker { |
public: |
explicit PageLoadTracker(bool in_foreground); |
@@ -33,6 +60,7 @@ class PageLoadTracker { |
// Returns true if the timing was successfully updated. |
bool UpdateTiming(const PageLoadTiming& timing); |
+ void RecordEvent(PageLoadEvent event); |
private: |
void RecordTimingHistograms(); |