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 // A QuicSession, which demuxes a single connection to individual streams. | 5 // A QuicSession, which demuxes a single connection to individual streams. |
6 | 6 |
7 #ifndef NET_QUIC_QUIC_SESSION_H_ | 7 #ifndef NET_QUIC_QUIC_SESSION_H_ |
8 #define NET_QUIC_QUIC_SESSION_H_ | 8 #define NET_QUIC_QUIC_SESSION_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 virtual void OnConfigNegotiated() OVERRIDE; | 69 virtual void OnConfigNegotiated() OVERRIDE; |
70 // Not needed for HTTP. | 70 // Not needed for HTTP. |
71 virtual bool OnCanWrite() OVERRIDE; | 71 virtual bool OnCanWrite() OVERRIDE; |
72 virtual bool HasPendingHandshake() const OVERRIDE; | 72 virtual bool HasPendingHandshake() const OVERRIDE; |
73 | 73 |
74 // Called by streams when they want to write data to the peer. | 74 // Called by streams when they want to write data to the peer. |
75 // Returns a pair with the number of bytes consumed from data, and a boolean | 75 // Returns a pair with the number of bytes consumed from data, and a boolean |
76 // indicating if the fin bit was consumed. This does not indicate the data | 76 // indicating if the fin bit was consumed. This does not indicate the data |
77 // has been sent on the wire: it may have been turned into a packet and queued | 77 // has been sent on the wire: it may have been turned into a packet and queued |
78 // if the socket was unexpectedly blocked. | 78 // if the socket was unexpectedly blocked. |
79 virtual QuicConsumedData WritevData(QuicStreamId id, | 79 // If provided, |ack_notifier_delegate| will be registered to be notified when |
80 const struct iovec* iov, | 80 // we have seen ACKs for all packets resulting from this call. Not owned by |
81 int iov_count, | 81 // this class. |
82 QuicStreamOffset offset, | 82 virtual QuicConsumedData WritevData( |
83 bool fin); | 83 QuicStreamId id, |
| 84 const struct iovec* iov, |
| 85 int iov_count, |
| 86 QuicStreamOffset offset, |
| 87 bool fin, |
| 88 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); |
84 | 89 |
85 // Called by streams when they want to close the stream in both directions. | 90 // Called by streams when they want to close the stream in both directions. |
86 virtual void SendRstStream(QuicStreamId id, QuicRstStreamErrorCode error); | 91 virtual void SendRstStream(QuicStreamId id, QuicRstStreamErrorCode error); |
87 | 92 |
88 // Called when the session wants to go away and not accept any new streams. | 93 // Called when the session wants to go away and not accept any new streams. |
89 void SendGoAway(QuicErrorCode error_code, const std::string& reason); | 94 void SendGoAway(QuicErrorCode error_code, const std::string& reason); |
90 | 95 |
91 // Removes the stream associated with 'stream_id' from the active stream map. | 96 // Removes the stream associated with 'stream_id' from the active stream map. |
92 virtual void CloseStream(QuicStreamId stream_id); | 97 virtual void CloseStream(QuicStreamId stream_id); |
93 | 98 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 294 |
290 // Indicate if there is pending data for the crypto stream. | 295 // Indicate if there is pending data for the crypto stream. |
291 bool has_pending_handshake_; | 296 bool has_pending_handshake_; |
292 | 297 |
293 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 298 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
294 }; | 299 }; |
295 | 300 |
296 } // namespace net | 301 } // namespace net |
297 | 302 |
298 #endif // NET_QUIC_QUIC_SESSION_H_ | 303 #endif // NET_QUIC_QUIC_SESSION_H_ |
OLD | NEW |