Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1315)

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 874603004: Remove HasAlternateProtocol(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..78238b946e13d20a976dfae78b28239117748c98 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -175,8 +175,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 +184,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;

Powered by Google App Engine
This is Rietveld 408576698