Chromium Code Reviews| 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_ADS_PAGE_LOAD_METRICS_OBSERVE R_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ADS_PAGE_LOAD_METRICS_OBSERVE R_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ADS_PAGE_LOAD_METRICS_OBSERVE R_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ADS_PAGE_LOAD_METRICS_OBSERVE R_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/feature_list.h" | |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" | 14 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" |
| 14 #include "components/ukm/ukm_source.h" | 15 #include "components/ukm/ukm_source.h" |
| 15 #include "net/http/http_response_info.h" | 16 #include "net/http/http_response_info.h" |
| 16 | 17 |
| 18 namespace features { | |
| 19 | |
| 20 extern const base::Feature kAdsFeature; | |
| 21 | |
| 22 } // namespace features | |
|
Ilya Sherman
2017/06/12 21:50:29
Same, for this and other features that you'd like
chaopeng
2017/06/28 19:21:24
Done.
| |
| 23 | |
| 17 // This observer labels each sub-frame as an ad or not, and keeps track of | 24 // This observer labels each sub-frame as an ad or not, and keeps track of |
| 18 // relevant per-frame and whole-page byte statistics. | 25 // relevant per-frame and whole-page byte statistics. |
| 19 class AdsPageLoadMetricsObserver | 26 class AdsPageLoadMetricsObserver |
| 20 : public page_load_metrics::PageLoadMetricsObserver { | 27 : public page_load_metrics::PageLoadMetricsObserver { |
| 21 public: | 28 public: |
| 22 // Returns a new AdsPageLoadMetricObserver. If the feature is disabled it | 29 // Returns a new AdsPageLoadMetricObserver. If the feature is disabled it |
| 23 // returns nullptr. | 30 // returns nullptr. |
| 24 static std::unique_ptr<AdsPageLoadMetricsObserver> CreateIfNeeded(); | 31 static std::unique_ptr<AdsPageLoadMetricsObserver> CreateIfNeeded(); |
| 25 | 32 |
| 26 AdsPageLoadMetricsObserver(); | 33 AdsPageLoadMetricsObserver(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 ongoing_navigation_resources_; | 81 ongoing_navigation_resources_; |
| 75 | 82 |
| 76 size_t page_bytes_ = 0u; | 83 size_t page_bytes_ = 0u; |
| 77 size_t uncached_page_bytes_ = 0u; | 84 size_t uncached_page_bytes_ = 0u; |
| 78 bool committed_ = false; | 85 bool committed_ = false; |
| 79 | 86 |
| 80 DISALLOW_COPY_AND_ASSIGN(AdsPageLoadMetricsObserver); | 87 DISALLOW_COPY_AND_ASSIGN(AdsPageLoadMetricsObserver); |
| 81 }; | 88 }; |
| 82 | 89 |
| 83 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ADS_PAGE_LOAD_METRICS_OBSE RVER_H_ | 90 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ADS_PAGE_LOAD_METRICS_OBSE RVER_H_ |
| OLD | NEW |