Index: net/socket/ssl_client_socket.cc |
diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc |
index 8f88b31f0ce10052b4857167e4f4e7a60ba7d54e..0e03262dd537c489b475a24615c9f64b8e89fc92 100644 |
--- a/net/socket/ssl_client_socket.cc |
+++ b/net/socket/ssl_client_socket.cc |
@@ -188,14 +188,22 @@ bool SSLClientSocket::IsTLSVersionAdequateForHTTP2( |
} |
// static |
+void SSLClientSocket::DisableHTTP2(NextProtoVector* next_protos) { |
+ for (NextProtoVector::iterator it = next_protos->begin(); |
+ it != next_protos->end();) { |
+ if (*it == kProtoHTTP2) { |
+ it = next_protos->erase(it); |
+ continue; |
+ } |
+ ++it; |
+ } |
+} |
+ |
+// static |
std::vector<uint8_t> SSLClientSocket::SerializeNextProtos( |
- const NextProtoVector& next_protos, |
- bool can_advertise_http2) { |
+ const NextProtoVector& next_protos) { |
std::vector<uint8_t> wire_protos; |
for (const NextProto next_proto : next_protos) { |
- if (!can_advertise_http2 && next_proto == kProtoHTTP2) { |
- continue; |
- } |
const std::string proto = NextProtoToString(next_proto); |
if (proto.size() > 255) { |
LOG(WARNING) << "Ignoring overlong NPN/ALPN protocol: " << proto; |