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

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

Issue 1979763002: Landing Recent QUIC changes until Sun May 8 00:39:29 2016 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_sent_packet_manager_test.cc ('k') | net/quic/quic_session_test.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/quic_session.h" 5 #include "net/quic/quic_session.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/quic/crypto/proof_verifier.h" 10 #include "net/quic/crypto/proof_verifier.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 void QuicSession::OnStreamFrame(const QuicStreamFrame& frame) { 77 void QuicSession::OnStreamFrame(const QuicStreamFrame& frame) {
78 // TODO(rch) deal with the error case of stream id 0. 78 // TODO(rch) deal with the error case of stream id 0.
79 QuicStreamId stream_id = frame.stream_id; 79 QuicStreamId stream_id = frame.stream_id;
80 ReliableQuicStream* stream = GetOrCreateStream(stream_id); 80 ReliableQuicStream* stream = GetOrCreateStream(stream_id);
81 if (!stream) { 81 if (!stream) {
82 // The stream no longer exists, but we may still be interested in the 82 // The stream no longer exists, but we may still be interested in the
83 // final stream byte offset sent by the peer. A frame with a FIN can give 83 // final stream byte offset sent by the peer. A frame with a FIN can give
84 // us this offset. 84 // us this offset.
85 if (frame.fin) { 85 if (frame.fin) {
86 QuicStreamOffset final_byte_offset = frame.offset + frame.frame_length; 86 QuicStreamOffset final_byte_offset = frame.offset + frame.data_length;
87 UpdateFlowControlOnFinalReceivedByteOffset(stream_id, final_byte_offset); 87 UpdateFlowControlOnFinalReceivedByteOffset(stream_id, final_byte_offset);
88 } 88 }
89 return; 89 return;
90 } 90 }
91 stream->OnStreamFrame(frame); 91 stream->OnStreamFrame(frame);
92 } 92 }
93 93
94 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { 94 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) {
95 if (ContainsKey(static_stream_map_, frame.stream_id)) { 95 if (ContainsKey(static_stream_map_, frame.stream_id)) {
96 connection()->CloseConnection( 96 connection()->CloseConnection(
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 806
807 size_t QuicSession::MaxAvailableStreams() const { 807 size_t QuicSession::MaxAvailableStreams() const {
808 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; 808 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier;
809 } 809 }
810 810
811 bool QuicSession::IsIncomingStream(QuicStreamId id) const { 811 bool QuicSession::IsIncomingStream(QuicStreamId id) const {
812 return id % 2 != next_outgoing_stream_id_ % 2; 812 return id % 2 != next_outgoing_stream_id_ % 2;
813 } 813 }
814 814
815 } // namespace net 815 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698