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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 trusted_spdy_proxy); | 433 trusted_spdy_proxy); |
434 | 434 |
435 if (record_mode || playback_mode) { | 435 if (record_mode || playback_mode) { |
436 main_cache->set_mode( | 436 main_cache->set_mode( |
437 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | 437 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); |
438 } | 438 } |
439 | 439 |
440 main_http_factory_.reset(main_cache); | 440 main_http_factory_.reset(main_cache); |
441 main_context->set_http_transaction_factory(main_cache); | 441 main_context->set_http_transaction_factory(main_cache); |
442 | 442 |
| 443 #if !defined(DISABLE_FTP_SUPPORT) |
443 ftp_factory_.reset( | 444 ftp_factory_.reset( |
444 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 445 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
445 main_context->set_ftp_transaction_factory(ftp_factory_.get()); | 446 main_context->set_ftp_transaction_factory(ftp_factory_.get()); |
| 447 #endif // !defined(DISABLE_FTP_SUPPORT) |
446 | 448 |
447 main_context->set_chrome_url_data_manager_backend( | 449 main_context->set_chrome_url_data_manager_backend( |
448 chrome_url_data_manager_backend()); | 450 chrome_url_data_manager_backend()); |
449 | 451 |
450 // Create a media request context based on the main context, but using a | 452 // Create a media request context based on the main context, but using a |
451 // media cache. | 453 // media cache. |
452 media_request_context_.reset(InitializeMediaRequestContext(main_context, "")); | 454 media_request_context_.reset(InitializeMediaRequestContext(main_context, "")); |
453 | 455 |
454 main_job_factory_.reset(new net::URLRequestJobFactoryImpl); | 456 main_job_factory_.reset(new net::URLRequestJobFactoryImpl); |
455 media_request_job_factory_.reset(new net::URLRequestJobFactoryImpl); | 457 media_request_job_factory_.reset(new net::URLRequestJobFactoryImpl); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 } | 656 } |
655 | 657 |
656 chrome_browser_net::LoadTimeStats* ProfileImplIOData::GetLoadTimeStats( | 658 chrome_browser_net::LoadTimeStats* ProfileImplIOData::GetLoadTimeStats( |
657 IOThread::Globals* io_thread_globals) const { | 659 IOThread::Globals* io_thread_globals) const { |
658 return io_thread_globals->load_time_stats.get(); | 660 return io_thread_globals->load_time_stats.get(); |
659 } | 661 } |
660 | 662 |
661 void ProfileImplIOData::CreateFtpProtocolHandler( | 663 void ProfileImplIOData::CreateFtpProtocolHandler( |
662 net::URLRequestJobFactory* job_factory, | 664 net::URLRequestJobFactory* job_factory, |
663 net::FtpAuthCache* ftp_auth_cache) const { | 665 net::FtpAuthCache* ftp_auth_cache) const { |
| 666 #if !defined(DISABLE_FTP_SUPPORT) |
664 job_factory->SetProtocolHandler( | 667 job_factory->SetProtocolHandler( |
665 chrome::kFtpScheme, | 668 chrome::kFtpScheme, |
666 new net::FtpProtocolHandler(ftp_factory_.get(), | 669 new net::FtpProtocolHandler(ftp_factory_.get(), |
667 ftp_auth_cache)); | 670 ftp_auth_cache)); |
| 671 #endif // !defined(DISABLE_FTP_SUPPORT) |
668 } | 672 } |
669 | 673 |
670 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 674 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
671 base::Time time) { | 675 base::Time time) { |
672 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 676 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
673 LazyInitialize(); | 677 LazyInitialize(); |
674 | 678 |
675 DCHECK(transport_security_state()); | 679 DCHECK(transport_security_state()); |
676 transport_security_state()->DeleteSince(time); | 680 transport_security_state()->DeleteSince(time); |
677 DCHECK(http_server_properties_manager()); | 681 DCHECK(http_server_properties_manager()); |
678 http_server_properties_manager()->Clear(); | 682 http_server_properties_manager()->Clear(); |
679 } | 683 } |
OLD | NEW |