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 13 matching lines...) Expand all Loading... |
24 namespace net { | 24 namespace net { |
25 | 25 |
26 namespace test { | 26 namespace test { |
27 class ReliableQuicStreamPeer; | 27 class ReliableQuicStreamPeer; |
28 } // namespace test | 28 } // namespace test |
29 | 29 |
30 class QuicSession; | 30 class QuicSession; |
31 | 31 |
32 class NET_EXPORT_PRIVATE ReliableQuicStream { | 32 class NET_EXPORT_PRIVATE ReliableQuicStream { |
33 public: | 33 public: |
34 ReliableQuicStream(QuicStreamId id, | 34 ReliableQuicStream(QuicStreamId id, QuicSession* session); |
35 QuicSession* session); | |
36 | 35 |
37 virtual ~ReliableQuicStream(); | 36 virtual ~ReliableQuicStream(); |
38 | 37 |
39 // Called when a (potentially duplicate) stream frame has been received | 38 // Called when a (potentially duplicate) stream frame has been received |
40 // for this stream. Returns false if this frame can not be accepted | 39 // for this stream. Returns false if this frame can not be accepted |
41 // because there is too much data already buffered. | 40 // because there is too much data already buffered. |
42 virtual bool OnStreamFrame(const QuicStreamFrame& frame); | 41 virtual bool OnStreamFrame(const QuicStreamFrame& frame); |
43 | 42 |
44 // Called when the connection becomes writeable to allow the stream | 43 // Called when the connection becomes writeable to allow the stream |
45 // to write any pending data. | 44 // to write any pending data. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 bool HasBufferedData() const; | 130 bool HasBufferedData() const; |
132 | 131 |
133 bool fin_buffered() const { return fin_buffered_; } | 132 bool fin_buffered() const { return fin_buffered_; } |
134 | 133 |
135 const QuicSession* session() const { return session_; } | 134 const QuicSession* session() const { return session_; } |
136 QuicSession* session() { return session_; } | 135 QuicSession* session() { return session_; } |
137 | 136 |
138 const QuicStreamSequencer* sequencer() const { return &sequencer_; } | 137 const QuicStreamSequencer* sequencer() const { return &sequencer_; } |
139 QuicStreamSequencer* sequencer() { return &sequencer_; } | 138 QuicStreamSequencer* sequencer() { return &sequencer_; } |
140 | 139 |
141 void DisableFlowControl() { | 140 void DisableFlowControl() { flow_controller_.Disable(); } |
142 flow_controller_.Disable(); | |
143 } | |
144 | 141 |
145 private: | 142 private: |
146 friend class test::ReliableQuicStreamPeer; | 143 friend class test::ReliableQuicStreamPeer; |
147 friend class QuicStreamUtils; | 144 friend class QuicStreamUtils; |
148 class ProxyAckNotifierDelegate; | 145 class ProxyAckNotifierDelegate; |
149 | 146 |
150 struct PendingData { | 147 struct PendingData { |
151 PendingData(string data_in, | 148 PendingData(string data_in, |
152 scoped_refptr<ProxyAckNotifierDelegate> delegate_in); | 149 scoped_refptr<ProxyAckNotifierDelegate> delegate_in); |
153 ~PendingData(); | 150 ~PendingData(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 bool is_server_; | 195 bool is_server_; |
199 | 196 |
200 QuicFlowController flow_controller_; | 197 QuicFlowController flow_controller_; |
201 | 198 |
202 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream); | 199 DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream); |
203 }; | 200 }; |
204 | 201 |
205 } // namespace net | 202 } // namespace net |
206 | 203 |
207 #endif // NET_QUIC_RELIABLE_QUIC_STREAM_H_ | 204 #endif // NET_QUIC_RELIABLE_QUIC_STREAM_H_ |
OLD | NEW |