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_USAGE_STATS
_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_USAGE_STATS
_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_USAGE_STATS
_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_USAGE_STATS
_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/prefs/pref_member.h" | 10 #include "base/prefs/pref_member.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Given the |content_length| and associated |request|, records the | 58 // Given the |content_length| and associated |request|, records the |
59 // number of bypassed bytes for that |request| into UMAs based on bypass type. | 59 // number of bypassed bytes for that |request| into UMAs based on bypass type. |
60 // |data_reduction_proxy_enabled| tells us the state of the | 60 // |data_reduction_proxy_enabled| tells us the state of the |
61 // kDataReductionProxyEnabled preference. | 61 // kDataReductionProxyEnabled preference. |
62 void RecordBypassedBytesHistograms( | 62 void RecordBypassedBytesHistograms( |
63 net::URLRequest& request, | 63 net::URLRequest& request, |
64 const BooleanPrefMember& data_reduction_proxy_enabled); | 64 const BooleanPrefMember& data_reduction_proxy_enabled); |
65 | 65 |
66 void RecordBypassEventHistograms(const net::ProxyServer& bypassed_proxy, | 66 void RecordBypassEventHistograms(const net::ProxyServer& bypassed_proxy, |
67 int net_error, | 67 int net_error) const; |
68 bool did_fallback) const; | |
69 | 68 |
70 private: | 69 private: |
71 enum BypassedBytesType { | 70 enum BypassedBytesType { |
72 NOT_BYPASSED = 0, /* Not bypassed. */ | 71 NOT_BYPASSED = 0, /* Not bypassed. */ |
73 SSL, /* Bypass due to SSL. */ | 72 SSL, /* Bypass due to SSL. */ |
74 LOCAL_BYPASS_RULES, /* Bypass due to client-side bypass rules. */ | 73 LOCAL_BYPASS_RULES, /* Bypass due to client-side bypass rules. */ |
75 AUDIO_VIDEO, /* Audio/Video bypass. */ | 74 AUDIO_VIDEO, /* Audio/Video bypass. */ |
76 TRIGGERING_REQUEST, /* Triggering request bypass. */ | 75 TRIGGERING_REQUEST, /* Triggering request bypass. */ |
77 NETWORK_ERROR, /* Network error. */ | 76 NETWORK_ERROR, /* Network error. */ |
78 BYPASSED_BYTES_TYPE_MAX /* This must always be last.*/ | 77 BYPASSED_BYTES_TYPE_MAX /* This must always be last.*/ |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 129 |
131 // Called when the unavailability status has changed. Runs on the UI thread. | 130 // Called when the unavailability status has changed. Runs on the UI thread. |
132 base::Callback<void(bool)> unavailable_callback_; | 131 base::Callback<void(bool)> unavailable_callback_; |
133 | 132 |
134 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyUsageStats); | 133 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyUsageStats); |
135 }; | 134 }; |
136 | 135 |
137 } // namespace data_reduction_proxy | 136 } // namespace data_reduction_proxy |
138 | 137 |
139 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_USAGE_ST
ATS_H_ | 138 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_USAGE_ST
ATS_H_ |
OLD | NEW |