OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_METRICS_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_METRICS_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_METRICS_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_METRICS_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic
s_prefs.h" |
9 | 10 |
10 namespace net { | 11 namespace net { |
11 class URLRequest; | 12 class URLRequest; |
12 } | 13 } |
13 | 14 |
14 class PrefService; | |
15 | |
16 namespace data_reduction_proxy { | 15 namespace data_reduction_proxy { |
17 | 16 |
18 enum DataReductionProxyRequestType { | 17 enum DataReductionProxyRequestType { |
19 VIA_DATA_REDUCTION_PROXY, // A request served by the data reduction proxy. | 18 VIA_DATA_REDUCTION_PROXY, // A request served by the data reduction proxy. |
20 | 19 |
21 // Below are reasons why a request is not served by the enabled data reduction | 20 // Below are reasons why a request is not served by the enabled data reduction |
22 // proxy. Off-the-record profile data is not counted in all cases. | 21 // proxy. Off-the-record profile data is not counted in all cases. |
23 HTTPS, // An https request. | 22 HTTPS, // An https request. |
24 SHORT_BYPASS, // The client is bypassed by the proxy for a short time. | 23 SHORT_BYPASS, // The client is bypassed by the proxy for a short time. |
25 LONG_BYPASS, // The client is bypassed by the proxy for a long time (due | 24 LONG_BYPASS, // The client is bypassed by the proxy for a long time (due |
(...skipping 13 matching lines...) Expand all Loading... |
39 int64 original_content_length, | 38 int64 original_content_length, |
40 int64 received_content_length); | 39 int64 received_content_length); |
41 | 40 |
42 // This is only exposed for testing. It is normally called by | 41 // This is only exposed for testing. It is normally called by |
43 // UpdateContentLengthPrefs. | 42 // UpdateContentLengthPrefs. |
44 void UpdateContentLengthPrefsForDataReductionProxy( | 43 void UpdateContentLengthPrefsForDataReductionProxy( |
45 int received_content_length, | 44 int received_content_length, |
46 int original_content_length, | 45 int original_content_length, |
47 bool with_data_reduction_proxy_enabled, | 46 bool with_data_reduction_proxy_enabled, |
48 DataReductionProxyRequestType request_type, | 47 DataReductionProxyRequestType request_type, |
49 base::Time now, PrefService* prefs); | 48 base::Time now, |
| 49 DataReductionProxyStatisticsPrefs* prefs); |
50 | 50 |
51 // Records daily data savings statistics to prefs and reports data savings UMA. | 51 // Records daily data savings statistics to prefs and reports data savings UMA. |
52 void UpdateContentLengthPrefs( | 52 void UpdateContentLengthPrefs( |
53 int received_content_length, | 53 int received_content_length, |
54 int original_content_length, | 54 int original_content_length, |
55 bool with_data_reduction_proxy_enabled, | 55 bool with_data_reduction_proxy_enabled, |
56 DataReductionProxyRequestType request_type, | 56 DataReductionProxyRequestType request_type, |
57 PrefService* prefs); | 57 DataReductionProxyStatisticsPrefs* prefs); |
58 | 58 |
59 } // namespace data_reduction_proxy | 59 } // namespace data_reduction_proxy |
60 | 60 |
61 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_METRICS_
H_ | 61 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_METRICS_
H_ |
OLD | NEW |