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 77968ff7d6105a653b6f7746fee0713fe7e9a7ad..c28d3778f146145823386fca01d1b9a8017134b0 100644 |
--- a/net/http/http_server_properties_impl.cc |
+++ b/net/http/http_server_properties_impl.cc |
@@ -56,12 +56,26 @@ void HttpServerPropertiesImpl::InitializeSpdyServers( |
void HttpServerPropertiesImpl::InitializeAlternativeServiceServers( |
AlternativeServiceMap* alternative_service_map) { |
+ AlternativeServiceMap new_alternative_service_map( |
+ AlternativeServiceMap::NO_AUTO_EVICT); |
// Add the entries from persisted data. |
for (AlternativeServiceMap::reverse_iterator input_it = |
alternative_service_map->rbegin(); |
input_it != alternative_service_map->rend(); ++input_it) { |
DCHECK(!input_it->second.empty()); |
- alternative_service_map_.Put(input_it->first, input_it->second); |
+ new_alternative_service_map.Put(input_it->first, input_it->second); |
+ } |
+ |
+ alternative_service_map_.Swap(new_alternative_service_map); |
+ |
+ // Add the entries from the memory cache. |
+ for (AlternativeServiceMap::reverse_iterator input_it = |
+ new_alternative_service_map.rbegin(); |
+ input_it != new_alternative_service_map.rend(); ++input_it) { |
+ if (alternative_service_map_.Get(input_it->first) == |
+ alternative_service_map_.end()) { |
+ alternative_service_map_.Put(input_it->first, input_it->second); |
+ } |
} |
// Attempt to find canonical servers. |