summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbnc <bnc@chromium.org>2015-04-27 07:14:12 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-27 14:14:13 +0000
commit62891a5fe6637cb5d07b2ecc137d145969de6db6 (patch)
tree731b192b6d29ea5b31f7032fcbdecee123555de8 /net
parent0f31f97fc9577a559a527a3421981b75427791b8 (diff)
downloadchromium_src-62891a5fe6637cb5d07b2ecc137d145969de6db6.zip
chromium_src-62891a5fe6637cb5d07b2ecc137d145969de6db6.tar.gz
chromium_src-62891a5fe6637cb5d07b2ecc137d145969de6db6.tar.bz2
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}
Diffstat (limited to 'net')
-rw-r--r--net/http/http_network_session.cc10
-rw-r--r--net/http/http_network_session.h2
-rw-r--r--net/http/http_server_properties.h3
-rw-r--r--net/http/http_server_properties_impl.cc12
-rw-r--r--net/http/http_server_properties_impl.h4
-rw-r--r--net/http/http_server_properties_impl_unittest.cc8
-rw-r--r--net/http/http_server_properties_manager.cc4
-rw-r--r--net/http/http_server_properties_manager.h2
-rw-r--r--net/quic/quic_network_transaction_unittest.cc6
9 files changed, 25 insertions, 26 deletions
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<HttpServerPropertiesImpl> 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");