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 "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 12 matching lines...) Expand all Loading... | |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
| 27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/resource_context.h" | 29 #include "content/public/browser/resource_context.h" |
| 30 #include "net/base/server_bound_cert_service.h" | 30 #include "net/base/server_bound_cert_service.h" |
| 31 #include "net/ftp/ftp_network_layer.h" | 31 #include "net/ftp/ftp_network_layer.h" |
| 32 #include "net/http/http_cache.h" | 32 #include "net/http/http_cache.h" |
| 33 #include "net/url_request/ftp_protocol_handler.h" | |
| 33 #include "net/url_request/url_request_job_factory.h" | 34 #include "net/url_request/url_request_job_factory.h" |
| 34 #include "webkit/quota/special_storage_policy.h" | 35 #include "webkit/quota/special_storage_policy.h" |
| 35 | 36 |
| 36 using content::BrowserThread; | 37 using content::BrowserThread; |
| 37 | 38 |
| 38 ProfileImplIOData::Handle::Handle(Profile* profile) | 39 ProfileImplIOData::Handle::Handle(Profile* profile) |
| 39 : io_data_(new ProfileImplIOData), | 40 : io_data_(new ProfileImplIOData), |
| 40 profile_(profile), | 41 profile_(profile), |
| 41 initialized_(false) { | 42 initialized_(false) { |
| 42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 main_http_factory_.reset(main_cache); | 429 main_http_factory_.reset(main_cache); |
| 429 media_http_factory_.reset(media_cache); | 430 media_http_factory_.reset(media_cache); |
| 430 main_context->set_http_transaction_factory(main_cache); | 431 main_context->set_http_transaction_factory(main_cache); |
| 431 media_request_context_->set_http_transaction_factory(media_cache); | 432 media_request_context_->set_http_transaction_factory(media_cache); |
| 432 | 433 |
| 433 ftp_factory_.reset( | 434 ftp_factory_.reset( |
| 434 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 435 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
| 435 main_context->set_ftp_transaction_factory(ftp_factory_.get()); | 436 main_context->set_ftp_transaction_factory(ftp_factory_.get()); |
| 436 media_request_context_->set_ftp_transaction_factory(ftp_factory_.get()); | 437 media_request_context_->set_ftp_transaction_factory(ftp_factory_.get()); |
| 437 | 438 |
| 439 ftp_auth_cache_.reset(new net::FtpAuthCache); | |
| 440 | |
| 438 main_context->set_chrome_url_data_manager_backend( | 441 main_context->set_chrome_url_data_manager_backend( |
| 439 chrome_url_data_manager_backend()); | 442 chrome_url_data_manager_backend()); |
| 440 | 443 |
| 441 main_context->set_job_factory(job_factory()); | 444 main_factory_.reset(new net::URLRequestJobFactory); |
|
erikwright (departed)
2012/06/13 15:31:42
rename as requested in OffTheRecord...
shalev
2012/06/21 20:04:55
Done.
| |
| 442 media_request_context_->set_job_factory(job_factory()); | 445 media_request_factory_.reset(new net::URLRequestJobFactory); |
| 443 extensions_context->set_job_factory(job_factory()); | 446 extensions_factory_.reset(new net::URLRequestJobFactory); |
| 444 | 447 |
| 445 job_factory()->AddInterceptor( | 448 SetUpJobFactoryDefaults(main_factory_.get()); |
| 449 SetUpJobFactoryDefaults(media_request_factory_.get()); | |
| 450 SetUpJobFactoryDefaults(extensions_factory_.get()); | |
| 451 | |
| 452 main_factory_->SetProtocolHandler(chrome::kFtpScheme, | |
| 453 new net::FtpProtocolHandler( | |
| 454 network_delegate(), ftp_factory_.get(), ftp_auth_cache_.get())); | |
| 455 media_request_factory_->SetProtocolHandler(chrome::kFtpScheme, | |
| 456 new net::FtpProtocolHandler( | |
| 457 network_delegate(), ftp_factory_.get(), ftp_auth_cache_.get())); | |
| 458 extensions_factory_->SetProtocolHandler(chrome::kFtpScheme, | |
| 459 new net::FtpProtocolHandler( | |
| 460 network_delegate(), ftp_factory_.get(), ftp_auth_cache_.get())); | |
| 461 | |
| 462 main_factory_->AddInterceptor( | |
| 446 new chrome_browser_net::ConnectInterceptor(predictor_.get())); | 463 new chrome_browser_net::ConnectInterceptor(predictor_.get())); |
| 464 media_request_factory_->AddInterceptor( | |
| 465 new chrome_browser_net::ConnectInterceptor(predictor_.get())); | |
| 466 extensions_factory_->AddInterceptor( | |
| 467 new chrome_browser_net::ConnectInterceptor(predictor_.get())); | |
| 468 | |
| 469 main_context->set_job_factory(main_factory_.get()); | |
| 470 media_request_context_->set_job_factory(media_request_factory_.get()); | |
| 471 extensions_context->set_job_factory(extensions_factory_.get()); | |
| 447 | 472 |
| 448 lazy_params_.reset(); | 473 lazy_params_.reset(); |
| 449 } | 474 } |
| 450 | 475 |
| 451 ChromeURLRequestContext* | 476 ChromeURLRequestContext* |
| 452 ProfileImplIOData::InitializeAppRequestContext( | 477 ProfileImplIOData::InitializeAppRequestContext( |
| 453 ChromeURLRequestContext* main_context, | 478 ChromeURLRequestContext* main_context, |
| 454 const std::string& app_id) const { | 479 const std::string& app_id) const { |
| 455 AppRequestContext* context = new AppRequestContext; | 480 AppRequestContext* context = new AppRequestContext; |
| 456 | 481 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 532 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 557 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
| 533 base::Time time) { | 558 base::Time time) { |
| 534 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 559 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 535 LazyInitialize(); | 560 LazyInitialize(); |
| 536 | 561 |
| 537 DCHECK(transport_security_state()); | 562 DCHECK(transport_security_state()); |
| 538 transport_security_state()->DeleteSince(time); | 563 transport_security_state()->DeleteSince(time); |
| 539 DCHECK(http_server_properties_manager()); | 564 DCHECK(http_server_properties_manager()); |
| 540 http_server_properties_manager()->Clear(); | 565 http_server_properties_manager()->Clear(); |
| 541 } | 566 } |
| OLD | NEW |