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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 298683010: QUIC - Persist 1000 MRU alternate protocols to preferences file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed rch's comments Created 6 years, 7 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_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
diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc
index 51771886034c82656d264b705057ba30ed0a99a3..bd7de2f8239a26a3aba43d22407bfebec49b9bb0 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -29,6 +29,8 @@ const uint64 kBrokenAlternateProtocolDelaySecs = 300;
HttpServerPropertiesImpl::HttpServerPropertiesImpl()
: spdy_servers_map_(SpdyServerHostPortMap::NO_AUTO_EVICT),
alternate_protocol_map_(AlternateProtocolMap::NO_AUTO_EVICT),
+ alternate_protocol_experiment_(
+ ALTERNATE_PROTOCOL_NOT_PART_OF_EXPERIMENT),
spdy_settings_map_(SpdySettingsMap::NO_AUTO_EVICT),
pipeline_capability_map_(
new CachedPipelineCapabilityMap(kDefaultNumHostsToRemember)),
@@ -220,6 +222,19 @@ bool HttpServerPropertiesImpl::HasAlternateProtocol(
return GetCanonicalHost(server) != canonical_host_to_origin_map_.end();
}
+std::string HttpServerPropertiesImpl::GetCanonicalSuffix(
+ const HostPortPair& server) {
+ // If this host ends with a canonical suffix, then return the canonical
+ // suffix.
+ for (size_t i = 0; i < canoncial_suffixes_.size(); ++i) {
+ std::string canonical_suffix = canoncial_suffixes_[i];
+ if (EndsWith(server.host(), canoncial_suffixes_[i], false)) {
+ return canonical_suffix;
+ }
+ }
+ return std::string();
+}
+
PortAlternateProtocolPair
HttpServerPropertiesImpl::GetAlternateProtocol(
const HostPortPair& server) {
@@ -275,7 +290,8 @@ void HttpServerPropertiesImpl::SetAlternateProtocol(
// TODO(rch): Consider the case where multiple requests are started
// before the first completes. In this case, only one of the jobs
// would reach this code, whereas all of them should should have.
- HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_MAPPING_MISSING);
+ HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_MAPPING_MISSING,
+ alternate_protocol_experiment_);
}
alternate_protocol_map_.Put(server, alternate);
@@ -340,6 +356,16 @@ HttpServerPropertiesImpl::alternate_protocol_map() const {
return alternate_protocol_map_;
}
+void HttpServerPropertiesImpl::SetAlternateProtocolExperiment(
+ AlternateProtocolExperiment experiment) {
+ alternate_protocol_experiment_ = experiment;
+}
+
+AlternateProtocolExperiment
+HttpServerPropertiesImpl::GetAlternateProtocolExperiment() const {
+ return alternate_protocol_experiment_;
+}
+
const SettingsMap& HttpServerPropertiesImpl::GetSpdySettings(
const HostPortPair& host_port_pair) {
SpdySettingsMap::iterator it = spdy_settings_map_.Get(host_port_pair);
« 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