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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_server_properties_impl.h" 5 #include "net/http/http_server_properties_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 canonical_host_to_origin_map_[canonical_host] = it->first; 87 canonical_host_to_origin_map_[canonical_host] = it->first;
88 break; 88 break;
89 } 89 }
90 } 90 }
91 } 91 }
92 } 92 }
93 } 93 }
94 94
95 void HttpServerPropertiesImpl::InitializeSpdySettingsServers( 95 void HttpServerPropertiesImpl::InitializeSpdySettingsServers(
96 SpdySettingsMap* spdy_settings_map) { 96 SpdySettingsMap* spdy_settings_map) {
97 // Add the entries from persisted data.
98 SpdySettingsMap new_spdy_settings_map(SpdySettingsMap::NO_AUTO_EVICT);
97 for (SpdySettingsMap::reverse_iterator it = spdy_settings_map->rbegin(); 99 for (SpdySettingsMap::reverse_iterator it = spdy_settings_map->rbegin();
98 it != spdy_settings_map->rend(); ++it) { 100 it != spdy_settings_map->rend(); ++it) {
99 spdy_settings_map_.Put(it->first, it->second); 101 new_spdy_settings_map.Put(it->first, it->second);
102 }
103
104 spdy_settings_map_.Swap(new_spdy_settings_map);
105
106 // Add the entries from the memory cache.
107 for (SpdySettingsMap::reverse_iterator it = new_spdy_settings_map.rbegin();
108 it != new_spdy_settings_map.rend(); ++it) {
109 if (spdy_settings_map_.Get(it->first) == spdy_settings_map_.end())
110 spdy_settings_map_.Put(it->first, it->second);
100 } 111 }
101 } 112 }
102 113
103 void HttpServerPropertiesImpl::InitializeSupportsQuic( 114 void HttpServerPropertiesImpl::InitializeSupportsQuic(
104 IPAddressNumber* last_address) { 115 IPAddressNumber* last_address) {
105 if (last_address) 116 if (last_address)
106 last_quic_address_ = *last_address; 117 last_quic_address_ = *last_address;
107 } 118 }
108 119
109 void HttpServerPropertiesImpl::InitializeServerNetworkStats( 120 void HttpServerPropertiesImpl::InitializeServerNetworkStats(
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); 729 base::TimeDelta delay = when > now ? when - now : base::TimeDelta();
719 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 730 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
720 FROM_HERE, 731 FROM_HERE,
721 base::Bind( 732 base::Bind(
722 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, 733 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings,
723 weak_ptr_factory_.GetWeakPtr()), 734 weak_ptr_factory_.GetWeakPtr()),
724 delay); 735 delay);
725 } 736 }
726 737
727 } // namespace net 738 } // namespace net
OLDNEW
« 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