| 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_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 // object to the IO thread after this function. | 553 // object to the IO thread after this function. |
| 554 BrowserContext::EnsureResourceContextInitialized(profile); | 554 BrowserContext::EnsureResourceContextInitialized(profile); |
| 555 } | 555 } |
| 556 | 556 |
| 557 ProfileIOData::MediaRequestContext::MediaRequestContext() { | 557 ProfileIOData::MediaRequestContext::MediaRequestContext() { |
| 558 } | 558 } |
| 559 | 559 |
| 560 void ProfileIOData::MediaRequestContext::SetHttpTransactionFactory( | 560 void ProfileIOData::MediaRequestContext::SetHttpTransactionFactory( |
| 561 std::unique_ptr<net::HttpTransactionFactory> http_factory) { | 561 std::unique_ptr<net::HttpTransactionFactory> http_factory) { |
| 562 http_factory_ = std::move(http_factory); | 562 http_factory_ = std::move(http_factory); |
| 563 set_name_string("media"); |
| 563 set_http_transaction_factory(http_factory_.get()); | 564 set_http_transaction_factory(http_factory_.get()); |
| 564 } | 565 } |
| 565 | 566 |
| 566 ProfileIOData::MediaRequestContext::~MediaRequestContext() { | 567 ProfileIOData::MediaRequestContext::~MediaRequestContext() { |
| 567 AssertNoURLRequests(); | 568 AssertNoURLRequests(); |
| 568 } | 569 } |
| 569 | 570 |
| 570 ProfileIOData::AppRequestContext::AppRequestContext() { | 571 ProfileIOData::AppRequestContext::AppRequestContext() { |
| 571 } | 572 } |
| 572 | 573 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 583 } | 584 } |
| 584 | 585 |
| 585 void ProfileIOData::AppRequestContext::SetHttpNetworkSession( | 586 void ProfileIOData::AppRequestContext::SetHttpNetworkSession( |
| 586 std::unique_ptr<net::HttpNetworkSession> http_network_session) { | 587 std::unique_ptr<net::HttpNetworkSession> http_network_session) { |
| 587 http_network_session_ = std::move(http_network_session); | 588 http_network_session_ = std::move(http_network_session); |
| 588 } | 589 } |
| 589 | 590 |
| 590 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( | 591 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( |
| 591 std::unique_ptr<net::HttpTransactionFactory> http_factory) { | 592 std::unique_ptr<net::HttpTransactionFactory> http_factory) { |
| 592 http_factory_ = std::move(http_factory); | 593 http_factory_ = std::move(http_factory); |
| 594 set_name_string("app_request"); |
| 593 set_http_transaction_factory(http_factory_.get()); | 595 set_http_transaction_factory(http_factory_.get()); |
| 594 } | 596 } |
| 595 | 597 |
| 596 void ProfileIOData::AppRequestContext::SetJobFactory( | 598 void ProfileIOData::AppRequestContext::SetJobFactory( |
| 597 std::unique_ptr<net::URLRequestJobFactory> job_factory) { | 599 std::unique_ptr<net::URLRequestJobFactory> job_factory) { |
| 598 job_factory_ = std::move(job_factory); | 600 job_factory_ = std::move(job_factory); |
| 599 set_job_factory(job_factory_.get()); | 601 set_job_factory(job_factory_.get()); |
| 600 } | 602 } |
| 601 | 603 |
| 602 ProfileIOData::AppRequestContext::~AppRequestContext() { | 604 ProfileIOData::AppRequestContext::~AppRequestContext() { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 IOThread* const io_thread = profile_params_->io_thread; | 1017 IOThread* const io_thread = profile_params_->io_thread; |
| 1016 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 1018 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
| 1017 const base::CommandLine& command_line = | 1019 const base::CommandLine& command_line = |
| 1018 *base::CommandLine::ForCurrentProcess(); | 1020 *base::CommandLine::ForCurrentProcess(); |
| 1019 | 1021 |
| 1020 // Create the common request contexts. | 1022 // Create the common request contexts. |
| 1021 main_request_context_.reset(new net::URLRequestContext()); | 1023 main_request_context_.reset(new net::URLRequestContext()); |
| 1022 main_request_context_storage_.reset( | 1024 main_request_context_storage_.reset( |
| 1023 new net::URLRequestContextStorage(main_request_context_.get())); | 1025 new net::URLRequestContextStorage(main_request_context_.get())); |
| 1024 extensions_request_context_.reset(new net::URLRequestContext()); | 1026 extensions_request_context_.reset(new net::URLRequestContext()); |
| 1027 main_request_context_->set_name_string("main"); |
| 1028 extensions_request_context_->set_name_string("extensions"); |
| 1025 | 1029 |
| 1026 main_request_context_->set_enable_brotli(io_thread_globals->enable_brotli); | 1030 main_request_context_->set_enable_brotli(io_thread_globals->enable_brotli); |
| 1027 | 1031 |
| 1028 std::unique_ptr<ChromeNetworkDelegate> network_delegate( | 1032 std::unique_ptr<ChromeNetworkDelegate> network_delegate( |
| 1029 new ChromeNetworkDelegate( | 1033 new ChromeNetworkDelegate( |
| 1030 #if defined(ENABLE_EXTENSIONS) | 1034 #if defined(ENABLE_EXTENSIONS) |
| 1031 io_thread_globals->extension_event_router_forwarder.get(), | 1035 io_thread_globals->extension_event_router_forwarder.get(), |
| 1032 #else | 1036 #else |
| 1033 NULL, | 1037 NULL, |
| 1034 #endif | 1038 #endif |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 void ProfileIOData::SetCookieSettingsForTesting( | 1358 void ProfileIOData::SetCookieSettingsForTesting( |
| 1355 content_settings::CookieSettings* cookie_settings) { | 1359 content_settings::CookieSettings* cookie_settings) { |
| 1356 DCHECK(!cookie_settings_.get()); | 1360 DCHECK(!cookie_settings_.get()); |
| 1357 cookie_settings_ = cookie_settings; | 1361 cookie_settings_ = cookie_settings; |
| 1358 } | 1362 } |
| 1359 | 1363 |
| 1360 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 1364 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( |
| 1361 const GURL& url) const { | 1365 const GURL& url) const { |
| 1362 return url_blacklist_manager_->GetURLBlacklistState(url); | 1366 return url_blacklist_manager_->GetURLBlacklistState(url); |
| 1363 } | 1367 } |
| OLD | NEW |