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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_params.h

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed code review comments by asvitkine@. Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 // Given |allowed_|, |fallback_allowed_|, and |alt_allowed_|, returns the 172 // Given |allowed_|, |fallback_allowed_|, and |alt_allowed_|, returns the
173 // list of data reduction proxies that may be used. 173 // list of data reduction proxies that may be used.
174 DataReductionProxyList GetAllowedProxies() const; 174 DataReductionProxyList GetAllowedProxies() const;
175 175
176 // Returns true if any proxy origins are set on the command line. 176 // Returns true if any proxy origins are set on the command line.
177 bool is_configured_on_command_line() const { 177 bool is_configured_on_command_line() const {
178 return configured_on_command_line_; 178 return configured_on_command_line_;
179 } 179 }
180 180
181 // Returns the corresponding string from preprocessor constants if defined,
bengr 2014/07/21 22:45:14 I don't think these need to be public.
Not at Google. Contact bengr 2014/07/22 00:12:09 Done.
182 // and an empty string otherwise.
183 // TODO(kundaji): Make this private when it is no longer access from IOThread.
bengr 2014/07/21 22:45:14 accessed
Not at Google. Contact bengr 2014/07/22 00:12:09 Done.
184 virtual std::string GetDefaultDevOrigin() const;
185 virtual std::string GetDefaultOrigin() const;
186 virtual std::string GetDefaultFallbackOrigin() const;
187 virtual std::string GetDefaultSSLOrigin() const;
188 virtual std::string GetDefaultAltOrigin() const;
189 virtual std::string GetDefaultAltFallbackOrigin() const;
190 virtual std::string GetDefaultProbeURL() const;
191 virtual std::string GetDefaultWarmupURL() const;
192
181 protected: 193 protected:
182 // Test constructor that optionally won't call Init(); 194 // Test constructor that optionally won't call Init();
183 DataReductionProxyParams(int flags, 195 DataReductionProxyParams(int flags,
184 bool should_call_init); 196 bool should_call_init);
185 197
186 // Initialize the values of the proxies, and probe URL, from command 198 // Initialize the values of the proxies, and probe URL, from command
187 // line flags and preprocessor constants, and check that there are 199 // line flags and preprocessor constants, and check that there are
188 // corresponding definitions for the allowed configurations. 200 // corresponding definitions for the allowed configurations.
189 bool Init(bool allowed, bool fallback_allowed, bool alt_allowed); 201 bool Init(bool allowed, bool fallback_allowed, bool alt_allowed);
190 202
191 // Initialize the values of the proxies, and probe URL from command 203 // Initialize the values of the proxies, and probe URL from command
192 // line flags and preprocessor constants. 204 // line flags and preprocessor constants.
193 void InitWithoutChecks(); 205 void InitWithoutChecks();
194 206
195 // Returns the corresponding string from preprocessor constants if defined,
196 // and an empty string otherwise.
197 virtual std::string GetDefaultDevOrigin() const;
198 virtual std::string GetDefaultOrigin() const;
199 virtual std::string GetDefaultFallbackOrigin() const;
200 virtual std::string GetDefaultSSLOrigin() const;
201 virtual std::string GetDefaultAltOrigin() const;
202 virtual std::string GetDefaultAltFallbackOrigin() const;
203 virtual std::string GetDefaultProbeURL() const;
204 virtual std::string GetDefaultWarmupURL() const;
205
206 private: 207 private:
207 GURL origin_; 208 GURL origin_;
208 GURL fallback_origin_; 209 GURL fallback_origin_;
209 GURL ssl_origin_; 210 GURL ssl_origin_;
210 GURL alt_origin_; 211 GURL alt_origin_;
211 GURL alt_fallback_origin_; 212 GURL alt_fallback_origin_;
212 GURL probe_url_; 213 GURL probe_url_;
213 GURL warmup_url_; 214 GURL warmup_url_;
214 215
215 bool allowed_; 216 bool allowed_;
216 const bool fallback_allowed_; 217 const bool fallback_allowed_;
217 bool alt_allowed_; 218 bool alt_allowed_;
218 const bool promo_allowed_; 219 const bool promo_allowed_;
219 bool holdback_; 220 bool holdback_;
220 221
221 bool configured_on_command_line_; 222 bool configured_on_command_line_;
222 223
223 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyParams); 224 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyParams);
224 }; 225 };
225 226
226 } // namespace data_reduction_proxy 227 } // namespace data_reduction_proxy
227 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H _ 228 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698