Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: components/data_reduction_proxy/core/common/lofi_decider.h

Issue 1933653004: Reset the Lo-Fi main frame state when there is a new main frame request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 {
11 class HttpRequestHeaders; 11 class HttpRequestHeaders;
12 class ProxyServer;
13 class URLRequest; 12 class URLRequest;
14 } 13 }
15 14
16 namespace data_reduction_proxy { 15 namespace data_reduction_proxy {
17 16
18 class DataReductionProxyConfig;
19
20 // 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
21 // of the resource. 18 // of the resource.
22 class LoFiDecider { 19 class LoFiDecider {
23 public: 20 public:
24 virtual ~LoFiDecider() {} 21 virtual ~LoFiDecider() {}
25 22
26 // 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
27 // Lo-Fi header should be added to the given request. 24 // Lo-Fi header should be added to the given request.
28 virtual bool IsUsingLoFiMode(const net::URLRequest& request) const = 0; 25 virtual bool IsUsingLoFiMode(const net::URLRequest& request) const = 0;
29 26
30 // Returns true when Lo-Fi mode is on for the given |request|. If the 27 // Returns true when Lo-Fi mode is on for the given |request|. If the
31 // |request| is using Lo-Fi mode, adds the "q=low" directive to the |headers|. 28 // |request| is using Lo-Fi mode, adds the "q=low" directive to the |headers|.
32 // If the |request| is using Lo-Fi preview mode, and it is a main frame 29 // If the |request| is using Lo-Fi preview mode, and it is a main frame
33 // request adds the "q=preview" and it is a main frame request directive to 30 // request adds the "q=preview" and it is a main frame request directive to
34 // the |headers|. Only adds this header if the provided |proxy_server| is a 31 // the |headers|. Only adds this header if the provided |proxy_server| is a
tbansal1 2016/05/06 23:36:51 nit: Update the comments.
megjablon 2016/05/07 00:29:08 Done.
35 // data reduction proxy as identified by the given |config|. 32 // data reduction proxy as identified by the given |config|.
36 virtual bool MaybeAddLoFiDirectiveToHeaders( 33 virtual bool MaybeAddLoFiDirectiveToHeaders(
37 const net::URLRequest& request, 34 const net::URLRequest& request,
38 net::HttpRequestHeaders* headers, 35 net::HttpRequestHeaders* headers) const = 0;
39 const net::ProxyServer& proxy_server,
40 DataReductionProxyConfig* config) const = 0;
41 }; 36 };
42 37
43 } // namespace data_reduction_proxy 38 } // namespace data_reduction_proxy
44 39
45 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ 40 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698