Index: chrome/browser/io_thread.cc |
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc |
index 9ef53eeac4556f6865d2b244199b8d94a453161e..0bb75b00a3bc48b0d4e9d92103b573ab919b502b 100644 |
--- a/chrome/browser/io_thread.cc |
+++ b/chrome/browser/io_thread.cc |
@@ -75,6 +75,7 @@ |
#include "net/spdy/spdy_session.h" |
#include "net/ssl/channel_id_service.h" |
#include "net/ssl/default_channel_id_store.h" |
+#include "net/ssl/ssl_socket_config_service.h" |
#include "net/url_request/data_protocol_handler.h" |
#include "net/url_request/file_protocol_handler.h" |
#include "net/url_request/ftp_protocol_handler.h" |
@@ -140,6 +141,10 @@ const char kSpdyFieldTrialSpdy4ControlGroupName[] = "Spdy4Control"; |
// Field trial for Cache-Control: stale-while-revalidate directive. |
const char kStaleWhileRevalidateFieldTrialName[] = "StaleWhileRevalidate"; |
+// Field trial for ClientHello padding. |
+const char kClientHelloFieldTrialName[] = "FastRadioPadding"; |
+const char kClientHelloFieldTrialEnabledGroupName[] = "Enabled"; |
+ |
#if defined(OS_MACOSX) && !defined(OS_IOS) |
void ObserveKeychainEvents() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
@@ -733,6 +738,8 @@ void IOThread::InitAsync() { |
globals_->proxy_script_fetcher_context.reset( |
ConstructProxyScriptFetcherContext(globals_, net_log_)); |
+ ConfigureSSLSocketConfigService(command_line); |
+ |
#if defined(OS_MACOSX) && !defined(OS_IOS) |
// Start observing Keychain events. This needs to be done on the UI thread, |
// as Keychain services requires a CFRunLoop. |
@@ -1006,6 +1013,7 @@ void IOThread::InitializeNetworkSessionParamsFromGlobals( |
params->use_stale_while_revalidate = globals.use_stale_while_revalidate; |
params->testing_fixed_http_port = globals.testing_fixed_http_port; |
params->testing_fixed_https_port = globals.testing_fixed_https_port; |
+ params->ssl_socket_config_service = globals.ssl_socket_config_service.get(); |
globals.enable_tcp_fast_open_for_ssl.CopyToIfSet( |
¶ms->enable_tcp_fast_open_for_ssl); |
@@ -1142,6 +1150,15 @@ void IOThread::ConfigureQuic(const base::CommandLine& command_line) { |
ConfigureQuicGlobals(command_line, group, params, globals_); |
} |
+void IOThread::ConfigureSSLSocketConfigService( |
+ const base::CommandLine& command_line) { |
+ // Always fetch the field trial group to ensure it is reported correctly. |
+ std::string group = |
+ base::FieldTrialList::FindFullName(kClientHelloFieldTrialName); |
+ |
+ ConfigureSSLSocketConfigServiceGlobals(command_line, group, globals_); |
+} |
+ |
// static |
void IOThread::ConfigureQuicGlobals( |
const base::CommandLine& command_line, |
@@ -1298,6 +1315,21 @@ double IOThread::GetAlternateProtocolProbabilityThreshold( |
} |
// static |
+void IOThread::ConfigureSSLSocketConfigServiceGlobals( |
+ const base::CommandLine& command_line, |
+ base::StringPiece client_hello_trial_group, |
+ Globals* globals) { |
+ globals->ssl_socket_config_service.reset(new net::SSLSocketConfigService()); |
+ |
+ if (client_hello_trial_group.starts_with( |
+ kClientHelloFieldTrialEnabledGroupName)) { |
+ globals->ssl_socket_config_service->EnableFastRadioPadding(); |
+ } else { |
+ globals->ssl_socket_config_service->DisableFastRadioPadding(); |
+ } |
+} |
+ |
+// static |
bool IOThread::ShouldQuicAlwaysRequireHandshakeConfirmation( |
const VariationParameters& quic_trial_params) { |
return LowerCaseEqualsASCII( |