| Index: net/http/http_server_properties_impl.cc
|
| diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc
|
| index 36bfb027cc98172d3435105eabd74ec4c7ef6d83..1efaa79af0ff88961aa61b55b55ead27b6eb1378 100644
|
| --- a/net/http/http_server_properties_impl.cc
|
| +++ b/net/http/http_server_properties_impl.cc
|
| @@ -207,7 +207,7 @@ void HttpServerPropertiesImpl::GetSpdyServerList(
|
| DCHECK(spdy_server_list);
|
| spdy_server_list->Clear();
|
| size_t count = 0;
|
| - // Get the list of servers (host/port) that support SPDY.
|
| + // Get the list of servers (scheme/host/port) that support SPDY.
|
| for (SpdyServerHostPortMap::const_iterator it = spdy_servers_map_.begin();
|
| it != spdy_servers_map_.end() && count < max_size; ++it) {
|
| const std::string spdy_server_host_port = it->first;
|
| @@ -238,7 +238,8 @@ bool HttpServerPropertiesImpl::SupportsRequestPriority(
|
| DCHECK(CalledOnValidThread());
|
| if (server.host().empty())
|
| return false;
|
| - if (GetSupportsSpdy(HostPortPair::FromSchemeHostPort(server)))
|
| +
|
| + if (GetSupportsSpdy(server))
|
| return true;
|
|
|
| const AlternativeServiceVector alternative_service_vector =
|
| @@ -253,31 +254,31 @@ bool HttpServerPropertiesImpl::SupportsRequestPriority(
|
| }
|
|
|
| bool HttpServerPropertiesImpl::GetSupportsSpdy(
|
| - const HostPortPair& host_port_pair) {
|
| + const url::SchemeHostPort& server) {
|
| DCHECK(CalledOnValidThread());
|
| - if (host_port_pair.host().empty())
|
| + if (server.host().empty())
|
| return false;
|
|
|
| SpdyServerHostPortMap::iterator spdy_host_port =
|
| - spdy_servers_map_.Get(host_port_pair.ToString());
|
| + spdy_servers_map_.Get(server.ToString());
|
| return spdy_host_port != spdy_servers_map_.end() && spdy_host_port->second;
|
| }
|
|
|
| void HttpServerPropertiesImpl::SetSupportsSpdy(
|
| - const HostPortPair& host_port_pair,
|
| + const url::SchemeHostPort& server,
|
| bool support_spdy) {
|
| DCHECK(CalledOnValidThread());
|
| - if (host_port_pair.host().empty())
|
| + if (server.host().empty())
|
| return;
|
|
|
| SpdyServerHostPortMap::iterator spdy_host_port =
|
| - spdy_servers_map_.Get(host_port_pair.ToString());
|
| + spdy_servers_map_.Get(server.ToString());
|
| if ((spdy_host_port != spdy_servers_map_.end()) &&
|
| (spdy_host_port->second == support_spdy)) {
|
| return;
|
| }
|
| // Cache the data.
|
| - spdy_servers_map_.Put(host_port_pair.ToString(), support_spdy);
|
| + spdy_servers_map_.Put(server.ToString(), support_spdy);
|
| }
|
|
|
| bool HttpServerPropertiesImpl::RequiresHTTP11(
|
| @@ -559,8 +560,8 @@ HttpServerPropertiesImpl::GetAlternativeServiceInfoAsValue()
|
| }
|
|
|
| const SettingsMap& HttpServerPropertiesImpl::GetSpdySettings(
|
| - const HostPortPair& host_port_pair) {
|
| - SpdySettingsMap::iterator it = spdy_settings_map_.Get(host_port_pair);
|
| + const url::SchemeHostPort& origin) {
|
| + SpdySettingsMap::iterator it = spdy_settings_map_.Get(origin);
|
| if (it == spdy_settings_map_.end()) {
|
| CR_DEFINE_STATIC_LOCAL(SettingsMap, kEmptySettingsMap, ());
|
| return kEmptySettingsMap;
|
| @@ -568,20 +569,19 @@ const SettingsMap& HttpServerPropertiesImpl::GetSpdySettings(
|
| return it->second;
|
| }
|
|
|
| -bool HttpServerPropertiesImpl::SetSpdySetting(
|
| - const HostPortPair& host_port_pair,
|
| - SpdySettingsIds id,
|
| - SpdySettingsFlags flags,
|
| - uint32_t value) {
|
| +bool HttpServerPropertiesImpl::SetSpdySetting(const url::SchemeHostPort& origin,
|
| + SpdySettingsIds id,
|
| + SpdySettingsFlags flags,
|
| + uint32_t value) {
|
| if (!(flags & SETTINGS_FLAG_PLEASE_PERSIST))
|
| return false;
|
|
|
| SettingsFlagsAndValue flags_and_value(SETTINGS_FLAG_PERSISTED, value);
|
| - SpdySettingsMap::iterator it = spdy_settings_map_.Get(host_port_pair);
|
| + SpdySettingsMap::iterator it = spdy_settings_map_.Get(origin);
|
| if (it == spdy_settings_map_.end()) {
|
| SettingsMap settings_map;
|
| settings_map[id] = flags_and_value;
|
| - spdy_settings_map_.Put(host_port_pair, settings_map);
|
| + spdy_settings_map_.Put(origin, settings_map);
|
| } else {
|
| SettingsMap& settings_map = it->second;
|
| settings_map[id] = flags_and_value;
|
| @@ -590,8 +590,8 @@ bool HttpServerPropertiesImpl::SetSpdySetting(
|
| }
|
|
|
| void HttpServerPropertiesImpl::ClearSpdySettings(
|
| - const HostPortPair& host_port_pair) {
|
| - SpdySettingsMap::iterator it = spdy_settings_map_.Peek(host_port_pair);
|
| + const url::SchemeHostPort& origin) {
|
| + SpdySettingsMap::iterator it = spdy_settings_map_.Peek(origin);
|
| if (it != spdy_settings_map_.end())
|
| spdy_settings_map_.Erase(it);
|
| }
|
| @@ -623,15 +623,14 @@ void HttpServerPropertiesImpl::SetSupportsQuic(bool used_quic,
|
| }
|
|
|
| void HttpServerPropertiesImpl::SetServerNetworkStats(
|
| - const HostPortPair& host_port_pair,
|
| + const url::SchemeHostPort& origin,
|
| ServerNetworkStats stats) {
|
| - server_network_stats_map_.Put(host_port_pair, stats);
|
| + server_network_stats_map_.Put(origin, stats);
|
| }
|
|
|
| const ServerNetworkStats* HttpServerPropertiesImpl::GetServerNetworkStats(
|
| - const HostPortPair& host_port_pair) {
|
| - ServerNetworkStatsMap::iterator it =
|
| - server_network_stats_map_.Get(host_port_pair);
|
| + const url::SchemeHostPort& origin) {
|
| + ServerNetworkStatsMap::iterator it = server_network_stats_map_.Get(origin);
|
| if (it == server_network_stats_map_.end()) {
|
| return NULL;
|
| }
|
|
|