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

Side by Side Diff: net/url_request/url_request_context_builder.cc

Issue 2876243002: Add method to init HttpNetworkSession::Params from context bulder params (Closed)
Patch Set: Oops, base on top of trunk Created 3 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
« no previous file with comments | « net/url_request/url_request_context_builder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "net/url_request/url_request_context_builder.h" 5 #include "net/url_request/url_request_context_builder.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 }; 174 };
175 175
176 } // namespace 176 } // namespace
177 177
178 URLRequestContextBuilder::HttpCacheParams::HttpCacheParams() 178 URLRequestContextBuilder::HttpCacheParams::HttpCacheParams()
179 : type(IN_MEMORY), 179 : type(IN_MEMORY),
180 max_size(0) {} 180 max_size(0) {}
181 URLRequestContextBuilder::HttpCacheParams::~HttpCacheParams() {} 181 URLRequestContextBuilder::HttpCacheParams::~HttpCacheParams() {}
182 182
183 URLRequestContextBuilder::HttpNetworkSessionParams::HttpNetworkSessionParams() 183 URLRequestContextBuilder::HttpNetworkSessionParams::HttpNetworkSessionParams()
184 : ignore_certificate_errors(false), 184 : host_mapping_rules(nullptr),
185 host_mapping_rules(NULL), 185 ignore_certificate_errors(false),
186 testing_fixed_http_port(0), 186 testing_fixed_http_port(0),
187 testing_fixed_https_port(0), 187 testing_fixed_https_port(0),
188 enable_http2(true), 188 enable_http2(true),
189 enable_quic(false), 189 enable_quic(false),
190 quic_max_server_configs_stored_in_properties(0), 190 quic_max_server_configs_stored_in_properties(0),
191 quic_close_sessions_on_ip_change(false),
191 quic_idle_connection_timeout_seconds(kIdleConnectionTimeoutSeconds), 192 quic_idle_connection_timeout_seconds(kIdleConnectionTimeoutSeconds),
192 quic_close_sessions_on_ip_change(false),
193 quic_migrate_sessions_on_network_change(false), 193 quic_migrate_sessions_on_network_change(false),
194 quic_migrate_sessions_early(false), 194 quic_migrate_sessions_early(false),
195 quic_disable_bidirectional_streams(false), 195 quic_disable_bidirectional_streams(false),
196 quic_race_cert_verification(false) {} 196 quic_race_cert_verification(false) {}
197 197
198 URLRequestContextBuilder::HttpNetworkSessionParams::~HttpNetworkSessionParams() 198 URLRequestContextBuilder::HttpNetworkSessionParams::~HttpNetworkSessionParams()
199 {} 199 {}
200 200
201 void URLRequestContextBuilder::HttpNetworkSessionParams::ConfigureSessionParams(
202 HttpNetworkSession::Params* network_session_params) const {
203 network_session_params->host_mapping_rules = host_mapping_rules;
204 network_session_params->ignore_certificate_errors = ignore_certificate_errors;
205 network_session_params->testing_fixed_http_port = testing_fixed_http_port;
206 network_session_params->testing_fixed_https_port = testing_fixed_https_port;
207
208 network_session_params->enable_http2 = enable_http2;
209
210 network_session_params->enable_quic = enable_quic;
211 network_session_params->quic_user_agent_id = quic_user_agent_id;
212 network_session_params->quic_max_server_configs_stored_in_properties =
213 quic_max_server_configs_stored_in_properties;
214 network_session_params->quic_connection_options = quic_connection_options;
215 network_session_params->quic_close_sessions_on_ip_change =
216 quic_close_sessions_on_ip_change;
217 network_session_params->quic_idle_connection_timeout_seconds =
218 quic_idle_connection_timeout_seconds;
219 network_session_params->quic_migrate_sessions_on_network_change =
220 quic_migrate_sessions_on_network_change;
221 network_session_params->quic_migrate_sessions_early =
222 quic_migrate_sessions_early;
223 network_session_params->quic_disable_bidirectional_streams =
224 quic_disable_bidirectional_streams;
225 network_session_params->quic_race_cert_verification =
226 quic_race_cert_verification;
227 }
228
201 URLRequestContextBuilder::URLRequestContextBuilder() 229 URLRequestContextBuilder::URLRequestContextBuilder()
202 : name_(nullptr), 230 : name_(nullptr),
203 enable_brotli_(false), 231 enable_brotli_(false),
204 network_quality_estimator_(nullptr), 232 network_quality_estimator_(nullptr),
205 data_enabled_(false), 233 data_enabled_(false),
206 #if !BUILDFLAG(DISABLE_FILE_SUPPORT) 234 #if !BUILDFLAG(DISABLE_FILE_SUPPORT)
207 file_enabled_(false), 235 file_enabled_(false),
208 #endif 236 #endif
209 #if !BUILDFLAG(DISABLE_FTP_SUPPORT) 237 #if !BUILDFLAG(DISABLE_FTP_SUPPORT)
210 ftp_enabled_(false), 238 ftp_enabled_(false),
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 434 }
407 storage->set_ct_policy_enforcer(base::MakeUnique<CTPolicyEnforcer>()); 435 storage->set_ct_policy_enforcer(base::MakeUnique<CTPolicyEnforcer>());
408 436
409 if (throttling_enabled_) { 437 if (throttling_enabled_) {
410 storage->set_throttler_manager( 438 storage->set_throttler_manager(
411 base::MakeUnique<URLRequestThrottlerManager>()); 439 base::MakeUnique<URLRequestThrottlerManager>());
412 } 440 }
413 441
414 HttpNetworkSession::Params network_session_params; 442 HttpNetworkSession::Params network_session_params;
415 SetHttpNetworkSessionComponents(context.get(), &network_session_params); 443 SetHttpNetworkSessionComponents(context.get(), &network_session_params);
444 http_network_session_params_.ConfigureSessionParams(&network_session_params);
416 445
417 network_session_params.ignore_certificate_errors =
418 http_network_session_params_.ignore_certificate_errors;
419 network_session_params.host_mapping_rules =
420 http_network_session_params_.host_mapping_rules;
421 network_session_params.testing_fixed_http_port =
422 http_network_session_params_.testing_fixed_http_port;
423 network_session_params.testing_fixed_https_port =
424 http_network_session_params_.testing_fixed_https_port;
425 network_session_params.enable_http2 =
426 http_network_session_params_.enable_http2;
427 network_session_params.enable_quic = http_network_session_params_.enable_quic;
428 network_session_params.quic_max_server_configs_stored_in_properties =
429 http_network_session_params_.quic_max_server_configs_stored_in_properties;
430 network_session_params.quic_idle_connection_timeout_seconds =
431 http_network_session_params_.quic_idle_connection_timeout_seconds;
432 network_session_params.quic_connection_options =
433 http_network_session_params_.quic_connection_options;
434 network_session_params.quic_close_sessions_on_ip_change =
435 http_network_session_params_.quic_close_sessions_on_ip_change;
436 network_session_params.quic_migrate_sessions_on_network_change =
437 http_network_session_params_.quic_migrate_sessions_on_network_change;
438 network_session_params.quic_user_agent_id =
439 http_network_session_params_.quic_user_agent_id;
440 network_session_params.quic_migrate_sessions_early =
441 http_network_session_params_.quic_migrate_sessions_early;
442 network_session_params.quic_disable_bidirectional_streams =
443 http_network_session_params_.quic_disable_bidirectional_streams;
444 network_session_params.quic_race_cert_verification =
445 http_network_session_params_.quic_race_cert_verification;
446 if (proxy_delegate_) { 446 if (proxy_delegate_) {
447 network_session_params.proxy_delegate = proxy_delegate_.get(); 447 network_session_params.proxy_delegate = proxy_delegate_.get();
448 storage->set_proxy_delegate(std::move(proxy_delegate_)); 448 storage->set_proxy_delegate(std::move(proxy_delegate_));
449 } 449 }
450 if (socket_performance_watcher_factory_) { 450 if (socket_performance_watcher_factory_) {
451 network_session_params.socket_performance_watcher_factory = 451 network_session_params.socket_performance_watcher_factory =
452 socket_performance_watcher_factory_; 452 socket_performance_watcher_factory_;
453 } 453 }
454 454
455 storage->set_http_network_session( 455 storage->set_http_network_session(
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 } 518 }
519 url_request_interceptors_.clear(); 519 url_request_interceptors_.clear();
520 } 520 }
521 storage->set_job_factory(std::move(top_job_factory)); 521 storage->set_job_factory(std::move(top_job_factory));
522 // TODO(willchan): Support sdch. 522 // TODO(willchan): Support sdch.
523 523
524 return std::move(context); 524 return std::move(context);
525 } 525 }
526 526
527 } // namespace net 527 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context_builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698