Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h |
index 64f75897543b26c1eae903f3b253e1ef41fcdad4..727706fad4a52619a2fefaa6d82b92a5f99ab541 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h |
@@ -74,6 +74,20 @@ enum SecureProxyCheckFetchResult { |
SECURE_PROXY_CHECK_FETCH_RESULT_COUNT |
}; |
+// Auto LoFi current status. |
+enum AutoLoFiStatus { |
jeremyim
2015/05/12 19:46:21
I think the enum should be in a separate file whic
tbansal1
2015/05/12 22:12:42
It seems that there are lot of places where enum i
|
+ // Auto LoFi is disabled. |
+ AUTO_LOFI_STATUS_DISABLED = 0, |
+ |
+ // Auto LoFi is off but the current network conditions are worse than the |
+ // ones specified in Auto LoFi control group. |
+ AUTO_LOFI_STATUS_OFF, |
+ |
+ // Auto LoFi is on and but the current network conditions are worse than the |
+ // ones specified in Auto LoFi enabled group. |
+ AUTO_LOFI_STATUS_ON |
+}; |
Tom Sepez
2015/05/12 19:46:20
nit: generally, the technique here is to add
AUTO
tbansal1
2015/05/12 22:12:42
Done.
|
+ |
// Central point for holding the Data Reduction Proxy configuration. |
// This object lives on the IO thread and all of its methods are expected to be |
// called from there. |
@@ -186,6 +200,10 @@ class DataReductionProxyConfig |
// tied to whether the Data Reduction Proxy is enabled. |
bool promo_allowed() const; |
+ // Returns the Auto LoFi status. Enabling LoFi from command line switch has |
+ // no effect on Auto LoFi. |
+ AutoLoFiStatus GetAutoLoFiStatus() const; |
+ |
protected: |
// Writes a warning to the log that is used in backend processing of |
// customer feedback. Virtual so tests can mock it for verification. |
@@ -257,6 +275,19 @@ class DataReductionProxyConfig |
bool is_https, |
base::TimeDelta* min_retry_delay) const; |
+ // Returns true if this client is part of LoFi enabled field trial. |
+ // Virtualized for mocking. |
+ virtual bool IsIncludedInLoFiEnabledFieldTrial() const; |
+ |
+ // Returns true if this client is part of LoFi control field trial. |
+ // Virtualized for mocking. |
+ virtual bool IsIncludedInLoFiControlFieldTrial() const; |
+ |
+ // Returns true if current network conditions are worse than the ones |
+ // specified in the enabled or control field trial group parameters. |
+ // Virtualized for mocking. |
+ virtual bool IsNetworkBad() const; |
+ |
scoped_ptr<SecureProxyChecker> secure_proxy_checker_; |
bool restricted_by_carrier_; |