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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 858433004: Modify SetAlternateProtocol and HasAlternateProtocol behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_impl.cc
diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc
index a8bc04a685980d1f5adb6d1ec778cdbc58f77968..1e697406fea55d8fb433b50cd3bffbd1fb6d0a22 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -282,9 +282,19 @@ void HttpServerPropertiesImpl::SetAlternateProtocol(
AlternateProtocolInfo alternate(alternate_port,
alternate_protocol,
alternate_probability);
- if (HasAlternateProtocol(server)) {
- const AlternateProtocolInfo existing_alternate =
- GetAlternateProtocol(server);
+ // Do not call HasAlternateProtocol(), because we do not care about
+ // |g_forced_alternate_protocol|, or whether the alternate protocol
+ // probability is higher than the threshold.
+ AlternateProtocolMap::iterator it = alternate_protocol_map_.Get(server);
+ if (it == alternate_protocol_map_.end()) {
+ const CanonicalHostMap::const_iterator canonical_host =
+ GetCanonicalHost(server);
+ if (canonical_host != canonical_host_to_origin_map_.end()) {
+ it = alternate_protocol_map_.Get(canonical_host->second);
+ }
+ }
Ryan Hamilton 2015/01/16 22:42:45 This looks like a good change. I wonder if this sh
Bence 2015/01/23 16:45:58 Done.
+ if (it != alternate_protocol_map_.end()) {
+ const AlternateProtocolInfo existing_alternate = it->second;
if (existing_alternate.is_broken) {
DVLOG(1) << "Ignore alternate protocol since it's known to be broken.";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698