diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-24 16:12:02 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-24 16:12:02 +0000 |
commit | b37bf363866d7a27b64fbae4a131169a863b8fa5 (patch) | |
tree | 0bee7eae3b53133742eac51006b74eca28018389 | |
parent | f2ae53a623e690b694c415223837d25980d3266b (diff) | |
download | chromium_src-b37bf363866d7a27b64fbae4a131169a863b8fa5.zip chromium_src-b37bf363866d7a27b64fbae4a131169a863b8fa5.tar.gz chromium_src-b37bf363866d7a27b64fbae4a131169a863b8fa5.tar.bz2 |
Move OffTheRecordProfileIOData::GetSSLSessionCacheShard() to the base
class ProfileIOData so that it can also be used by ProfileImplIOData.
This builds on agl's CL http://codereview.chromium.org/8995016.
R=agl@chromium.org,mirandac@chromium.org
BUG=118308
TEST=Normal SSL connections without client certificates should have
no apparent changes. SSL websites that request client certificates
will cause Chrome to pop up the client certificate selection dialog
for each profile, including each incarnation of incognito mode.
Review URL: http://codereview.chromium.org/9835059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128745 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/profiles/off_the_record_profile_io_data.cc | 13 | ||||
-rw-r--r-- | chrome/browser/profiles/off_the_record_profile_io_data.h | 2 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl_io_data.cc | 3 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_io_data.cc | 12 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_io_data.h | 2 |
5 files changed, 15 insertions, 17 deletions
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc index 3bd8f79..c0507d1 100644 --- a/chrome/browser/profiles/off_the_record_profile_io_data.cc +++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc @@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/logging.h" #include "base/stl_util.h" -#include "base/stringprintf.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/io_thread.h" @@ -149,18 +148,6 @@ OffTheRecordProfileIOData::OffTheRecordProfileIOData() : ProfileIOData(true) {} OffTheRecordProfileIOData::~OffTheRecordProfileIOData() {} -unsigned OffTheRecordProfileIOData::ssl_session_cache_instance_ = 0; - -// static -std::string OffTheRecordProfileIOData::GetSSLSessionCacheShard() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - // The SSL session cache is partitioned by setting a string. This returns a - // unique string to partition the SSL session cache. Each time we create a - // new Incognito profile, we'll get a fresh SSL session cache which is also - // separate from the non-incognito ones. - return StringPrintf("incognito/%u", ssl_session_cache_instance_++); -} - void OffTheRecordProfileIOData::LazyInitializeInternal( ProfileParams* profile_params) const { ChromeURLRequestContext* main_context = main_request_context(); diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.h b/chrome/browser/profiles/off_the_record_profile_io_data.h index ebf3c16..a23b8fb 100644 --- a/chrome/browser/profiles/off_the_record_profile_io_data.h +++ b/chrome/browser/profiles/off_the_record_profile_io_data.h @@ -96,7 +96,6 @@ class OffTheRecordProfileIOData : public ProfileIOData { OffTheRecordProfileIOData(); virtual ~OffTheRecordProfileIOData(); - static std::string GetSSLSessionCacheShard(); virtual void LazyInitializeInternal( ProfileParams* profile_params) const OVERRIDE; virtual scoped_refptr<ChromeURLRequestContext> InitializeAppRequestContext( @@ -113,7 +112,6 @@ class OffTheRecordProfileIOData : public ProfileIOData { mutable scoped_ptr<net::HttpTransactionFactory> main_http_factory_; mutable scoped_ptr<net::FtpTransactionFactory> ftp_factory_; - static unsigned ssl_session_cache_instance_; // See GetSSLSessionCacheShard. DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileIOData); }; diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index 75d00a4..2d59a95 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc @@ -389,8 +389,7 @@ void ProfileImplIOData::LazyInitializeInternal( main_context->server_bound_cert_service(), main_context->transport_security_state(), main_context->proxy_service(), - "", // pass empty ssl_session_cache_shard to share the SSL session cache - // with everything that doesn't explicitly want a different one. + GetSSLSessionCacheShard(), main_context->ssl_config_service(), main_context->http_auth_handler_factory(), main_context->network_delegate(), diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index ca6c90b..1556ad8 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc @@ -15,6 +15,7 @@ #include "base/stl_util.h" #include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/stringprintf.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings.h" #include "chrome/browser/content_settings/host_content_settings_map.h" @@ -396,6 +397,17 @@ content::MediaObserver* ProfileIOData::ResourceContext::GetMediaObserver() { return media_observer_; } +// static +std::string ProfileIOData::GetSSLSessionCacheShard() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + // The SSL session cache is partitioned by setting a string. This returns a + // unique string to partition the SSL session cache. Each time we create a + // new profile, we'll get a fresh SSL session cache which is separate from + // the other profiles. + static unsigned ssl_session_cache_instance = 0; + return StringPrintf("profile/%u", ssl_session_cache_instance++); +} + void ProfileIOData::LazyInitialize() const { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (initialized_) diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h index c8e2c55..b6ff4c8 100644 --- a/chrome/browser/profiles/profile_io_data.h +++ b/chrome/browser/profiles/profile_io_data.h @@ -158,6 +158,8 @@ class ProfileIOData { explicit ProfileIOData(bool is_incognito); + static std::string GetSSLSessionCacheShard(); + void InitializeOnUIThread(Profile* profile); void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const; |