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

Unified Diff: net/http/http_network_transaction.cc

Issue 339663010: Add a probability to Alternate-Protocol support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better plumbing Created 6 years, 6 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/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 32af2dd1844a8170be8615aa2701601e24ee0b63..59e6a12e741b4cfaa6b59d22ca7c6375b1e416a0 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -79,17 +79,20 @@ void ProcessAlternateProtocol(
HttpNetworkSession* session,
const HttpResponseHeaders& headers,
const HostPortPair& http_host_port_pair) {
- std::string alternate_protocol_str;
-
- if (!headers.EnumerateHeader(NULL, kAlternateProtocolHeader,
- &alternate_protocol_str)) {
- // Header is not present.
+ if (!headers.HasHeader(kAlternateProtocolHeader))
return;
+
+ std::vector<std::string> alternate_protocol_values;
+ void* iter = NULL;
+ std::string alternate_protocol_str;
+ while (headers.EnumerateHeader(&iter, kAlternateProtocolHeader,
+ &alternate_protocol_str)) {
+ alternate_protocol_values.push_back(alternate_protocol_str);
}
session->http_stream_factory()->ProcessAlternateProtocol(
session->http_server_properties(),
- alternate_protocol_str,
+ alternate_protocol_values,
http_host_port_pair,
*session);
}

Powered by Google App Engine
This is Rietveld 408576698