| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame); | 96 virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame); |
| 97 | 97 |
| 98 int num_frames_received() const; | 98 int num_frames_received() const; |
| 99 | 99 |
| 100 int num_duplicate_frames_received() const; | 100 int num_duplicate_frames_received() const; |
| 101 | 101 |
| 102 QuicFlowController* flow_controller() { return &flow_controller_; } | 102 QuicFlowController* flow_controller() { return &flow_controller_; } |
| 103 | 103 |
| 104 // Called when we see a frame which could increase the highest offset. | 104 // Called when we see a frame which could increase the highest offset. |
| 105 // Returns true if the highest offset did increase. | 105 // Returns true if the highest offset did increase. |
| 106 bool MaybeIncreaseHighestReceivedOffset(uint64 new_offset); | 106 bool MaybeIncreaseHighestReceivedOffset(QuicStreamOffset new_offset); |
| 107 // Called when bytese are sent to the peer. | 107 // Called when bytese are sent to the peer. |
| 108 void AddBytesSent(uint64 bytes); | 108 void AddBytesSent(QuicByteCount bytes); |
| 109 // Called by the stream sequencer as bytes are consumed from the buffer. | 109 // Called by the stream sequencer as bytes are consumed from the buffer. |
| 110 // If our receive window has dropped below the threshold, then send a | 110 // If our receive window has dropped below the threshold, then send a |
| 111 // WINDOW_UPDATE frame. | 111 // WINDOW_UPDATE frame. |
| 112 void AddBytesConsumed(uint64 bytes); | 112 void AddBytesConsumed(QuicByteCount bytes); |
| 113 | 113 |
| 114 // Updates the flow controller's send window offset and calls OnCanWrite if | 114 // Updates the flow controller's send window offset and calls OnCanWrite if |
| 115 // it was blocked before. | 115 // it was blocked before. |
| 116 void UpdateSendWindowOffset(uint64 new_offset); | 116 void UpdateSendWindowOffset(QuicStreamOffset new_offset); |
| 117 | 117 |
| 118 // Returns true if the stream is flow control blocked, by the stream flow | 118 // Returns true if the stream is flow control blocked, by the stream flow |
| 119 // control window or the connection flow control window. | 119 // control window or the connection flow control window. |
| 120 bool IsFlowControlBlocked(); | 120 bool IsFlowControlBlocked(); |
| 121 | 121 |
| 122 // Returns true if we have received either a RST or a FIN - either of which | 122 // Returns true if we have received either a RST or a FIN - either of which |
| 123 // gives a definitive number of bytes which the peer has sent. If this is not | 123 // gives a definitive number of bytes which the peer has sent. If this is not |
| 124 // true on stream termination the session must keep track of the stream's byte | 124 // true on stream termination the session must keep track of the stream's byte |
| 125 // offset until a definitive final value arrives. | 125 // offset until a definitive final value arrives. |
| 126 bool HasFinalReceivedByteOffset() const { | 126 bool HasFinalReceivedByteOffset() const { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // connection level flow control limits (but are stream level flow control | 248 // connection level flow control limits (but are stream level flow control |
| 249 // limited). | 249 // limited). |
| 250 bool stream_contributes_to_connection_flow_control_; | 250 bool stream_contributes_to_connection_flow_control_; |
| 251 | 251 |
| 252 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream); | 252 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream); |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 } // namespace net | 255 } // namespace net |
| 256 | 256 |
| 257 #endif // NET_QUIC_RELIABLE_QUIC_STREAM_H_ | 257 #endif // NET_QUIC_RELIABLE_QUIC_STREAM_H_ |
| OLD | NEW |