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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 8423028: Persist dynamically learned SPDY settings (like CWND). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « net/http/http_server_properties_impl.h ('k') | 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
===================================================================
--- net/http/http_server_properties_impl.cc (revision 110097)
+++ net/http/http_server_properties_impl.cc (working copy)
@@ -43,6 +43,11 @@
}
}
+void HttpServerPropertiesImpl::InitializeSpdySettingsServers(
+ std::map<HostPortPair, spdy::SpdySettings>* spdy_settings_map) {
+ spdy_settings_map_.swap(*spdy_settings_map);
+}
+
void HttpServerPropertiesImpl::GetSpdyServerList(
base::ListValue* spdy_server_list) const {
DCHECK(CalledOnValidThread());
@@ -88,6 +93,7 @@
DCHECK(CalledOnValidThread());
spdy_servers_table_.clear();
alternate_protocol_map_.clear();
+ spdy_settings_map_.clear();
}
bool HttpServerPropertiesImpl::SupportsSpdy(
@@ -190,4 +196,47 @@
return alternate_protocol_map_;
}
+const spdy::SpdySettings& HttpServerPropertiesImpl::GetSpdySettings(
+ const HostPortPair& host_port_pair) const {
+ SpdySettingsMap::const_iterator it = spdy_settings_map_.find(host_port_pair);
+ if (it == spdy_settings_map_.end()) {
+ CR_DEFINE_STATIC_LOCAL(spdy::SpdySettings, kEmptySpdySettings, ());
+ return kEmptySpdySettings;
+ }
+ return it->second;
+}
+
+bool HttpServerPropertiesImpl::SetSpdySettings(
+ const HostPortPair& host_port_pair,
+ const spdy::SpdySettings& settings) {
+ spdy::SpdySettings persistent_settings;
+
+ // Iterate through the list, and only copy those settings which are marked
+ // for persistence.
+ spdy::SpdySettings::const_iterator it;
+ for (it = settings.begin(); it != settings.end(); ++it) {
+ spdy::SettingsFlagsAndId id = it->first;
+ if (id.flags() & spdy::SETTINGS_FLAG_PLEASE_PERSIST) {
+ id.set_flags(spdy::SETTINGS_FLAG_PERSISTED);
+ persistent_settings.push_back(std::make_pair(id, it->second));
+ }
+ }
+
+ // If we didn't persist anything, then we are done.
+ if (persistent_settings.empty())
+ return false;
+
+ spdy_settings_map_[host_port_pair] = persistent_settings;
+ return true;
+}
+
+void HttpServerPropertiesImpl::ClearSpdySettings() {
+ spdy_settings_map_.clear();
+}
+
+const SpdySettingsMap&
+HttpServerPropertiesImpl::spdy_settings_map() const {
+ return spdy_settings_map_;
+}
+
} // namespace net
« no previous file with comments | « net/http/http_server_properties_impl.h ('k') | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698