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

Unified Diff: chrome/browser/io_thread.cc

Issue 869393005: Perform ClientHello padding if the field trial is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@net_connection_error_uma
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
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(
&params->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(

Powered by Google App Engine
This is Rietveld 408576698