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

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

Issue 1744693002: Implement QUIC-based net::BidirectionalStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@basecl
Patch Set: Removed dependency Created 4 years, 9 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_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 #include <utility> 9 #include <utility>
10 10
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 if (session_->quic_stream_factory()->IsQuicDisabled(destination.port())) 1008 if (session_->quic_stream_factory()->IsQuicDisabled(destination.port()))
1009 return ERR_QUIC_PROTOCOL_ERROR; 1009 return ERR_QUIC_PROTOCOL_ERROR;
1010 } else { 1010 } else {
1011 DCHECK(using_ssl_); 1011 DCHECK(using_ssl_);
1012 // The certificate of a QUIC alternative server is expected to be valid 1012 // The certificate of a QUIC alternative server is expected to be valid
1013 // for the origin of the request (in addition to being valid for the 1013 // for the origin of the request (in addition to being valid for the
1014 // server itself). 1014 // server itself).
1015 destination = server_; 1015 destination = server_;
1016 ssl_config = &server_ssl_config_; 1016 ssl_config = &server_ssl_config_;
1017 } 1017 }
1018 1018 int rv = quic_request_.Request(destination, request_info_.privacy_mode,
1019 int rv = 1019 ssl_config->GetCertVerifyFlags(), url,
1020 quic_request_.Request(destination, request_info_.privacy_mode, 1020 request_info_.method, net_log_, io_callback_,
1021 ssl_config->GetCertVerifyFlags(), url, 1021 for_bidirectional_);
Ryan Hamilton 2016/03/03 04:14:57 Let's use HttpStreamRequest::StreamType stream_typ
xunjieli 2016/03/03 16:54:19 Done.
1022 request_info_.method, net_log_, io_callback_);
1023 if (rv == OK) { 1022 if (rv == OK) {
1024 using_existing_quic_session_ = true; 1023 using_existing_quic_session_ = true;
1025 } else { 1024 } else {
1026 // OK, there's no available QUIC session. Let |waiting_job_| resume 1025 // OK, there's no available QUIC session. Let |waiting_job_| resume
1027 // if it's paused. 1026 // if it's paused.
1028 if (waiting_job_) { 1027 if (waiting_job_) {
1029 if (rv == ERR_IO_PENDING) { 1028 if (rv == ERR_IO_PENDING) {
1030 // Start the |waiting_job_| after the delay returned by 1029 // Start the |waiting_job_| after the delay returned by
1031 // GetTimeDelayForWaitingJob(). 1030 // GetTimeDelayForWaitingJob().
1032 // 1031 //
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 MaybeMarkAlternativeServiceBroken(); 1249 MaybeMarkAlternativeServiceBroken();
1251 return result; 1250 return result;
1252 } 1251 }
1253 1252
1254 if (using_quic_) { 1253 if (using_quic_) {
1255 if (result < 0) { 1254 if (result < 0) {
1256 job_status_ = STATUS_BROKEN; 1255 job_status_ = STATUS_BROKEN;
1257 MaybeMarkAlternativeServiceBroken(); 1256 MaybeMarkAlternativeServiceBroken();
1258 return result; 1257 return result;
1259 } 1258 }
1260 stream_ = quic_request_.ReleaseStream(); 1259 if (for_bidirectional_) {
1260 #if BUILDFLAG(ENABLE_BIDIRECTIONAL_STREAM)
1261 bidirectional_stream_job_ = quic_request_.ReleaseBidirectionalStreamJob();
1262 #else
1263 NOTREACHED();
1264 #endif
Ryan Hamilton 2016/03/03 04:14:57 I don't want to keep harping on this, but this is
xunjieli 2016/03/03 16:54:19 After changing for_bidirectional_ to the enum, is
1265 } else {
1266 stream_ = quic_request_.ReleaseStream();
1267 }
1261 next_state_ = STATE_NONE; 1268 next_state_ = STATE_NONE;
1262 return OK; 1269 return OK;
1263 } 1270 }
1264 1271
1265 if (result < 0 && !ssl_started) 1272 if (result < 0 && !ssl_started)
1266 return ReconsiderProxyAfterError(result); 1273 return ReconsiderProxyAfterError(result);
1267 establishing_tunnel_ = false; 1274 establishing_tunnel_ = false;
1268 1275
1269 if (connection_->socket()) { 1276 if (connection_->socket()) {
1270 // We officially have a new connection. Record the type. 1277 // We officially have a new connection. Record the type.
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 if (connection_->socket()) { 1805 if (connection_->socket()) {
1799 ConnectionAttempts socket_attempts; 1806 ConnectionAttempts socket_attempts;
1800 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1807 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1801 request_->AddConnectionAttempts(socket_attempts); 1808 request_->AddConnectionAttempts(socket_attempts);
1802 } else { 1809 } else {
1803 request_->AddConnectionAttempts(connection_->connection_attempts()); 1810 request_->AddConnectionAttempts(connection_->connection_attempts());
1804 } 1811 }
1805 } 1812 }
1806 1813
1807 } // namespace net 1814 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698