summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 20:34:23 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 20:34:23 +0000
commit5c7f649f4ff46a1764cbe82b850c69ce8af39c75 (patch)
treefb3aa61ef27036a8a4f7141d04ed5639ad919b00 /chrome/browser/net
parentda13e896a39a8fa7adeb7ea0c3345f62fbcbac86 (diff)
downloadchromium_src-5c7f649f4ff46a1764cbe82b850c69ce8af39c75.zip
chromium_src-5c7f649f4ff46a1764cbe82b850c69ce8af39c75.tar.gz
chromium_src-5c7f649f4ff46a1764cbe82b850c69ce8af39c75.tar.bz2
Revert 78272 - Changes to SSLConfigServicePref to use preferences from
Local State rather than user preferences on linux. SSL settings will apply to all profiles. This change impacts SSL3, TLS1 and Cert revocation enabled check boxes. BUG=67622 TEST=Options UI for security settings on all platforms. R=wtc,mattm Review URL: http://codereview.chromium.org/6646023 TBR=rtenneti@google.com Review URL: http://codereview.chromium.org/6695033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78274 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/ssl_config_service_manager.h13
-rw-r--r--chrome/browser/net/ssl_config_service_manager_pref.cc85
-rw-r--r--chrome/browser/net/ssl_config_service_manager_system.cc5
3 files changed, 24 insertions, 79 deletions
diff --git a/chrome/browser/net/ssl_config_service_manager.h b/chrome/browser/net/ssl_config_service_manager.h
index 2d734d4..750c5d8 100644
--- a/chrome/browser/net/ssl_config_service_manager.h
+++ b/chrome/browser/net/ssl_config_service_manager.h
@@ -10,20 +10,15 @@ namespace net {
class SSLConfigService;
} // namespace net
-class PrefService;
+class Profile;
// An interface for creating SSLConfigService objects for the current platform.
class SSLConfigServiceManager {
public:
// Create an instance of the default SSLConfigServiceManager for the current
- // platform. The lifetime of the PrefService objects must be longer than that
- // of the manager. On Linux, get SSL preferences from local_state object. If
- // SSL preferences don't exist in local_state object, then get the data from
- // user_prefs object and migrate it to local_state object and then delete the
- // data from user_prefs object.
- static SSLConfigServiceManager* CreateDefaultManager(
- PrefService* user_prefs,
- PrefService* local_state);
+ // platform. The lifetime of the profile must be longer than that of the
+ // manager.
+ static SSLConfigServiceManager* CreateDefaultManager(Profile* profile);
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 71e385b..2883085 100644
--- a/chrome/browser/net/ssl_config_service_manager_pref.cc
+++ b/chrome/browser/net/ssl_config_service_manager_pref.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/net/ssl_config_service_manager.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
@@ -62,21 +63,13 @@ class SSLConfigServiceManagerPref
: public SSLConfigServiceManager,
public NotificationObserver {
public:
- SSLConfigServiceManagerPref(PrefService* user_prefs,
- PrefService* local_state);
+ explicit SSLConfigServiceManagerPref(Profile* profile);
virtual ~SSLConfigServiceManagerPref() {}
virtual net::SSLConfigService* Get();
private:
- // Register user_prefs and local_state SSL preferences.
- static void RegisterPrefs(PrefService* prefs);
-
- // Copy pref values to local_state from user_prefs if local_state doesn't have
- // the pref value and user_prefs has the pref value. Remove them from
- // user_prefs.
- static void MigrateUserPrefs(PrefService* local_state,
- PrefService* user_prefs);
+ static void RegisterUserPrefs(PrefService* user_prefs);
// Callback for preference changes. This will post the changes to the IO
// thread with SetNewSSLConfig.
@@ -98,22 +91,14 @@ class SSLConfigServiceManagerPref
DISALLOW_COPY_AND_ASSIGN(SSLConfigServiceManagerPref);
};
-SSLConfigServiceManagerPref::SSLConfigServiceManagerPref(
- PrefService* user_prefs, PrefService* local_state)
+SSLConfigServiceManagerPref::SSLConfigServiceManagerPref(Profile* profile)
: ssl_config_service_(new SSLConfigServicePref()) {
- DCHECK(user_prefs);
- DCHECK(local_state);
-
- RegisterPrefs(user_prefs);
- RegisterPrefs(local_state);
-
- // TODO(rtenneti): remove migration code after 6 months.
- MigrateUserPrefs(local_state, user_prefs);
+ RegisterUserPrefs(profile->GetPrefs());
rev_checking_enabled_.Init(prefs::kCertRevocationCheckingEnabled,
- local_state, this);
- ssl3_enabled_.Init(prefs::kSSL3Enabled, local_state, this);
- tls1_enabled_.Init(prefs::kTLS1Enabled, local_state, this);
+ profile->GetPrefs(), this);
+ ssl3_enabled_.Init(prefs::kSSL3Enabled, profile->GetPrefs(), this);
+ tls1_enabled_.Init(prefs::kTLS1Enabled, profile->GetPrefs(), this);
// Initialize from UI thread. This is okay as there shouldn't be anything on
// the IO thread trying to access it yet.
@@ -121,49 +106,14 @@ SSLConfigServiceManagerPref::SSLConfigServiceManagerPref(
}
// static
-void SSLConfigServiceManagerPref::RegisterPrefs(PrefService* prefs) {
+void SSLConfigServiceManagerPref::RegisterUserPrefs(PrefService* user_prefs) {
net::SSLConfig default_config;
- if (!prefs->FindPreference(prefs::kCertRevocationCheckingEnabled)) {
- prefs->RegisterBooleanPref(prefs::kCertRevocationCheckingEnabled,
- default_config.rev_checking_enabled);
- }
- if (!prefs->FindPreference(prefs::kSSL3Enabled)) {
- prefs->RegisterBooleanPref(prefs::kSSL3Enabled,
- default_config.ssl3_enabled);
- }
- if (!prefs->FindPreference(prefs::kTLS1Enabled)) {
- prefs->RegisterBooleanPref(prefs::kTLS1Enabled,
- default_config.tls1_enabled);
- }
-}
-
-// static
-void SSLConfigServiceManagerPref::MigrateUserPrefs(PrefService* local_state,
- PrefService* user_prefs) {
- if (user_prefs->HasPrefPath(prefs::kCertRevocationCheckingEnabled)) {
- if (!local_state->HasPrefPath(prefs::kCertRevocationCheckingEnabled)) {
- // Migrate the kCertRevocationCheckingEnabled preference.
- local_state->SetBoolean(prefs::kCertRevocationCheckingEnabled,
- user_prefs->GetBoolean(prefs::kCertRevocationCheckingEnabled));
- }
- user_prefs->ClearPref(prefs::kCertRevocationCheckingEnabled);
- }
- if (user_prefs->HasPrefPath(prefs::kSSL3Enabled)) {
- if (!local_state->HasPrefPath(prefs::kSSL3Enabled)) {
- // Migrate the kSSL3Enabled preference.
- local_state->SetBoolean(prefs::kSSL3Enabled,
- user_prefs->GetBoolean(prefs::kSSL3Enabled));
- }
- user_prefs->ClearPref(prefs::kSSL3Enabled);
- }
- if (user_prefs->HasPrefPath(prefs::kTLS1Enabled)) {
- if (!local_state->HasPrefPath(prefs::kTLS1Enabled)) {
- // Migrate the kTLS1Enabled preference.
- local_state->SetBoolean(prefs::kTLS1Enabled,
- user_prefs->GetBoolean(prefs::kTLS1Enabled));
- }
- user_prefs->ClearPref(prefs::kTLS1Enabled);
- }
+ user_prefs->RegisterBooleanPref(prefs::kCertRevocationCheckingEnabled,
+ default_config.rev_checking_enabled);
+ user_prefs->RegisterBooleanPref(prefs::kSSL3Enabled,
+ default_config.ssl3_enabled);
+ user_prefs->RegisterBooleanPref(prefs::kTLS1Enabled,
+ default_config.tls1_enabled);
}
net::SSLConfigService* SSLConfigServiceManagerPref::Get() {
@@ -202,7 +152,6 @@ void SSLConfigServiceManagerPref::GetSSLConfigFromPrefs(
// static
SSLConfigServiceManager* SSLConfigServiceManager::CreateDefaultManager(
- PrefService* user_prefs,
- PrefService* local_state) {
- return new SSLConfigServiceManagerPref(user_prefs, local_state);
+ Profile* profile) {
+ return new SSLConfigServiceManagerPref(profile);
}
diff --git a/chrome/browser/net/ssl_config_service_manager_system.cc b/chrome/browser/net/ssl_config_service_manager_system.cc
index 20b4252..15ac023 100644
--- a/chrome/browser/net/ssl_config_service_manager_system.cc
+++ b/chrome/browser/net/ssl_config_service_manager_system.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/net/ssl_config_service_manager.h"
#include "net/base/ssl_config_service.h"
+class Profile;
+
////////////////////////////////////////////////////////////////////////////////
// SSLConfigServiceManagerSystem
@@ -34,7 +36,6 @@ class SSLConfigServiceManagerSystem
// static
SSLConfigServiceManager* SSLConfigServiceManager::CreateDefaultManager(
- PrefService* user_prefs,
- PrefService* local_state) {
+ Profile* profile) {
return new SSLConfigServiceManagerSystem();
}