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

Unified Diff: net/quic/bidirectional_stream_quic_impl.cc

Issue 2077683002: Move the logic for delaying 0-RTT QUIC POST from the QuicStreamFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@QuicHttpStream
Patch Set: tweak Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/bidirectional_stream_quic_impl.h ('k') | net/quic/bidirectional_stream_quic_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/bidirectional_stream_quic_impl.cc
diff --git a/net/quic/bidirectional_stream_quic_impl.cc b/net/quic/bidirectional_stream_quic_impl.cc
index 25154b40cf79bd238275053969faf8d8bf88333b..1056d1c8e5eefd389dbfde04615d8c9c9a0bf6eb 100644
--- a/net/quic/bidirectional_stream_quic_impl.cc
+++ b/net/quic/bidirectional_stream_quic_impl.cc
@@ -33,6 +33,7 @@ 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);
@@ -281,6 +282,8 @@ bool BidirectionalStreamQuicImpl::HasSendHeadersComplete() {
void BidirectionalStreamQuicImpl::OnCryptoHandshakeConfirmed() {
was_handshake_confirmed_ = true;
+ if (waiting_for_confirmation_)
+ NotifyStreamReady();
}
void BidirectionalStreamQuicImpl::OnSessionClosed(
@@ -296,11 +299,11 @@ void BidirectionalStreamQuicImpl::OnStreamReady(int rv) {
DCHECK(rv == OK || !stream_);
if (rv == OK) {
stream_->SetDelegate(this);
- if (send_request_headers_automatically_) {
- SendRequestHeaders();
+ if (!was_handshake_confirmed_ && request_info_->method == "POST") {
+ waiting_for_confirmation_ = true;
+ return;
}
- if (delegate_)
- delegate_->OnStreamReady(has_sent_headers_);
+ NotifyStreamReady();
} else {
NotifyError(rv);
}
@@ -332,6 +335,14 @@ void BidirectionalStreamQuicImpl::NotifyError(int error) {
}
}
+void BidirectionalStreamQuicImpl::NotifyStreamReady() {
+ if (send_request_headers_automatically_) {
+ SendRequestHeaders();
+ }
+ if (delegate_)
+ delegate_->OnStreamReady(has_sent_headers_);
+}
+
void BidirectionalStreamQuicImpl::ResetStream() {
if (!stream_)
return;
« no previous file with comments | « net/quic/bidirectional_stream_quic_impl.h ('k') | net/quic/bidirectional_stream_quic_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698