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

Unified Diff: net/quic/quic_client_session_base.cc

Issue 1572013002: relnote: QUIC header streams support to receive PUSH_PROMISE. Protected by --quic_supports_push_pr… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@14_CL_111507546
Patch Set: Created 4 years, 11 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_client_session_base.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_client_session_base.cc
diff --git a/net/quic/quic_client_session_base.cc b/net/quic/quic_client_session_base.cc
index 740263d2d5956a6c0e78af967b0c88fb5d7d0049..5ff7d12aa609fa873e6d36f3571e57ec4499448e 100644
--- a/net/quic/quic_client_session_base.cc
+++ b/net/quic/quic_client_session_base.cc
@@ -28,4 +28,35 @@ void QuicClientSessionBase::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
headers_stream()->set_fec_policy(FEC_PROTECT_ALWAYS);
}
+void QuicClientSessionBase::OnPromiseHeaders(QuicStreamId stream_id,
+ StringPiece headers_data) {
+ QuicSpdyStream* stream = GetSpdyDataStream(stream_id);
+ if (!stream) {
+ // It's quite possible to receive headers after a stream has been reset.
+ return;
+ }
+ stream->OnPromiseHeaders(headers_data);
+}
+
+void QuicClientSessionBase::OnPromiseHeadersComplete(
+ QuicStreamId stream_id,
+ QuicStreamId promised_stream_id,
+ size_t frame_len) {
+ if (promised_stream_id != kInvalidStreamId &&
+ promised_stream_id <= largest_promised_stream_id_) {
+ CloseConnectionWithDetails(QUIC_INVALID_STREAM_ID,
+ "Received push stream id lesser or equal to the"
+ " last accepted before");
+ return;
+ }
+ largest_promised_stream_id_ = promised_stream_id;
+
+ QuicSpdyStream* stream = GetSpdyDataStream(stream_id);
+ if (!stream) {
+ // It's quite possible to receive headers after a stream has been reset.
+ return;
+ }
+ stream->OnPromiseHeadersComplete(promised_stream_id, frame_len);
+}
+
} // namespace net
« no previous file with comments | « net/quic/quic_client_session_base.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698