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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/quic/quic_client_session_base.h" 5 #include "net/quic/quic_client_session_base.h"
6 6
7 #include "net/quic/quic_flags.h" 7 #include "net/quic/quic_flags.h"
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 10 matching lines...) Expand all
21 if (!FLAGS_enable_quic_fec || event != ENCRYPTION_FIRST_ESTABLISHED || 21 if (!FLAGS_enable_quic_fec || event != ENCRYPTION_FIRST_ESTABLISHED ||
22 !config()->HasSendConnectionOptions() || 22 !config()->HasSendConnectionOptions() ||
23 !ContainsQuicTag(config()->SendConnectionOptions(), kFHDR)) { 23 !ContainsQuicTag(config()->SendConnectionOptions(), kFHDR)) {
24 return; 24 return;
25 } 25 }
26 // kFHDR config maps to FEC protection always for headers stream. 26 // kFHDR config maps to FEC protection always for headers stream.
27 // TODO(jri): Add crypto stream in addition to headers for kHDR. 27 // TODO(jri): Add crypto stream in addition to headers for kHDR.
28 headers_stream()->set_fec_policy(FEC_PROTECT_ALWAYS); 28 headers_stream()->set_fec_policy(FEC_PROTECT_ALWAYS);
29 } 29 }
30 30
31 void QuicClientSessionBase::OnPromiseHeaders(QuicStreamId stream_id,
32 StringPiece headers_data) {
33 QuicSpdyStream* stream = GetSpdyDataStream(stream_id);
34 if (!stream) {
35 // It's quite possible to receive headers after a stream has been reset.
36 return;
37 }
38 stream->OnPromiseHeaders(headers_data);
39 }
40
41 void QuicClientSessionBase::OnPromiseHeadersComplete(
42 QuicStreamId stream_id,
43 QuicStreamId promised_stream_id,
44 size_t frame_len) {
45 if (promised_stream_id != kInvalidStreamId &&
46 promised_stream_id <= largest_promised_stream_id_) {
47 CloseConnectionWithDetails(QUIC_INVALID_STREAM_ID,
48 "Received push stream id lesser or equal to the"
49 " last accepted before");
50 return;
51 }
52 largest_promised_stream_id_ = promised_stream_id;
53
54 QuicSpdyStream* stream = GetSpdyDataStream(stream_id);
55 if (!stream) {
56 // It's quite possible to receive headers after a stream has been reset.
57 return;
58 }
59 stream->OnPromiseHeadersComplete(promised_stream_id, frame_len);
60 }
61
31 } // namespace net 62 } // namespace net
OLDNEW
« 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