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

Unified Diff: net/ssl/ssl_socket_config_service.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: net/ssl/ssl_socket_config_service.cc
diff --git a/net/ssl/ssl_socket_config_service.cc b/net/ssl/ssl_socket_config_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8ae1925ed3da2e858ddbdc864045214ea3f69933
--- /dev/null
+++ b/net/ssl/ssl_socket_config_service.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/ssl/ssl_socket_config_service.h"
+
+#include <string>
+#include "net/base/host_port_pair.h"
+
+namespace {
+const char* kGoogleDomain = ".google.com";
+}
+
+namespace net {
+
+void SSLSocketConfigService::EnableFastRadioPadding() {
+ enabled_ = true;
+}
+
+void SSLSocketConfigService::DisableFastRadioPadding() {
+ enabled_ = false;
+}
+
+bool SSLSocketConfigService::UseFastRadioPadding(
+ const HostPortPair& host_and_port) {
+ if (!enabled_)
+ return false;
+
+ return IsGoogle(host_and_port);
+}
+
+bool SSLSocketConfigService::IsGoogle(const HostPortPair& host_and_port) {
+ const std::string& host = host_and_port.host();
+ bool is_google =
+ host == kGoogleDomain ||
+ (host.size() > 11 && host.rfind(kGoogleDomain) == host.size() - 11);
+ return is_google;
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698