Chromium Code Reviews| 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..e33ed2fb2cc4ec0c0759174ae542bb55f208be82 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,24 +347,7 @@ 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(); |
| it.Advance()) { |
| // Get server's host/pair. |
| @@ -445,8 +412,6 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() { |
| continue; |
| } |
| - if (count >= alternate_protocols_to_load) |
|
jar (doing other things)
2014/10/23 23:11:51
I think this is OK. Just to confirm.... we will "
ramant (doing other things)
2014/10/23 23:27:19
Made this code similar to other MRU items we are p
|
| - continue; |
| do { |
| int port = 0; |
| if (!port_alternate_protocol_dict->GetIntegerWithoutPathExpansion( |
| @@ -484,7 +449,6 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() { |
| protocol, |
| probability); |
| alternate_protocol_map->Put(server, port_alternate_protocol); |
| - ++count; |
| } while (false); |
| // Get SupportsQuic. |
| @@ -522,7 +486,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 +494,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 +514,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); |