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

Unified Diff: net/socket/ssl_client_socket.cc

Issue 1371263002: Refactor SSLClientSocket::SerializeNextProtos(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/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;

Powered by Google App Engine
This is Rietveld 408576698