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

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

Issue 17760008: [SPDY] Enable tests for SPDY/3.1 and SPDY/4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix more tests Created 7 years, 6 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
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/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // single user on a multi-user system to hijack the alternate protocol. 219 // single user on a multi-user system to hijack the alternate protocol.
220 // These systems also enforce ports <1024 as restricted ports. So don't 220 // These systems also enforce ports <1024 as restricted ports. So don't
221 // allow protocol upgrades to user-controllable ports. 221 // allow protocol upgrades to user-controllable ports.
222 const int kUnrestrictedPort = 1024; 222 const int kUnrestrictedPort = 1024;
223 if (!session_->params().enable_user_alternate_protocol_ports && 223 if (!session_->params().enable_user_alternate_protocol_ports &&
224 (alternate.port >= kUnrestrictedPort && 224 (alternate.port >= kUnrestrictedPort &&
225 origin.port() < kUnrestrictedPort)) 225 origin.port() < kUnrestrictedPort))
226 return kNoAlternateProtocol; 226 return kNoAlternateProtocol;
227 227
228 origin.set_port(alternate.port); 228 origin.set_port(alternate.port);
229 if (alternate.protocol >= NPN_SPDY_2 && alternate.protocol <= NPN_SPDY_3) { 229 if (alternate.protocol >= NPN_SPDY_MINIMUM_VERSION &&
230 alternate.protocol <= NPN_SPDY_MAXIMUM_VERSION) {
230 if (!spdy_enabled()) 231 if (!spdy_enabled())
231 return kNoAlternateProtocol; 232 return kNoAlternateProtocol;
232 233
233 if (HttpStreamFactory::HasSpdyExclusion(origin)) 234 if (HttpStreamFactory::HasSpdyExclusion(origin))
234 return kNoAlternateProtocol; 235 return kNoAlternateProtocol;
235 236
236 *alternate_url = UpgradeUrlToHttps(original_url, alternate.port); 237 *alternate_url = UpgradeUrlToHttps(original_url, alternate.port);
237 } else { 238 } else {
238 DCHECK_EQ(QUIC, alternate.protocol); 239 DCHECK_EQ(QUIC, alternate.protocol);
239 if (!session_->params().enable_quic || 240 if (!session_->params().enable_quic ||
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 it != requests_to_fail.end(); ++it) { 345 it != requests_to_fail.end(); ++it) {
345 Request* request = *it; 346 Request* request = *it;
346 if (request == request_map_[job]) { 347 if (request == request_map_[job]) {
347 continue; 348 continue;
348 } 349 }
349 request->OnStreamFailed(NULL, status, used_ssl_config); 350 request->OnStreamFailed(NULL, status, used_ssl_config);
350 } 351 }
351 } 352 }
352 353
353 } // namespace net 354 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698