| 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 COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_ | 5 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_ |
| 6 #define COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_ | 6 #define COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 namespace net { | 10 namespace net { |
| 9 class URLRequest; | 11 class URLRequest; |
| 10 } | 12 } |
| 11 | 13 |
| 12 namespace data_use_measurement { | 14 namespace data_use_measurement { |
| 13 | 15 |
| 14 // Interface for a classifier that can classify URL requests. | 16 // Interface for a classifier that can classify URL requests. |
| 15 class URLRequestClassifier { | 17 class URLRequestClassifier { |
| 16 public: | 18 public: |
| 17 virtual ~URLRequestClassifier() {} | 19 virtual ~URLRequestClassifier() {} |
| 18 | 20 |
| 19 // Returns true if the URLRequest |request| is initiated by user traffic. | 21 // Returns true if the URLRequest |request| is initiated by user traffic. |
| 20 virtual bool IsUserRequest(const net::URLRequest& request) const = 0; | 22 virtual bool IsUserRequest(const net::URLRequest& request) const = 0; |
| 23 |
| 24 // Records the page transition histograms. |
| 25 virtual void RecordPageTransitionUMA(uint64_t page_transition, |
| 26 int64_t received_bytes) const = 0; |
| 21 }; | 27 }; |
| 22 | 28 |
| 23 } // namespace data_use_measurement | 29 } // namespace data_use_measurement |
| 24 | 30 |
| 25 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_ | 31 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_ |
| OLD | NEW |