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

Unified Diff: net/http/http_stream_factory.cc

Issue 1824903002: Change the AlternativeServiceMap with SchemeOriginPair key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unittests Created 4 years, 9 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_stream_factory.cc
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index d6d76b453c8e82d124d474ad7c844d3f5a1f5ade..9a6bc0ae47564557cdba0ff476d0df83ae67457e 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -35,7 +35,7 @@ void HttpStreamFactory::ResetStaticSettingsToInit() {
void HttpStreamFactory::ProcessAlternativeService(
const base::WeakPtr<HttpServerProperties>& http_server_properties,
base::StringPiece alternative_service_str,
- const HostPortPair& http_host_port_pair,
+ const SchemeOriginPair& scheme_origin_pair,
const HttpNetworkSession& session) {
SpdyAltSvcWireFormat::AlternativeServiceVector alternative_service_vector;
if (!SpdyAltSvcWireFormat::ParseHeaderFieldValue(
@@ -85,13 +85,15 @@ void HttpStreamFactory::ProcessAlternativeService(
}
http_server_properties->SetAlternativeServices(
- RewriteHost(http_host_port_pair), alternative_service_info_vector);
+ SchemeOriginPair(scheme_origin_pair.scheme(),
+ RewriteHost(scheme_origin_pair.host_port_pair())),
+ alternative_service_info_vector);
}
void HttpStreamFactory::ProcessAlternateProtocol(
const base::WeakPtr<HttpServerProperties>& http_server_properties,
const std::vector<std::string>& alternate_protocol_values,
- const HostPortPair& http_host_port_pair,
+ const SchemeOriginPair& scheme_origin_pair,
const HttpNetworkSession& session) {
AlternateProtocol protocol = UNINITIALIZED_ALTERNATE_PROTOCOL;
int port = 0;
@@ -146,12 +148,13 @@ void HttpStreamFactory::ProcessAlternateProtocol(
}
if (!is_valid || protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) {
- http_server_properties->ClearAlternativeServices(http_host_port_pair);
+ http_server_properties->ClearAlternativeServices(scheme_origin_pair);
return;
}
http_server_properties->SetAlternativeService(
- RewriteHost(http_host_port_pair),
+ SchemeOriginPair(scheme_origin_pair.scheme(),
+ RewriteHost(scheme_origin_pair.host_port_pair())),
AlternativeService(protocol, "", static_cast<uint16_t>(port)),
probability, base::Time::Now() + base::TimeDelta::FromDays(30));
}

Powered by Google App Engine
This is Rietveld 408576698