From 62891a5fe6637cb5d07b2ecc137d145969de6db6 Mon Sep 17 00:00:00 2001 From: bnc Date: Mon, 27 Apr 2015 07:14:12 -0700 Subject: Rename methods and members and const variables to alternative service. Rename methods and members and const variables from "alternate protocol" to "alternative service": * alternate_protocol_probability_threshold_ to alternative_service_probability_threshold_ in HttpServerPropertiesImpl, * switches::kAlternateProtocolProbabilityThreshold to switches::kAlternativeServiceProbabilityThreshold, * test names in IOThreadTest, * SetAlternateProtocolProbabilityThreshold() to SetAlternativeServiceProbabilityThreshold(), * GetAlternateProtocolProbabilityThreshold() to GetAlternativeServiceProbabilityThreshold(), * remove obsolete force-alt-protocols from comments in io_thread.cc, * "Alternate Protocol" to "Alternative Service" in NetInternals user facing QUIC page, * alternate_protocol_probability_threshold to alternative_service_probability_threshold in IOThread::Globals and HttpNetworkSession::Params. BUG=392575 Review URL: https://codereview.chromium.org/1091283007 Cr-Commit-Position: refs/heads/master@{#327038} --- net/http/http_network_session.cc | 10 +++++----- net/http/http_network_session.h | 2 +- net/http/http_server_properties.h | 3 +-- net/http/http_server_properties_impl.cc | 12 ++++++------ net/http/http_server_properties_impl.h | 4 ++-- net/http/http_server_properties_impl_unittest.cc | 8 ++++---- net/http/http_server_properties_manager.cc | 4 ++-- net/http/http_server_properties_manager.h | 2 +- net/quic/quic_network_transaction_unittest.cc | 6 +++--- 9 files changed, 25 insertions(+), 26 deletions(-) (limited to 'net') diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 639db9f..45e8736 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc @@ -83,7 +83,7 @@ HttpNetworkSession::Params::Params() spdy_max_concurrent_streams_limit(0), time_func(&base::TimeTicks::Now), use_alternate_protocols(false), - alternate_protocol_probability_threshold(1), + alternative_service_probability_threshold(1), enable_quic(false), enable_quic_for_proxies(false), enable_quic_port_selection(true), @@ -196,8 +196,8 @@ HttpNetworkSession::HttpNetworkSession(const Params& params) } } - http_server_properties_->SetAlternateProtocolProbabilityThreshold( - params.alternate_protocol_probability_threshold); + http_server_properties_->SetAlternativeServiceProbabilityThreshold( + params.alternative_service_probability_threshold); } HttpNetworkSession::~HttpNetworkSession() { @@ -271,8 +271,8 @@ base::Value* HttpNetworkSession::QuicInfoToValue() const { dict->Set("connection_options", connection_options); dict->SetString("origin_to_force_quic_on", params_.origin_to_force_quic_on.ToString()); - dict->SetDouble("alternate_protocol_probability_threshold", - params_.alternate_protocol_probability_threshold); + dict->SetDouble("alternative_service_probability_threshold", + params_.alternative_service_probability_threshold); return dict; } diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index cd18f79..95fea4c 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -104,7 +104,7 @@ class NET_EXPORT HttpNetworkSession // Noe: Using this in the case of NPN for HTTP only results in the browser // trying SSL and then falling back to http. bool use_alternate_protocols; - double alternate_protocol_probability_threshold; + double alternative_service_probability_threshold; bool enable_quic; bool enable_quic_for_proxies; diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h index 367d059..d3825ae 100644 --- a/net/http/http_server_properties.h +++ b/net/http/http_server_properties.h @@ -279,8 +279,7 @@ class NET_EXPORT HttpServerProperties { // to |threshold| will be honored. |threshold| must be between 0.0 and 1.0 // inclusive. Hence, a threshold of 0.0 implies that all advertisements will // be honored. - virtual void SetAlternateProtocolProbabilityThreshold( - double threshold) = 0; + virtual void SetAlternativeServiceProbabilityThreshold(double threshold) = 0; // Gets a reference to the SettingsMap stored for a host. // If no settings are stored, returns an empty SettingsMap. diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc index 8b3bed2..c42293a 100644 --- a/net/http/http_server_properties_impl.cc +++ b/net/http/http_server_properties_impl.cc @@ -27,7 +27,7 @@ HttpServerPropertiesImpl::HttpServerPropertiesImpl() alternative_service_map_(AlternativeServiceMap::NO_AUTO_EVICT), spdy_settings_map_(SpdySettingsMap::NO_AUTO_EVICT), server_network_stats_map_(ServerNetworkStatsMap::NO_AUTO_EVICT), - alternate_protocol_probability_threshold_(1), + alternative_service_probability_threshold_(1.0), weak_ptr_factory_(this) { canonical_suffixes_.push_back(".c.youtube.com"); canonical_suffixes_.push_back(".googlevideo.com"); @@ -227,7 +227,7 @@ AlternativeService HttpServerPropertiesImpl::GetAlternativeService( AlternativeServiceMap::const_iterator it = alternative_service_map_.Get(origin); if (it != alternative_service_map_.end()) { - if (it->second.probability < alternate_protocol_probability_threshold_) { + if (it->second.probability < alternative_service_probability_threshold_) { return AlternativeService(); } AlternativeService alternative_service(it->second.alternative_service); @@ -245,7 +245,7 @@ AlternativeService HttpServerPropertiesImpl::GetAlternativeService( if (it == alternative_service_map_.end()) { return AlternativeService(); } - if (it->second.probability < alternate_protocol_probability_threshold_) { + if (it->second.probability < alternative_service_probability_threshold_) { return AlternativeService(); } AlternativeService alternative_service(it->second.alternative_service); @@ -290,7 +290,7 @@ void HttpServerPropertiesImpl::SetAlternativeService( << alternative_service_info.ToString() << "."; } } else { - if (alternative_probability >= alternate_protocol_probability_threshold_) { + if (alternative_probability >= alternative_service_probability_threshold_) { // 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. @@ -506,9 +506,9 @@ HttpServerPropertiesImpl::server_network_stats_map() const { return server_network_stats_map_; } -void HttpServerPropertiesImpl::SetAlternateProtocolProbabilityThreshold( +void HttpServerPropertiesImpl::SetAlternativeServiceProbabilityThreshold( double threshold) { - alternate_protocol_probability_threshold_ = threshold; + alternative_service_probability_threshold_ = threshold; } AlternativeServiceMap::const_iterator diff --git a/net/http/http_server_properties_impl.h b/net/http/http_server_properties_impl.h index 67b9127..e9f576f 100644 --- a/net/http/http_server_properties_impl.h +++ b/net/http/http_server_properties_impl.h @@ -103,7 +103,7 @@ class NET_EXPORT HttpServerPropertiesImpl void ClearAlternativeService(const HostPortPair& origin) override; const AlternativeServiceMap& alternative_service_map() const override; base::Value* GetAlternativeServiceInfoAsValue() const override; - void SetAlternateProtocolProbabilityThreshold(double threshold) override; + void SetAlternativeServiceProbabilityThreshold(double threshold) override; const SettingsMap& GetSpdySettings( const HostPortPair& host_port_pair) override; bool SetSpdySetting(const HostPortPair& host_port_pair, @@ -170,7 +170,7 @@ class NET_EXPORT HttpServerPropertiesImpl // ".googlevideo.com", ".googleusercontent.com") of canonical hostnames. CanonicalSufficList canonical_suffixes_; - double alternate_protocol_probability_threshold_; + double alternative_service_probability_threshold_; base::WeakPtrFactory weak_ptr_factory_; diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc index cce7d6c..00a4da9 100644 --- a/net/http/http_server_properties_impl_unittest.cc +++ b/net/http/http_server_properties_impl_unittest.cc @@ -265,7 +265,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, DefaultProbabilityExcluded) { } TEST_F(AlternateProtocolServerPropertiesTest, Probability) { - impl_.SetAlternateProtocolProbabilityThreshold(0.25); + impl_.SetAlternativeServiceProbabilityThreshold(0.25); HostPortPair test_host_port_pair("foo", 80); const AlternativeService alternative_service(NPN_SPDY_4, "foo", 443); @@ -281,7 +281,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, Probability) { } TEST_F(AlternateProtocolServerPropertiesTest, ProbabilityExcluded) { - impl_.SetAlternateProtocolProbabilityThreshold(0.75); + impl_.SetAlternativeServiceProbabilityThreshold(0.75); HostPortPair test_host_port_pair("foo", 80); const AlternativeService alternative_service(NPN_SPDY_4, "foo", 443); @@ -433,7 +433,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, CanonicalDefaultHost) { } TEST_F(AlternateProtocolServerPropertiesTest, CanonicalBelowThreshold) { - impl_.SetAlternateProtocolProbabilityThreshold(0.02); + impl_.SetAlternativeServiceProbabilityThreshold(0.02); HostPortPair test_host_port_pair("foo.c.youtube.com", 80); HostPortPair canonical_port_pair("bar.c.youtube.com", 80); @@ -445,7 +445,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, CanonicalBelowThreshold) { } TEST_F(AlternateProtocolServerPropertiesTest, CanonicalAboveThreshold) { - impl_.SetAlternateProtocolProbabilityThreshold(0.02); + impl_.SetAlternativeServiceProbabilityThreshold(0.02); HostPortPair test_host_port_pair("foo.c.youtube.com", 80); HostPortPair canonical_port_pair("bar.c.youtube.com", 80); diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc index eb80a53..88a8466 100644 --- a/net/http/http_server_properties_manager.cc +++ b/net/http/http_server_properties_manager.cc @@ -254,10 +254,10 @@ base::Value* HttpServerPropertiesManager::GetAlternativeServiceInfoAsValue() return http_server_properties_impl_->GetAlternativeServiceInfoAsValue(); } -void HttpServerPropertiesManager::SetAlternateProtocolProbabilityThreshold( +void HttpServerPropertiesManager::SetAlternativeServiceProbabilityThreshold( double threshold) { DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); - http_server_properties_impl_->SetAlternateProtocolProbabilityThreshold( + http_server_properties_impl_->SetAlternativeServiceProbabilityThreshold( threshold); } diff --git a/net/http/http_server_properties_manager.h b/net/http/http_server_properties_manager.h index db4c633..406905d 100644 --- a/net/http/http_server_properties_manager.h +++ b/net/http/http_server_properties_manager.h @@ -103,7 +103,7 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties { void ClearAlternativeService(const HostPortPair& origin) override; const AlternativeServiceMap& alternative_service_map() const override; base::Value* GetAlternativeServiceInfoAsValue() const override; - void SetAlternateProtocolProbabilityThreshold(double threshold) override; + void SetAlternativeServiceProbabilityThreshold(double threshold) override; const SettingsMap& GetSpdySettings( const HostPortPair& host_port_pair) override; bool SetSpdySetting(const HostPortPair& host_port_pair, diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc index 6142070..f02d811 100644 --- a/net/quic/quic_network_transaction_unittest.cc +++ b/net/quic/quic_network_transaction_unittest.cc @@ -663,7 +663,7 @@ TEST_P(QuicNetworkTransactionTest, UseAlternateProtocolProbabilityForQuic) { // the alternate-protocol job will "win". AddHangingNonAlternateProtocolSocketData(); - params_.alternate_protocol_probability_threshold = .25; + params_.alternative_service_probability_threshold = .25; CreateSessionWithNextProtos(); SendRequestAndExpectHttpResponse("hello world"); @@ -684,7 +684,7 @@ TEST_P(QuicNetworkTransactionTest, DontUseAlternateProtocolProbabilityForQuic) { socket_factory_.AddSocketDataProvider(&http_data); socket_factory_.AddSocketDataProvider(&http_data); - params_.alternate_protocol_probability_threshold = .75; + params_.alternative_service_probability_threshold = .75; CreateSessionWithNextProtos(); SendRequestAndExpectHttpResponse("hello world"); @@ -706,7 +706,7 @@ TEST_P(QuicNetworkTransactionTest, socket_factory_.AddSocketDataProvider(&http_data); socket_factory_.AddSocketDataProvider(&http_data); - params_.alternate_protocol_probability_threshold = .75; + params_.alternative_service_probability_threshold = .75; CreateSessionWithNextProtos(); SendRequestAndExpectHttpResponse("hello world"); -- cgit v1.1