Chromium Code Reviews| 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 kHistogramFirstContentfulPaintDataReductionProxyAutoLofiOn[]; | |
| 27 extern const char kHistogramFirstContentfulPaintDataReductionProxyAutoLofiOff[]; | |
| 28 | |
| 29 } // internal | |
|
Charlie Harrison
2016/05/03 01:08:32
nit: namespace internal.
RyanSturm
2016/05/03 18:14:13
Done.
| |
| 30 | |
| 31 // Observer responsible for recording core page load metrics releveant to | |
| 32 // DataReductionProxy. | |
| 33 class DataReductionProxyMetricsObserver | |
| 34 : public page_load_metrics::PageLoadMetricsObserver { | |
| 35 public: | |
| 36 DataReductionProxyMetricsObserver(); | |
| 37 ~DataReductionProxyMetricsObserver() override; | |
| 38 | |
| 39 // page_load_metrics::PageLoadMetricsObserver implementation: | |
|
Charlie Harrison
2016/05/03 01:08:32
nit: I prefer "// page_load_metrics::PageLoadMetri
RyanSturm
2016/05/03 18:14:13
Done.
| |
| 40 void OnCommit(content::NavigationHandle* navigation_handle) override; | |
| 41 void OnComplete(const page_load_metrics::PageLoadTiming& timing, | |
| 42 const page_load_metrics::PageLoadExtraInfo& info) override; | |
| 43 | |
| 44 void RecordTimingHistograms( | |
| 45 const page_load_metrics::PageLoadTiming& timing, | |
| 46 const page_load_metrics::PageLoadExtraInfo& info) const; | |
| 47 | |
| 48 private: | |
| 49 // True if the navigation requested LoFi. | |
| 50 bool lofi_requested_; | |
| 51 | |
| 52 // True if the navigation was proxied through the data reduction proxy. | |
| 53 bool used_data_reduction_proxy_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyMetricsObserver); | |
| 56 }; | |
| 57 | |
| 58 } // namespace data_reduction_proxy | |
| 59 | |
| 60 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRI CS_OBSERVER_H_ | |
| OLD | NEW |