| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_TAB_RESTORE_PAGE_LOAD_METRICS
_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METRICS
_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METRICS
_OBSERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METRICS
_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 TabRestorePageLoadMetricsObserver(); | 27 TabRestorePageLoadMetricsObserver(); |
| 28 ~TabRestorePageLoadMetricsObserver() override; | 28 ~TabRestorePageLoadMetricsObserver() override; |
| 29 | 29 |
| 30 // page_load_metrics::PageLoadMetricsObserver: | 30 // page_load_metrics::PageLoadMetricsObserver: |
| 31 void OnComplete(const page_load_metrics::PageLoadTiming& timing, | 31 void OnComplete(const page_load_metrics::PageLoadTiming& timing, |
| 32 const page_load_metrics::PageLoadExtraInfo& info) override; | 32 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 33 page_load_metrics::PageLoadMetricsObserver::ObservePolicy OnStart( | 33 page_load_metrics::PageLoadMetricsObserver::ObservePolicy OnStart( |
| 34 content::NavigationHandle* navigation_handle, | 34 content::NavigationHandle* navigation_handle, |
| 35 const GURL& currently_committed_url, | 35 const GURL& currently_committed_url, |
| 36 bool started_in_foreground) override; | 36 bool started_in_foreground) override; |
| 37 void OnLoadedResource( | 37 void OnLoadedResource(const page_load_metrics::ExtraRequestCompleteInfo& |
| 38 const page_load_metrics::ExtraRequestInfo& extra_request_info) override; | 38 extra_request_info) override; |
| 39 page_load_metrics::PageLoadMetricsObserver::ObservePolicy | 39 page_load_metrics::PageLoadMetricsObserver::ObservePolicy |
| 40 FlushMetricsOnAppEnterBackground( | 40 FlushMetricsOnAppEnterBackground( |
| 41 const page_load_metrics::PageLoadTiming& timing, | 41 const page_load_metrics::PageLoadTiming& timing, |
| 42 const page_load_metrics::PageLoadExtraInfo& info) override; | 42 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 // Whether the navigation handle is a tab restore. | 45 // Whether the navigation handle is a tab restore. |
| 46 // Overridden in testing. | 46 // Overridden in testing. |
| 47 virtual bool IsTabRestore(content::NavigationHandle* navigation_handle); | 47 virtual bool IsTabRestore(content::NavigationHandle* navigation_handle); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // Records histograms for byte information. | 50 // Records histograms for byte information. |
| 51 void RecordByteHistograms(); | 51 void RecordByteHistograms(); |
| 52 | 52 |
| 53 // The number of body (not header) prefilter bytes consumed by requests for | 53 // The number of body (not header) prefilter bytes consumed by requests for |
| 54 // the page. | 54 // the page. |
| 55 int64_t cache_bytes_; | 55 int64_t cache_bytes_; |
| 56 int64_t network_bytes_; | 56 int64_t network_bytes_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(TabRestorePageLoadMetricsObserver); | 58 DISALLOW_COPY_AND_ASSIGN(TabRestorePageLoadMetricsObserver); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METR
ICS_OBSERVER_H_ | 61 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METR
ICS_OBSERVER_H_ |
| OLD | NEW |