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