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

Unified Diff: net/quic/chromium/bidirectional_stream_quic_impl.cc

Issue 2848923004: Move the "wait for QUIC handshake confirmation" logic to QuicChromiumClientSession::StreamRequest (Closed)
Patch Set: fix Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/chromium/bidirectional_stream_quic_impl.cc
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl.cc b/net/quic/chromium/bidirectional_stream_quic_impl.cc
index 04278f130d8abfb5dff37e1c1281e8440a3d729e..159d1d18cd8c4d7aca60a5991cee919add37f017 100644
--- a/net/quic/chromium/bidirectional_stream_quic_impl.cc
+++ b/net/quic/chromium/bidirectional_stream_quic_impl.cc
@@ -38,7 +38,6 @@ BidirectionalStreamQuicImpl::BidirectionalStreamQuicImpl(
has_sent_headers_(false),
has_received_headers_(false),
send_request_headers_automatically_(true),
- waiting_for_confirmation_(false),
weak_factory_(this) {
DCHECK(session_);
session_->AddObserver(this);
@@ -73,9 +72,13 @@ void BidirectionalStreamQuicImpl::Start(
delegate_ = delegate;
request_info_ = request_info;
- stream_request_ = session_->CreateStreamRequest();
+ stream_request_ =
+ session_->CreateStreamRequest(request_info_->method == "POST");
int rv = stream_request_->StartRequest(base::Bind(
&BidirectionalStreamQuicImpl::OnStreamReady, weak_factory_.GetWeakPtr()));
+ if (rv == ERR_IO_PENDING)
+ return;
+
if (rv == OK) {
OnStreamReady(rv);
} else if (!was_handshake_confirmed_) {
@@ -286,8 +289,6 @@ bool BidirectionalStreamQuicImpl::HasSendHeadersComplete() {
void BidirectionalStreamQuicImpl::OnCryptoHandshakeConfirmed() {
was_handshake_confirmed_ = true;
- if (waiting_for_confirmation_)
- NotifyStreamReady();
}
void BidirectionalStreamQuicImpl::OnSuccessfulVersionNegotiation(
@@ -308,10 +309,6 @@ void BidirectionalStreamQuicImpl::OnStreamReady(int rv) {
stream_ = stream_request_->ReleaseStream();
stream_request_.reset();
stream_->SetDelegate(this);
- if (!was_handshake_confirmed_ && request_info_->method == "POST") {
- waiting_for_confirmation_ = true;
- return;
- }
NotifyStreamReady();
} else {
NotifyError(rv);
« no previous file with comments | « net/quic/chromium/bidirectional_stream_quic_impl.h ('k') | net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698