| 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));
|
| }
|
|
|