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

Side by Side Diff: net/quic/core/quic_session.cc

Issue 2692813002: Server push cancellation: add a finch trial parameter (Closed)
Patch Set: Spin the message loop to ensure the client receives the response 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 unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/core/quic_session.h" 5 #include "net/quic/core/quic_session.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <utility> 8 #include <utility>
9 9
10 #include "net/quic/core/quic_connection.h" 10 #include "net/quic/core/quic_connection.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { 89 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) {
90 if (QuicContainsKey(static_stream_map_, frame.stream_id)) { 90 if (QuicContainsKey(static_stream_map_, frame.stream_id)) {
91 connection()->CloseConnection( 91 connection()->CloseConnection(
92 QUIC_INVALID_STREAM_ID, "Attempt to reset a static stream", 92 QUIC_INVALID_STREAM_ID, "Attempt to reset a static stream",
93 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); 93 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
94 return; 94 return;
95 } 95 }
96 96
97 if (visitor_) {
98 visitor_->OnRstStreamReceived(frame);
99 }
100
97 QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id); 101 QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id);
98 if (!stream) { 102 if (!stream) {
99 HandleRstOnValidNonexistentStream(frame); 103 HandleRstOnValidNonexistentStream(frame);
100 return; // Errors are handled by GetOrCreateStream. 104 return; // Errors are handled by GetOrCreateStream.
101 } 105 }
102 106
103 stream->OnStreamReset(frame); 107 stream->OnStreamReset(frame);
104 } 108 }
105 109
106 void QuicSession::OnGoAway(const QuicGoAwayFrame& frame) { 110 void QuicSession::OnGoAway(const QuicGoAwayFrame& frame) {
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 869
866 size_t QuicSession::MaxAvailableStreams() const { 870 size_t QuicSession::MaxAvailableStreams() const {
867 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; 871 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier;
868 } 872 }
869 873
870 bool QuicSession::IsIncomingStream(QuicStreamId id) const { 874 bool QuicSession::IsIncomingStream(QuicStreamId id) const {
871 return id % 2 != next_outgoing_stream_id_ % 2; 875 return id % 2 != next_outgoing_stream_id_ % 2;
872 } 876 }
873 877
874 } // namespace net 878 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698