Chromium Code Reviews| 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 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 380 http_network_session_params_.use_alternative_services; | 380 http_network_session_params_.use_alternative_services; |
| 381 network_session_params.trusted_spdy_proxy = | 381 network_session_params.trusted_spdy_proxy = |
| 382 http_network_session_params_.trusted_spdy_proxy; | 382 http_network_session_params_.trusted_spdy_proxy; |
| 383 network_session_params.next_protos = http_network_session_params_.next_protos; | 383 network_session_params.next_protos = http_network_session_params_.next_protos; |
| 384 network_session_params.enable_quic = http_network_session_params_.enable_quic; | 384 network_session_params.enable_quic = http_network_session_params_.enable_quic; |
| 385 network_session_params.enable_insecure_quic = | 385 network_session_params.enable_insecure_quic = |
| 386 http_network_session_params_.enable_insecure_quic; | 386 http_network_session_params_.enable_insecure_quic; |
| 387 network_session_params.quic_connection_options = | 387 network_session_params.quic_connection_options = |
| 388 http_network_session_params_.quic_connection_options; | 388 http_network_session_params_.quic_connection_options; |
| 389 | 389 |
| 390 storage->set_http_network_session( | |
| 391 make_scoped_ptr(new HttpNetworkSession(network_session_params))); | |
| 392 | |
| 390 HttpTransactionFactory* http_transaction_factory = NULL; | 393 HttpTransactionFactory* http_transaction_factory = NULL; |
|
pauljensen
2015/09/11 13:05:25
nit: remove the " = NULL" like you did in profile_
mmenke
2015/09/11 14:46:50
Done.
| |
| 391 if (http_cache_enabled_) { | 394 if (http_cache_enabled_) { |
| 392 HttpCache::BackendFactory* http_cache_backend = NULL; | 395 HttpCache::BackendFactory* http_cache_backend = NULL; |
| 393 if (http_cache_params_.type == HttpCacheParams::DISK) { | 396 if (http_cache_params_.type == HttpCacheParams::DISK) { |
| 394 http_cache_backend = new HttpCache::DefaultBackend( | 397 http_cache_backend = new HttpCache::DefaultBackend( |
| 395 DISK_CACHE, CACHE_BACKEND_DEFAULT, http_cache_params_.path, | 398 DISK_CACHE, CACHE_BACKEND_DEFAULT, http_cache_params_.path, |
| 396 http_cache_params_.max_size, context->GetFileTaskRunner()); | 399 http_cache_params_.max_size, context->GetFileTaskRunner()); |
| 397 } else { | 400 } else { |
| 398 http_cache_backend = | 401 http_cache_backend = |
| 399 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); | 402 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); |
| 400 } | 403 } |
| 401 | 404 |
| 402 http_transaction_factory = new HttpCache( | 405 http_transaction_factory = new HttpCache(storage->http_network_session(), |
| 403 network_session_params, http_cache_backend); | 406 http_cache_backend, true); |
| 404 } else { | 407 } else { |
| 405 scoped_refptr<HttpNetworkSession> network_session( | 408 http_transaction_factory = |
| 406 new HttpNetworkSession(network_session_params)); | 409 new HttpNetworkLayer(storage->http_network_session()); |
| 407 | |
| 408 http_transaction_factory = new HttpNetworkLayer(network_session.get()); | |
| 409 } | 410 } |
| 410 storage->set_http_transaction_factory(http_transaction_factory); | 411 storage->set_http_transaction_factory(http_transaction_factory); |
| 411 | 412 |
| 412 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl; | 413 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl; |
| 413 if (data_enabled_) | 414 if (data_enabled_) |
| 414 job_factory->SetProtocolHandler("data", | 415 job_factory->SetProtocolHandler("data", |
| 415 make_scoped_ptr(new DataProtocolHandler)); | 416 make_scoped_ptr(new DataProtocolHandler)); |
| 416 | 417 |
| 417 #if !defined(DISABLE_FILE_SUPPORT) | 418 #if !defined(DISABLE_FILE_SUPPORT) |
| 418 if (file_enabled_) { | 419 if (file_enabled_) { |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 444 } | 445 } |
| 445 url_request_interceptors_.weak_clear(); | 446 url_request_interceptors_.weak_clear(); |
| 446 } | 447 } |
| 447 storage->set_job_factory(top_job_factory.release()); | 448 storage->set_job_factory(top_job_factory.release()); |
| 448 // TODO(willchan): Support sdch. | 449 // TODO(willchan): Support sdch. |
| 449 | 450 |
| 450 return context.Pass(); | 451 return context.Pass(); |
| 451 } | 452 } |
| 452 | 453 |
| 453 } // namespace net | 454 } // namespace net |
| OLD | NEW |