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

Side by Side Diff: components/ssl_config/ssl_config_service_manager_pref.cc

Issue 1771923002: Remove the RC4 field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU fix Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "components/ssl_config/ssl_config_service_manager.h" 4 #include "components/ssl_config/ssl_config_service_manager.h"
5 5
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/feature_list.h" 13 #include "base/feature_list.h"
14 #include "base/location.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/metrics/field_trial.h"
16 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
17 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
18 #include "base/values.h" 18 #include "base/values.h"
19 #include "components/content_settings/core/browser/content_settings_utils.h" 19 #include "components/content_settings/core/browser/content_settings_utils.h"
20 #include "components/content_settings/core/common/content_settings.h" 20 #include "components/content_settings/core/common/content_settings.h"
21 #include "components/prefs/pref_change_registrar.h" 21 #include "components/prefs/pref_change_registrar.h"
22 #include "components/prefs/pref_member.h" 22 #include "components/prefs/pref_member.h"
23 #include "components/prefs/pref_registry_simple.h" 23 #include "components/prefs/pref_registry_simple.h"
24 #include "components/prefs/pref_service.h" 24 #include "components/prefs/pref_service.h"
25 #include "components/ssl_config/ssl_config_prefs.h" 25 #include "components/ssl_config/ssl_config_prefs.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (version_str == switches::kSSLVersionTLSv1) { 76 if (version_str == switches::kSSLVersionTLSv1) {
77 version = net::SSL_PROTOCOL_VERSION_TLS1; 77 version = net::SSL_PROTOCOL_VERSION_TLS1;
78 } else if (version_str == switches::kSSLVersionTLSv11) { 78 } else if (version_str == switches::kSSLVersionTLSv11) {
79 version = net::SSL_PROTOCOL_VERSION_TLS1_1; 79 version = net::SSL_PROTOCOL_VERSION_TLS1_1;
80 } else if (version_str == switches::kSSLVersionTLSv12) { 80 } else if (version_str == switches::kSSLVersionTLSv12) {
81 version = net::SSL_PROTOCOL_VERSION_TLS1_2; 81 version = net::SSL_PROTOCOL_VERSION_TLS1_2;
82 } 82 }
83 return version; 83 return version;
84 } 84 }
85 85
86 bool IsRC4EnabledByDefault() {
87 const std::string group_name =
88 base::FieldTrialList::FindFullName("RC4Ciphers");
89 return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE);
90 }
91
92 const base::Feature kSSLVersionFallbackTLSv11 { 86 const base::Feature kSSLVersionFallbackTLSv11 {
93 "SSLVersionFallbackTLSv1.1", base::FEATURE_DISABLED_BY_DEFAULT, 87 "SSLVersionFallbackTLSv1.1", base::FEATURE_DISABLED_BY_DEFAULT,
94 }; 88 };
95 89
96 } // namespace 90 } // namespace
97 91
98 //////////////////////////////////////////////////////////////////////////////// 92 ////////////////////////////////////////////////////////////////////////////////
99 // SSLConfigServicePref 93 // SSLConfigServicePref
100 94
101 // An SSLConfigService which stores a cached version of the current SSLConfig 95 // An SSLConfigService which stores a cached version of the current SSLConfig
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 DISALLOW_COPY_AND_ASSIGN(SSLConfigServiceManagerPref); 185 DISALLOW_COPY_AND_ASSIGN(SSLConfigServiceManagerPref);
192 }; 186 };
193 187
194 SSLConfigServiceManagerPref::SSLConfigServiceManagerPref( 188 SSLConfigServiceManagerPref::SSLConfigServiceManagerPref(
195 PrefService* local_state, 189 PrefService* local_state,
196 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) 190 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner)
197 : ssl_config_service_(new SSLConfigServicePref(io_task_runner)), 191 : ssl_config_service_(new SSLConfigServicePref(io_task_runner)),
198 io_task_runner_(io_task_runner) { 192 io_task_runner_(io_task_runner) {
199 DCHECK(local_state); 193 DCHECK(local_state);
200 194
201 local_state->SetDefaultPrefValue(
202 ssl_config::prefs::kRC4Enabled,
203 new base::FundamentalValue(IsRC4EnabledByDefault()));
204
205 // Restore the TLS 1.1 fallback leg if enabled via features. 195 // Restore the TLS 1.1 fallback leg if enabled via features.
206 // TODO(davidben): Remove this when the fallback removal has succeeded. 196 // TODO(davidben): Remove this when the fallback removal has succeeded.
207 // https://crbug.com/536200. 197 // https://crbug.com/536200.
208 if (base::FeatureList::IsEnabled(kSSLVersionFallbackTLSv11)) { 198 if (base::FeatureList::IsEnabled(kSSLVersionFallbackTLSv11)) {
209 local_state->SetDefaultPrefValue( 199 local_state->SetDefaultPrefValue(
210 ssl_config::prefs::kSSLVersionFallbackMin, 200 ssl_config::prefs::kSSLVersionFallbackMin,
211 new base::StringValue(switches::kSSLVersionTLSv11)); 201 new base::StringValue(switches::kSSLVersionTLSv11));
212 } 202 }
213 203
214 PrefChangeRegistrar::NamedChangeCallback local_state_callback = 204 PrefChangeRegistrar::NamedChangeCallback local_state_callback =
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 PrefService* local_state, 323 PrefService* local_state,
334 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) { 324 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) {
335 return new SSLConfigServiceManagerPref(local_state, io_task_runner); 325 return new SSLConfigServiceManagerPref(local_state, io_task_runner);
336 } 326 }
337 327
338 // static 328 // static
339 void SSLConfigServiceManager::RegisterPrefs(PrefRegistrySimple* registry) { 329 void SSLConfigServiceManager::RegisterPrefs(PrefRegistrySimple* registry) {
340 SSLConfigServiceManagerPref::RegisterPrefs(registry); 330 SSLConfigServiceManagerPref::RegisterPrefs(registry);
341 } 331 }
342 } // namespace ssl_config 332 } // namespace ssl_config
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698