| 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 | 9 |
| 10 namespace net { | 10 namespace net { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // Returns true if |headers| contains the Chrome-Proxy-Accept-Transform | 47 // Returns true if |headers| contains the Chrome-Proxy-Accept-Transform |
| 48 // header with the "lite-page" directive. | 48 // header with the "lite-page" directive. |
| 49 virtual bool IsLitePagePreviewRequested( | 49 virtual bool IsLitePagePreviewRequested( |
| 50 const net::HttpRequestHeaders& headers) const = 0; | 50 const net::HttpRequestHeaders& headers) const = 0; |
| 51 | 51 |
| 52 // Unconditionally removes the Chrome-Proxy-Accept-Transform header from | 52 // Unconditionally removes the Chrome-Proxy-Accept-Transform header from |
| 53 // |headers.| | 53 // |headers.| |
| 54 virtual void RemoveAcceptTransformHeader( | 54 virtual void RemoveAcceptTransformHeader( |
| 55 net::HttpRequestHeaders* headers) const = 0; | 55 net::HttpRequestHeaders* headers) const = 0; |
| 56 | 56 |
| 57 // Adds a directive to tell the server to ignore blacklists when a Lite Page | |
| 58 // preview is being requested due to command line flags being set. | |
| 59 virtual void MaybeSetIgnorePreviewsBlacklistDirective( | |
| 60 net::HttpRequestHeaders* headers) const = 0; | |
| 61 | |
| 62 // Returns true if the Lo-Fi specific UMA should be recorded. It is set to | 57 // Returns true if the Lo-Fi specific UMA should be recorded. It is set to |
| 63 // true if Lo-Fi is enabled for |request|, Chrome session is in Lo-Fi | 58 // true if Lo-Fi is enabled for |request|, Chrome session is in Lo-Fi |
| 64 // Enabled or Control field trial, and the network quality was slow. | 59 // Enabled or Control field trial, and the network quality was slow. |
| 65 virtual bool ShouldRecordLoFiUMA(const net::URLRequest& request) const = 0; | 60 virtual bool ShouldRecordLoFiUMA(const net::URLRequest& request) const = 0; |
| 66 | 61 |
| 67 // Returns whether the request was a client-side Lo-Fi image request. | 62 // Returns whether the request was a client-side Lo-Fi image request. |
| 68 virtual bool IsClientLoFiImageRequest( | 63 virtual bool IsClientLoFiImageRequest( |
| 69 const net::URLRequest& request) const = 0; | 64 const net::URLRequest& request) const = 0; |
| 70 | 65 |
| 71 // Returns true if the request is for a client-side Lo-Fi image that is being | 66 // Returns true if the request is for a client-side Lo-Fi image that is being |
| 72 // automatically reloaded because of a decoding error. | 67 // automatically reloaded because of a decoding error. |
| 73 virtual bool IsClientLoFiAutoReloadRequest( | 68 virtual bool IsClientLoFiAutoReloadRequest( |
| 74 const net::URLRequest& request) const = 0; | 69 const net::URLRequest& request) const = 0; |
| 75 }; | 70 }; |
| 76 | 71 |
| 77 } // namespace data_reduction_proxy | 72 } // namespace data_reduction_proxy |
| 78 | 73 |
| 79 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ | 74 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ |
| OLD | NEW |