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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 media_request_context_->set_http_transaction_factory(media_cache); | 430 media_request_context_->set_http_transaction_factory(media_cache); |
431 | 431 |
432 ftp_factory_.reset( | 432 ftp_factory_.reset( |
433 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 433 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
434 main_context->set_ftp_transaction_factory(ftp_factory_.get()); | 434 main_context->set_ftp_transaction_factory(ftp_factory_.get()); |
435 media_request_context_->set_ftp_transaction_factory(ftp_factory_.get()); | 435 media_request_context_->set_ftp_transaction_factory(ftp_factory_.get()); |
436 | 436 |
437 main_context->set_chrome_url_data_manager_backend( | 437 main_context->set_chrome_url_data_manager_backend( |
438 chrome_url_data_manager_backend()); | 438 chrome_url_data_manager_backend()); |
439 | 439 |
440 main_context->set_job_factory(job_factory()); | 440 main_job_factory_.reset(new net::URLRequestJobFactory); |
441 media_request_context_->set_job_factory(job_factory()); | 441 media_request_job_factory_.reset(new net::URLRequestJobFactory); |
442 extensions_context->set_job_factory(job_factory()); | 442 extensions_job_factory_.reset(new net::URLRequestJobFactory); |
443 | 443 |
444 job_factory()->AddInterceptor( | 444 net::URLRequestJobFactory* job_factories[3]; |
445 new chrome_browser_net::ConnectInterceptor(predictor_.get())); | 445 job_factories[0] = main_job_factory_.get(); |
| 446 job_factories[1] = media_request_job_factory_.get(); |
| 447 job_factories[2] = extensions_job_factory_.get(); |
| 448 |
| 449 for (int i = 0; i < 3; i++) { |
| 450 SetUpJobFactoryDefaults(job_factories[i]); |
| 451 job_factories[i]->AddInterceptor( |
| 452 new chrome_browser_net::ConnectInterceptor(predictor_.get())); |
| 453 } |
| 454 |
| 455 main_context->set_job_factory(main_job_factory_.get()); |
| 456 media_request_context_->set_job_factory(media_request_job_factory_.get()); |
| 457 extensions_context->set_job_factory(extensions_job_factory_.get()); |
446 | 458 |
447 lazy_params_.reset(); | 459 lazy_params_.reset(); |
448 } | 460 } |
449 | 461 |
450 ChromeURLRequestContext* | 462 ChromeURLRequestContext* |
451 ProfileImplIOData::InitializeAppRequestContext( | 463 ProfileImplIOData::InitializeAppRequestContext( |
452 ChromeURLRequestContext* main_context, | 464 ChromeURLRequestContext* main_context, |
453 const std::string& app_id) const { | 465 const std::string& app_id) const { |
454 AppRequestContext* context = new AppRequestContext; | 466 AppRequestContext* context = new AppRequestContext; |
455 | 467 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 543 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
532 base::Time time) { | 544 base::Time time) { |
533 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 545 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
534 LazyInitialize(); | 546 LazyInitialize(); |
535 | 547 |
536 DCHECK(transport_security_state()); | 548 DCHECK(transport_security_state()); |
537 transport_security_state()->DeleteSince(time); | 549 transport_security_state()->DeleteSince(time); |
538 DCHECK(http_server_properties_manager()); | 550 DCHECK(http_server_properties_manager()); |
539 http_server_properties_manager()->Clear(); | 551 http_server_properties_manager()->Clear(); |
540 } | 552 } |
OLD | NEW |