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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); | 500 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); |
501 main_context_storage->set_cookie_store( | 501 main_context_storage->set_cookie_store( |
502 content::CreateCookieStore(cookie_config)); | 502 content::CreateCookieStore(cookie_config)); |
503 | 503 |
504 // Set up server bound cert service. | 504 // Set up server bound cert service. |
505 DCHECK(!lazy_params_->channel_id_path.empty()); | 505 DCHECK(!lazy_params_->channel_id_path.empty()); |
506 scoped_refptr<QuotaPolicyChannelIDStore> channel_id_db = | 506 scoped_refptr<QuotaPolicyChannelIDStore> channel_id_db = |
507 new QuotaPolicyChannelIDStore( | 507 new QuotaPolicyChannelIDStore( |
508 lazy_params_->channel_id_path, | 508 lazy_params_->channel_id_path, |
509 base::CreateSequencedTaskRunnerWithTraits( | 509 base::CreateSequencedTaskRunnerWithTraits( |
510 base::TaskTraits().MayBlock().WithPriority( | 510 {base::MayBlock(), base::TaskPriority::BACKGROUND}), |
511 base::TaskPriority::BACKGROUND)), | |
512 lazy_params_->special_storage_policy.get()); | 511 lazy_params_->special_storage_policy.get()); |
513 main_context_storage->set_channel_id_service( | 512 main_context_storage->set_channel_id_service( |
514 base::MakeUnique<net::ChannelIDService>( | 513 base::MakeUnique<net::ChannelIDService>( |
515 new net::DefaultChannelIDStore(channel_id_db.get()))); | 514 new net::DefaultChannelIDStore(channel_id_db.get()))); |
516 | 515 |
517 main_context->cookie_store()->SetChannelIDServiceID( | 516 main_context->cookie_store()->SetChannelIDServiceID( |
518 main_context->channel_id_service()->GetUniqueID()); | 517 main_context->channel_id_service()->GetUniqueID()); |
519 | 518 |
520 std::unique_ptr<net::HttpCache::BackendFactory> main_backend( | 519 std::unique_ptr<net::HttpCache::BackendFactory> main_backend( |
521 new net::HttpCache::DefaultBackend( | 520 new net::HttpCache::DefaultBackend( |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 | 647 |
649 // TODO(creis): We should have a cookie delegate for notifying the cookie | 648 // TODO(creis): We should have a cookie delegate for notifying the cookie |
650 // extensions API, but we need to update it to understand isolated apps | 649 // extensions API, but we need to update it to understand isolated apps |
651 // first. | 650 // first. |
652 content::CookieStoreConfig cookie_config( | 651 content::CookieStoreConfig cookie_config( |
653 cookie_path, content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, | 652 cookie_path, content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, |
654 nullptr, nullptr); | 653 nullptr, nullptr); |
655 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); | 654 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); |
656 cookie_store = content::CreateCookieStore(cookie_config); | 655 cookie_store = content::CreateCookieStore(cookie_config); |
657 channel_id_db = new net::SQLiteChannelIDStore( | 656 channel_id_db = new net::SQLiteChannelIDStore( |
658 channel_id_path, base::CreateSequencedTaskRunnerWithTraits( | 657 channel_id_path, |
659 base::TaskTraits().MayBlock().WithPriority( | 658 base::CreateSequencedTaskRunnerWithTraits( |
660 base::TaskPriority::BACKGROUND))); | 659 {base::MayBlock(), base::TaskPriority::BACKGROUND})); |
661 } | 660 } |
662 std::unique_ptr<net::ChannelIDService> channel_id_service( | 661 std::unique_ptr<net::ChannelIDService> channel_id_service( |
663 new net::ChannelIDService( | 662 new net::ChannelIDService( |
664 new net::DefaultChannelIDStore(channel_id_db.get()))); | 663 new net::DefaultChannelIDStore(channel_id_db.get()))); |
665 cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); | 664 cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); |
666 | 665 |
667 // Build a new HttpNetworkSession that uses the new ChannelIDService. | 666 // Build a new HttpNetworkSession that uses the new ChannelIDService. |
668 // TODO(mmenke): It weird to combine state from | 667 // TODO(mmenke): It weird to combine state from |
669 // main_request_context_storage() objects and the argumet to this method, | 668 // main_request_context_storage() objects and the argumet to this method, |
670 // |main_context|. Remove |main_context| as an argument, and just use | 669 // |main_context|. Remove |main_context| as an argument, and just use |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 const base::Closure& completion) { | 806 const base::Closure& completion) { |
808 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 807 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
809 DCHECK(initialized()); | 808 DCHECK(initialized()); |
810 | 809 |
811 DCHECK(transport_security_state()); | 810 DCHECK(transport_security_state()); |
812 // Completes synchronously. | 811 // Completes synchronously. |
813 transport_security_state()->DeleteAllDynamicDataSince(time); | 812 transport_security_state()->DeleteAllDynamicDataSince(time); |
814 DCHECK(http_server_properties_manager_); | 813 DCHECK(http_server_properties_manager_); |
815 http_server_properties_manager_->Clear(completion); | 814 http_server_properties_manager_->Clear(completion); |
816 } | 815 } |
OLD | NEW |