OLD | NEW |
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // as the connection will consume. | 133 // as the connection will consume. |
134 // If |ack_notifier_delegate| is provided, then it will be notified once all | 134 // If |ack_notifier_delegate| is provided, then it will be notified once all |
135 // the ACKs for this write have been received. | 135 // the ACKs for this write have been received. |
136 // Returns the number of bytes consumed by the connection. | 136 // Returns the number of bytes consumed by the connection. |
137 QuicConsumedData WritevData( | 137 QuicConsumedData WritevData( |
138 const struct iovec* iov, | 138 const struct iovec* iov, |
139 int iov_count, | 139 int iov_count, |
140 bool fin, | 140 bool fin, |
141 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); | 141 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); |
142 | 142 |
| 143 // Helper method that returns FecProtection to use for writes to the session. |
| 144 FecProtection GetFecProtection(); |
| 145 |
143 // Close the read side of the socket. Further frames will not be accepted. | 146 // Close the read side of the socket. Further frames will not be accepted. |
144 virtual void CloseReadSide(); | 147 virtual void CloseReadSide(); |
145 | 148 |
146 // Close the write side of the socket. Further writes will fail. | 149 // Close the write side of the socket. Further writes will fail. |
147 void CloseWriteSide(); | 150 void CloseWriteSide(); |
148 | 151 |
149 bool HasBufferedData() const; | 152 bool HasBufferedData() const; |
150 | 153 |
151 bool fin_buffered() const { return fin_buffered_; } | 154 bool fin_buffered() const { return fin_buffered_; } |
152 | 155 |
| 156 void set_fec_policy(FecPolicy fec_policy) { fec_policy_ = fec_policy; } |
| 157 |
153 const QuicSession* session() const { return session_; } | 158 const QuicSession* session() const { return session_; } |
154 QuicSession* session() { return session_; } | 159 QuicSession* session() { return session_; } |
155 | 160 |
156 const QuicStreamSequencer* sequencer() const { return &sequencer_; } | 161 const QuicStreamSequencer* sequencer() const { return &sequencer_; } |
157 QuicStreamSequencer* sequencer() { return &sequencer_; } | 162 QuicStreamSequencer* sequencer() { return &sequencer_; } |
158 | 163 |
159 void DisableFlowControl() { | 164 void DisableFlowControl() { |
160 flow_controller_.Disable(); | 165 flow_controller_.Disable(); |
161 } | 166 } |
162 | 167 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // StreamFrame with the FIN set. | 216 // StreamFrame with the FIN set. |
212 bool fin_received_; | 217 bool fin_received_; |
213 | 218 |
214 // In combination with fin_sent_, used to ensure that a FIN and/or a RST is | 219 // In combination with fin_sent_, used to ensure that a FIN and/or a RST is |
215 // always sent before stream termination. | 220 // always sent before stream termination. |
216 bool rst_sent_; | 221 bool rst_sent_; |
217 | 222 |
218 // True if this stream has received a RST stream frame. | 223 // True if this stream has received a RST stream frame. |
219 bool rst_received_; | 224 bool rst_received_; |
220 | 225 |
| 226 // FEC policy to be used for this stream. |
| 227 FecPolicy fec_policy_; |
| 228 |
221 // True if the session this stream is running under is a server session. | 229 // True if the session this stream is running under is a server session. |
222 bool is_server_; | 230 bool is_server_; |
223 | 231 |
224 QuicFlowController flow_controller_; | 232 QuicFlowController flow_controller_; |
225 | 233 |
226 // The connection level flow controller. Not owned. | 234 // The connection level flow controller. Not owned. |
227 QuicFlowController* connection_flow_controller_; | 235 QuicFlowController* connection_flow_controller_; |
228 | 236 |
229 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream); | 237 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream); |
230 }; | 238 }; |
231 | 239 |
232 } // namespace net | 240 } // namespace net |
233 | 241 |
234 #endif // NET_QUIC_RELIABLE_QUIC_STREAM_H_ | 242 #endif // NET_QUIC_RELIABLE_QUIC_STREAM_H_ |
OLD | NEW |