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

Side by Side Diff: components/cronet/url_request_context_config.h

Issue 2567093002: [cronet] Add a Builder class for UrlRequestContextConfig (Closed)
Patch Set: per #4 Created 3 years, 12 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_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ 5 #ifndef COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_
6 #define COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ 6 #define COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // App-provided list of servers that support QUIC. 169 // App-provided list of servers that support QUIC.
170 ScopedVector<QuicHint> quic_hints; 170 ScopedVector<QuicHint> quic_hints;
171 171
172 // The list of public key pins. 172 // The list of public key pins.
173 ScopedVector<Pkp> pkp_list; 173 ScopedVector<Pkp> pkp_list;
174 174
175 private: 175 private:
176 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); 176 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig);
177 }; 177 };
178 178
179 // Stores intermediate state for URLRequestContextConfig. Initializes with
180 // (mostly) sane defaults,
mef 2016/12/22 20:29:19 nit: unexpected line break.
lilyhoughton 2017/01/09 18:13:25 Done.
181 // then modify it with appropriate setters, and finalize with Build().
mef 2016/12/22 20:29:18 Um, there are no setters.
lilyhoughton 2017/01/09 18:13:25 Done. Mis-commented
182 struct URLRequestContextConfigBuilder {
183 URLRequestContextConfigBuilder();
184 ~URLRequestContextConfigBuilder();
185
186 // Finalize state into a URLRequestContextConfig. Must only be called once,
187 // as once
mef 2016/12/22 20:29:18 nit: unexpected line break.
lilyhoughton 2017/01/09 18:13:25 Done.
188 // |mock_cert_verifier| is moved into a URLRequestContextConfig, it cannot be
189 // used again.
190 std::unique_ptr<URLRequestContextConfig> Build();
191
192 // Enable QUIC.
193 bool enable_quic = false;
194 // QUIC User Agent ID.
195 std::string quic_user_agent_id = "";
196 // Enable SPDY.
197 bool enable_spdy = false;
198 // Enable SDCH.
199 bool enable_sdch = false;
200 // Type of http cache.
201 URLRequestContextConfig::HttpCacheType http_cache =
202 URLRequestContextConfig::DISK;
203 // Max size of http cache in bytes.
204 int http_cache_max_size = 0;
205 // Disable caching for HTTP responses. Other information may be stored in
206 // the cache.
207 bool load_disable_cache = false;
208 // Storage path for http cache and cookie storage.
209 std::string storage_path = "";
210 // User-Agent request header field.
211 std::string user_agent = "";
212 // Experimental options encoded as a string in a JSON format containing
213 // experiments and their corresponding configuration options. The format
214 // is a JSON object with the name of the experiment as the key, and the
215 // configuration options as the value. An example:
216 // {"experiment1": {"option1": "option_value1", "option2": "option_value2",
217 // ...}, "experiment2: {"option3", "option_value3", ...}, ...}
218 std::string experimental_options = "{}";
219 // Enable Data Reduction Proxy with authentication key.
220 std::string data_reduction_proxy_key = "";
221 std::string data_reduction_primary_proxy = "";
222 std::string data_reduction_fallback_proxy = "";
223 std::string data_reduction_secure_proxy_check_url = "";
224
225 // Certificate verifier for testing.
226 std::unique_ptr<net::CertVerifier> mock_cert_verifier = nullptr;
227
228 // Enable network quality estimator.
229 bool enable_network_quality_estimator = false;
230
231 // Enable public key pinning bypass for local trust anchors.
232 bool bypass_public_key_pinning_for_local_trust_anchors = true;
233
234 // Data to populate CertVerifierCache.
235 std::string cert_verifier_data = "";
236
237 private:
238 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfigBuilder);
239 };
240
179 } // namespace cronet 241 } // namespace cronet
180 242
181 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ 243 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_
OLDNEW
« no previous file with comments | « components/cronet/ios/cronet_environment.mm ('k') | components/cronet/url_request_context_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698