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

Side by Side Diff: chrome/browser/page_load_metrics/observers/prerender_page_load_metrics_observer.h

Issue 2782503004: Prerender: clarify how FCP works in non-prerendered cases (Closed)
Patch Set: clarified the comment a little Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PRERENDER_PAGE_LOAD_METRICS_O BSERVER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PRERENDER_PAGE_LOAD_METRICS_O BSERVER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PRERENDER_PAGE_LOAD_METRICS_O BSERVER_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PRERENDER_PAGE_LOAD_METRICS_O BSERVER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" 9 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
11 11
12 namespace content { 12 namespace content {
13 class WebContents; 13 class WebContents;
14 } 14 }
15 15
16 namespace prerender { 16 namespace prerender {
17 class PrerenderManager; 17 class PrerenderManager;
18 } 18 }
19 19
20 // Observer recording metrics related to prerender. 20 // Observer responsible for recording First Contentful Paing metrics related to
21 // Prerender.
22 //
23 // To record FCP metrics for non-Prerender loads, the
24 // |NoStatePrefetchPageLoadMetricsObserver| is used.
21 class PrerenderPageLoadMetricsObserver 25 class PrerenderPageLoadMetricsObserver
22 : public page_load_metrics::PageLoadMetricsObserver { 26 : public page_load_metrics::PageLoadMetricsObserver {
23 public: 27 public:
24 // Returns a PrerenderPageLoadMetricsObserver, or nullptr if it is not needed. 28 // Returns a PrerenderPageLoadMetricsObserver, or nullptr if it is not needed.
25 static std::unique_ptr<page_load_metrics::PageLoadMetricsObserver> 29 static std::unique_ptr<page_load_metrics::PageLoadMetricsObserver>
26 CreateIfNeeded(content::WebContents* web_contents); 30 CreateIfNeeded(content::WebContents* web_contents);
27 31
28 // Public for testing. Normally one should use CreateIfNeeded. Both the 32 // Public for testing. Normally one should use CreateIfNeeded. Both the
29 // manager and the web_contents must outlive this observer. 33 // manager and the web_contents must outlive this observer.
30 PrerenderPageLoadMetricsObserver(prerender::PrerenderManager* manager, 34 PrerenderPageLoadMetricsObserver(prerender::PrerenderManager* manager,
(...skipping 17 matching lines...) Expand all
48 prerender::PrerenderManager* const prerender_manager_; 52 prerender::PrerenderManager* const prerender_manager_;
49 content::WebContents* web_contents_; 53 content::WebContents* web_contents_;
50 base::TimeTicks start_ticks_; 54 base::TimeTicks start_ticks_;
51 bool is_no_store_; 55 bool is_no_store_;
52 bool was_hidden_; 56 bool was_hidden_;
53 57
54 DISALLOW_COPY_AND_ASSIGN(PrerenderPageLoadMetricsObserver); 58 DISALLOW_COPY_AND_ASSIGN(PrerenderPageLoadMetricsObserver);
55 }; 59 };
56 60
57 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PRERENDER_PAGE_LOAD_METRIC S_OBSERVER_H_ 61 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PRERENDER_PAGE_LOAD_METRIC S_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698