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

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698