| 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 <map> | 10 #include <map> |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 virtual ReliableQuicStream* CreateIncomingDynamicStream(QuicStreamId id) = 0; | 218 virtual ReliableQuicStream* CreateIncomingDynamicStream(QuicStreamId id) = 0; |
| 219 | 219 |
| 220 // Create a new stream, owned by the caller, to handle a locally-initiated | 220 // Create a new stream, owned by the caller, to handle a locally-initiated |
| 221 // stream. Returns nullptr if max streams have already been opened. | 221 // stream. Returns nullptr if max streams have already been opened. |
| 222 virtual ReliableQuicStream* CreateOutgoingDynamicStream( | 222 virtual ReliableQuicStream* CreateOutgoingDynamicStream( |
| 223 SpdyPriority priority) = 0; | 223 SpdyPriority priority) = 0; |
| 224 | 224 |
| 225 // Return the reserved crypto stream. | 225 // Return the reserved crypto stream. |
| 226 virtual QuicCryptoStream* GetCryptoStream() = 0; | 226 virtual QuicCryptoStream* GetCryptoStream() = 0; |
| 227 | 227 |
| 228 // Adds 'stream' to the active stream map. | 228 // Adds |stream| to the dynamic stream map. |
| 229 // Takes ownership of |stream|. |
| 229 virtual void ActivateStream(ReliableQuicStream* stream); | 230 virtual void ActivateStream(ReliableQuicStream* stream); |
| 230 | 231 |
| 231 // Returns the stream ID for a new outgoing stream, and increments the | 232 // Returns the stream ID for a new outgoing stream, and increments the |
| 232 // underlying counter. | 233 // underlying counter. |
| 233 QuicStreamId GetNextOutgoingStreamId(); | 234 QuicStreamId GetNextOutgoingStreamId(); |
| 234 | 235 |
| 235 // Returns existing stream with id = |stream_id|. If no such stream exists, | 236 // Returns existing stream with id = |stream_id|. If no such stream exists, |
| 236 // and |stream_id| is a peer-created id, then a new stream is created and | 237 // and |stream_id| is a peer-created id, then a new stream is created and |
| 237 // returned. However if |stream_id| is a locally-created id and no such stream | 238 // returned. However if |stream_id| is a locally-created id and no such stream |
| 238 // exists, the connection is closed. | 239 // exists, the connection is closed. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 325 |
| 325 QuicConfig config_; | 326 QuicConfig config_; |
| 326 | 327 |
| 327 // Returns the maximum number of streams this connection can open. | 328 // Returns the maximum number of streams this connection can open. |
| 328 size_t max_open_streams_; | 329 size_t max_open_streams_; |
| 329 | 330 |
| 330 // Static streams, such as crypto and header streams. Owned by child classes | 331 // Static streams, such as crypto and header streams. Owned by child classes |
| 331 // that create these streams. | 332 // that create these streams. |
| 332 StreamMap static_stream_map_; | 333 StreamMap static_stream_map_; |
| 333 | 334 |
| 334 // Map from StreamId to pointers to streams that are owned by the caller. | 335 // Map from StreamId to pointers to streams. Owns the streams. |
| 335 StreamMap dynamic_stream_map_; | 336 StreamMap dynamic_stream_map_; |
| 336 | 337 |
| 337 // The ID to use for the next outgoing stream. | 338 // The ID to use for the next outgoing stream. |
| 338 QuicStreamId next_outgoing_stream_id_; | 339 QuicStreamId next_outgoing_stream_id_; |
| 339 | 340 |
| 340 // Set of stream ids that are less than the largest stream id that has been | 341 // Set of stream ids that are less than the largest stream id that has been |
| 341 // received, but are nonetheless available to be created. | 342 // received, but are nonetheless available to be created. |
| 342 base::hash_set<QuicStreamId> available_streams_; | 343 base::hash_set<QuicStreamId> available_streams_; |
| 343 | 344 |
| 344 // Set of stream ids that are "draining" -- a FIN has been sent and received, | 345 // Set of stream ids that are "draining" -- a FIN has been sent and received, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 366 | 367 |
| 367 // Used for connection-level flow control. | 368 // Used for connection-level flow control. |
| 368 QuicFlowController flow_controller_; | 369 QuicFlowController flow_controller_; |
| 369 | 370 |
| 370 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 371 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
| 371 }; | 372 }; |
| 372 | 373 |
| 373 } // namespace net | 374 } // namespace net |
| 374 | 375 |
| 375 #endif // NET_QUIC_QUIC_SESSION_H_ | 376 #endif // NET_QUIC_QUIC_SESSION_H_ |
| OLD | NEW |