Commit 141ec021 authored by rch@chromium.org's avatar rch@chromium.org

Make the default alternate protcol probability threshold 1, not 0.

This means that by default, Chrome will honor headers like:
  Alternate-Protocol: 80:quic
  Alternate-Protocol: 80:quic,p=1
But not:
  Alternate-Protocol: 80:quic,p=.5
Eventually we need to switch to a dynamic threshold, but on step at a time.

Review URL: https://codereview.chromium.org/411423003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285473 0039d316-1c4b-4281-b951-d872f2087c98
parent 1834d999
......@@ -81,7 +81,7 @@ HttpNetworkSession::Params::Params()
force_spdy_over_ssl(true),
force_spdy_always(false),
use_alternate_protocols(false),
alternate_protocol_probability_threshold(0),
alternate_protocol_probability_threshold(1),
enable_websocket_over_spdy(false),
enable_quic(false),
enable_quic_port_selection(true),
......
......@@ -26,7 +26,7 @@ HttpServerPropertiesImpl::HttpServerPropertiesImpl()
alternate_protocol_experiment_(
ALTERNATE_PROTOCOL_NOT_PART_OF_EXPERIMENT),
spdy_settings_map_(SpdySettingsMap::NO_AUTO_EVICT),
alternate_protocol_probability_threshold_(0),
alternate_protocol_probability_threshold_(1),
weak_ptr_factory_(this) {
canoncial_suffixes_.push_back(".c.youtube.com");
canoncial_suffixes_.push_back(".googlevideo.com");
......@@ -198,7 +198,7 @@ bool HttpServerPropertiesImpl::HasAlternateProtocol(
return true;
AlternateProtocolMap::const_iterator it = alternate_protocol_map_.Get(server);
if (it != alternate_protocol_map_.end() &&
it->second.probability > alternate_protocol_probability_threshold_) {
it->second.probability >= alternate_protocol_probability_threshold_) {
return true;
}
......
......@@ -254,6 +254,13 @@ TEST_F(AlternateProtocolServerPropertiesTest, Basic) {
EXPECT_FALSE(impl_.HasAlternateProtocol(test_host_port_pair));
}
TEST_F(AlternateProtocolServerPropertiesTest, DefaultProbabilityExcluded) {
HostPortPair test_host_port_pair("foo", 80);
impl_.SetAlternateProtocol(test_host_port_pair, 443, NPN_SPDY_3, .99);
EXPECT_FALSE(impl_.HasAlternateProtocol(test_host_port_pair));
}
TEST_F(AlternateProtocolServerPropertiesTest, Probability) {
impl_.SetAlternateProtocolProbabilityThreshold(.25);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment