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

Unified Diff: net/http/http_server_properties_manager.cc

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 08e4f6a5c00c18dad65e695ba26ca3efb7eebaaa..6796fb19fd8fbb36238da08a9a84f9f808e0ac97 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
-#include "base/rand_util.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
@@ -44,11 +43,8 @@ const int kVersionNumber = 3;
typedef std::vector<std::string> StringVector;
-// Load either 200 or 1000 servers based on a coin flip.
-const int k200AlternateProtocolHostsToLoad = 200;
-const int k1000AlternateProtocolHostsToLoad = 1000;
-// Persist 1000 MRU AlternateProtocolHostPortPairs.
-const int kMaxAlternateProtocolHostsToPersist = 1000;
+// Persist 200 MRU AlternateProtocolHostPortPairs.
+const int kMaxAlternateProtocolHostsToPersist = 200;
// Persist 200 MRU SpdySettingsHostPortPairs.
const int kMaxSpdySettingsHostsToPersist = 200;
@@ -213,12 +209,6 @@ HttpServerPropertiesManager::alternate_protocol_map() const {
return http_server_properties_impl_->alternate_protocol_map();
}
-void HttpServerPropertiesManager::SetAlternateProtocolExperiment(
- AlternateProtocolExperiment experiment) {
- DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
- http_server_properties_impl_->SetAlternateProtocolExperiment(experiment);
-}
-
void HttpServerPropertiesManager::SetAlternateProtocolProbabilityThreshold(
double threshold) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
@@ -226,12 +216,6 @@ void HttpServerPropertiesManager::SetAlternateProtocolProbabilityThreshold(
threshold);
}
-AlternateProtocolExperiment
-HttpServerPropertiesManager::GetAlternateProtocolExperiment() const {
- DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
- return http_server_properties_impl_->GetAlternateProtocolExperiment();
-}
-
const SettingsMap& HttpServerPropertiesManager::GetSpdySettings(
const HostPortPair& host_port_pair) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
@@ -363,22 +347,6 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() {
new net::AlternateProtocolMap(kMaxAlternateProtocolHostsToPersist));
scoped_ptr<net::SupportsQuicMap> supports_quic_map(
new net::SupportsQuicMap());
- // TODO(rtenneti): Delete the following code after the experiment.
- int alternate_protocols_to_load = k200AlternateProtocolHostsToLoad;
- net::AlternateProtocolExperiment alternate_protocol_experiment =
- net::ALTERNATE_PROTOCOL_NOT_PART_OF_EXPERIMENT;
- if (version == kVersionNumber) {
- if (base::RandInt(0, 99) == 0) {
- alternate_protocol_experiment =
- net::ALTERNATE_PROTOCOL_TRUNCATED_200_SERVERS;
- } else {
- alternate_protocols_to_load = k1000AlternateProtocolHostsToLoad;
- alternate_protocol_experiment =
- net::ALTERNATE_PROTOCOL_TRUNCATED_1000_SERVERS;
- }
- DVLOG(1) << "# of servers that support alternate_protocol: "
- << alternate_protocols_to_load;
- }
int count = 0;
for (base::DictionaryValue::Iterator it(*servers_dict); !it.IsAtEnd();
@@ -445,7 +413,7 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() {
continue;
}
- if (count >= alternate_protocols_to_load)
+ if (count >= kMaxAlternateProtocolHostsToPersist)
continue;
do {
int port = 0;
@@ -522,7 +490,6 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() {
base::Owned(spdy_servers.release()),
base::Owned(spdy_settings_map.release()),
base::Owned(alternate_protocol_map.release()),
- alternate_protocol_experiment,
base::Owned(supports_quic_map.release()),
detected_corrupted_prefs));
}
@@ -531,7 +498,6 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnNetworkThread(
StringVector* spdy_servers,
net::SpdySettingsMap* spdy_settings_map,
net::AlternateProtocolMap* alternate_protocol_map,
- net::AlternateProtocolExperiment alternate_protocol_experiment,
net::SupportsQuicMap* supports_quic_map,
bool detected_corrupted_prefs) {
// Preferences have the master data because admins might have pushed new
@@ -552,8 +518,6 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnNetworkThread(
alternate_protocol_map->size());
http_server_properties_impl_->InitializeAlternateProtocolServers(
alternate_protocol_map);
- http_server_properties_impl_->SetAlternateProtocolExperiment(
- alternate_protocol_experiment);
http_server_properties_impl_->InitializeSupportsQuic(supports_quic_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