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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/ssl/ssl_socket_config_service.h"
6
7 #include <string>
8 #include "net/base/host_port_pair.h"
9
10 namespace {
11 const char* kGoogleDomain = ".google.com";
12 }
13
14 namespace net {
15
16 void SSLSocketConfigService::EnableFastRadioPadding() {
17 enabled_ = true;
18 }
19
20 void SSLSocketConfigService::DisableFastRadioPadding() {
21 enabled_ = false;
22 }
23
24 bool SSLSocketConfigService::UseFastRadioPadding(
25 const HostPortPair& host_and_port) {
26 if (!enabled_)
27 return false;
28
29 return IsGoogle(host_and_port);
30 }
31
32 bool SSLSocketConfigService::IsGoogle(const HostPortPair& host_and_port) {
33 const std::string& host = host_and_port.host();
34 bool is_google =
35 host == kGoogleDomain ||
36 (host.size() > 11 && host.rfind(kGoogleDomain) == host.size() - 11);
37 return is_google;
38 }
39
40 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698