diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 07:05:18 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 07:05:18 +0000 |
commit | de95f929772cb7214efb747f9a5a115b27561336 (patch) | |
tree | 3f376123413c93b064eb65baf2643a407f6dfc7e /net/http/http_server_properties_impl.cc | |
parent | 817925aaf716cb623c56e21030650f075e510157 (diff) | |
download | chromium_src-de95f929772cb7214efb747f9a5a115b27561336.zip chromium_src-de95f929772cb7214efb747f9a5a115b27561336.tar.gz chromium_src-de95f929772cb7214efb747f9a5a115b27561336.tar.bz2 |
Persist Alternate-Protocol.
Record Alternate-Protocol servers in spdy.alternate_protocol. Don't persist broken Alternate-Protocol so they will retry on next browser session.
Also fix listening to notifications when we're the ones setting them. This was leading to unnecessary double updates, where we'd update the cache on the IO thread, and then propagate to the UI thread, where we'd set the prefs, and then observe that change and propagate back to the IO thread to update the cache.
BUG=98472
TEST=Observe that spdy.alternate_protocol is empty in your Preferences file. Confirm that there is no alternate-protocol mapping in chrome://net-internals/#spdy. Browse to www.strangeloopnetworks.com. Check chrome://net-internals/#spdy again and notice that it populates with the mapping. Wait some seconds and then check the Preferences file again and note that it got persisted to disk. Restart Chrome and check chrome://net-internals/#spdy and note that the same alternate-protocol mappings reappear.
Review URL: http://codereview.chromium.org/8221030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_server_properties_impl.cc')
-rw-r--r-- | net/http/http_server_properties_impl.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc index 1226c9c..3ea973c 100644 --- a/net/http/http_server_properties_impl.cc +++ b/net/http/http_server_properties_impl.cc @@ -30,6 +30,19 @@ void HttpServerPropertiesImpl::InitializeSpdyServers( } } +void HttpServerPropertiesImpl::InitializeAlternateProtocolServers( + AlternateProtocolMap* alternate_protocol_map) { + // First swap, and then add back all the ALTERNATE_PROTOCOL_BROKEN ones since + // those don't get persisted. + alternate_protocol_map_.swap(*alternate_protocol_map); + for (AlternateProtocolMap::const_iterator it = + alternate_protocol_map->begin(); + it != alternate_protocol_map->end(); ++it) { + if (it->second.protocol == ALTERNATE_PROTOCOL_BROKEN) + alternate_protocol_map_[it->first] = it->second; + } +} + void HttpServerPropertiesImpl::GetSpdyServerList( base::ListValue* spdy_server_list) const { DCHECK(CalledOnValidThread()); @@ -71,7 +84,7 @@ void HttpServerPropertiesImpl::DisableForcedAlternateProtocol() { g_forced_alternate_protocol = NULL; } -void HttpServerPropertiesImpl::DeleteAll() { +void HttpServerPropertiesImpl::Clear() { DCHECK(CalledOnValidThread()); spdy_servers_table_.clear(); alternate_protocol_map_.clear(); |