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

Side by Side Diff: net/http/http_stream_factory.cc

Issue 1216703002: Implement multiple alternative services per origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_stream_factory.h" 5 #include "net/http/http_stream_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 !session.IsProtocolEnabled(protocol)) { 79 !session.IsProtocolEnabled(protocol)) {
80 DVLOG(1) << kAlternateProtocolHeader 80 DVLOG(1) << kAlternateProtocolHeader
81 << " header has unrecognized protocol: " 81 << " header has unrecognized protocol: "
82 << port_protocol_vector[1]; 82 << port_protocol_vector[1];
83 is_valid = false; 83 is_valid = false;
84 break; 84 break;
85 } 85 }
86 } 86 }
87 87
88 if (!is_valid || protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) { 88 if (!is_valid || protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) {
89 http_server_properties->ClearAlternativeService(http_host_port_pair); 89 http_server_properties->ClearAlternativeServices(http_host_port_pair);
90 return; 90 return;
91 } 91 }
92 92
93 HostPortPair host_port(http_host_port_pair); 93 HostPortPair host_port(http_host_port_pair);
94 const HostMappingRules* mapping_rules = GetHostMappingRules(); 94 const HostMappingRules* mapping_rules = GetHostMappingRules();
95 if (mapping_rules) 95 if (mapping_rules)
96 mapping_rules->RewriteHost(&host_port); 96 mapping_rules->RewriteHost(&host_port);
97 97
98 http_server_properties->SetAlternativeService( 98 http_server_properties->SetAlternativeService(
99 host_port, AlternativeService(protocol, "", static_cast<uint16>(port)), 99 host_port, AlternativeService(protocol, "", static_cast<uint16>(port)),
(...skipping 10 matching lines...) Expand all
110 replacements.SetHost(endpoint->host().c_str(), 110 replacements.SetHost(endpoint->host().c_str(),
111 url::Component(0, endpoint->host().size())); 111 url::Component(0, endpoint->host().size()));
112 return url.ReplaceComponents(replacements); 112 return url.ReplaceComponents(replacements);
113 } 113 }
114 return url; 114 return url;
115 } 115 }
116 116
117 HttpStreamFactory::HttpStreamFactory() {} 117 HttpStreamFactory::HttpStreamFactory() {}
118 118
119 } // namespace net 119 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_manager_unittest.cc ('k') | net/http/http_stream_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698