| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 main_context->set_fraudulent_certificate_reporter( | 503 main_context->set_fraudulent_certificate_reporter( |
| 504 fraudulent_certificate_reporter()); | 504 fraudulent_certificate_reporter()); |
| 505 | 505 |
| 506 main_context->set_throttler_manager( | 506 main_context->set_throttler_manager( |
| 507 io_thread_globals->throttler_manager.get()); | 507 io_thread_globals->throttler_manager.get()); |
| 508 | 508 |
| 509 main_context->set_proxy_service(proxy_service()); | 509 main_context->set_proxy_service(proxy_service()); |
| 510 | 510 |
| 511 scoped_refptr<net::CookieStore> cookie_store = NULL; | 511 scoped_refptr<net::CookieStore> cookie_store = NULL; |
| 512 net::ChannelIDService* channel_id_service = NULL; | 512 net::ChannelIDService* channel_id_service = NULL; |
| 513 if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { | |
| 514 // Don't use existing cookies and use an in-memory store. | |
| 515 using content::CookieStoreConfig; | |
| 516 cookie_store = content::CreateCookieStore(CookieStoreConfig( | |
| 517 base::FilePath(), | |
| 518 CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, | |
| 519 NULL, | |
| 520 profile_params->cookie_monster_delegate.get())); | |
| 521 // Don't use existing channel ids and use an in-memory store. | |
| 522 channel_id_service = new net::ChannelIDService( | |
| 523 new net::DefaultChannelIDStore(NULL), | |
| 524 base::WorkerPool::GetTaskRunner(true)); | |
| 525 } | |
| 526 | 513 |
| 527 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | 514 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. |
| 528 tracked_objects::ScopedTracker tracking_profile5( | 515 tracked_objects::ScopedTracker tracking_profile5( |
| 529 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 516 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 530 "436671 ProfileImplIOData::InitializeInternal5")); | 517 "436671 ProfileImplIOData::InitializeInternal5")); |
| 531 | 518 |
| 532 // setup cookie store | 519 // setup cookie store |
| 533 if (!cookie_store.get()) { | 520 if (!cookie_store.get()) { |
| 534 DCHECK(!lazy_params_->cookie_path.empty()); | 521 DCHECK(!lazy_params_->cookie_path.empty()); |
| 535 | 522 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 scoped_ptr<net::HttpCache> main_cache = CreateMainHttpFactory( | 570 scoped_ptr<net::HttpCache> main_cache = CreateMainHttpFactory( |
| 584 profile_params, main_backend); | 571 profile_params, main_backend); |
| 585 | 572 |
| 586 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | 573 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. |
| 587 tracked_objects::ScopedTracker tracking_profile71( | 574 tracked_objects::ScopedTracker tracking_profile71( |
| 588 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 575 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 589 "436671 ProfileImplIOData::InitializeInternal71")); | 576 "436671 ProfileImplIOData::InitializeInternal71")); |
| 590 | 577 |
| 591 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); | 578 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); |
| 592 | 579 |
| 593 if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { | |
| 594 main_cache->set_mode( | |
| 595 chrome_browser_net::IsCookieRecordMode() ? | |
| 596 net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | |
| 597 } | |
| 598 | |
| 599 main_http_factory_.reset(main_cache.release()); | 580 main_http_factory_.reset(main_cache.release()); |
| 600 main_context->set_http_transaction_factory(main_http_factory_.get()); | 581 main_context->set_http_transaction_factory(main_http_factory_.get()); |
| 601 | 582 |
| 602 #if !defined(DISABLE_FTP_SUPPORT) | 583 #if !defined(DISABLE_FTP_SUPPORT) |
| 603 ftp_factory_.reset( | 584 ftp_factory_.reset( |
| 604 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 585 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
| 605 #endif // !defined(DISABLE_FTP_SUPPORT) | 586 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 606 | 587 |
| 607 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | 588 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. |
| 608 tracked_objects::ScopedTracker tracking_profile8( | 589 tracked_objects::ScopedTracker tracking_profile8( |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); | 710 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); |
| 730 } | 711 } |
| 731 net::HttpNetworkSession* main_network_session = | 712 net::HttpNetworkSession* main_network_session = |
| 732 main_http_factory_->GetSession(); | 713 main_http_factory_->GetSession(); |
| 733 scoped_ptr<net::HttpCache> app_http_cache = | 714 scoped_ptr<net::HttpCache> app_http_cache = |
| 734 CreateHttpFactory(main_network_session, app_backend); | 715 CreateHttpFactory(main_network_session, app_backend); |
| 735 | 716 |
| 736 scoped_refptr<net::CookieStore> cookie_store = NULL; | 717 scoped_refptr<net::CookieStore> cookie_store = NULL; |
| 737 if (partition_descriptor.in_memory) { | 718 if (partition_descriptor.in_memory) { |
| 738 cookie_store = content::CreateCookieStore(content::CookieStoreConfig()); | 719 cookie_store = content::CreateCookieStore(content::CookieStoreConfig()); |
| 739 } else if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { | |
| 740 // Don't use existing cookies and use an in-memory store. | |
| 741 // TODO(creis): We should have a cookie delegate for notifying the cookie | |
| 742 // extensions API, but we need to update it to understand isolated apps | |
| 743 // first. | |
| 744 cookie_store = content::CreateCookieStore(content::CookieStoreConfig()); | |
| 745 app_http_cache->set_mode( | |
| 746 chrome_browser_net::IsCookieRecordMode() ? | |
| 747 net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | |
| 748 } | 720 } |
| 749 | 721 |
| 750 // Use an app-specific cookie store. | 722 // Use an app-specific cookie store. |
| 751 if (!cookie_store.get()) { | 723 if (!cookie_store.get()) { |
| 752 DCHECK(!cookie_path.empty()); | 724 DCHECK(!cookie_path.empty()); |
| 753 | 725 |
| 754 // TODO(creis): We should have a cookie delegate for notifying the cookie | 726 // TODO(creis): We should have a cookie delegate for notifying the cookie |
| 755 // extensions API, but we need to update it to understand isolated apps | 727 // extensions API, but we need to update it to understand isolated apps |
| 756 // first. | 728 // first. |
| 757 content::CookieStoreConfig cookie_config( | 729 content::CookieStoreConfig cookie_config( |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 const base::Closure& completion) { | 849 const base::Closure& completion) { |
| 878 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 850 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 879 DCHECK(initialized()); | 851 DCHECK(initialized()); |
| 880 | 852 |
| 881 DCHECK(transport_security_state()); | 853 DCHECK(transport_security_state()); |
| 882 // Completes synchronously. | 854 // Completes synchronously. |
| 883 transport_security_state()->DeleteAllDynamicDataSince(time); | 855 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 884 DCHECK(http_server_properties_manager_); | 856 DCHECK(http_server_properties_manager_); |
| 885 http_server_properties_manager_->Clear(completion); | 857 http_server_properties_manager_->Clear(completion); |
| 886 } | 858 } |
| OLD | NEW |