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

Unified Diff: net/http/http_server_properties_manager.cc

Issue 1860343002: SHP 1: Change SupportsSpdy dict to use SchemeHostPort as the key. No change to Pref data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
Index: net/http/http_server_properties_manager.cc
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index a592f441bb09eb71cb7371d421b33e5fb63f5600..ad841b0863ffeb539c5ee42910765a7e13f0d498 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -145,18 +145,20 @@ void HttpServerPropertiesManager::Clear(const base::Closure& completion) {
}
bool HttpServerPropertiesManager::SupportsRequestPriority(
- const HostPortPair& server) {
+ const url::SchemeHostPort& server) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
return http_server_properties_impl_->SupportsRequestPriority(server);
}
-bool HttpServerPropertiesManager::GetSupportsSpdy(const HostPortPair& server) {
+bool HttpServerPropertiesManager::GetSupportsSpdy(
+ const url::SchemeHostPort& server) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
return http_server_properties_impl_->GetSupportsSpdy(server);
}
-void HttpServerPropertiesManager::SetSupportsSpdy(const HostPortPair& server,
- bool support_spdy) {
+void HttpServerPropertiesManager::SetSupportsSpdy(
+ const url::SchemeHostPort& server,
+ bool support_spdy) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
bool old_support_spdy = http_server_properties_impl_->GetSupportsSpdy(server);
@@ -489,7 +491,7 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() {
IPAddress* addr = new IPAddress;
ReadSupportsQuic(http_server_properties_dict, addr);
- // String is host/port pair of spdy server.
+ // String is "scheme://host:port" tuple of spdy server.
scoped_ptr<ServerList> spdy_servers(new ServerList);
scoped_ptr<SpdySettingsMap> spdy_settings_map(
new SpdySettingsMap(kMaxSpdySettingsHostsToPersist));
@@ -547,6 +549,8 @@ bool HttpServerPropertiesManager::AddServersData(
ServerNetworkStatsMap* network_stats_map) {
for (base::DictionaryValue::Iterator it(servers_dict); !it.IsAtEnd();
it.Advance()) {
+ // TODO(zhongyi): get server's scheme/host/port when servers_dict migrates
+ // to SchemeHostPort.
// Get server's host/pair.
const std::string& server_str = it.key();
HostPortPair server = HostPortPair::FromString(server_str);
@@ -565,7 +569,9 @@ bool HttpServerPropertiesManager::AddServersData(
bool supports_spdy = false;
if ((server_pref_dict->GetBoolean(kSupportsSpdyKey, &supports_spdy)) &&
supports_spdy) {
- spdy_servers->push_back(server_str);
+ // TODO(zhongyi): fill in the scheme field when servers_dict has scheme.
+ std::string server_scheme_host_port = "http://" + server_str;
Ryan Hamilton 2016/04/06 19:16:08 Hm. Seems like we should convert servers_dict at t
Zhongyi Shi 2016/04/07 00:31:18 Will do when we migrating servers_dict!:D
+ spdy_servers->push_back(server_scheme_host_port);
}
AddToSpdySettingsMap(server, *server_pref_dict, spdy_settings_map);

Powered by Google App Engine
This is Rietveld 408576698