| OLD | NEW |
| 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_AMP_PAGE_LOAD_METRICS_OBSERVE
R_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_AMP_PAGE_LOAD_METRICS_OBSERVE
R_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_AMP_PAGE_LOAD_METRICS_OBSERVE
R_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_AMP_PAGE_LOAD_METRICS_OBSERVE
R_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 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 class NavigationHandle; | 12 class NavigationHandle; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace page_load_metrics { | |
| 16 struct PageLoadExtraInfo; | |
| 17 struct PageLoadTiming; | |
| 18 } | |
| 19 | |
| 20 // Observer responsible for recording page load metrics relevant to page served | 15 // Observer responsible for recording page load metrics relevant to page served |
| 21 // from the AMP cache. When AMP pages are served in a same page navigation, UMA | 16 // from the AMP cache. When AMP pages are served in a same page navigation, UMA |
| 22 // is not recorded; this is typical for AMP pages navigated to from google.com. | 17 // is not recorded; this is typical for AMP pages navigated to from google.com. |
| 23 // Navigations to AMP pages from the google search app or directly to the amp | 18 // Navigations to AMP pages from the google search app or directly to the amp |
| 24 // cache page will be tracked. Refreshing an AMP page served from google.com | 19 // cache page will be tracked. Refreshing an AMP page served from google.com |
| 25 // will be tracked. | 20 // will be tracked. |
| 26 class AMPPageLoadMetricsObserver | 21 class AMPPageLoadMetricsObserver |
| 27 : public page_load_metrics::PageLoadMetricsObserver { | 22 : public page_load_metrics::PageLoadMetricsObserver { |
| 28 public: | 23 public: |
| 29 AMPPageLoadMetricsObserver(); | 24 AMPPageLoadMetricsObserver(); |
| 30 ~AMPPageLoadMetricsObserver() override; | 25 ~AMPPageLoadMetricsObserver() override; |
| 31 | 26 |
| 32 // page_load_metrics::PageLoadMetricsObserver: | 27 // page_load_metrics::PageLoadMetricsObserver: |
| 33 ObservePolicy OnCommit(content::NavigationHandle* navigation_handle) override; | 28 ObservePolicy OnCommit(content::NavigationHandle* navigation_handle) override; |
| 34 void OnDomContentLoadedEventStart( | 29 void OnDomContentLoadedEventStart( |
| 35 const page_load_metrics::PageLoadTiming& timing, | 30 const page_load_metrics::mojom::PageLoadTiming& timing, |
| 36 const page_load_metrics::PageLoadExtraInfo& info) override; | 31 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 37 void OnLoadEventStart( | 32 void OnLoadEventStart( |
| 38 const page_load_metrics::PageLoadTiming& timing, | 33 const page_load_metrics::mojom::PageLoadTiming& timing, |
| 39 const page_load_metrics::PageLoadExtraInfo& info) override; | 34 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 40 void OnFirstLayout(const page_load_metrics::PageLoadTiming& timing, | 35 void OnFirstLayout(const page_load_metrics::mojom::PageLoadTiming& timing, |
| 41 const page_load_metrics::PageLoadExtraInfo& info) override; | 36 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 42 void OnFirstContentfulPaint( | 37 void OnFirstContentfulPaint( |
| 43 const page_load_metrics::PageLoadTiming& timing, | 38 const page_load_metrics::mojom::PageLoadTiming& timing, |
| 44 const page_load_metrics::PageLoadExtraInfo& info) override; | 39 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 45 void OnParseStart(const page_load_metrics::PageLoadTiming& timing, | 40 void OnParseStart(const page_load_metrics::mojom::PageLoadTiming& timing, |
| 46 const page_load_metrics::PageLoadExtraInfo& info) override; | 41 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 47 | 42 |
| 48 private: | 43 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(AMPPageLoadMetricsObserver); | 44 DISALLOW_COPY_AND_ASSIGN(AMPPageLoadMetricsObserver); |
| 50 }; | 45 }; |
| 51 | 46 |
| 52 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_AMP_PAGE_LOAD_METRICS_OBSE
RVER_H_ | 47 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_AMP_PAGE_LOAD_METRICS_OBSE
RVER_H_ |
| OLD | NEW |