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

Side by Side Diff: components/data_reduction_proxy/content/browser/content_lofi_decider.h

Issue 1463583003: Move adding Lo-Fi directives from DRPRequestOptions to ContentLoFiDecider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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_CONTENT_BROWSER_CONTENT_LOFI_DECIDER_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CONTENT_BROWSER_CONTENT_LOFI_DECIDER_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CONTENT_BROWSER_CONTENT_LOFI_DECIDER_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CONTENT_BROWSER_CONTENT_LOFI_DECIDER_H_
7 7
8 #include "components/data_reduction_proxy/core/common/lofi_decider.h" 8 #include "components/data_reduction_proxy/core/common/lofi_decider.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 10
11 namespace net { 11 namespace net {
12 class URLRequest; 12 class URLRequest;
13 class HttpRequestHeaders;
tbansal1 2015/11/20 21:56:58 Alphabetize.
megjablon 2015/11/20 23:14:50 Done.
13 } 14 }
14 15
15 namespace data_reduction_proxy { 16 namespace data_reduction_proxy {
16 17
18 extern const char kLoFiHeader[];
19 extern const char kLoFiExperimentHeader[];
20
17 // Class responsible for deciding whether a request should be requested with low 21 // Class responsible for deciding whether a request should be requested with low
18 // fidelity (Lo-Fi) or not. Relies on the Lo-Fi mode state stored in the 22 // fidelity (Lo-Fi) or not. Relies on the Lo-Fi mode state stored in the
19 // request's content::ResourceRequestInfo, which must be fetched using 23 // request's content::ResourceRequestInfo, which must be fetched using
20 // content::ResourceRequestInfo::ForRequest. Owned by DataReductionProxyIOData 24 // content::ResourceRequestInfo::ForRequest. Owned by DataReductionProxyIOData
21 // and should be called on the IO thread. 25 // and should be called on the IO thread.
22 class ContentLoFiDecider : public LoFiDecider { 26 class ContentLoFiDecider : public LoFiDecider {
23 public: 27 public:
24 ContentLoFiDecider(); 28 ContentLoFiDecider();
25 ~ContentLoFiDecider() override; 29 ~ContentLoFiDecider() override;
26 30
27 bool IsUsingLoFiMode(const net::URLRequest& request) const override; 31 bool IsUsingLoFiMode(const net::URLRequest& request) const override;
28 32
33 bool MaybeEnableLoFiMode(const net::URLRequest& request,
tbansal1 2015/11/20 21:56:58 // LoFiDecider implementation: Also, this is not
megjablon 2015/11/20 23:14:50 SGTM. It's only called in one place so I don't thi
34 net::HttpRequestHeaders* headers) const override;
35
29 private: 36 private:
30 DISALLOW_COPY_AND_ASSIGN(ContentLoFiDecider); 37 DISALLOW_COPY_AND_ASSIGN(ContentLoFiDecider);
31 }; 38 };
32 39
33 } // namespace data_reduction_proxy 40 } // namespace data_reduction_proxy
34 41
35 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CONTENT_BROWSER_CONTENT_LOFI_DECIDER_ H_ 42 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CONTENT_BROWSER_CONTENT_LOFI_DECIDER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698