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

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

Issue 284423002: Remove HttpStreamFactory's NPN/SPDY globals, except for spdy_enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_impl.h" 5 #include "net/http/http_stream_factory_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 return http_pipelined_host_pool_.PipelineInfoToValue(); 183 return http_pipelined_host_pool_.PipelineInfoToValue();
184 } 184 }
185 185
186 const HostMappingRules* HttpStreamFactoryImpl::GetHostMappingRules() const { 186 const HostMappingRules* HttpStreamFactoryImpl::GetHostMappingRules() const {
187 return session_->params().host_mapping_rules; 187 return session_->params().host_mapping_rules;
188 } 188 }
189 189
190 PortAlternateProtocolPair HttpStreamFactoryImpl::GetAlternateProtocolRequestFor( 190 PortAlternateProtocolPair HttpStreamFactoryImpl::GetAlternateProtocolRequestFor(
191 const GURL& original_url, 191 const GURL& original_url,
192 GURL* alternate_url) { 192 GURL* alternate_url) {
193 if (!use_alternate_protocols()) 193 if (!session_->params().use_alternate_protocols)
194 return kNoAlternateProtocol; 194 return kNoAlternateProtocol;
195 195
196 if (original_url.SchemeIs("ftp")) 196 if (original_url.SchemeIs("ftp"))
197 return kNoAlternateProtocol; 197 return kNoAlternateProtocol;
198 198
199 HostPortPair origin = HostPortPair(original_url.HostNoBrackets(), 199 HostPortPair origin = HostPortPair(original_url.HostNoBrackets(),
200 original_url.EffectiveIntPort()); 200 original_url.EffectiveIntPort());
201 201
202 HttpServerProperties& http_server_properties = 202 HttpServerProperties& http_server_properties =
203 *session_->http_server_properties(); 203 *session_->http_server_properties();
(...skipping 20 matching lines...) Expand all
224 // allow protocol upgrades to user-controllable ports. 224 // allow protocol upgrades to user-controllable ports.
225 const int kUnrestrictedPort = 1024; 225 const int kUnrestrictedPort = 1024;
226 if (!session_->params().enable_user_alternate_protocol_ports && 226 if (!session_->params().enable_user_alternate_protocol_ports &&
227 (alternate.port >= kUnrestrictedPort && 227 (alternate.port >= kUnrestrictedPort &&
228 origin.port() < kUnrestrictedPort)) 228 origin.port() < kUnrestrictedPort))
229 return kNoAlternateProtocol; 229 return kNoAlternateProtocol;
230 230
231 origin.set_port(alternate.port); 231 origin.set_port(alternate.port);
232 if (alternate.protocol >= NPN_SPDY_MINIMUM_VERSION && 232 if (alternate.protocol >= NPN_SPDY_MINIMUM_VERSION &&
233 alternate.protocol <= NPN_SPDY_MAXIMUM_VERSION) { 233 alternate.protocol <= NPN_SPDY_MAXIMUM_VERSION) {
234 if (!spdy_enabled()) 234 if (!HttpStreamFactory::spdy_enabled())
235 return kNoAlternateProtocol; 235 return kNoAlternateProtocol;
236 236
237 if (HttpStreamFactory::HasSpdyExclusion(origin)) 237 if (session_->HasSpdyExclusion(origin))
238 return kNoAlternateProtocol; 238 return kNoAlternateProtocol;
239 239
240 *alternate_url = UpgradeUrlToHttps(original_url, alternate.port); 240 *alternate_url = UpgradeUrlToHttps(original_url, alternate.port);
241 } else { 241 } else {
242 DCHECK_EQ(QUIC, alternate.protocol); 242 DCHECK_EQ(QUIC, alternate.protocol);
243 if (!session_->params().enable_quic || 243 if (!session_->params().enable_quic ||
244 !(original_url.SchemeIs("http") || 244 !(original_url.SchemeIs("http") ||
245 session_->params().enable_quic_https)) { 245 session_->params().enable_quic_https)) {
246 return kNoAlternateProtocol; 246 return kNoAlternateProtocol;
247 } 247 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 it != requests_to_fail.end(); ++it) { 349 it != requests_to_fail.end(); ++it) {
350 Request* request = *it; 350 Request* request = *it;
351 if (request == request_map_[job]) { 351 if (request == request_map_[job]) {
352 continue; 352 continue;
353 } 353 }
354 request->OnStreamFailed(NULL, status, used_ssl_config); 354 request->OnStreamFailed(NULL, status, used_ssl_config);
355 } 355 }
356 } 356 }
357 357
358 } // namespace net 358 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698