Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: chrome/browser/net/ssl_config_service_manager_pref.cc

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix. And rebase Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/threading/thread.h" 6 #include "base/threading/thread.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/io_thread.h" 8 #include "chrome/browser/io_thread.h"
9 #include "chrome/browser/net/ssl_config_service_manager.h" 9 #include "chrome/browser/net/ssl_config_service_manager.h"
10 #include "chrome/browser/prefs/pref_member.h" 10 #include "chrome/browser/prefs/pref_member.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Initialize from UI thread. This is okay as there shouldn't be anything on 118 // Initialize from UI thread. This is okay as there shouldn't be anything on
119 // the IO thread trying to access it yet. 119 // the IO thread trying to access it yet.
120 GetSSLConfigFromPrefs(&ssl_config_service_->cached_config_); 120 GetSSLConfigFromPrefs(&ssl_config_service_->cached_config_);
121 } 121 }
122 122
123 // static 123 // static
124 void SSLConfigServiceManagerPref::RegisterPrefs(PrefService* prefs) { 124 void SSLConfigServiceManagerPref::RegisterPrefs(PrefService* prefs) {
125 net::SSLConfig default_config; 125 net::SSLConfig default_config;
126 if (!prefs->FindPreference(prefs::kCertRevocationCheckingEnabled)) { 126 if (!prefs->FindPreference(prefs::kCertRevocationCheckingEnabled)) {
127 prefs->RegisterBooleanPref(prefs::kCertRevocationCheckingEnabled, 127 prefs->RegisterBooleanPref(prefs::kCertRevocationCheckingEnabled,
128 default_config.rev_checking_enabled); 128 default_config.rev_checking_enabled,
129 PrefService::UNSYNCABLE_PREF);
129 } 130 }
130 if (!prefs->FindPreference(prefs::kSSL3Enabled)) { 131 if (!prefs->FindPreference(prefs::kSSL3Enabled)) {
131 prefs->RegisterBooleanPref(prefs::kSSL3Enabled, 132 prefs->RegisterBooleanPref(prefs::kSSL3Enabled,
132 default_config.ssl3_enabled); 133 default_config.ssl3_enabled,
134 PrefService::UNSYNCABLE_PREF);
133 } 135 }
134 if (!prefs->FindPreference(prefs::kTLS1Enabled)) { 136 if (!prefs->FindPreference(prefs::kTLS1Enabled)) {
135 prefs->RegisterBooleanPref(prefs::kTLS1Enabled, 137 prefs->RegisterBooleanPref(prefs::kTLS1Enabled,
136 default_config.tls1_enabled); 138 default_config.tls1_enabled,
139 PrefService::UNSYNCABLE_PREF);
137 } 140 }
138 } 141 }
139 142
140 // static 143 // static
141 void SSLConfigServiceManagerPref::MigrateUserPrefs(PrefService* local_state, 144 void SSLConfigServiceManagerPref::MigrateUserPrefs(PrefService* local_state,
142 PrefService* user_prefs) { 145 PrefService* user_prefs) {
143 if (user_prefs->HasPrefPath(prefs::kCertRevocationCheckingEnabled)) { 146 if (user_prefs->HasPrefPath(prefs::kCertRevocationCheckingEnabled)) {
144 if (!local_state->HasPrefPath(prefs::kCertRevocationCheckingEnabled)) { 147 if (!local_state->HasPrefPath(prefs::kCertRevocationCheckingEnabled)) {
145 // Migrate the kCertRevocationCheckingEnabled preference. 148 // Migrate the kCertRevocationCheckingEnabled preference.
146 local_state->SetBoolean(prefs::kCertRevocationCheckingEnabled, 149 local_state->SetBoolean(prefs::kCertRevocationCheckingEnabled,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 202
200 //////////////////////////////////////////////////////////////////////////////// 203 ////////////////////////////////////////////////////////////////////////////////
201 // SSLConfigServiceManager 204 // SSLConfigServiceManager
202 205
203 // static 206 // static
204 SSLConfigServiceManager* SSLConfigServiceManager::CreateDefaultManager( 207 SSLConfigServiceManager* SSLConfigServiceManager::CreateDefaultManager(
205 PrefService* user_prefs, 208 PrefService* user_prefs,
206 PrefService* local_state) { 209 PrefService* local_state) {
207 return new SSLConfigServiceManagerPref(user_prefs, local_state); 210 return new SSLConfigServiceManagerPref(user_prefs, local_state);
208 } 211 }
OLDNEW
« no previous file with comments | « chrome/browser/net/pref_proxy_config_service.cc ('k') | chrome/browser/password_manager/password_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698