| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 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_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "components/page_load_metrics/browser/page_load_metrics_observer.h" |
| 10 |
| 11 namespace content { |
| 12 class NavigationHandle; |
| 13 } |
| 14 |
| 15 namespace page_load_metrics { |
| 16 struct PageLoadExtraInfo; |
| 17 struct PageLoadTiming; |
| 18 } |
| 19 |
| 20 namespace data_reduction_proxy { |
| 21 |
| 22 namespace internal { |
| 23 |
| 24 // Various UMA histogram names for DataReductionProxy core page load metrics. |
| 25 extern const char kHistogramFirstContentfulPaintDataReductionProxy[]; |
| 26 extern const char kHistogramFirstContentfulPaintDataReductionProxyLoFiOn[]; |
| 27 |
| 28 } // namespace internal |
| 29 |
| 30 // Observer responsible for recording core page load metrics releveant to |
| 31 // DataReductionProxy. |
| 32 class DataReductionProxyMetricsObserver |
| 33 : public page_load_metrics::PageLoadMetricsObserver { |
| 34 public: |
| 35 DataReductionProxyMetricsObserver(); |
| 36 ~DataReductionProxyMetricsObserver() override; |
| 37 |
| 38 // page_load_metrics::PageLoadMetricsObserver: |
| 39 void OnCommit(content::NavigationHandle* navigation_handle) override; |
| 40 void OnComplete(const page_load_metrics::PageLoadTiming& timing, |
| 41 const page_load_metrics::PageLoadExtraInfo& info) override; |
| 42 |
| 43 void RecordTimingHistograms( |
| 44 const page_load_metrics::PageLoadTiming& timing, |
| 45 const page_load_metrics::PageLoadExtraInfo& info) const; |
| 46 |
| 47 private: |
| 48 // True if the navigation requested LoFi. |
| 49 bool lofi_requested_; |
| 50 |
| 51 // True if the navigation was proxied through the data reduction proxy. |
| 52 bool used_data_reduction_proxy_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyMetricsObserver); |
| 55 }; |
| 56 |
| 57 } // namespace data_reduction_proxy |
| 58 |
| 59 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRI
CS_OBSERVER_H_ |
| OLD | NEW |