Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 // |triggering_request_| to true. A triggering request is the first request to | 54 // |triggering_request_| to true. A triggering request is the first request to |
| 55 // cause the current bypass. | 55 // cause the current bypass. |
| 56 void SetBypassType(DataReductionProxyBypassType type); | 56 void SetBypassType(DataReductionProxyBypassType type); |
| 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 const net::ProxyConfig& data_reduction_proxy_config); | |
|
bengr
2014/08/29 19:29:48
Update the comment to describe this parameter.
megjablon
2014/08/29 20:26:32
Done.
| |
| 65 | 66 |
| 66 void RecordBypassEventHistograms(const net::ProxyServer& bypassed_proxy, | 67 void RecordBypassEventHistograms(const net::ProxyServer& bypassed_proxy, |
| 67 int net_error) const; | 68 int net_error) const; |
| 68 | 69 |
| 69 private: | 70 private: |
| 70 enum BypassedBytesType { | 71 enum BypassedBytesType { |
| 71 NOT_BYPASSED = 0, /* Not bypassed. */ | 72 NOT_BYPASSED = 0, /* Not bypassed. */ |
| 72 SSL, /* Bypass due to SSL. */ | 73 SSL, /* Bypass due to SSL. */ |
| 73 LOCAL_BYPASS_RULES, /* Bypass due to client-side bypass rules. */ | 74 LOCAL_BYPASS_RULES, /* Bypass due to client-side bypass rules. */ |
| 75 MANAGED_PAC, /* Bypass due to managed config. */ | |
|
bengr
2014/08/29 19:29:48
This isn't quite right. I'd call this MANAGED_PROX
megjablon
2014/08/29 20:26:32
Done.
| |
| 74 AUDIO_VIDEO, /* Audio/Video bypass. */ | 76 AUDIO_VIDEO, /* Audio/Video bypass. */ |
| 75 TRIGGERING_REQUEST, /* Triggering request bypass. */ | 77 TRIGGERING_REQUEST, /* Triggering request bypass. */ |
| 76 NETWORK_ERROR, /* Network error. */ | 78 NETWORK_ERROR, /* Network error. */ |
| 77 BYPASSED_BYTES_TYPE_MAX /* This must always be last.*/ | 79 BYPASSED_BYTES_TYPE_MAX /* This must always be last.*/ |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 // NetworkChangeNotifier::NetworkChangeObserver: | 82 // NetworkChangeNotifier::NetworkChangeObserver: |
| 81 virtual void OnNetworkChanged( | 83 virtual void OnNetworkChanged( |
| 82 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; | 84 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; |
| 83 | 85 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 | 131 |
| 130 // Called when the unavailability status has changed. Runs on the UI thread. | 132 // Called when the unavailability status has changed. Runs on the UI thread. |
| 131 base::Callback<void(bool)> unavailable_callback_; | 133 base::Callback<void(bool)> unavailable_callback_; |
| 132 | 134 |
| 133 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyUsageStats); | 135 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyUsageStats); |
| 134 }; | 136 }; |
| 135 | 137 |
| 136 } // namespace data_reduction_proxy | 138 } // namespace data_reduction_proxy |
| 137 | 139 |
| 138 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_USAGE_ST ATS_H_ | 140 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_USAGE_ST ATS_H_ |
| OLD | NEW |