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

Unified Diff: chrome/browser/net/ssl_config_service_manager_pref.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: Rebase Created 5 years, 10 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
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | net/socket/ssl_client_socket_openssl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/ssl_config_service_manager_pref.cc
diff --git a/chrome/browser/net/ssl_config_service_manager_pref.cc b/chrome/browser/net/ssl_config_service_manager_pref.cc
index decd8951c11ef5829b8125a65b5634150749d906..a1bf2a85e950ac190de418b42d2c73f86068c0ad 100644
--- a/chrome/browser/net/ssl_config_service_manager_pref.cc
+++ b/chrome/browser/net/ssl_config_service_manager_pref.cc
@@ -23,11 +23,17 @@
#include "net/socket/ssl_client_socket.h"
#include "net/ssl/ssl_cipher_suite_names.h"
#include "net/ssl/ssl_config_service.h"
+#include "url/gurl.h"
using content::BrowserThread;
namespace {
+// Field trial for ClientHello padding.
+const char kClientHelloFieldTrialName[] = "FastRadioPadding";
+const char kClientHelloFieldTrialEnabledGroupName[] = "Enabled";
+const char* kGoogleDomain = "google.com";
Alexei Svitkine (slow) 2015/02/06 20:26:34 Nit: Change to the same syntax as the ones above,
jeremyim 2015/02/06 22:40:29 Done.
+
// Converts a ListValue of StringValues into a vector of strings. Any Values
// which cannot be converted will be skipped.
std::vector<std::string> ListValueToStringVector(const base::ListValue* value) {
@@ -96,6 +102,8 @@ class SSLConfigServicePref : public net::SSLConfigService {
// Store SSL config settings in |config|. Must only be called from IO thread.
void GetSSLConfig(net::SSLConfig* config) override;
+ bool SupportsFastradioPadding(const GURL& url) override;
+
private:
// Allow the pref watcher to update our internal state.
friend class SSLConfigServiceManagerPref;
@@ -116,6 +124,14 @@ void SSLConfigServicePref::GetSSLConfig(net::SSLConfig* config) {
*config = cached_config_;
}
+bool SSLConfigServicePref::SupportsFastradioPadding(const GURL& url) {
+ const std::string& host = url.host();
+ bool is_google =
+ host == kGoogleDomain ||
+ (host.size() > 10 && host.rfind(kGoogleDomain) == host.size() - 10);
Alexei Svitkine (slow) 2015/02/06 20:26:34 Can this use some of the existing utils we have in
Ryan Sleevi 2015/02/06 22:12:59 +1
davidben 2015/02/06 22:22:54 If not switching it, note the current logic will t
jeremyim 2015/02/06 22:40:29 Done.
+ return is_google;
+}
+
void SSLConfigServicePref::SetNewSSLConfig(
const net::SSLConfig& new_config) {
net::SSLConfig orig_config = cached_config_;
@@ -286,6 +302,12 @@ void SSLConfigServiceManagerPref::GetSSLConfigFromPrefs(
config->disabled_cipher_suites = disabled_cipher_suites_;
// disabling False Start also happens to disable record splitting.
config->false_start_enabled = !ssl_record_splitting_disabled_.GetValue();
+
+ base::StringPiece group =
+ base::FieldTrialList::FindFullName(kClientHelloFieldTrialName);
+ if (group.starts_with(kClientHelloFieldTrialEnabledGroupName)) {
+ config->enable_fastradio_padding = true;
+ }
}
void SSLConfigServiceManagerPref::OnDisabledCipherSuitesChange(
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | net/socket/ssl_client_socket_openssl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698