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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 1534593002: SPDY Settings - preferences read from the disk maintain MRU order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_spdy_servers_mru_cache
Patch Set: rebase Created 5 years 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 | « no previous file | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5abfe2c3ceb0c72f3686b500e6420a07d7ef491a 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -94,9 +94,20 @@ void HttpServerPropertiesImpl::InitializeAlternativeServiceServers(
void HttpServerPropertiesImpl::InitializeSpdySettingsServers(
SpdySettingsMap* spdy_settings_map) {
+ // Add the entries from persisted data.
+ SpdySettingsMap new_spdy_settings_map(SpdySettingsMap::NO_AUTO_EVICT);
for (SpdySettingsMap::reverse_iterator it = spdy_settings_map->rbegin();
it != spdy_settings_map->rend(); ++it) {
- spdy_settings_map_.Put(it->first, it->second);
+ new_spdy_settings_map.Put(it->first, it->second);
+ }
+
+ spdy_settings_map_.Swap(new_spdy_settings_map);
+
+ // Add the entries from the memory cache.
+ for (SpdySettingsMap::reverse_iterator it = new_spdy_settings_map.rbegin();
+ it != new_spdy_settings_map.rend(); ++it) {
+ if (spdy_settings_map_.Get(it->first) == spdy_settings_map_.end())
+ spdy_settings_map_.Put(it->first, it->second);
}
}
« no previous file with comments | « no previous file | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698