| Index: chrome/browser/profiles/profile_impl.cc
|
| diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
|
| index b5b0b8d13de9629c23e990b971c086c01ba1e9e2..d4dc459df9012521686bada6f1ddcf0d29efaecf 100644
|
| --- a/chrome/browser/profiles/profile_impl.cc
|
| +++ b/chrome/browser/profiles/profile_impl.cc
|
| @@ -46,6 +46,7 @@
|
| #include "chrome/browser/history/top_sites.h"
|
| #include "chrome/browser/metrics/metrics_service.h"
|
| #include "chrome/browser/net/chrome_url_request_context.h"
|
| +#include "chrome/browser/net/cookie_store_util.h"
|
| #include "chrome/browser/net/net_pref_observer.h"
|
| #include "chrome/browser/net/predictor.h"
|
| #include "chrome/browser/net/pref_proxy_config_tracker.h"
|
| @@ -84,6 +85,7 @@
|
| #include "components/user_prefs/pref_registry_syncable.h"
|
| #include "components/user_prefs/user_prefs.h"
|
| #include "content/public/browser/browser_thread.h"
|
| +#include "content/public/browser/cookie_store_factory.h"
|
| #include "content/public/browser/dom_storage_context.h"
|
| #include "content/public/browser/host_zoom_map.h"
|
| #include "content/public/browser/notification_service.h"
|
| @@ -492,8 +494,6 @@ void ProfileImpl::DoFinalInit() {
|
| g_browser_process->background_mode_manager()->RegisterProfile(this);
|
| }
|
|
|
| - base::FilePath cookie_path = GetPath();
|
| - cookie_path = cookie_path.Append(chrome::kCookieFilename);
|
| base::FilePath server_bound_cert_path = GetPath();
|
| server_bound_cert_path =
|
| server_bound_cert_path.Append(chrome::kOBCertFilename);
|
| @@ -515,28 +515,14 @@ void ProfileImpl::DoFinalInit() {
|
| infinite_cache_path =
|
| infinite_cache_path.Append(FILE_PATH_LITERAL("Infinite Cache"));
|
|
|
| -#if defined(OS_ANDROID)
|
| - SessionStartupPref::Type startup_pref_type =
|
| - SessionStartupPref::GetDefaultStartupType();
|
| -#else
|
| - SessionStartupPref::Type startup_pref_type =
|
| - StartupBrowserCreator::GetSessionStartupPref(
|
| - *CommandLine::ForCurrentProcess(), this).type;
|
| -#endif
|
| - bool restore_old_session_cookies =
|
| - (GetLastSessionExitType() == Profile::EXIT_CRASHED ||
|
| - startup_pref_type == SessionStartupPref::LAST);
|
| -
|
| InitHostZoomMap();
|
|
|
| // Make sure we initialize the ProfileIOData after everything else has been
|
| // initialized that we might be reading from the IO thread.
|
|
|
| - io_data_.Init(cookie_path, server_bound_cert_path, cache_path,
|
| + io_data_.Init(server_bound_cert_path, cache_path,
|
| cache_max_size, media_cache_path, media_cache_max_size,
|
| - extensions_cookie_path, GetPath(), infinite_cache_path,
|
| - predictor_,
|
| - restore_old_session_cookies,
|
| + GetPath(), infinite_cache_path, predictor_,
|
| GetSpecialStoragePolicy());
|
|
|
| #if defined(ENABLE_PLUGINS)
|
| @@ -554,7 +540,7 @@ void ProfileImpl::DoFinalInit() {
|
| if (!CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kDisableRestoreSessionState)) {
|
| TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk")
|
| - content::BrowserContext::GetDefaultStoragePartition(this)->
|
| + GetDefaultStoragePartition(this)->
|
| GetDOMStorageContext()->SetSaveSessionStorageOnDisk();
|
| }
|
|
|
| @@ -672,6 +658,36 @@ bool ProfileImpl::IsOffTheRecord() const {
|
| return false;
|
| }
|
|
|
| +content::CookieStoreConfig ProfileImpl::GetCookieStoreConfig() {
|
| + // The delegate is stateless so it's silly to create more than one per
|
| + // profile.
|
| + if (!cookie_delegate_) {
|
| + cookie_delegate_ = chrome_browser_net::CreateCookieDelegate(this);
|
| + }
|
| +
|
| +#if defined(OS_ANDROID)
|
| + SessionStartupPref::Type startup_pref_type =
|
| + SessionStartupPref::GetDefaultStartupType();
|
| +#else
|
| + SessionStartupPref::Type startup_pref_type =
|
| + StartupBrowserCreator::GetSessionStartupPref(
|
| + *CommandLine::ForCurrentProcess(), this).type;
|
| +#endif
|
| + bool restore_old_session_cookies =
|
| + (GetLastSessionExitType() == Profile::EXIT_CRASHED ||
|
| + startup_pref_type == SessionStartupPref::LAST);
|
| +
|
| + if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) {
|
| + return content::CookieStoreConfig::InMemoryWithOptions(
|
| + GetSpecialStoragePolicy(), cookie_delegate_);
|
| + }
|
| +
|
| + return content::CookieStoreConfig::PersistentWithOptions(
|
| + GetPath().Append(content::kCookieFilename),
|
| + restore_old_session_cookies, GetSpecialStoragePolicy(),
|
| + cookie_delegate_);
|
| +}
|
| +
|
| Profile* ProfileImpl::GetOffTheRecordProfile() {
|
| if (!off_the_record_profile_) {
|
| scoped_ptr<Profile> p(CreateOffTheRecordProfile());
|
| @@ -871,10 +887,6 @@ content::ResourceContext* ProfileImpl::GetResourceContext() {
|
| return io_data_.GetResourceContext();
|
| }
|
|
|
| -net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() {
|
| - return io_data_.GetExtensionsRequestContextGetter().get();
|
| -}
|
| -
|
| net::URLRequestContextGetter*
|
| ProfileImpl::CreateRequestContextForStoragePartition(
|
| const base::FilePath& partition_path,
|
|
|