Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CORE_BROWSER_LOFI_DECIDER_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "net/url_request/url_request.h" | 9 #include "net/url_request/url_request.h" |
| 10 | 10 |
| 11 namespace net { | |
| 12 class HttpRequestHeaders; | |
| 13 } | |
| 14 | |
| 11 namespace data_reduction_proxy { | 15 namespace data_reduction_proxy { |
| 12 | 16 |
| 13 // Interface to determine if a request should be made for a low fidelity version | 17 // Interface to determine if a request should be made for a low fidelity version |
| 14 // of the resource. | 18 // of the resource. |
| 15 class LoFiDecider { | 19 class LoFiDecider { |
| 16 public: | 20 public: |
| 17 virtual ~LoFiDecider() {} | 21 virtual ~LoFiDecider() {} |
| 18 | 22 |
| 19 // Returns true when Lo-Fi mode is on for the given |request|. This means the | 23 // Returns true when Lo-Fi mode is on for the given |request|. This means the |
| 20 // Lo-Fi header should be added to the given request, unless the user is in | 24 // Lo-Fi header should be added to the given request. |
| 21 // in the Lo-Fi control group. | |
| 22 virtual bool IsUsingLoFiMode(const net::URLRequest& request) const = 0; | 25 virtual bool IsUsingLoFiMode(const net::URLRequest& request) const = 0; |
| 26 | |
| 27 // Returns true when Lo-Fi mode is on for the given |request|. If the | |
| 28 // |request| is using Lo-Fi mode, adds the "q=low" directive to the |headers|. | |
|
tbansal1
2015/11/20 21:56:58
May be also say something about lofi_active_contro
megjablon
2015/11/20 23:14:50
Done.
| |
| 29 virtual bool MaybeEnableLoFiMode(const net::URLRequest& request, | |
| 30 net::HttpRequestHeaders* headers) const = 0; | |
| 23 }; | 31 }; |
| 24 | 32 |
| 25 } // namespace data_reduction_proxy | 33 } // namespace data_reduction_proxy |
| 26 | 34 |
| 27 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ | 35 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ |
| OLD | NEW |