Chromium Code Reviews| 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 16f62c51412f93ee168c906268f9e2292c4c8c50..9e97f8460f0be4a1bd6bf115f6e40727b4772b91 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 |
| @@ -78,38 +78,6 @@ enum SecureProxyCheckFetchResult { |
| SECURE_PROXY_CHECK_FETCH_RESULT_COUNT |
| }; |
| -// Values of the |lofi_status_|. |
| -// Default state is |LOFI_STATUS_TEMPORARILY_OFF|. |
| -enum LoFiStatus { |
| - // Used if Lo-Fi is permanently off. |
| - LOFI_STATUS_OFF = 0, |
| - |
| - // Used if Lo-Fi is disabled temporarily through direct or indirect user |
| - // action. The state would be reset on next main frame request. |
| - LOFI_STATUS_TEMPORARILY_OFF, |
| - |
| - // Used if Lo-Fi is enabled through flags. |
| - LOFI_STATUS_ACTIVE_FROM_FLAGS, |
| - |
| - // Session is in Auto Lo-Fi Control group and the current conditions are |
| - // suitable to use Lo-Fi "q=low" header. |
| - LOFI_STATUS_ACTIVE_CONTROL, |
| - |
| - // Session is in Auto Lo-Fi Control group and the current conditions are |
| - // not suitable to use Lo-Fi "q=low" header. |
| - LOFI_STATUS_INACTIVE_CONTROL, |
| - |
| - // Session is in Auto Lo-Fi enabled group and the current conditions are |
| - // suitable to use Lo-Fi "q=low" header. |
| - LOFI_STATUS_ACTIVE, |
| - |
| - // Session is in Auto Lo-Fi enabled group and the current conditions are |
| - // not suitable to use Lo-Fi "q=low" header. |
| - LOFI_STATUS_INACTIVE, |
| - |
| - LOFI_STATUS_LAST = LOFI_STATUS_INACTIVE |
| -}; |
| - |
| // 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. |
| @@ -213,23 +181,17 @@ class DataReductionProxyConfig |
| // tied to whether the Data Reduction Proxy is enabled. |
| bool promo_allowed() const; |
| - // Returns the Lo-Fi status. |
| - LoFiStatus GetLoFiStatus() const; |
| - |
| - // Returns true only if Lo-Fi "q=low" header should be added to the Chrome |
| - // Proxy header. |
| - // Should be called on all URL requests (main frame and non main frame). |
| - bool ShouldUseLoFiHeaderForRequests() const; |
| - |
| - // Sets |lofi_status_| to LOFI_STATUS_OFF. |
| + // Sets |lofi_off_| to true. |
| void SetLoFiModeOff(); |
| - // Updates |lofi_status_| based on the arguments provided and the current |
| - // value of |lofi_status_|. |
| - // |network_quality_estimator| may be NULL. |
| - // Should be called only on main frame loads. |
| - void UpdateLoFiStatusOnMainFrameRequest( |
| - bool user_temporarily_disabled_lofi, |
| + // Returns |lofi_off_|. |
| + bool IsLoFiOff() const { return lofi_off_; } |
| + |
| + // Returns true only if Lo-Fi "q=low" header should be added to the Chrome |
|
bengr
2015/08/25 00:00:01
only if -> only when
Same for line 300
megjablon
2015/08/25 20:29:46
Done.
|
| + // Proxy header. Updates |lofi_status_| based on the arguments provided and |
| + // the current value of |lofi_status_|. |network_quality_estimator| may be |
| + // NULL. Should be called only on main frame loads. |
| + bool ShouldTurnOnLoFiOnMainFrameRequest( |
| const net::NetworkQualityEstimator* network_quality_estimator); |
| protected: |
| @@ -335,9 +297,9 @@ class DataReductionProxyConfig |
| virtual bool IsNetworkQualityProhibitivelySlow( |
| const net::NetworkQualityEstimator* network_quality_estimator); |
| - // Returns true only if Lo-Fi "q=low" header should be added to the Chrome |
| - // Proxy header based on the value of |lofi_status|. |
| - static bool ShouldUseLoFiHeaderForRequests(LoFiStatus lofi_status); |
| + // // Returns true only if Lo-Fi "q=low" header should be added to the Chrome |
|
bengr
2015/08/25 00:00:01
Remove the second //. On the next line too.
megjablon
2015/08/25 20:29:46
Removed the method
|
| + // // Proxy header based on the value of |lofi_status|. |
| + // static bool ShouldUseLoFiHeaderForRequests(LoFiStatus lofi_status); |
| // Records Lo-Fi accuracy metric. Should be called only on main frame loads. |
| void RecordAutoLoFiAccuracyRate( |
| @@ -398,9 +360,7 @@ class DataReductionProxyConfig |
| // network quality was last updated (most recent main frame request). |
| net::NetworkChangeNotifier::ConnectionType connection_type_; |
| - // Current Lo-Fi status. |
| - // The value changes only on main frame load. |
| - LoFiStatus lofi_status_; |
| + bool lofi_off_; |
|
bengr
2015/08/25 00:00:01
Please add a comment.
megjablon
2015/08/25 20:29:46
Done.
|
| // Timestamp when the most recent main frame request started. |
| base::TimeTicks last_main_frame_request_; |