| 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 f0da8e05a4fd3c219d78fc0ddcc67dfd38e80640..a6fd674f588866b9606f9ce6aae2f1b30b7ee23c 100644
|
| --- a/components/page_load_metrics/browser/metrics_web_contents_observer.h
|
| +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.h
|
| @@ -37,6 +37,18 @@ class MetricsWebContentsObserver
|
| void DidCommitNavigation(
|
| content::NavigationHandle* navigation_handle) override;
|
| void RenderProcessGone(base::TerminationStatus status) override;
|
| + void DidStartNavigation(
|
| + content::NavigationHandle* navigation_handle) override;
|
| + void DidFinishLoad(content::RenderFrameHost* render_frame_host,
|
| + const GURL& validated_url) override;
|
| + void DidFailLoad(content::RenderFrameHost* render_frame_host,
|
| + const GURL& validated_url,
|
| + int error_code,
|
| + const base::string16& error_description,
|
| + bool was_ignored_by_handler) override;
|
| +
|
| + void WasShown() override;
|
| + void WasHidden() override;
|
|
|
| private:
|
| explicit MetricsWebContentsObserver(content::WebContents* web_contents);
|
| @@ -52,6 +64,18 @@ class MetricsWebContentsObserver
|
| // commits we will initialize this as empty.
|
| scoped_ptr<PageLoadTiming> current_timing_;
|
|
|
| + // True if the web contents stayed in the foreground for the entire page load.
|
| + // We record separate metrics for any web contents that have been
|
| + // backgrounded, because metrics like layout/paint are delayed artificially
|
| + // when they occur in the bacground.
|
| + bool current_navigation_stayed_in_foreground_;
|
| +
|
| + // True if the previous navigation stayed in the foreground.
|
| + bool previous_navigation_stayed_in_foreground_;
|
| +
|
| + // True if the web contents is currently in the foreground.
|
| + bool in_foreground_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver);
|
| };
|
|
|
|
|