| Index: net/http/http_stream_factory_impl.cc
|
| diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
|
| index 9e932ee99cc0e3cf4ed6d415f8c684a4a0a56aa7..235122d2e834ae363f77203bc88277c5ad2c96e5 100644
|
| --- a/net/http/http_stream_factory_impl.cc
|
| +++ b/net/http/http_stream_factory_impl.cc
|
| @@ -24,11 +24,10 @@ namespace {
|
|
|
| GURL UpgradeUrlToHttps(const GURL& original_url, int port) {
|
| GURL::Replacements replacements;
|
| - // new_sheme and new_port need to be in scope here because GURL::Replacements
|
| - // references the memory contained by them directly.
|
| - const std::string new_scheme = "https";
|
| + // new_port needs to be in scope here because GURL::Replacements references
|
| + // the memory contained by it directly.
|
| const std::string new_port = base::IntToString(port);
|
| - replacements.SetSchemeStr(new_scheme);
|
| + replacements.SetSchemeStr("https");
|
| replacements.SetPortStr(new_port);
|
| return original_url.ReplaceComponents(replacements);
|
| }
|
| @@ -175,8 +174,7 @@ const HostMappingRules* HttpStreamFactoryImpl::GetHostMappingRules() const {
|
| AlternateProtocolInfo HttpStreamFactoryImpl::GetAlternateProtocolRequestFor(
|
| const GURL& original_url,
|
| GURL* alternate_url) {
|
| - const AlternateProtocolInfo kNoAlternateProtocol =
|
| - AlternateProtocolInfo(0, UNINITIALIZED_ALTERNATE_PROTOCOL, 0);
|
| + const AlternateProtocolInfo kNoAlternateProtocol;
|
|
|
| if (!session_->params().use_alternate_protocols)
|
| return kNoAlternateProtocol;
|
| @@ -185,19 +183,17 @@ AlternateProtocolInfo HttpStreamFactoryImpl::GetAlternateProtocolRequestFor(
|
| return kNoAlternateProtocol;
|
|
|
| HostPortPair origin = HostPortPair::FromURL(original_url);
|
| -
|
| HttpServerProperties& http_server_properties =
|
| *session_->http_server_properties();
|
| - if (!http_server_properties.HasAlternateProtocol(origin))
|
| - return kNoAlternateProtocol;
|
| -
|
| - AlternateProtocolInfo alternate =
|
| + const AlternateProtocolInfo alternate =
|
| http_server_properties.GetAlternateProtocol(origin);
|
| +
|
| + if (alternate.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL)
|
| + return kNoAlternateProtocol;
|
| if (alternate.is_broken) {
|
| HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN);
|
| return kNoAlternateProtocol;
|
| }
|
| -
|
| if (!IsAlternateProtocolValid(alternate.protocol)) {
|
| NOTREACHED();
|
| return kNoAlternateProtocol;
|
|
|