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

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: nasko@ nits Created 4 years, 4 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 b53fb5771efd11e44b06b1ac1e82862383d620d7..89c92b8ab8c72b7c0551e3cdf01ee2c4b8b0d639 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
@@ -190,7 +190,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);
@@ -204,6 +204,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:
@@ -259,6 +261,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.
@@ -299,8 +303,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(
@@ -313,6 +315,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);
+
// Flush any buffered metrics, as part of the metrics subsystem persisting
// metrics as the application goes into the background. The application may be
// killed at any time after this method is invoked without further

Powered by Google App Engine
This is Rietveld 408576698