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 "chrome/browser/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
410 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { | 410 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { |
411 trusted_spdy_proxy = command_line.GetSwitchValueASCII( | 411 trusted_spdy_proxy = command_line.GetSwitchValueASCII( |
412 switches::kTrustedSpdyProxy); | 412 switches::kTrustedSpdyProxy); |
413 } | 413 } |
414 net::HttpCache::DefaultBackend* main_backend = | 414 net::HttpCache::DefaultBackend* main_backend = |
415 new net::HttpCache::DefaultBackend( | 415 new net::HttpCache::DefaultBackend( |
416 net::DISK_CACHE, | 416 net::DISK_CACHE, |
417 lazy_params_->cache_path, | 417 lazy_params_->cache_path, |
418 lazy_params_->cache_max_size, | 418 lazy_params_->cache_max_size, |
419 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); | 419 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); |
420 | |
421 net::HttpNetworkSession::Params network_session_params; | |
422 network_session_params.host_resolver = main_context->host_resolver(); | |
423 network_session_params.cert_verifier = main_context->cert_verifier(); | |
424 network_session_params.server_bound_cert_service = | |
425 main_context->server_bound_cert_service(); | |
426 network_session_params.transport_security_state = | |
427 main_context->transport_security_state(); | |
428 network_session_params.proxy_service = main_context->proxy_service(); | |
429 network_session_params.ssl_session_cache_shard = | |
430 GetSSLSessionCacheShard(); | |
431 network_session_params.ssl_config_service = | |
432 main_context->ssl_config_service(); | |
433 network_session_params.http_auth_handler_factory = | |
434 main_context->http_auth_handler_factory(); | |
435 network_session_params.network_delegate = | |
436 main_context->network_delegate(); | |
437 network_session_params.http_server_properties = | |
438 main_context->http_server_properties(); | |
439 network_session_params.net_log = main_context->net_log(); | |
440 network_session_params.host_mapping_rules = | |
441 io_thread_globals->host_mapping_rules.get(); | |
442 network_session_params.ignore_certificate_errors = | |
443 io_thread_globals->ignore_certificate_errors; | |
444 network_session_params.http_pipelining_enabled = | |
445 io_thread_globals->http_pipelining_enabled; | |
446 network_session_params.testing_fixed_http_port = | |
447 io_thread_globals->testing_fixed_http_port; | |
448 network_session_params.testing_fixed_https_port = | |
449 io_thread_globals->testing_fixed_https_port; | |
450 network_session_params.trusted_spdy_proxy = trusted_spdy_proxy; | |
Nico
2012/08/31 17:12:19
This looks fairly similar to off_the_record_profil
szager1
2012/08/31 17:17:43
The type of main_context is ChromeURLRequestContex
mmenke
2012/08/31 17:21:53
Aren't all these parameters also members of net::U
| |
451 | |
420 net::HttpCache* main_cache = new net::HttpCache( | 452 net::HttpCache* main_cache = new net::HttpCache( |
421 main_context->host_resolver(), | 453 network_session_params, main_backend); |
422 main_context->cert_verifier(), | |
423 main_context->server_bound_cert_service(), | |
424 main_context->transport_security_state(), | |
425 main_context->proxy_service(), | |
426 GetSSLSessionCacheShard(), | |
427 main_context->ssl_config_service(), | |
428 main_context->http_auth_handler_factory(), | |
429 main_context->network_delegate(), | |
430 main_context->http_server_properties(), | |
431 main_context->net_log(), | |
432 main_backend, | |
433 trusted_spdy_proxy); | |
434 | 454 |
435 if (record_mode || playback_mode) { | 455 if (record_mode || playback_mode) { |
436 main_cache->set_mode( | 456 main_cache->set_mode( |
437 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | 457 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); |
438 } | 458 } |
439 | 459 |
440 main_http_factory_.reset(main_cache); | 460 main_http_factory_.reset(main_cache); |
441 main_context->set_http_transaction_factory(main_cache); | 461 main_context->set_http_transaction_factory(main_cache); |
442 | 462 |
443 #if !defined(DISABLE_FTP_SUPPORT) | 463 #if !defined(DISABLE_FTP_SUPPORT) |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
674 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 694 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
675 base::Time time) { | 695 base::Time time) { |
676 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 696 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
677 LazyInitialize(); | 697 LazyInitialize(); |
678 | 698 |
679 DCHECK(transport_security_state()); | 699 DCHECK(transport_security_state()); |
680 transport_security_state()->DeleteSince(time); | 700 transport_security_state()->DeleteSince(time); |
681 DCHECK(http_server_properties_manager()); | 701 DCHECK(http_server_properties_manager()); |
682 http_server_properties_manager()->Clear(); | 702 http_server_properties_manager()->Clear(); |
683 } | 703 } |
OLD | NEW |