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

Unified Diff: net/http/http_stream_factory.cc

Issue 1904483004: Change SupportsSpdy dict, SpdySettingsMap, ServerNetworkStatsMap, AlternativeServiceMap and disk da… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile after sync code, introduced by commit 388755 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 0f2cf40abe7128d3e76b420b336f5776bb665ed5..b0f1780a7620451f77f997ea5c1930cc7769a020 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -37,15 +37,14 @@ void HttpStreamFactory::ResetStaticSettingsToInit() {
void HttpStreamFactory::ProcessAlternativeServices(
HttpNetworkSession* session,
const HttpResponseHeaders* headers,
- const HostPortPair& http_host_port_pair) {
+ const url::SchemeHostPort& http_server) {
if (session->params().parse_alternative_services) {
if (headers->HasHeader(kAlternativeServiceHeader)) {
std::string alternative_service_str;
headers->GetNormalizedHeader(kAlternativeServiceHeader,
&alternative_service_str);
ProcessAlternativeService(session->http_server_properties(),
- alternative_service_str, http_host_port_pair,
- *session);
+ alternative_service_str, http_server, *session);
}
// If "Alt-Svc" is enabled, then ignore "Alternate-Protocol".
return;
@@ -67,8 +66,7 @@ void HttpStreamFactory::ProcessAlternativeServices(
}
ProcessAlternateProtocol(session->http_server_properties(),
- alternate_protocol_values, http_host_port_pair,
- *session);
+ alternate_protocol_values, http_server, *session);
}
GURL HttpStreamFactory::ApplyHostMappingRules(const GURL& url,
@@ -90,7 +88,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& http_server,
const HttpNetworkSession& session) {
SpdyAltSvcWireFormat::AlternativeServiceVector alternative_service_vector;
if (!SpdyAltSvcWireFormat::ParseHeaderFieldValue(
@@ -140,13 +138,13 @@ void HttpStreamFactory::ProcessAlternativeService(
}
http_server_properties->SetAlternativeServices(
- RewriteHost(http_host_port_pair), alternative_service_info_vector);
+ RewriteHost(http_server), 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& http_server,
const HttpNetworkSession& session) {
AlternateProtocol protocol = UNINITIALIZED_ALTERNATE_PROTOCOL;
int port = 0;
@@ -192,21 +190,24 @@ void HttpStreamFactory::ProcessAlternateProtocol(
}
if (!is_valid || protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) {
- http_server_properties->ClearAlternativeServices(http_host_port_pair);
+ http_server_properties->ClearAlternativeServices(http_server);
return;
}
http_server_properties->SetAlternativeService(
- RewriteHost(http_host_port_pair),
+ RewriteHost(http_server),
AlternativeService(protocol, "", static_cast<uint16_t>(port)),
base::Time::Now() + base::TimeDelta::FromDays(30));
}
-HostPortPair HttpStreamFactory::RewriteHost(HostPortPair host_port_pair) {
+url::SchemeHostPort HttpStreamFactory::RewriteHost(
+ const url::SchemeHostPort& server) {
+ HostPortPair host_port_pair(server.host(), server.port());
const HostMappingRules* mapping_rules = GetHostMappingRules();
if (mapping_rules)
mapping_rules->RewriteHost(&host_port_pair);
- return host_port_pair;
+ return url::SchemeHostPort(server.scheme(), host_port_pair.host(),
+ host_port_pair.port());
}
} // namespace net
« 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