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

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

Issue 2334363002: Landing Recent QUIC changes until Sat Sep 10 00:32:41 (Closed)
Patch Set: Revase Created 4 years, 3 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_stream_sequencer.h ('k') | net/quic/core/quic_stream_sequencer_buffer.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_stream_sequencer.h" 5 #include "net/quic/core/quic_stream_sequencer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 17 matching lines...) Expand all
28 namespace net { 28 namespace net {
29 29
30 QuicStreamSequencer::QuicStreamSequencer(ReliableQuicStream* quic_stream, 30 QuicStreamSequencer::QuicStreamSequencer(ReliableQuicStream* quic_stream,
31 const QuicClock* clock) 31 const QuicClock* clock)
32 : stream_(quic_stream), 32 : stream_(quic_stream),
33 buffered_frames_(kStreamReceiveWindowLimit), 33 buffered_frames_(kStreamReceiveWindowLimit),
34 close_offset_(numeric_limits<QuicStreamOffset>::max()), 34 close_offset_(numeric_limits<QuicStreamOffset>::max()),
35 blocked_(false), 35 blocked_(false),
36 num_frames_received_(0), 36 num_frames_received_(0),
37 num_duplicate_frames_received_(0), 37 num_duplicate_frames_received_(0),
38 num_early_frames_received_(0),
39 clock_(clock), 38 clock_(clock),
40 ignore_read_data_(false) {} 39 ignore_read_data_(false) {}
41 40
42 QuicStreamSequencer::~QuicStreamSequencer() {} 41 QuicStreamSequencer::~QuicStreamSequencer() {}
43 42
44 void QuicStreamSequencer::OnStreamFrame(const QuicStreamFrame& frame) { 43 void QuicStreamSequencer::OnStreamFrame(const QuicStreamFrame& frame) {
45 ++num_frames_received_; 44 ++num_frames_received_;
46 const QuicStreamOffset byte_offset = frame.offset; 45 const QuicStreamOffset byte_offset = frame.offset;
47 const size_t data_len = frame.data_length; 46 const size_t data_len = frame.data_length;
48 47
(...skipping 18 matching lines...) Expand all
67 stream_->CloseConnectionWithDetails(result, details); 66 stream_->CloseConnectionWithDetails(result, details);
68 return; 67 return;
69 } 68 }
70 69
71 if (bytes_written == 0) { 70 if (bytes_written == 0) {
72 ++num_duplicate_frames_received_; 71 ++num_duplicate_frames_received_;
73 // Silently ignore duplicates. 72 // Silently ignore duplicates.
74 return; 73 return;
75 } 74 }
76 75
77 if (byte_offset > buffered_frames_.BytesConsumed()) {
78 ++num_early_frames_received_;
79 }
80
81 if (blocked_) { 76 if (blocked_) {
82 return; 77 return;
83 } 78 }
84 79
85 if (byte_offset == buffered_frames_.BytesConsumed()) { 80 if (byte_offset == buffered_frames_.BytesConsumed()) {
86 if (ignore_read_data_) { 81 if (ignore_read_data_) {
87 FlushBufferedFrames(); 82 FlushBufferedFrames();
88 } else { 83 } else {
89 stream_->OnDataAvailable(); 84 stream_->OnDataAvailable();
90 } 85 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 "\n bytes buffered: " + IntToString(NumBytesBuffered()) + 208 "\n bytes buffered: " + IntToString(NumBytesBuffered()) +
214 "\n bytes consumed: " + IntToString( NumBytesConsumed()) + 209 "\n bytes consumed: " + IntToString( NumBytesConsumed()) +
215 "\n has bytes to read: " + (HasBytesToRead() ? "true" : "false") + 210 "\n has bytes to read: " + (HasBytesToRead() ? "true" : "false") +
216 "\n frames received: " + IntToString(num_frames_received()) + 211 "\n frames received: " + IntToString(num_frames_received()) +
217 "\n close offset bytes: " + IntToString( close_offset_) + 212 "\n close offset bytes: " + IntToString( close_offset_) +
218 "\n is closed: " + (IsClosed() ? "true" : "false"); 213 "\n is closed: " + (IsClosed() ? "true" : "false");
219 // clang-format on 214 // clang-format on
220 } 215 }
221 216
222 } // namespace net 217 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_stream_sequencer.h ('k') | net/quic/core/quic_stream_sequencer_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698