| 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 51771886034c82656d264b705057ba30ed0a99a3..3e9fc98c8c86f2f6539d58902578d8d2d24b2c0b 100644
|
| --- a/net/http/http_server_properties_impl.cc
|
| +++ b/net/http/http_server_properties_impl.cc
|
| @@ -48,7 +48,8 @@ void HttpServerPropertiesImpl::InitializeSpdyServers(
|
| return;
|
| // Add the entries from persisted data.
|
| for (std::vector<std::string>::reverse_iterator it = spdy_servers->rbegin();
|
| - it != spdy_servers->rend(); ++it) {
|
| + it != spdy_servers->rend();
|
| + ++it) {
|
| spdy_servers_map_.Put(*it, support_spdy);
|
| }
|
| }
|
| @@ -69,27 +70,30 @@ void HttpServerPropertiesImpl::InitializeAlternateProtocolServers(
|
| // Add the entries from persisted data.
|
| for (AlternateProtocolMap::reverse_iterator it =
|
| alternate_protocol_map->rbegin();
|
| - it != alternate_protocol_map->rend(); ++it) {
|
| + it != alternate_protocol_map->rend();
|
| + ++it) {
|
| alternate_protocol_map_.Put(it->first, it->second);
|
| }
|
|
|
| // Attempt to find canonical servers.
|
| - int canonical_ports[] = { 80, 443 };
|
| + int canonical_ports[] = {80, 443};
|
| for (size_t i = 0; i < canoncial_suffixes_.size(); ++i) {
|
| std::string canonical_suffix = canoncial_suffixes_[i];
|
| for (size_t j = 0; j < arraysize(canonical_ports); ++j) {
|
| HostPortPair canonical_host(canonical_suffix, canonical_ports[j]);
|
| // If we already have a valid canonical server, we're done.
|
| if (ContainsKey(canonical_host_to_origin_map_, canonical_host) &&
|
| - (alternate_protocol_map_.Peek(canonical_host_to_origin_map_[
|
| - canonical_host]) != alternate_protocol_map_.end())) {
|
| + (alternate_protocol_map_.Peek(
|
| + canonical_host_to_origin_map_[canonical_host]) !=
|
| + alternate_protocol_map_.end())) {
|
| continue;
|
| }
|
| // Now attempt to find a server which matches this origin and set it as
|
| // canonical .
|
| for (AlternateProtocolMap::const_iterator it =
|
| alternate_protocol_map_.begin();
|
| - it != alternate_protocol_map_.end(); ++it) {
|
| + it != alternate_protocol_map_.end();
|
| + ++it) {
|
| if (EndsWith(it->first.host(), canoncial_suffixes_[i], false)) {
|
| canonical_host_to_origin_map_[canonical_host] = it->first;
|
| break;
|
| @@ -102,7 +106,8 @@ void HttpServerPropertiesImpl::InitializeAlternateProtocolServers(
|
| void HttpServerPropertiesImpl::InitializeSpdySettingsServers(
|
| SpdySettingsMap* spdy_settings_map) {
|
| for (SpdySettingsMap::reverse_iterator it = spdy_settings_map->rbegin();
|
| - it != spdy_settings_map->rend(); ++it) {
|
| + it != spdy_settings_map->rend();
|
| + ++it) {
|
| spdy_settings_map_.Put(it->first, it->second);
|
| }
|
| }
|
| @@ -112,7 +117,8 @@ void HttpServerPropertiesImpl::InitializePipelineCapabilities(
|
| PipelineCapabilityMap::const_iterator it;
|
| pipeline_capability_map_->Clear();
|
| for (it = pipeline_capability_map->begin();
|
| - it != pipeline_capability_map->end(); ++it) {
|
| + it != pipeline_capability_map->end();
|
| + ++it) {
|
| pipeline_capability_map_->Put(it->first, it->second);
|
| }
|
| }
|
| @@ -131,7 +137,8 @@ void HttpServerPropertiesImpl::GetSpdyServerList(
|
| size_t count = 0;
|
| // Get the list of servers (host/port) that support SPDY.
|
| for (SpdyServerHostPortMap::const_iterator it = spdy_servers_map_.begin();
|
| - it != spdy_servers_map_.end() && count < max_size; ++it) {
|
| + it != spdy_servers_map_.end() && count < max_size;
|
| + ++it) {
|
| const std::string spdy_server_host_port = it->first;
|
| if (it->second) {
|
| spdy_server_list->Append(new base::StringValue(spdy_server_host_port));
|
| @@ -220,8 +227,7 @@ bool HttpServerPropertiesImpl::HasAlternateProtocol(
|
| return GetCanonicalHost(server) != canonical_host_to_origin_map_.end();
|
| }
|
|
|
| -PortAlternateProtocolPair
|
| -HttpServerPropertiesImpl::GetAlternateProtocol(
|
| +PortAlternateProtocolPair HttpServerPropertiesImpl::GetAlternateProtocol(
|
| const HostPortPair& server) {
|
| DCHECK(HasAlternateProtocol(server));
|
|
|
| @@ -268,8 +274,7 @@ void HttpServerPropertiesImpl::SetAlternateProtocol(
|
| << " from [Port: " << existing_alternate.port
|
| << ", Protocol: " << existing_alternate.protocol
|
| << "] to [Port: " << alternate_port
|
| - << ", Protocol: " << alternate_protocol
|
| - << "].";
|
| + << ", Protocol: " << alternate_protocol << "].";
|
| }
|
| } else {
|
| // TODO(rch): Consider the case where multiple requests are started
|
| @@ -335,8 +340,8 @@ void HttpServerPropertiesImpl::ClearAlternateProtocol(
|
| alternate_protocol_map_.Erase(it);
|
| }
|
|
|
| -const AlternateProtocolMap&
|
| -HttpServerPropertiesImpl::alternate_protocol_map() const {
|
| +const AlternateProtocolMap& HttpServerPropertiesImpl::alternate_protocol_map()
|
| + const {
|
| return alternate_protocol_map_;
|
| }
|
|
|
| @@ -356,7 +361,7 @@ bool HttpServerPropertiesImpl::SetSpdySetting(
|
| SpdySettingsFlags flags,
|
| uint32 value) {
|
| if (!(flags & SETTINGS_FLAG_PLEASE_PERSIST))
|
| - return false;
|
| + return false;
|
|
|
| SettingsFlagsAndValue flags_and_value(SETTINGS_FLAG_PERSISTED, value);
|
| SpdySettingsMap::iterator it = spdy_settings_map_.Get(host_port_pair);
|
| @@ -382,8 +387,7 @@ void HttpServerPropertiesImpl::ClearAllSpdySettings() {
|
| spdy_settings_map_.Clear();
|
| }
|
|
|
| -const SpdySettingsMap&
|
| -HttpServerPropertiesImpl::spdy_settings_map() const {
|
| +const SpdySettingsMap& HttpServerPropertiesImpl::spdy_settings_map() const {
|
| return spdy_settings_map_;
|
| }
|
|
|
| @@ -416,8 +420,8 @@ HttpPipelinedHostCapability HttpServerPropertiesImpl::GetPipelineCapability(
|
| }
|
|
|
| void HttpServerPropertiesImpl::SetPipelineCapability(
|
| - const HostPortPair& origin,
|
| - HttpPipelinedHostCapability capability) {
|
| + const HostPortPair& origin,
|
| + HttpPipelinedHostCapability capability) {
|
| CachedPipelineCapabilityMap::iterator it =
|
| pipeline_capability_map_->Peek(origin);
|
| if (it == pipeline_capability_map_->end() ||
|
| @@ -430,12 +434,13 @@ void HttpServerPropertiesImpl::ClearPipelineCapabilities() {
|
| pipeline_capability_map_->Clear();
|
| }
|
|
|
| -PipelineCapabilityMap
|
| -HttpServerPropertiesImpl::GetPipelineCapabilityMap() const {
|
| +PipelineCapabilityMap HttpServerPropertiesImpl::GetPipelineCapabilityMap()
|
| + const {
|
| PipelineCapabilityMap result;
|
| CachedPipelineCapabilityMap::const_iterator it;
|
| for (it = pipeline_capability_map_->begin();
|
| - it != pipeline_capability_map_->end(); ++it) {
|
| + it != pipeline_capability_map_->end();
|
| + ++it) {
|
| result[it->first] = it->second;
|
| }
|
| return result;
|
|
|