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