summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/io_thread.cc2
-rw-r--r--chrome/browser/net/ssl_config_service_manager.h8
-rw-r--r--chrome/browser/net/ssl_config_service_manager_pref.cc91
-rw-r--r--chrome/browser/net/ssl_config_service_manager_pref_unittest.cc178
-rw-r--r--chrome/browser/profiles/profile_impl.cc2
5 files changed, 221 insertions, 60 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 037868a..e2c61d1 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -359,7 +359,7 @@ IOThread::IOThread(
ChromeNetworkDelegate::InitializeReferrersEnabled(&system_enable_referrers_,
local_state);
ssl_config_service_manager_.reset(
- SSLConfigServiceManager::CreateDefaultManager(local_state));
+ SSLConfigServiceManager::CreateDefaultManager(local_state, NULL));
BrowserThread::SetDelegate(BrowserThread::IO, this);
}
diff --git a/chrome/browser/net/ssl_config_service_manager.h b/chrome/browser/net/ssl_config_service_manager.h
index f3b3052..b5c7b2b 100644
--- a/chrome/browser/net/ssl_config_service_manager.h
+++ b/chrome/browser/net/ssl_config_service_manager.h
@@ -16,11 +16,13 @@ class SSLConfigServiceManager {
public:
// Create an instance of the SSLConfigServiceManager. The lifetime of the
// PrefService objects must be longer than that of the manager. Get SSL
- // preferences from local_state object.
+ // preferences from local_state object. The user_prefs may be NULL if this
+ // SSLConfigServiceManager is not associated with a profile.
static SSLConfigServiceManager* CreateDefaultManager(
- PrefService* local_state);
+ PrefService* local_state,
+ PrefService* user_prefs);
- static void RegisterPrefs(PrefService* prefs);
+ static void RegisterPrefs(PrefService* local_state);
virtual ~SSLConfigServiceManager() {}
diff --git a/chrome/browser/net/ssl_config_service_manager_pref.cc b/chrome/browser/net/ssl_config_service_manager_pref.cc
index f7e0e73..402eb53 100644
--- a/chrome/browser/net/ssl_config_service_manager_pref.cc
+++ b/chrome/browser/net/ssl_config_service_manager_pref.cc
@@ -11,8 +11,10 @@
#include "base/bind.h"
#include "chrome/browser/api/prefs/pref_change_registrar.h"
#include "chrome/browser/api/prefs/pref_member.h"
+#include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/content_settings.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
@@ -145,11 +147,12 @@ class SSLConfigServiceManagerPref
: public SSLConfigServiceManager,
public content::NotificationObserver {
public:
- explicit SSLConfigServiceManagerPref(PrefService* local_state);
+ SSLConfigServiceManagerPref(PrefService* local_state,
+ PrefService* user_prefs);
virtual ~SSLConfigServiceManagerPref() {}
// Register local_state SSL preferences.
- static void RegisterPrefs(PrefService* prefs);
+ static void RegisterPrefs(PrefService* local_state);
virtual net::SSLConfigService* Get();
@@ -166,11 +169,15 @@ class SSLConfigServiceManagerPref
// Processes changes to the disabled cipher suites preference, updating the
// cached list of parsed SSL/TLS cipher suites that are disabled.
- void OnDisabledCipherSuitesChange(PrefService* prefs);
+ void OnDisabledCipherSuitesChange(PrefService* local_state);
- PrefChangeRegistrar pref_change_registrar_;
+ // Processes changes to the default cookie settings.
+ void OnDefaultContentSettingsChange(PrefService* user_prefs);
- // The prefs (should only be accessed from UI thread)
+ PrefChangeRegistrar local_state_change_registrar_;
+ PrefChangeRegistrar user_prefs_change_registrar_;
+
+ // The local_state prefs (should only be accessed from UI thread)
BooleanPrefMember rev_checking_enabled_;
StringPrefMember ssl_version_min_;
StringPrefMember ssl_version_max_;
@@ -180,14 +187,24 @@ class SSLConfigServiceManagerPref
// The cached list of disabled SSL cipher suites.
std::vector<uint16> disabled_cipher_suites_;
+ // The user_prefs prefs (should only be accessed from UI thread).
+ // |have_user_prefs_| will be false if no user_prefs are associated with this
+ // instance.
+ bool have_user_prefs_;
+ BooleanPrefMember block_third_party_cookies_;
+
+ // Cached value of if cookies are disabled by default.
+ bool cookies_disabled_;
+
scoped_refptr<SSLConfigServicePref> ssl_config_service_;
DISALLOW_COPY_AND_ASSIGN(SSLConfigServiceManagerPref);
};
SSLConfigServiceManagerPref::SSLConfigServiceManagerPref(
- PrefService* local_state)
- : ssl_config_service_(new SSLConfigServicePref()) {
+ PrefService* local_state, PrefService* user_prefs)
+ : have_user_prefs_(!!user_prefs),
+ ssl_config_service_(new SSLConfigServicePref()) {
DCHECK(local_state);
rev_checking_enabled_.Init(prefs::kCertRevocationCheckingEnabled,
@@ -197,31 +214,41 @@ SSLConfigServiceManagerPref::SSLConfigServiceManagerPref(
channel_id_enabled_.Init(prefs::kEnableOriginBoundCerts, local_state, this);
ssl_record_splitting_disabled_.Init(prefs::kDisableSSLRecordSplitting,
local_state, this);
- pref_change_registrar_.Init(local_state);
- pref_change_registrar_.Add(prefs::kCipherSuiteBlacklist, this);
+ local_state_change_registrar_.Init(local_state);
+ local_state_change_registrar_.Add(prefs::kCipherSuiteBlacklist, this);
OnDisabledCipherSuitesChange(local_state);
+
+ if (user_prefs) {
+ block_third_party_cookies_.Init(prefs::kBlockThirdPartyCookies, user_prefs,
+ this);
+ user_prefs_change_registrar_.Init(user_prefs);
+ user_prefs_change_registrar_.Add(prefs::kDefaultContentSettings, this);
+
+ OnDefaultContentSettingsChange(user_prefs);
+ }
+
// Initialize from UI thread. This is okay as there shouldn't be anything on
// the IO thread trying to access it yet.
GetSSLConfigFromPrefs(&ssl_config_service_->cached_config_);
}
// static
-void SSLConfigServiceManagerPref::RegisterPrefs(PrefService* prefs) {
+void SSLConfigServiceManagerPref::RegisterPrefs(PrefService* local_state) {
net::SSLConfig default_config;
- prefs->RegisterBooleanPref(prefs::kCertRevocationCheckingEnabled,
- default_config.rev_checking_enabled);
+ local_state->RegisterBooleanPref(prefs::kCertRevocationCheckingEnabled,
+ default_config.rev_checking_enabled);
std::string version_min_str =
SSLProtocolVersionToString(default_config.version_min);
std::string version_max_str =
SSLProtocolVersionToString(default_config.version_max);
- prefs->RegisterStringPref(prefs::kSSLVersionMin, version_min_str);
- prefs->RegisterStringPref(prefs::kSSLVersionMax, version_max_str);
- prefs->RegisterBooleanPref(prefs::kEnableOriginBoundCerts,
- default_config.channel_id_enabled);
- prefs->RegisterBooleanPref(prefs::kDisableSSLRecordSplitting,
- !default_config.false_start_enabled);
- prefs->RegisterListPref(prefs::kCipherSuiteBlacklist);
+ local_state->RegisterStringPref(prefs::kSSLVersionMin, version_min_str);
+ local_state->RegisterStringPref(prefs::kSSLVersionMax, version_max_str);
+ local_state->RegisterBooleanPref(prefs::kEnableOriginBoundCerts,
+ default_config.channel_id_enabled);
+ local_state->RegisterBooleanPref(prefs::kDisableSSLRecordSplitting,
+ !default_config.false_start_enabled);
+ local_state->RegisterListPref(prefs::kCipherSuiteBlacklist);
}
net::SSLConfigService* SSLConfigServiceManagerPref::Get() {
@@ -239,6 +266,8 @@ void SSLConfigServiceManagerPref::Observe(
DCHECK(pref_name_in && prefs);
if (*pref_name_in == prefs::kCipherSuiteBlacklist)
OnDisabledCipherSuitesChange(prefs);
+ else if (*pref_name_in == prefs::kDefaultContentSettings)
+ OnDefaultContentSettingsChange(prefs);
net::SSLConfig new_config;
GetSSLConfigFromPrefs(&new_config);
@@ -280,24 +309,40 @@ void SSLConfigServiceManagerPref::GetSSLConfigFromPrefs(
}
config->disabled_cipher_suites = disabled_cipher_suites_;
config->channel_id_enabled = channel_id_enabled_.GetValue();
+ if (have_user_prefs_ &&
+ (cookies_disabled_ || block_third_party_cookies_.GetValue()))
+ config->channel_id_enabled = false;
// disabling False Start also happens to disable record splitting.
config->false_start_enabled = !ssl_record_splitting_disabled_.GetValue();
SSLConfigServicePref::SetSSLConfigFlags(config);
}
void SSLConfigServiceManagerPref::OnDisabledCipherSuitesChange(
- PrefService* prefs) {
- const ListValue* value = prefs->GetList(prefs::kCipherSuiteBlacklist);
+ PrefService* local_state) {
+ const ListValue* value = local_state->GetList(prefs::kCipherSuiteBlacklist);
disabled_cipher_suites_ = ParseCipherSuites(ListValueToStringVector(value));
}
+void SSLConfigServiceManagerPref::OnDefaultContentSettingsChange(
+ PrefService* user_prefs) {
+ const DictionaryValue* value = user_prefs->GetDictionary(
+ prefs::kDefaultContentSettings);
+ int default_cookie_settings = -1;
+ cookies_disabled_ = (
+ value &&
+ value->GetInteger(
+ content_settings::GetTypeName(CONTENT_SETTINGS_TYPE_COOKIES),
+ &default_cookie_settings) &&
+ default_cookie_settings == CONTENT_SETTING_BLOCK);
+}
+
////////////////////////////////////////////////////////////////////////////////
// SSLConfigServiceManager
// static
SSLConfigServiceManager* SSLConfigServiceManager::CreateDefaultManager(
- PrefService* local_state) {
- return new SSLConfigServiceManagerPref(local_state);
+ PrefService* local_state, PrefService* user_prefs) {
+ return new SSLConfigServiceManagerPref(local_state, user_prefs);
}
// static
diff --git a/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc b/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc
index f5b10ac..9f65805 100644
--- a/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc
+++ b/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc
@@ -8,11 +8,14 @@
#include "base/memory/ref_counted.h"
#include "base/message_loop.h"
#include "base/values.h"
+#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/prefs/pref_service_mock_builder.h"
#include "chrome/browser/prefs/testing_pref_store.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/content_settings.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_pref_service.h"
+#include "chrome/test/base/testing_profile.h"
#include "content/public/test/test_browser_thread.h"
#include "net/base/ssl_config_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -23,6 +26,17 @@ using content::BrowserThread;
using net::SSLConfig;
using net::SSLConfigService;
+namespace {
+
+void SetCookiePref(TestingProfile* profile, ContentSetting setting) {
+ HostContentSettingsMap* host_content_settings_map =
+ profile->GetHostContentSettingsMap();
+ host_content_settings_map->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_COOKIES, setting);
+}
+
+} // namespace
+
class SSLConfigServiceManagerPrefTest : public testing::Test {
public:
SSLConfigServiceManagerPrefTest()
@@ -30,19 +44,117 @@ class SSLConfigServiceManagerPrefTest : public testing::Test {
io_thread_(BrowserThread::IO, &message_loop_) {}
protected:
+ bool IsChannelIdEnabled(SSLConfigService* config_service) {
+ // Pump the message loop to notify the SSLConfigServiceManagerPref that the
+ // preferences changed.
+ message_loop_.RunAllPending();
+ SSLConfig config;
+ config_service->GetSSLConfig(&config);
+ return config.channel_id_enabled;
+ }
+
MessageLoop message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread io_thread_;
};
+// Test channel id with no user prefs.
+TEST_F(SSLConfigServiceManagerPrefTest, ChannelIDWithoutUserPrefs) {
+ TestingPrefService local_state;
+ SSLConfigServiceManager::RegisterPrefs(&local_state);
+ local_state.SetUserPref(prefs::kEnableOriginBoundCerts,
+ Value::CreateBooleanValue(false));
+
+ scoped_ptr<SSLConfigServiceManager> config_manager(
+ SSLConfigServiceManager::CreateDefaultManager(&local_state, NULL));
+ ASSERT_TRUE(config_manager.get());
+ scoped_refptr<SSLConfigService> config_service(config_manager->Get());
+ ASSERT_TRUE(config_service.get());
+
+ SSLConfig config;
+ config_service->GetSSLConfig(&config);
+ EXPECT_FALSE(config.channel_id_enabled);
+
+ local_state.SetUserPref(prefs::kEnableOriginBoundCerts,
+ Value::CreateBooleanValue(true));
+ // Pump the message loop to notify the SSLConfigServiceManagerPref that the
+ // preferences changed.
+ message_loop_.RunAllPending();
+ config_service->GetSSLConfig(&config);
+ EXPECT_TRUE(config.channel_id_enabled);
+}
+
+// Test channel id with user prefs.
+TEST_F(SSLConfigServiceManagerPrefTest, ChannelIDWithUserPrefs) {
+ TestingPrefService local_state;
+ SSLConfigServiceManager::RegisterPrefs(&local_state);
+ local_state.SetUserPref(prefs::kEnableOriginBoundCerts,
+ Value::CreateBooleanValue(false));
+
+ TestingProfile testing_profile;
+ TestingPrefService* user_prefs = testing_profile.GetTestingPrefService();
+ SetCookiePref(&testing_profile, CONTENT_SETTING_BLOCK);
+ user_prefs->SetUserPref(prefs::kBlockThirdPartyCookies,
+ Value::CreateBooleanValue(true));
+
+ scoped_ptr<SSLConfigServiceManager> config_manager(
+ SSLConfigServiceManager::CreateDefaultManager(&local_state, user_prefs));
+ ASSERT_TRUE(config_manager.get());
+ scoped_refptr<SSLConfigService> config_service(config_manager->Get());
+ ASSERT_TRUE(config_service.get());
+
+ // channelid=false, cookies=block, 3rdpartycookies=block
+ EXPECT_FALSE(IsChannelIdEnabled(config_service));
+
+ // channelid=false, cookies=block, 3rdpartycookies=allow
+ user_prefs->SetUserPref(prefs::kBlockThirdPartyCookies,
+ Value::CreateBooleanValue(false));
+ EXPECT_FALSE(IsChannelIdEnabled(config_service));
+
+ // channelid=false, cookies=allow, 3rdpartycookies=block
+ SetCookiePref(&testing_profile, CONTENT_SETTING_ALLOW);
+ user_prefs->SetUserPref(prefs::kBlockThirdPartyCookies,
+ Value::CreateBooleanValue(true));
+ EXPECT_FALSE(IsChannelIdEnabled(config_service));
+
+ // channelid=false, cookies=allow, 3rdpartycookies=allow
+ user_prefs->SetUserPref(prefs::kBlockThirdPartyCookies,
+ Value::CreateBooleanValue(false));
+ EXPECT_FALSE(IsChannelIdEnabled(config_service));
+
+ // channelid=true, cookies=block, 3rdpartycookies=block
+ local_state.SetUserPref(prefs::kEnableOriginBoundCerts,
+ Value::CreateBooleanValue(true));
+ SetCookiePref(&testing_profile, CONTENT_SETTING_BLOCK);
+ user_prefs->SetUserPref(prefs::kBlockThirdPartyCookies,
+ Value::CreateBooleanValue(true));
+ EXPECT_FALSE(IsChannelIdEnabled(config_service));
+
+ // channelid=true, cookies=block, 3rdpartycookies=allow
+ user_prefs->SetUserPref(prefs::kBlockThirdPartyCookies,
+ Value::CreateBooleanValue(false));
+ EXPECT_FALSE(IsChannelIdEnabled(config_service));
+
+ // channelid=true, cookies=allow, 3rdpartycookies=block
+ SetCookiePref(&testing_profile, CONTENT_SETTING_ALLOW);
+ user_prefs->SetUserPref(prefs::kBlockThirdPartyCookies,
+ Value::CreateBooleanValue(true));
+ EXPECT_FALSE(IsChannelIdEnabled(config_service));
+
+ // channelid=true, cookies=allow, 3rdpartycookies=allow
+ user_prefs->SetUserPref(prefs::kBlockThirdPartyCookies,
+ Value::CreateBooleanValue(false));
+ EXPECT_TRUE(IsChannelIdEnabled(config_service));
+}
+
// Test that cipher suites can be disabled. "Good" refers to the fact that
// every value is expected to be successfully parsed into a cipher suite.
TEST_F(SSLConfigServiceManagerPrefTest, GoodDisabledCipherSuites) {
- TestingPrefService pref_service;
- SSLConfigServiceManager::RegisterPrefs(&pref_service);
+ TestingPrefService local_state;
+ SSLConfigServiceManager::RegisterPrefs(&local_state);
scoped_ptr<SSLConfigServiceManager> config_manager(
- SSLConfigServiceManager::CreateDefaultManager(&pref_service));
+ SSLConfigServiceManager::CreateDefaultManager(&local_state, NULL));
ASSERT_TRUE(config_manager.get());
scoped_refptr<SSLConfigService> config_service(config_manager->Get());
ASSERT_TRUE(config_service.get());
@@ -54,7 +166,7 @@ TEST_F(SSLConfigServiceManagerPrefTest, GoodDisabledCipherSuites) {
ListValue* list_value = new ListValue();
list_value->Append(Value::CreateStringValue("0x0004"));
list_value->Append(Value::CreateStringValue("0x0005"));
- pref_service.SetUserPref(prefs::kCipherSuiteBlacklist, list_value);
+ local_state.SetUserPref(prefs::kCipherSuiteBlacklist, list_value);
// Pump the message loop to notify the SSLConfigServiceManagerPref that the
// preferences changed.
@@ -73,11 +185,11 @@ TEST_F(SSLConfigServiceManagerPrefTest, GoodDisabledCipherSuites) {
// there are one or more non-cipher suite strings in the preference. They
// should be ignored.
TEST_F(SSLConfigServiceManagerPrefTest, BadDisabledCipherSuites) {
- TestingPrefService pref_service;
- SSLConfigServiceManager::RegisterPrefs(&pref_service);
+ TestingPrefService local_state;
+ SSLConfigServiceManager::RegisterPrefs(&local_state);
scoped_ptr<SSLConfigServiceManager> config_manager(
- SSLConfigServiceManager::CreateDefaultManager(&pref_service));
+ SSLConfigServiceManager::CreateDefaultManager(&local_state, NULL));
ASSERT_TRUE(config_manager.get());
scoped_refptr<SSLConfigService> config_service(config_manager->Get());
ASSERT_TRUE(config_service.get());
@@ -91,7 +203,7 @@ TEST_F(SSLConfigServiceManagerPrefTest, BadDisabledCipherSuites) {
list_value->Append(Value::CreateStringValue("TLS_NOT_WITH_A_CIPHER_SUITE"));
list_value->Append(Value::CreateStringValue("0x0005"));
list_value->Append(Value::CreateStringValue("0xBEEFY"));
- pref_service.SetUserPref(prefs::kCipherSuiteBlacklist, list_value);
+ local_state.SetUserPref(prefs::kCipherSuiteBlacklist, list_value);
// Pump the message loop to notify the SSLConfigServiceManagerPref that the
// preferences changed.
@@ -109,16 +221,16 @@ TEST_F(SSLConfigServiceManagerPrefTest, BadDisabledCipherSuites) {
// Test that without command-line settings for minimum and maximum SSL
// versions, SSL 3.0 ~ default_version_max() are enabled.
TEST_F(SSLConfigServiceManagerPrefTest, NoCommandLinePrefs) {
- scoped_refptr<TestingPrefStore> user_prefs(new TestingPrefStore());
+ scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore());
PrefServiceMockBuilder builder;
- builder.WithUserPrefs(user_prefs.get());
- scoped_ptr<PrefService> pref_service(builder.Create());
+ builder.WithUserPrefs(local_state_store.get());
+ scoped_ptr<PrefService> local_state(builder.Create());
- SSLConfigServiceManager::RegisterPrefs(pref_service.get());
+ SSLConfigServiceManager::RegisterPrefs(local_state.get());
scoped_ptr<SSLConfigServiceManager> config_manager(
- SSLConfigServiceManager::CreateDefaultManager(pref_service.get()));
+ SSLConfigServiceManager::CreateDefaultManager(local_state.get(), NULL));
ASSERT_TRUE(config_manager.get());
scoped_refptr<SSLConfigService> config_service(config_manager->Get());
ASSERT_TRUE(config_service.get());
@@ -131,36 +243,37 @@ TEST_F(SSLConfigServiceManagerPrefTest, NoCommandLinePrefs) {
EXPECT_EQ(net::SSLConfigService::default_version_max(),
ssl_config.version_max);
- // The user settings should not be added to the pref_service.
- EXPECT_FALSE(pref_service->HasPrefPath(prefs::kSSLVersionMin));
- EXPECT_FALSE(pref_service->HasPrefPath(prefs::kSSLVersionMax));
+ // The settings should not be added to the local_state.
+ EXPECT_FALSE(local_state->HasPrefPath(prefs::kSSLVersionMin));
+ EXPECT_FALSE(local_state->HasPrefPath(prefs::kSSLVersionMax));
- // Explicitly double-check the settings are not in the user preference
- // store.
+ // Explicitly double-check the settings are not in the preference store.
std::string version_min_str;
std::string version_max_str;
- EXPECT_FALSE(user_prefs->GetString(prefs::kSSLVersionMin, &version_min_str));
- EXPECT_FALSE(user_prefs->GetString(prefs::kSSLVersionMax, &version_max_str));
+ EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin,
+ &version_min_str));
+ EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax,
+ &version_max_str));
}
// Test that command-line settings for minimum and maximum SSL versions are
-// respected and that they do not persist to the user preferences files.
+// respected and that they do not persist to the preferences files.
TEST_F(SSLConfigServiceManagerPrefTest, CommandLinePrefs) {
- scoped_refptr<TestingPrefStore> user_prefs(new TestingPrefStore());
+ scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore());
CommandLine command_line(CommandLine::NO_PROGRAM);
command_line.AppendSwitchASCII(switches::kSSLVersionMin, "tls1");
command_line.AppendSwitchASCII(switches::kSSLVersionMax, "ssl3");
PrefServiceMockBuilder builder;
- builder.WithUserPrefs(user_prefs.get());
+ builder.WithUserPrefs(local_state_store.get());
builder.WithCommandLine(&command_line);
- scoped_ptr<PrefService> pref_service(builder.Create());
+ scoped_ptr<PrefService> local_state(builder.Create());
- SSLConfigServiceManager::RegisterPrefs(pref_service.get());
+ SSLConfigServiceManager::RegisterPrefs(local_state.get());
scoped_ptr<SSLConfigServiceManager> config_manager(
- SSLConfigServiceManager::CreateDefaultManager(pref_service.get()));
+ SSLConfigServiceManager::CreateDefaultManager(local_state.get(), NULL));
ASSERT_TRUE(config_manager.get());
scoped_refptr<SSLConfigService> config_service(config_manager->Get());
ASSERT_TRUE(config_service.get());
@@ -171,18 +284,19 @@ TEST_F(SSLConfigServiceManagerPrefTest, CommandLinePrefs) {
EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_min);
EXPECT_EQ(net::SSL_PROTOCOL_VERSION_SSL3, ssl_config.version_max);
- // Explicitly double-check the settings are not in the user preference
- // store.
+ // Explicitly double-check the settings are not in the preference store.
const PrefService::Preference* version_min_pref =
- pref_service->FindPreference(prefs::kSSLVersionMin);
+ local_state->FindPreference(prefs::kSSLVersionMin);
EXPECT_FALSE(version_min_pref->IsUserModifiable());
const PrefService::Preference* version_max_pref =
- pref_service->FindPreference(prefs::kSSLVersionMax);
+ local_state->FindPreference(prefs::kSSLVersionMax);
EXPECT_FALSE(version_max_pref->IsUserModifiable());
std::string version_min_str;
std::string version_max_str;
- EXPECT_FALSE(user_prefs->GetString(prefs::kSSLVersionMin, &version_min_str));
- EXPECT_FALSE(user_prefs->GetString(prefs::kSSLVersionMax, &version_max_str));
+ EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin,
+ &version_min_str));
+ EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax,
+ &version_max_str));
}
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index a550e5e..5933687 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -346,7 +346,7 @@ void ProfileImpl::DoFinalInit(bool is_new_profile) {
PrefService* local_state = g_browser_process->local_state();
ssl_config_service_manager_.reset(
- SSLConfigServiceManager::CreateDefaultManager(local_state));
+ SSLConfigServiceManager::CreateDefaultManager(local_state, prefs));
// Initialize the BackgroundModeManager - this has to be done here before
// InitExtensions() is called because it relies on receiving notifications