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

Side by Side Diff: net/quic/reliable_quic_stream.h

Issue 312553003: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_stream_sequencer.cc ('k') | net/quic/reliable_quic_stream.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 // The base class for client/server reliable streams. 5 // The base class for client/server reliable streams.
6 6
7 #ifndef NET_QUIC_RELIABLE_QUIC_STREAM_H_ 7 #ifndef NET_QUIC_RELIABLE_QUIC_STREAM_H_
8 #define NET_QUIC_RELIABLE_QUIC_STREAM_H_ 8 #define NET_QUIC_RELIABLE_QUIC_STREAM_H_
9 9
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 uint64 stream_bytes_written() const { return stream_bytes_written_; } 85 uint64 stream_bytes_written() const { return stream_bytes_written_; }
86 86
87 QuicVersion version() const; 87 QuicVersion version() const;
88 88
89 void set_fin_sent(bool fin_sent) { fin_sent_ = fin_sent; } 89 void set_fin_sent(bool fin_sent) { fin_sent_ = fin_sent; }
90 void set_rst_sent(bool rst_sent) { rst_sent_ = rst_sent; } 90 void set_rst_sent(bool rst_sent) { rst_sent_ = rst_sent; }
91 91
92 // Adjust our flow control windows according to new offset in |frame|. 92 // Adjust our flow control windows according to new offset in |frame|.
93 virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame); 93 virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame);
94 94
95 // If our receive window has dropped below the threshold, then send a
96 // WINDOW_UPDATE frame. This is called whenever bytes are consumed from the
97 // sequencer's buffer.
98 void MaybeSendWindowUpdate();
99
100 int num_frames_received() const; 95 int num_frames_received() const;
101 96
102 int num_duplicate_frames_received() const; 97 int num_duplicate_frames_received() const;
103 98
104 QuicFlowController* flow_controller() { return &flow_controller_; } 99 QuicFlowController* flow_controller() { return &flow_controller_; }
105 100
106 // Called by the stream sequeuncer as bytes are added to the buffer. 101 // Called when we see a frame which could increase the highest offset.
107 void AddBytesBuffered(uint64 bytes); 102 void MaybeIncreaseHighestReceivedOffset(uint64 new_offset);
108 // Called by the stream sequeuncer as bytes are removed from the buffer.
109 void RemoveBytesBuffered(uint64 bytes);
110 // Called when bytese are sent to the peer. 103 // Called when bytese are sent to the peer.
111 void AddBytesSent(uint64 bytes); 104 void AddBytesSent(uint64 bytes);
112 // Called by the stream sequeuncer as bytes are consumed from the buffer. 105 // Called by the stream sequencer as bytes are consumed from the buffer.
106 // If our receive window has dropped below the threshold, then send a
107 // WINDOW_UPDATE frame.
113 void AddBytesConsumed(uint64 bytes); 108 void AddBytesConsumed(uint64 bytes);
114 109
115 // Returns true if the stream is flow control blocked, by the stream flow 110 // Returns true if the stream is flow control blocked, by the stream flow
116 // control window or the connection flow control window. 111 // control window or the connection flow control window.
117 bool IsFlowControlBlocked(); 112 bool IsFlowControlBlocked();
118 113
119 protected: 114 protected:
120 // Sends as much of 'data' to the connection as the connection will consume, 115 // Sends as much of 'data' to the connection as the connection will consume,
121 // and then buffers any remaining data in queued_data_. 116 // and then buffers any remaining data in queued_data_.
122 void WriteOrBufferData( 117 void WriteOrBufferData(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 PendingData(string data_in, 159 PendingData(string data_in,
165 scoped_refptr<ProxyAckNotifierDelegate> delegate_in); 160 scoped_refptr<ProxyAckNotifierDelegate> delegate_in);
166 ~PendingData(); 161 ~PendingData();
167 162
168 string data; 163 string data;
169 // Delegate that should be notified when the pending data is acked. 164 // Delegate that should be notified when the pending data is acked.
170 // Can be nullptr. 165 // Can be nullptr.
171 scoped_refptr<ProxyAckNotifierDelegate> delegate; 166 scoped_refptr<ProxyAckNotifierDelegate> delegate;
172 }; 167 };
173 168
174 // Calculates and returns available flow control send window.
175 uint64 SendWindowSize() const;
176
177 // Calculates and returns total number of bytes this stream has received.
178 uint64 TotalReceivedBytes() const;
179
180 // Calls MaybeSendBlocked on our flow controller, and connection level flow 169 // Calls MaybeSendBlocked on our flow controller, and connection level flow
181 // controller. If we are flow control blocked, marks this stream as write 170 // controller. If we are flow control blocked, marks this stream as write
182 // blocked. 171 // blocked.
183 void MaybeSendBlocked(); 172 void MaybeSendBlocked();
184 173
185 std::list<PendingData> queued_data_; 174 std::list<PendingData> queued_data_;
186 175
187 QuicStreamSequencer sequencer_; 176 QuicStreamSequencer sequencer_;
188 QuicStreamId id_; 177 QuicStreamId id_;
189 QuicSession* session_; 178 QuicSession* session_;
(...skipping 29 matching lines...) Expand all
219 208
220 // The connection level flow controller. Not owned. 209 // The connection level flow controller. Not owned.
221 QuicFlowController* connection_flow_controller_; 210 QuicFlowController* connection_flow_controller_;
222 211
223 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream); 212 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream);
224 }; 213 };
225 214
226 } // namespace net 215 } // namespace net
227 216
228 #endif // NET_QUIC_RELIABLE_QUIC_STREAM_H_ 217 #endif // NET_QUIC_RELIABLE_QUIC_STREAM_H_
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer.cc ('k') | net/quic/reliable_quic_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698