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

Unified Diff: net/quic/quic_http_stream.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/quic_http_stream.h ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_http_stream.cc
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index 8d542072d79d9197cbb5ad4eb4fb67df8d976b22..7598a1ff97f8141d7ec1f03d41f8bb4cc0a6863c 100644
--- a/net/quic/quic_http_stream.cc
+++ b/net/quic/quic_http_stream.cc
@@ -525,6 +525,13 @@ bool QuicHttpStream::HasSendHeadersComplete() {
void QuicHttpStream::OnCryptoHandshakeConfirmed() {
was_handshake_confirmed_ = true;
+ if (next_state_ == STATE_WAIT_FOR_CONFIRMATION_COMPLETE) {
+ int rv = DoLoop(OK);
+
+ if (rv != ERR_IO_PENDING && !callback_.is_null()) {
+ DoCallback(rv);
+ }
+ }
}
void QuicHttpStream::OnSessionClosed(int error, bool port_migration_detected) {
@@ -562,6 +569,13 @@ int QuicHttpStream::DoLoop(int rv) {
case STATE_SET_REQUEST_PRIORITY:
rv = DoSetRequestPriority();
break;
+ case STATE_WAIT_FOR_CONFIRMATION:
+ CHECK_EQ(OK, rv);
+ rv = DoWaitForConfirmation();
+ break;
+ case STATE_WAIT_FOR_CONFIRMATION_COMPLETE:
+ rv = DoWaitForConfirmationComplete(rv);
+ break;
case STATE_SEND_HEADERS:
CHECK_EQ(OK, rv);
rv = DoSendHeaders();
@@ -621,12 +635,28 @@ int QuicHttpStream::DoStreamRequest() {
}
int QuicHttpStream::DoSetRequestPriority() {
- // Set priority according to request and, and advance to
- // STATE_SEND_HEADERS.
+ // Set priority according to request
DCHECK(stream_);
DCHECK(response_info_);
SpdyPriority priority = ConvertRequestPriorityToQuicPriority(priority_);
stream_->SetPriority(priority);
+ next_state_ = STATE_WAIT_FOR_CONFIRMATION;
+ return OK;
+}
+
+int QuicHttpStream::DoWaitForConfirmation() {
+ next_state_ = STATE_WAIT_FOR_CONFIRMATION_COMPLETE;
+ if (!session_->IsCryptoHandshakeConfirmed() &&
+ request_info_->method == "POST") {
+ return ERR_IO_PENDING;
+ }
+ return OK;
+}
+
+int QuicHttpStream::DoWaitForConfirmationComplete(int rv) {
+ if (rv < 0)
+ return rv;
+
next_state_ = STATE_SEND_HEADERS;
return OK;
}
« no previous file with comments | « net/quic/quic_http_stream.h ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698