| 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_DATA_REDUCTION_PROXY_METRICS_
OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_
OBSERVER_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_
OBSERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_
OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 extern const char kHistogramFirstContentfulPaintSuffix[]; | 37 extern const char kHistogramFirstContentfulPaintSuffix[]; |
| 38 extern const char kHistogramFirstMeaningfulPaintSuffix[]; | 38 extern const char kHistogramFirstMeaningfulPaintSuffix[]; |
| 39 extern const char kHistogramFirstImagePaintSuffix[]; | 39 extern const char kHistogramFirstImagePaintSuffix[]; |
| 40 extern const char kHistogramFirstPaintSuffix[]; | 40 extern const char kHistogramFirstPaintSuffix[]; |
| 41 extern const char kHistogramFirstTextPaintSuffix[]; | 41 extern const char kHistogramFirstTextPaintSuffix[]; |
| 42 extern const char kHistogramParseStartSuffix[]; | 42 extern const char kHistogramParseStartSuffix[]; |
| 43 extern const char kHistogramParseBlockedOnScriptLoadSuffix[]; | 43 extern const char kHistogramParseBlockedOnScriptLoadSuffix[]; |
| 44 extern const char kHistogramParseDurationSuffix[]; | 44 extern const char kHistogramParseDurationSuffix[]; |
| 45 | 45 |
| 46 // Byte and request specific histogram suffixes. | 46 // Byte and request specific histogram suffixes. |
| 47 extern const char kRequestsPercentProxied[]; | 47 extern const char kResourcesPercentProxied[]; |
| 48 extern const char kBytesPercentProxied[]; | 48 extern const char kBytesPercentProxied[]; |
| 49 extern const char kBytesCompressionRatio[]; | 49 extern const char kBytesCompressionRatio[]; |
| 50 extern const char kBytesInflationPercent[]; | 50 extern const char kBytesInflationPercent[]; |
| 51 extern const char kNetworkRequests[]; | 51 extern const char kNetworkResources[]; |
| 52 extern const char kRequestsProxied[]; | 52 extern const char kResourcesProxied[]; |
| 53 extern const char kRequestsNotProxied[]; | 53 extern const char kResourcesNotProxied[]; |
| 54 extern const char kNetworkBytes[]; | 54 extern const char kNetworkBytes[]; |
| 55 extern const char kBytesProxied[]; | 55 extern const char kBytesProxied[]; |
| 56 extern const char kBytesNotProxied[]; | 56 extern const char kBytesNotProxied[]; |
| 57 extern const char kBytesOriginal[]; | 57 extern const char kBytesOriginal[]; |
| 58 extern const char kBytesSavings[]; | 58 extern const char kBytesSavings[]; |
| 59 extern const char kBytesInflation[]; | 59 extern const char kBytesInflation[]; |
| 60 | 60 |
| 61 } // namespace internal | 61 } // namespace internal |
| 62 | 62 |
| 63 // Observer responsible for recording core page load metrics releveant to | 63 // Observer responsible for recording core page load metrics releveant to |
| 64 // DataReductionProxy. | 64 // DataReductionProxy. |
| 65 class DataReductionProxyMetricsObserver | 65 class DataReductionProxyMetricsObserver |
| 66 : public page_load_metrics::PageLoadMetricsObserver { | 66 : public page_load_metrics::PageLoadMetricsObserver { |
| 67 public: | 67 public: |
| 68 DataReductionProxyMetricsObserver(); | 68 DataReductionProxyMetricsObserver(); |
| 69 ~DataReductionProxyMetricsObserver() override; | 69 ~DataReductionProxyMetricsObserver() override; |
| 70 | 70 |
| 71 // page_load_metrics::PageLoadMetricsObserver: | 71 // page_load_metrics::PageLoadMetricsObserver: |
| 72 ObservePolicy OnStart(content::NavigationHandle* navigation_handle, | 72 ObservePolicy OnStart(content::NavigationHandle* navigation_handle, |
| 73 const GURL& currently_committed_url, | 73 const GURL& currently_committed_url, |
| 74 bool started_in_foreground) override; | 74 bool started_in_foreground) override; |
| 75 ObservePolicy OnCommit(content::NavigationHandle* navigation_handle) override; | 75 ObservePolicy OnCommit(content::NavigationHandle* navigation_handle) override; |
| 76 ObservePolicy OnHidden( | |
| 77 const page_load_metrics::PageLoadTiming& timing, | |
| 78 const page_load_metrics::PageLoadExtraInfo& info) override; | |
| 79 ObservePolicy FlushMetricsOnAppEnterBackground( | 76 ObservePolicy FlushMetricsOnAppEnterBackground( |
| 80 const page_load_metrics::PageLoadTiming& timing, | 77 const page_load_metrics::PageLoadTiming& timing, |
| 81 const page_load_metrics::PageLoadExtraInfo& info) override; | 78 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 82 void OnComplete(const page_load_metrics::PageLoadTiming& timing, | 79 void OnComplete(const page_load_metrics::PageLoadTiming& timing, |
| 83 const page_load_metrics::PageLoadExtraInfo& info) override; | 80 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 84 void OnDomContentLoadedEventStart( | 81 void OnDomContentLoadedEventStart( |
| 85 const page_load_metrics::PageLoadTiming& timing, | 82 const page_load_metrics::PageLoadTiming& timing, |
| 86 const page_load_metrics::PageLoadExtraInfo& info) override; | 83 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 87 void OnLoadEventStart( | 84 void OnLoadEventStart( |
| 88 const page_load_metrics::PageLoadTiming& timing, | 85 const page_load_metrics::PageLoadTiming& timing, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 117 |
| 121 // Gets the default DataReductionProxyPingbackClient. Overridden in testing. | 118 // Gets the default DataReductionProxyPingbackClient. Overridden in testing. |
| 122 virtual DataReductionProxyPingbackClient* GetPingbackClient() const; | 119 virtual DataReductionProxyPingbackClient* GetPingbackClient() const; |
| 123 | 120 |
| 124 // Data related to this navigation. | 121 // Data related to this navigation. |
| 125 std::unique_ptr<DataReductionProxyData> data_; | 122 std::unique_ptr<DataReductionProxyData> data_; |
| 126 | 123 |
| 127 // The browser context this navigation is operating in. | 124 // The browser context this navigation is operating in. |
| 128 content::BrowserContext* browser_context_; | 125 content::BrowserContext* browser_context_; |
| 129 | 126 |
| 130 // The number of requests that used data reduction proxy. | 127 // The number of resources that used data reduction proxy. |
| 131 int num_data_reduction_proxy_requests_; | 128 int num_data_reduction_proxy_resources_; |
| 132 | 129 |
| 133 // The number of request that did not come from cache. | 130 // The number of resources that did not come from cache. |
| 134 int num_network_requests_; | 131 int num_network_resources_; |
| 135 | 132 |
| 136 // The total content network bytes that the user would have downloaded if they | 133 // The total content network bytes that the user would have downloaded if they |
| 137 // were not using data reduction proxy. | 134 // were not using data reduction proxy. |
| 138 int64_t original_network_bytes_; | 135 int64_t original_network_bytes_; |
| 139 | 136 |
| 140 // The total network bytes loaded through data reduction proxy. | 137 // The total network bytes loaded through data reduction proxy. |
| 141 int64_t network_bytes_proxied_; | 138 int64_t network_bytes_proxied_; |
| 142 | 139 |
| 143 // The total network bytes used. | 140 // The total network bytes used. |
| 144 int64_t network_bytes_; | 141 int64_t network_bytes_; |
| 145 | 142 |
| 146 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyMetricsObserver); | 143 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyMetricsObserver); |
| 147 }; | 144 }; |
| 148 | 145 |
| 149 } // namespace data_reduction_proxy | 146 } // namespace data_reduction_proxy |
| 150 | 147 |
| 151 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRI
CS_OBSERVER_H_ | 148 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRI
CS_OBSERVER_H_ |
| OLD | NEW |