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

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: git sync 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
« no previous file with comments | « net/http/http_server_properties_manager.h ('k') | net/http/http_server_properties_manager_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_manager.cc
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index 628ec7ab76737392bd08f07941ab200841edd6d7..6fd0df7fe9913de5b29f6a8b16710ba8039b6212 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -14,6 +14,7 @@
#include "base/values.h"
#include "net/base/ip_address.h"
#include "net/base/port_util.h"
+#include "url/gurl.h"
namespace net {
@@ -145,18 +146,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);
@@ -488,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.
std::unique_ptr<ServerList> spdy_servers(new ServerList);
std::unique_ptr<SpdySettingsMap> spdy_settings_map(
new SpdySettingsMap(kMaxSpdySettingsHostsToPersist));
@@ -546,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);
@@ -564,7 +569,10 @@ 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 spdy_server_url = "https://" + server_str;
+ url::SchemeHostPort spdy_server((GURL(spdy_server_url)));
+ spdy_servers->push_back(spdy_server.Serialize());
}
AddToSpdySettingsMap(server, *server_pref_dict, spdy_settings_map);
« no previous file with comments | « net/http/http_server_properties_manager.h ('k') | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698