| 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(); } |
| 67 const QuicConnection* connection() const { return connection_.get(); } |
| 62 size_t num_active_requests() const { return stream_map_.size(); } | 68 size_t num_active_requests() const { return stream_map_.size(); } |
| 63 const IPEndPoint& peer_address() const { | 69 const IPEndPoint& peer_address() const { |
| 64 return connection_->peer_address(); | 70 return connection_->peer_address(); |
| 65 } | 71 } |
| 66 | 72 |
| 67 QuicPacketCreator::Options* options() { return connection()->options(); } | 73 QuicPacketCreator::Options* options() { return connection()->options(); } |
| 68 | 74 |
| 69 // Returns the number of currently open streams, including those which have | 75 // Returns the number of currently open streams, including those which have |
| 70 // been implicitly created. | 76 // been implicitly created. |
| 71 virtual size_t GetNumOpenStreams(); | 77 virtual size_t GetNumOpenStreams(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 120 |
| 115 // Set of stream ids that have been "implicitly created" by receipt | 121 // Set of stream ids that have been "implicitly created" by receipt |
| 116 // of a stream id larger than the next expected stream id. | 122 // of a stream id larger than the next expected stream id. |
| 117 base::hash_set<QuicStreamId> implicitly_created_streams_; | 123 base::hash_set<QuicStreamId> implicitly_created_streams_; |
| 118 QuicStreamId largest_peer_created_stream_id_; | 124 QuicStreamId largest_peer_created_stream_id_; |
| 119 }; | 125 }; |
| 120 | 126 |
| 121 } // namespace net | 127 } // namespace net |
| 122 | 128 |
| 123 #endif // NET_QUIC_QUIC_SESSION_H_ | 129 #endif // NET_QUIC_QUIC_SESSION_H_ |
| OLD | NEW |