OLD | NEW |
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Returns true if the authentication key was set on the command line. | 52 // Returns true if the authentication key was set on the command line. |
53 static bool IsKeySetOnCommandLine(); | 53 static bool IsKeySetOnCommandLine(); |
54 | 54 |
55 // Constructs configuration parameters. If |kAllowed|, then the standard | 55 // Constructs configuration parameters. If |kAllowed|, then the standard |
56 // data reduction proxy configuration is allowed to be used. If | 56 // data reduction proxy configuration is allowed to be used. If |
57 // |kfallbackAllowed| a fallback proxy can be used if the primary proxy is | 57 // |kfallbackAllowed| a fallback proxy can be used if the primary proxy is |
58 // bypassed or disabled. If |kAlternativeAllowed| then an alternative proxy | 58 // bypassed or disabled. If |kAlternativeAllowed| then an alternative proxy |
59 // configuration is allowed to be used. This alternative configuration would | 59 // configuration is allowed to be used. This alternative configuration would |
60 // replace the primary and fallback proxy configurations if enabled. Finally | 60 // replace the primary and fallback proxy configurations if enabled. Finally |
61 // if |kPromoAllowed|, the client may show a promotion for the data | 61 // if |kPromoAllowed|, the client may show a promotion for the data reduction |
62 // reduction proxy. | 62 // proxy. |
63 // | 63 // |
64 // A standard configuration has a primary proxy, and a fallback proxy for | 64 // A standard configuration has a primary proxy, and a fallback proxy for |
65 // HTTP traffic. The alternative configuration has a different primary and | 65 // HTTP traffic. The alternative configuration has a different primary and |
66 // fallback proxy for HTTP traffic, and an SSL proxy. | 66 // fallback proxy for HTTP traffic, and an SSL proxy. |
67 | 67 |
68 DataReductionProxyParams(int flags); | 68 DataReductionProxyParams(int flags); |
69 | 69 |
70 virtual ~DataReductionProxyParams(); | 70 virtual ~DataReductionProxyParams(); |
71 | 71 |
72 // Returns true if a data reduction proxy was used for the given |request|. | 72 // Returns true if a data reduction proxy was used for the given |request|. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // Returns the alternative data reduction proxy fallback origin. | 112 // Returns the alternative data reduction proxy fallback origin. |
113 const GURL& alt_fallback_origin() const { | 113 const GURL& alt_fallback_origin() const { |
114 return alt_fallback_origin_; | 114 return alt_fallback_origin_; |
115 } | 115 } |
116 | 116 |
117 // Returns the URL to probe to decide if the primary origin should be used. | 117 // Returns the URL to probe to decide if the primary origin should be used. |
118 const GURL& probe_url() const { | 118 const GURL& probe_url() const { |
119 return probe_url_; | 119 return probe_url_; |
120 } | 120 } |
121 | 121 |
| 122 // Returns the URL to fetch to warm the data reduction proxy connection. |
| 123 const GURL& warmup_url() const { |
| 124 return warmup_url_; |
| 125 } |
| 126 |
122 // Set the proxy authentication key. | 127 // Set the proxy authentication key. |
123 void set_key(const std::string& key) { | 128 void set_key(const std::string& key) { |
124 key_ = key; | 129 key_ = key; |
125 } | 130 } |
126 | 131 |
127 // Returns the proxy authentication key. | 132 // Returns the proxy authentication key. |
128 const std::string& key() const { | 133 const std::string& key() const { |
129 return key_; | 134 return key_; |
130 } | 135 } |
131 | 136 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // Returns the corresponding string from preprocessor constants if defined, | 178 // Returns the corresponding string from preprocessor constants if defined, |
174 // and an empty string otherwise. | 179 // and an empty string otherwise. |
175 virtual std::string GetDefaultKey() const; | 180 virtual std::string GetDefaultKey() const; |
176 virtual std::string GetDefaultDevOrigin() const; | 181 virtual std::string GetDefaultDevOrigin() const; |
177 virtual std::string GetDefaultOrigin() const; | 182 virtual std::string GetDefaultOrigin() const; |
178 virtual std::string GetDefaultFallbackOrigin() const; | 183 virtual std::string GetDefaultFallbackOrigin() const; |
179 virtual std::string GetDefaultSSLOrigin() const; | 184 virtual std::string GetDefaultSSLOrigin() const; |
180 virtual std::string GetDefaultAltOrigin() const; | 185 virtual std::string GetDefaultAltOrigin() const; |
181 virtual std::string GetDefaultAltFallbackOrigin() const; | 186 virtual std::string GetDefaultAltFallbackOrigin() const; |
182 virtual std::string GetDefaultProbeURL() const; | 187 virtual std::string GetDefaultProbeURL() const; |
| 188 virtual std::string GetDefaultWarmupURL() const; |
183 | 189 |
184 private: | 190 private: |
185 GURL origin_; | 191 GURL origin_; |
186 GURL fallback_origin_; | 192 GURL fallback_origin_; |
187 GURL ssl_origin_; | 193 GURL ssl_origin_; |
188 GURL alt_origin_; | 194 GURL alt_origin_; |
189 GURL alt_fallback_origin_; | 195 GURL alt_fallback_origin_; |
190 GURL probe_url_; | 196 GURL probe_url_; |
| 197 GURL warmup_url_; |
191 | 198 |
192 std::string key_; | 199 std::string key_; |
193 | 200 |
194 bool allowed_; | 201 bool allowed_; |
195 const bool fallback_allowed_; | 202 const bool fallback_allowed_; |
196 bool alt_allowed_; | 203 bool alt_allowed_; |
197 const bool promo_allowed_; | 204 const bool promo_allowed_; |
198 | 205 |
199 | |
200 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyParams); | 206 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyParams); |
201 }; | 207 }; |
202 | 208 |
203 } // namespace data_reduction_proxy | 209 } // namespace data_reduction_proxy |
204 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H
_ | 210 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H
_ |
OLD | NEW |