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

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: Created 4 years, 8 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
« no previous file with comments | « net/http/http_stream_factory.h ('k') | net/http/http_stream_factory_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory.cc
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index 6ea3224dc96cb3534ca9788d0fdacf0767a5bbb2..f4296c1234926e1b0f72fcb21ab53528b9999937 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -36,7 +36,7 @@ void HttpStreamFactory::ResetStaticSettingsToInit() {
void HttpStreamFactory::ProcessAlternativeServices(
HttpNetworkSession* session,
const HttpResponseHeaders* headers,
- const HostPortPair& http_host_port_pair) {
+ const url::SchemeHostPort& http_host_port_pair) {
if (session->params().parse_alternative_services) {
if (headers->HasHeader(kAlternativeServiceHeader)) {
std::string alternative_service_str;
@@ -89,7 +89,7 @@ HttpStreamFactory::HttpStreamFactory() {}
void HttpStreamFactory::ProcessAlternativeService(
const base::WeakPtr<HttpServerProperties>& http_server_properties,
base::StringPiece alternative_service_str,
- const HostPortPair& http_host_port_pair,
+ const url::SchemeHostPort& scheme_origin_pair,
const HttpNetworkSession& session) {
SpdyAltSvcWireFormat::AlternativeServiceVector alternative_service_vector;
if (!SpdyAltSvcWireFormat::ParseHeaderFieldValue(
@@ -137,15 +137,19 @@ void HttpStreamFactory::ProcessAlternativeService(
expiration);
alternative_service_info_vector.push_back(alternative_service_info);
}
+ HostPortPair rewrite_host =
+ RewriteHost(HostPortPair::FromSchemeHostPort(scheme_origin_pair));
http_server_properties->SetAlternativeServices(
- RewriteHost(http_host_port_pair), alternative_service_info_vector);
+ url::SchemeHostPort(scheme_origin_pair.scheme(), rewrite_host.host(),
+ rewrite_host.port()),
+ 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 url::SchemeHostPort& scheme_origin_pair,
const HttpNetworkSession& session) {
AlternateProtocol protocol = UNINITIALIZED_ALTERNATE_PROTOCOL;
int port = 0;
@@ -190,12 +194,16 @@ 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;
}
+ HostPortPair rewrite_host =
+ RewriteHost(HostPortPair::FromSchemeHostPort(scheme_origin_pair));
+
http_server_properties->SetAlternativeService(
- RewriteHost(http_host_port_pair),
+ url::SchemeHostPort(scheme_origin_pair.scheme(), rewrite_host.host(),
+ rewrite_host.port()),
AlternativeService(protocol, "", static_cast<uint16_t>(port)),
base::Time::Now() + base::TimeDelta::FromDays(30));
}
« no previous file with comments | « net/http/http_stream_factory.h ('k') | net/http/http_stream_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698