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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/threading/sequenced_worker_pool.h" | 22 #include "base/threading/sequenced_worker_pool.h" |
23 #include "base/threading/worker_pool.h" | 23 #include "base/threading/worker_pool.h" |
24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/chrome_notification_types.h" | 25 #include "chrome/browser/chrome_notification_types.h" |
26 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 26 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
27 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 27 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
28 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 28 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
29 #include "chrome/browser/io_thread.h" | 29 #include "chrome/browser/io_thread.h" |
30 #include "chrome/browser/net/chrome_network_delegate.h" | 30 #include "chrome/browser/net/chrome_network_delegate.h" |
31 #include "chrome/browser/net/connect_interceptor.h" | 31 #include "chrome/browser/net/connect_interceptor.h" |
32 #include "chrome/browser/net/cookie_store_util.h" | |
33 #include "chrome/browser/net/http_server_properties_manager_factory.h" | 32 #include "chrome/browser/net/http_server_properties_manager_factory.h" |
34 #include "chrome/browser/net/predictor.h" | 33 #include "chrome/browser/net/predictor.h" |
35 #include "chrome/browser/net/quota_policy_channel_id_store.h" | 34 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
36 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" | 35 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" |
37 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 36 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
38 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 37 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
39 #include "chrome/browser/profiles/profile.h" | 38 #include "chrome/browser/profiles/profile.h" |
40 #include "chrome/common/chrome_constants.h" | 39 #include "chrome/common/chrome_constants.h" |
41 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
43 #include "chrome/common/url_constants.h" | 42 #include "chrome/common/url_constants.h" |
| 43 #include "components/cookie_config/cookie_store_util.h" |
44 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 44 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
46 #include "components/data_reduction_proxy/core/browser/data_store_impl.h" | 46 #include "components/data_reduction_proxy/core/browser/data_store_impl.h" |
47 #include "components/domain_reliability/monitor.h" | 47 #include "components/domain_reliability/monitor.h" |
48 #include "components/net_log/chrome_net_log.h" | 48 #include "components/net_log/chrome_net_log.h" |
49 #include "content/public/browser/browser_thread.h" | 49 #include "content/public/browser/browser_thread.h" |
50 #include "content/public/browser/cookie_store_factory.h" | 50 #include "content/public/browser/cookie_store_factory.h" |
51 #include "content/public/browser/notification_service.h" | 51 #include "content/public/browser/notification_service.h" |
52 #include "content/public/browser/resource_context.h" | 52 #include "content/public/browser/resource_context.h" |
53 #include "content/public/browser/storage_partition.h" | 53 #include "content/public/browser/storage_partition.h" |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 506 |
507 // Set up cookie store. | 507 // Set up cookie store. |
508 if (!cookie_store.get()) { | 508 if (!cookie_store.get()) { |
509 DCHECK(!lazy_params_->cookie_path.empty()); | 509 DCHECK(!lazy_params_->cookie_path.empty()); |
510 | 510 |
511 content::CookieStoreConfig cookie_config( | 511 content::CookieStoreConfig cookie_config( |
512 lazy_params_->cookie_path, | 512 lazy_params_->cookie_path, |
513 lazy_params_->session_cookie_mode, | 513 lazy_params_->session_cookie_mode, |
514 lazy_params_->special_storage_policy.get(), | 514 lazy_params_->special_storage_policy.get(), |
515 profile_params->cookie_monster_delegate.get()); | 515 profile_params->cookie_monster_delegate.get()); |
516 cookie_config.crypto_delegate = | 516 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); |
517 chrome_browser_net::GetCookieCryptoDelegate(); | |
518 cookie_store = content::CreateCookieStore(cookie_config); | 517 cookie_store = content::CreateCookieStore(cookie_config); |
519 } | 518 } |
520 | 519 |
521 main_context->set_cookie_store(cookie_store.get()); | 520 main_context->set_cookie_store(cookie_store.get()); |
522 | 521 |
523 // Set up server bound cert service. | 522 // Set up server bound cert service. |
524 if (!channel_id_service) { | 523 if (!channel_id_service) { |
525 DCHECK(!lazy_params_->channel_id_path.empty()); | 524 DCHECK(!lazy_params_->channel_id_path.empty()); |
526 | 525 |
527 scoped_refptr<QuotaPolicyChannelIDStore> channel_id_db = | 526 scoped_refptr<QuotaPolicyChannelIDStore> channel_id_db = |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 ApplyProfileParamsToContext(extensions_context); | 608 ApplyProfileParamsToContext(extensions_context); |
610 | 609 |
611 extensions_context->set_transport_security_state(transport_security_state()); | 610 extensions_context->set_transport_security_state(transport_security_state()); |
612 | 611 |
613 extensions_context->set_net_log(io_thread->net_log()); | 612 extensions_context->set_net_log(io_thread->net_log()); |
614 | 613 |
615 content::CookieStoreConfig cookie_config( | 614 content::CookieStoreConfig cookie_config( |
616 lazy_params_->extensions_cookie_path, | 615 lazy_params_->extensions_cookie_path, |
617 lazy_params_->session_cookie_mode, | 616 lazy_params_->session_cookie_mode, |
618 NULL, NULL); | 617 NULL, NULL); |
619 cookie_config.crypto_delegate = | 618 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); |
620 chrome_browser_net::GetCookieCryptoDelegate(); | |
621 net::CookieStore* extensions_cookie_store = | 619 net::CookieStore* extensions_cookie_store = |
622 content::CreateCookieStore(cookie_config); | 620 content::CreateCookieStore(cookie_config); |
623 // Enable cookies for chrome-extension URLs. | 621 // Enable cookies for chrome-extension URLs. |
624 const char* const schemes[] = { | 622 const char* const schemes[] = { |
625 extensions::kExtensionScheme | 623 extensions::kExtensionScheme |
626 }; | 624 }; |
627 extensions_cookie_store->GetCookieMonster()->SetCookieableSchemes( | 625 extensions_cookie_store->GetCookieMonster()->SetCookieableSchemes( |
628 schemes, arraysize(schemes)); | 626 schemes, arraysize(schemes)); |
629 extensions_context->set_cookie_store(extensions_cookie_store); | 627 extensions_context->set_cookie_store(extensions_cookie_store); |
630 | 628 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 if (!cookie_store.get()) { | 685 if (!cookie_store.get()) { |
688 DCHECK(!cookie_path.empty()); | 686 DCHECK(!cookie_path.empty()); |
689 | 687 |
690 // TODO(creis): We should have a cookie delegate for notifying the cookie | 688 // TODO(creis): We should have a cookie delegate for notifying the cookie |
691 // extensions API, but we need to update it to understand isolated apps | 689 // extensions API, but we need to update it to understand isolated apps |
692 // first. | 690 // first. |
693 content::CookieStoreConfig cookie_config( | 691 content::CookieStoreConfig cookie_config( |
694 cookie_path, | 692 cookie_path, |
695 content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, | 693 content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, |
696 NULL, NULL); | 694 NULL, NULL); |
697 cookie_config.crypto_delegate = | 695 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); |
698 chrome_browser_net::GetCookieCryptoDelegate(); | |
699 cookie_store = content::CreateCookieStore(cookie_config); | 696 cookie_store = content::CreateCookieStore(cookie_config); |
700 } | 697 } |
701 | 698 |
702 // Transfer ownership of the cookies and cache to AppRequestContext. | 699 // Transfer ownership of the cookies and cache to AppRequestContext. |
703 context->SetCookieStore(cookie_store.get()); | 700 context->SetCookieStore(cookie_store.get()); |
704 context->SetHttpTransactionFactory(app_http_cache.Pass()); | 701 context->SetHttpTransactionFactory(app_http_cache.Pass()); |
705 | 702 |
706 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 703 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
707 new net::URLRequestJobFactoryImpl()); | 704 new net::URLRequestJobFactoryImpl()); |
708 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 705 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 const base::Closure& completion) { | 808 const base::Closure& completion) { |
812 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 809 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
813 DCHECK(initialized()); | 810 DCHECK(initialized()); |
814 | 811 |
815 DCHECK(transport_security_state()); | 812 DCHECK(transport_security_state()); |
816 // Completes synchronously. | 813 // Completes synchronously. |
817 transport_security_state()->DeleteAllDynamicDataSince(time); | 814 transport_security_state()->DeleteAllDynamicDataSince(time); |
818 DCHECK(http_server_properties_manager_); | 815 DCHECK(http_server_properties_manager_); |
819 http_server_properties_manager_->Clear(completion); | 816 http_server_properties_manager_->Clear(completion); |
820 } | 817 } |
OLD | NEW |