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 d58cfb003b594b0b803b1b3b7fa8befb7d2354ab..9f1ae5c7b9c7052bb56d78183a34b17883f3393e 100644 |
--- a/components/page_load_metrics/browser/metrics_web_contents_observer.h |
+++ b/components/page_load_metrics/browser/metrics_web_contents_observer.h |
@@ -87,6 +87,11 @@ enum InternalErrorLoadEvent { |
// latest aborted load is used to track the chain size. |
ERR_NAVIGATION_SIGNALS_MULIPLE_ABORTED_LOADS, |
+ // A timetick in the browser process has value lesser than navigation_start_. |
Charlie Harrison
2016/05/19 18:20:49
nit: A TimeTicks value in the browser process has
shivanisha
2016/05/23 15:06:43
done
|
+ // This could happen if the navigation_start_ was computed in the renderer |
+ // process and the system clock has inter process time tick skew. |
+ ERR_INTER_PROCESS_TIME_TICK_SKEW, |
+ |
// Add values before this final count. |
ERR_LAST_ENTRY |
}; |
@@ -143,8 +148,12 @@ class PageLoadTracker { |
// If the user performs some abort-like action while we are tracking this page |
// load, notify the tracker. Note that we may not classify this as an abort if |
// we've already performed a first paint. |
- void NotifyAbort(UserAbortType abort_type, base::TimeTicks timestamp); |
- void UpdateAbort(UserAbortType abort_type, base::TimeTicks timestamp); |
+ void NotifyAbort(UserAbortType abort_type, |
+ base::TimeTicks timestamp, |
+ bool is_browser_timetick); |
Charlie Harrison
2016/05/19 18:20:49
Let's replace "timetick" with "timestamp". Also in
shivanisha
2016/05/23 15:06:43
done
|
+ void UpdateAbort(UserAbortType abort_type, |
+ base::TimeTicks timestamp, |
+ bool is_browser_timetick); |
// This method returns true if this page load has been aborted with type of |
// ABORT_OTHER, and the |abort_cause_time| is within a sufficiently close |
@@ -161,11 +170,20 @@ class PageLoadTracker { |
return url_; |
} |
+ PageLoadExtraInfo ComputePageLoadExtraInfo(); |
+ |
private: |
- PageLoadExtraInfo GetPageLoadMetricsInfo(); |
+ // This function converts a TimeTicks value taken in the browser process |
+ // to navigation_start_ if: |
+ // - base::TimeTicks is not comparable across processes because the clock |
+ // is not system wide monotonic. |
+ // - *event_time < navigation_start_ |
+ void ClampBrowserTimestampIfInterProcessTimeTickSkew( |
+ base::TimeTicks* event_time); |
void UpdateAbortInternal(UserAbortType abort_type, |
- base::TimeTicks timestamp); |
+ base::TimeTicks timestamp, |
+ bool is_browser_timetick); |
// If |final_navigation| is null, then this is an "unparented" abort chain, |
// and represents a sequence of provisional aborts that never ends with a |
@@ -251,6 +269,9 @@ class MetricsWebContentsObserver |
void WasHidden() override; |
void RenderProcessGone(base::TerminationStatus status) override; |
+ // This getter function is required for testing. |
+ const PageLoadExtraInfo GetPageLoadExtraInfoCommittedLoad(); |
+ |
private: |
friend class content::WebContentsUserData<MetricsWebContentsObserver>; |
@@ -258,7 +279,8 @@ class MetricsWebContentsObserver |
// that might abort them. |
void NotifyAbortAllLoads(UserAbortType abort_type); |
void NotifyAbortAllLoadsWithTimestamp(UserAbortType abort_type, |
- base::TimeTicks timestamp); |
+ base::TimeTicks timestamp, |
+ bool is_browser_timetick); |
// Notify aborted provisional loads that a new navigation occurred. This is |
// used for more consistent attribution tracking for aborted provisional |
// loads. This method returns the provisional load that was likely aborted by |