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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 QuicStreamOffset offset, bool fin); | 44 QuicStreamOffset offset, bool fin); |
45 // Called by streams when they want to close the stream in both directions. | 45 // Called by streams when they want to close the stream in both directions. |
46 void SendRstStream(QuicStreamId id, | 46 void SendRstStream(QuicStreamId id, |
47 QuicErrorCode error, | 47 QuicErrorCode error, |
48 QuicStreamOffset offset); | 48 QuicStreamOffset offset); |
49 | 49 |
50 // Removes the stream associated with 'stream_id' from the active stream map. | 50 // Removes the stream associated with 'stream_id' from the active stream map. |
51 virtual void CloseStream(QuicStreamId stream_id); | 51 virtual void CloseStream(QuicStreamId stream_id); |
52 | 52 |
53 // Returns true once the crypto handshake is complete. | 53 // Returns true once the crypto handshake is complete. |
54 virtual bool IsHandshakeComplete(); | 54 virtual bool IsCryptoHandshakeComplete(); |
| 55 |
| 56 // Called by the QuicCryptoStream when the handshake completes. |
| 57 // If |error| is QUIC_NO_ERROR then the handshake was succesful, |
| 58 // otherwise it failed. |
| 59 virtual void OnCryptoHandshakeComplete(QuicErrorCode error); |
55 | 60 |
56 // Returns true if the stream existed previously and has been closed. | 61 // Returns true if the stream existed previously and has been closed. |
57 // Returns false if the stream is still active or if the stream has | 62 // Returns false if the stream is still active or if the stream has |
58 // not yet been created. | 63 // not yet been created. |
59 bool IsClosedStream(QuicStreamId id); | 64 bool IsClosedStream(QuicStreamId id); |
60 | 65 |
61 QuicConnection* connection() { return connection_.get(); } | 66 QuicConnection* connection() { return connection_.get(); } |
62 size_t num_active_requests() const { return stream_map_.size(); } | 67 size_t num_active_requests() const { return stream_map_.size(); } |
63 const IPEndPoint& peer_address() const { | 68 const IPEndPoint& peer_address() const { |
64 return connection_->peer_address(); | 69 return connection_->peer_address(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 119 |
115 // Set of stream ids that have been "implicitly created" by receipt | 120 // Set of stream ids that have been "implicitly created" by receipt |
116 // of a stream id larger than the next expected stream id. | 121 // of a stream id larger than the next expected stream id. |
117 base::hash_set<QuicStreamId> implicitly_created_streams_; | 122 base::hash_set<QuicStreamId> implicitly_created_streams_; |
118 QuicStreamId largest_peer_created_stream_id_; | 123 QuicStreamId largest_peer_created_stream_id_; |
119 }; | 124 }; |
120 | 125 |
121 } // namespace net | 126 } // namespace net |
122 | 127 |
123 #endif // NET_QUIC_QUIC_SESSION_H_ | 128 #endif // NET_QUIC_QUIC_SESSION_H_ |
OLD | NEW |