Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698