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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 449 |
450 // Create a media request context based on the main context, but using a | 450 // Create a media request context based on the main context, but using a |
451 // media cache. | 451 // media cache. |
452 media_request_context_.reset(InitializeMediaRequestContext(main_context, "")); | 452 media_request_context_.reset(InitializeMediaRequestContext(main_context, "")); |
453 | 453 |
454 main_job_factory_.reset(new net::URLRequestJobFactory); | 454 main_job_factory_.reset(new net::URLRequestJobFactory); |
455 media_request_job_factory_.reset(new net::URLRequestJobFactory); | 455 media_request_job_factory_.reset(new net::URLRequestJobFactory); |
456 extensions_job_factory_.reset(new net::URLRequestJobFactory); | 456 extensions_job_factory_.reset(new net::URLRequestJobFactory); |
457 | 457 |
458 int set_protocol = main_job_factory_->SetProtocolHandler( | 458 int set_protocol = main_job_factory_->SetProtocolHandler( |
459 chrome::kFileScheme, new net::FileProtocolHandler(network_delegate())); | 459 chrome::kFileScheme, new net::FileProtocolHandler()); |
460 DCHECK(set_protocol); | 460 DCHECK(set_protocol); |
461 set_protocol = media_request_job_factory_->SetProtocolHandler( | 461 set_protocol = media_request_job_factory_->SetProtocolHandler( |
462 chrome::kFileScheme, new net::FileProtocolHandler(network_delegate())); | 462 chrome::kFileScheme, new net::FileProtocolHandler()); |
463 DCHECK(set_protocol); | 463 DCHECK(set_protocol); |
464 // TODO(shalev): Without a network_delegate this protocol handler will never | 464 // TODO(shalev): The extensions_job_factory has a NULL NetworkDelegate. |
| 465 // Without a network_delegate, this protocol handler will never |
465 // handle file: requests, but as a side effect it makes | 466 // handle file: requests, but as a side effect it makes |
466 // job_factory::IsHandledProtocol return true, which prevents attempts to | 467 // job_factory::IsHandledProtocol return true, which prevents attempts to |
467 // handle the protocol externally. | 468 // handle the protocol externally. |
468 set_protocol = extensions_job_factory_->SetProtocolHandler( | 469 set_protocol = extensions_job_factory_->SetProtocolHandler( |
469 chrome::kFileScheme, new net::FileProtocolHandler(NULL)); | 470 chrome::kFileScheme, new net::FileProtocolHandler()); |
470 DCHECK(set_protocol); | 471 DCHECK(set_protocol); |
471 | 472 |
472 set_protocol = main_job_factory_->SetProtocolHandler( | 473 set_protocol = main_job_factory_->SetProtocolHandler( |
473 chrome::kChromeDevToolsScheme, | 474 chrome::kChromeDevToolsScheme, |
474 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend(), | 475 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend(), |
475 network_delegate())); | 476 network_delegate())); |
476 DCHECK(set_protocol); | 477 DCHECK(set_protocol); |
477 set_protocol = media_request_job_factory_->SetProtocolHandler( | 478 set_protocol = media_request_job_factory_->SetProtocolHandler( |
478 chrome::kChromeDevToolsScheme, | 479 chrome::kChromeDevToolsScheme, |
479 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend(), | 480 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend(), |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 chrome_browser_net::LoadTimeStats* ProfileImplIOData::GetLoadTimeStats( | 656 chrome_browser_net::LoadTimeStats* ProfileImplIOData::GetLoadTimeStats( |
656 IOThread::Globals* io_thread_globals) const { | 657 IOThread::Globals* io_thread_globals) const { |
657 return io_thread_globals->load_time_stats.get(); | 658 return io_thread_globals->load_time_stats.get(); |
658 } | 659 } |
659 | 660 |
660 void ProfileImplIOData::CreateFtpProtocolHandler( | 661 void ProfileImplIOData::CreateFtpProtocolHandler( |
661 net::URLRequestJobFactory* job_factory, | 662 net::URLRequestJobFactory* job_factory, |
662 net::FtpAuthCache* ftp_auth_cache) const { | 663 net::FtpAuthCache* ftp_auth_cache) const { |
663 job_factory->SetProtocolHandler( | 664 job_factory->SetProtocolHandler( |
664 chrome::kFtpScheme, | 665 chrome::kFtpScheme, |
665 new net::FtpProtocolHandler(network_delegate(), | 666 new net::FtpProtocolHandler(ftp_factory_.get(), |
666 ftp_factory_.get(), | |
667 ftp_auth_cache)); | 667 ftp_auth_cache)); |
668 } | 668 } |
669 | 669 |
670 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 670 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
671 base::Time time) { | 671 base::Time time) { |
672 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 672 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
673 LazyInitialize(); | 673 LazyInitialize(); |
674 | 674 |
675 DCHECK(transport_security_state()); | 675 DCHECK(transport_security_state()); |
676 transport_security_state()->DeleteSince(time); | 676 transport_security_state()->DeleteSince(time); |
677 DCHECK(http_server_properties_manager()); | 677 DCHECK(http_server_properties_manager()); |
678 http_server_properties_manager()->Clear(); | 678 http_server_properties_manager()->Clear(); |
679 } | 679 } |
OLD | NEW |