OLD | NEW |
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 quic_close_sessions_on_ip_change(false), | 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 URLRequestContextBuilder::URLRequestContextBuilder() | 201 URLRequestContextBuilder::URLRequestContextBuilder() |
202 : data_enabled_(false), | 202 : name_(nullptr), |
| 203 enable_brotli_(false), |
| 204 network_quality_estimator_(nullptr), |
| 205 data_enabled_(false), |
203 #if !BUILDFLAG(DISABLE_FILE_SUPPORT) | 206 #if !BUILDFLAG(DISABLE_FILE_SUPPORT) |
204 file_enabled_(false), | 207 file_enabled_(false), |
205 #endif | 208 #endif |
206 #if !BUILDFLAG(DISABLE_FTP_SUPPORT) | 209 #if !BUILDFLAG(DISABLE_FTP_SUPPORT) |
207 ftp_enabled_(false), | 210 ftp_enabled_(false), |
208 #endif | 211 #endif |
209 http_cache_enabled_(true), | 212 http_cache_enabled_(true), |
210 throttling_enabled_(false), | 213 throttling_enabled_(false), |
211 sdch_enabled_(false), | 214 sdch_enabled_(false), |
212 cookie_store_set_by_client_(false), | 215 cookie_store_set_by_client_(false), |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 void URLRequestContextBuilder::SetHttpServerProperties( | 297 void URLRequestContextBuilder::SetHttpServerProperties( |
295 std::unique_ptr<HttpServerProperties> http_server_properties) { | 298 std::unique_ptr<HttpServerProperties> http_server_properties) { |
296 http_server_properties_ = std::move(http_server_properties); | 299 http_server_properties_ = std::move(http_server_properties); |
297 } | 300 } |
298 | 301 |
299 std::unique_ptr<URLRequestContext> URLRequestContextBuilder::Build() { | 302 std::unique_ptr<URLRequestContext> URLRequestContextBuilder::Build() { |
300 std::unique_ptr<ContainerURLRequestContext> context( | 303 std::unique_ptr<ContainerURLRequestContext> context( |
301 new ContainerURLRequestContext(file_task_runner_)); | 304 new ContainerURLRequestContext(file_task_runner_)); |
302 URLRequestContextStorage* storage = context->storage(); | 305 URLRequestContextStorage* storage = context->storage(); |
303 | 306 |
| 307 context->set_name(name_); |
| 308 context->set_enable_brotli(enable_brotli_); |
| 309 context->set_network_quality_estimator(network_quality_estimator_); |
| 310 |
304 storage->set_http_user_agent_settings( | 311 storage->set_http_user_agent_settings( |
305 base::MakeUnique<StaticHttpUserAgentSettings>(accept_language_, | 312 base::MakeUnique<StaticHttpUserAgentSettings>(accept_language_, |
306 user_agent_)); | 313 user_agent_)); |
307 | 314 |
308 if (!network_delegate_) | 315 if (!network_delegate_) |
309 network_delegate_.reset(new BasicNetworkDelegate); | 316 network_delegate_.reset(new BasicNetworkDelegate); |
310 storage->set_network_delegate(std::move(network_delegate_)); | 317 storage->set_network_delegate(std::move(network_delegate_)); |
311 | 318 |
312 if (net_log_) { | 319 if (net_log_) { |
313 // Unlike the other builder parameters, |net_log_| is not owned by the | 320 // Unlike the other builder parameters, |net_log_| is not owned by the |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 } | 519 } |
513 url_request_interceptors_.clear(); | 520 url_request_interceptors_.clear(); |
514 } | 521 } |
515 storage->set_job_factory(std::move(top_job_factory)); | 522 storage->set_job_factory(std::move(top_job_factory)); |
516 // TODO(willchan): Support sdch. | 523 // TODO(willchan): Support sdch. |
517 | 524 |
518 return std::move(context); | 525 return std::move(context); |
519 } | 526 } |
520 | 527 |
521 } // namespace net | 528 } // namespace net |
OLD | NEW |