Chromium Code Reviews| 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..ac7e591bda16002cf5262d8d3057422ba228669f 100644 |
| --- a/components/page_load_metrics/browser/metrics_web_contents_observer.h |
| +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.h |
| @@ -17,6 +17,7 @@ |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/browser/web_contents_user_data.h" |
| #include "net/base/net_errors.h" |
| +#include "third_party/WebKit/public/web/WebInputEvent.h" |
| namespace content { |
| class NavigationHandle; |
| @@ -87,8 +88,11 @@ enum InternalErrorLoadEvent { |
| // latest aborted load is used to track the chain size. |
| ERR_NAVIGATION_SIGNALS_MULIPLE_ABORTED_LOADS, |
| + // Receives user interaction before navigation start |
| + ERR_USER_INTERACTION_WITH_NO_RELEVANT_LOAD, |
| + |
| // Add values before this final count. |
| - ERR_LAST_ENTRY |
| + ERR_LAST_ENTRY, |
| }; |
| // This class serves as a functional interface to various chrome// features. |
| @@ -123,6 +127,8 @@ class PageLoadTracker { |
| void WebContentsHidden(); |
| void WebContentsShown(); |
| + void OnInputEvent(const blink::WebInputEvent& event); |
| + |
| // Returns true if the timing was successfully updated. |
| bool UpdateTiming(const PageLoadTiming& timing, |
| const PageLoadMetadata& metadata); |
| @@ -164,8 +170,7 @@ class PageLoadTracker { |
| private: |
| PageLoadExtraInfo GetPageLoadMetricsInfo(); |
| - void UpdateAbortInternal(UserAbortType abort_type, |
| - base::TimeTicks timestamp); |
| + void UpdateAbortInternal(UserAbortType abort_type, base::TimeTicks timestamp); |
| // If |final_navigation| is null, then this is an "unparented" abort chain, |
| // and represents a sequence of provisional aborts that never ends with a |
| @@ -198,6 +203,8 @@ class PageLoadTracker { |
| base::TimeTicks foreground_time_; |
| bool started_in_foreground_; |
| + base::TimeTicks user_interaction_time_; |
|
Bryan McQuade
2016/05/25 21:32:30
let's remove this (see related comment with more d
|
| + |
| PageLoadTiming timing_; |
| PageLoadMetadata metadata_; |
| @@ -247,6 +254,7 @@ class MetricsWebContentsObserver |
| void DidRedirectNavigation( |
| content::NavigationHandle* navigation_handle) override; |
| void NavigationStopped() override; |
| + bool OnInputEvent(const blink::WebInputEvent& event); |
| void WasShown() override; |
| void WasHidden() override; |
| void RenderProcessGone(base::TerminationStatus status) override; |
| @@ -261,7 +269,8 @@ class MetricsWebContentsObserver |
| base::TimeTicks timestamp); |
| // 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 |
| + // loads. This method returns the provisional load that was likely aborted |
| + // by |
| // this navigation, to help instantiate the new PageLoadTracker. |
|
tdresser
2016/05/24 14:28:38
Awkward whitespace.
|
| std::unique_ptr<PageLoadTracker> NotifyAbortedProvisionalLoadsNewNavigation( |
| content::NavigationHandle* new_navigation); |
| @@ -286,7 +295,8 @@ class MetricsWebContentsObserver |
| // Tracks aborted provisional loads for a little bit longer than usual (one |
| // more navigation commit at the max), in order to better understand how the |
| - // navigation failed. This is because most provisional loads are destroyed and |
| + // navigation failed. This is because most provisional loads are destroyed |
| + // and |
| // vanish before we get signal about what caused the abort (new navigation, |
|
tdresser
2016/05/24 14:28:38
Awkward whitespace.
|
| // stop button, etc.). |
| std::vector<std::unique_ptr<PageLoadTracker>> aborted_provisional_loads_; |