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

Unified Diff: chrome/browser/page_load_metrics/metrics_web_contents_observer.h

Issue 2132603002: [page_load_metrics] Add a NavigationThrottle for richer abort metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some fix ups with the move to //chrome 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: chrome/browser/page_load_metrics/metrics_web_contents_observer.h
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
index 16dece9bdfbadf3896b21917afe88a134fd20417..80ac25d3a0e07811fa8faafa2ecec65060ab0a98 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
@@ -179,7 +179,7 @@ class PageLoadTracker {
// delta to when it was aborted. Note that only provisional loads can be
// aborted with ABORT_OTHER. While this heuristic is coarse, it works better
// and is simpler than other feasible methods. See https://goo.gl/WKRG98.
- bool IsLikelyProvisionalAbort(base::TimeTicks abort_cause_time);
+ bool IsLikelyProvisionalAbort(base::TimeTicks abort_cause_time) const;
bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle);
@@ -193,6 +193,8 @@ class PageLoadTracker {
PageLoadExtraInfo ComputePageLoadExtraInfo();
+ ui::PageTransition page_transition() const { return page_transition_; }
+
private:
// This function converts a TimeTicks value taken in the browser process
// to navigation_start_ if:
@@ -244,6 +246,8 @@ class PageLoadTracker {
PageLoadTiming timing_;
PageLoadMetadata metadata_;
+ ui::PageTransition page_transition_;
+
// This is a subtle member. If a provisional load A gets aborted by
// provisional load B, which gets aborted by C that eventually commits, then
// there exists an abort chain of length 2, starting at A's navigation_start.
@@ -284,8 +288,6 @@ class MetricsWebContentsObserver
// content::WebContentsObserver implementation:
bool OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* render_frame_host) override;
- void DidStartNavigation(
- content::NavigationHandle* navigation_handle) override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
void DidRedirectNavigation(
@@ -298,6 +300,9 @@ class MetricsWebContentsObserver
void RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host) override;
+ // This method is forwarded from the MetricsNavigationThrottle.
+ void WillStartNavigationRequest(content::NavigationHandle* navigation_handle);
+
// This getter function is required for testing.
const PageLoadExtraInfo GetPageLoadExtraInfoForCommittedLoad();

Powered by Google App Engine
This is Rietveld 408576698