| 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 <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 644 } |
| 645 std::unique_ptr<net::ChannelIDService> channel_id_service( | 645 std::unique_ptr<net::ChannelIDService> channel_id_service( |
| 646 new net::ChannelIDService( | 646 new net::ChannelIDService( |
| 647 new net::DefaultChannelIDStore(channel_id_db.get()))); | 647 new net::DefaultChannelIDStore(channel_id_db.get()))); |
| 648 cookie_config.channel_id_service = channel_id_service.get(); | 648 cookie_config.channel_id_service = channel_id_service.get(); |
| 649 cookie_config.background_task_runner = cookie_background_task_runner; | 649 cookie_config.background_task_runner = cookie_background_task_runner; |
| 650 cookie_store = content::CreateCookieStore(cookie_config); | 650 cookie_store = content::CreateCookieStore(cookie_config); |
| 651 cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); | 651 cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); |
| 652 | 652 |
| 653 // Build a new HttpNetworkSession that uses the new ChannelIDService. | 653 // Build a new HttpNetworkSession that uses the new ChannelIDService. |
| 654 // TODO(mmenke): It weird to combine state from | 654 // TODO(mmenke): It's weird to combine state from |
| 655 // main_request_context_storage() objects and the argumet to this method, | 655 // main_request_context_storage() objects and the argumet to this method, |
| 656 // |main_context|. Remove |main_context| as an argument, and just use | 656 // |main_context|. Remove |main_context| as an argument, and just use |
| 657 // main_context() instead. | 657 // main_context() instead. |
| 658 net::HttpNetworkSession::Params network_params = | 658 net::HttpNetworkSession::Context session_context = |
| 659 main_request_context_storage()->http_network_session()->params(); | 659 main_request_context_storage()->http_network_session()->context(); |
| 660 network_params.channel_id_service = channel_id_service.get(); | 660 session_context.channel_id_service = channel_id_service.get(); |
| 661 std::unique_ptr<net::HttpNetworkSession> http_network_session( | 661 std::unique_ptr<net::HttpNetworkSession> http_network_session( |
| 662 new net::HttpNetworkSession(network_params)); | 662 new net::HttpNetworkSession( |
| 663 main_request_context_storage()->http_network_session()->params(), |
| 664 session_context)); |
| 663 std::unique_ptr<net::HttpCache> app_http_cache = | 665 std::unique_ptr<net::HttpCache> app_http_cache = |
| 664 CreateMainHttpFactory(http_network_session.get(), std::move(app_backend)); | 666 CreateMainHttpFactory(http_network_session.get(), std::move(app_backend)); |
| 665 | 667 |
| 666 // Transfer ownership of the ChannelIDStore and the HttpNetworkSession to the | 668 // Transfer ownership of the ChannelIDStore and the HttpNetworkSession to the |
| 667 // AppRequestContext. | 669 // AppRequestContext. |
| 668 context->SetChannelIDService(std::move(channel_id_service)); | 670 context->SetChannelIDService(std::move(channel_id_service)); |
| 669 context->SetHttpNetworkSession(std::move(http_network_session)); | 671 context->SetHttpNetworkSession(std::move(http_network_session)); |
| 670 | 672 |
| 671 // Transfer ownership of the cookies and cache to AppRequestContext. | 673 // Transfer ownership of the cookies and cache to AppRequestContext. |
| 672 context->SetCookieStore(std::move(cookie_store)); | 674 context->SetCookieStore(std::move(cookie_store)); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 const base::Closure& completion) { | 795 const base::Closure& completion) { |
| 794 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 796 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 795 DCHECK(initialized()); | 797 DCHECK(initialized()); |
| 796 | 798 |
| 797 DCHECK(transport_security_state()); | 799 DCHECK(transport_security_state()); |
| 798 // Completes synchronously. | 800 // Completes synchronously. |
| 799 transport_security_state()->DeleteAllDynamicDataSince(time); | 801 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 800 DCHECK(http_server_properties_manager_); | 802 DCHECK(http_server_properties_manager_); |
| 801 http_server_properties_manager_->Clear(completion); | 803 http_server_properties_manager_->Clear(completion); |
| 802 } | 804 } |
| OLD | NEW |