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

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

Issue 1121043002: Make alternate Jobs not use HTTP/1.1 sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re: #5. Created 5 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
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | 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_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 1100
1101 next_state_ = STATE_CREATE_STREAM_COMPLETE; 1101 next_state_ = STATE_CREATE_STREAM_COMPLETE;
1102 1102
1103 // We only set the socket motivation if we're the first to use 1103 // We only set the socket motivation if we're the first to use
1104 // this socket. Is there a race for two SPDY requests? We really 1104 // this socket. Is there a race for two SPDY requests? We really
1105 // need to plumb this through to the connect level. 1105 // need to plumb this through to the connect level.
1106 if (connection_->socket() && !connection_->is_reused()) 1106 if (connection_->socket() && !connection_->is_reused())
1107 SetSocketMotivation(); 1107 SetSocketMotivation();
1108 1108
1109 if (!using_spdy_) { 1109 if (!using_spdy_) {
1110 if (IsAlternate())
Ryan Hamilton 2015/05/05 18:31:55 nit: I think this should be IsSpdyAlternate(), sin
Bence 2015/05/05 20:14:18 Done. BTW I moved the check from here to DoInitCo
1111 return ERR_NPN_NEGOTIATION_FAILED;
1110 // We may get ftp scheme when fetching ftp resources through proxy. 1112 // We may get ftp scheme when fetching ftp resources through proxy.
1111 bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) && 1113 bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) &&
1112 (request_info_.url.SchemeIs("http") || 1114 (request_info_.url.SchemeIs("http") ||
1113 request_info_.url.SchemeIs("ftp")); 1115 request_info_.url.SchemeIs("ftp"));
1114 if (stream_factory_->for_websockets_) { 1116 if (stream_factory_->for_websockets_) {
1115 DCHECK(request_); 1117 DCHECK(request_);
1116 DCHECK(request_->websocket_handshake_stream_create_helper()); 1118 DCHECK(request_->websocket_handshake_stream_create_helper());
1117 websocket_stream_.reset( 1119 websocket_stream_.reset(
1118 request_->websocket_handshake_stream_create_helper() 1120 request_->websocket_handshake_stream_create_helper()
1119 ->CreateBasicStream(connection_.Pass(), using_proxy)); 1121 ->CreateBasicStream(connection_.Pass(), using_proxy));
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 1548
1547 void HttpStreamFactoryImpl::Job:: 1549 void HttpStreamFactoryImpl::Job::
1548 MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest() { 1550 MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest() {
1549 if (IsOrphaned() || !connection_) 1551 if (IsOrphaned() || !connection_)
1550 return; 1552 return;
1551 1553
1552 request_->AddConnectionAttempts(connection_->connection_attempts()); 1554 request_->AddConnectionAttempts(connection_->connection_attempts());
1553 } 1555 }
1554 1556
1555 } // namespace net 1557 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698