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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 size_t get_max_available_streams() const { | 200 size_t get_max_available_streams() const { |
201 return max_open_streams_ * kMaxAvailableStreamsMultiplier; | 201 return max_open_streams_ * kMaxAvailableStreamsMultiplier; |
202 } | 202 } |
203 | 203 |
204 ReliableQuicStream* GetStream(const QuicStreamId stream_id); | 204 ReliableQuicStream* GetStream(const QuicStreamId stream_id); |
205 | 205 |
206 // Mark a stream as draining. | 206 // Mark a stream as draining. |
207 void StreamDraining(QuicStreamId id); | 207 void StreamDraining(QuicStreamId id); |
208 | 208 |
209 // Close the connection, if it is not already closed. | 209 // Close the connection, if it is not already closed. |
210 void CloseConnection(QuicErrorCode error); | 210 void CloseConnectionWithDetails(QuicErrorCode error, const char* details); |
211 | 211 |
212 protected: | 212 protected: |
213 typedef base::hash_map<QuicStreamId, ReliableQuicStream*> StreamMap; | 213 typedef base::hash_map<QuicStreamId, ReliableQuicStream*> StreamMap; |
214 | 214 |
215 // Creates a new stream, owned by the caller, to handle a peer-initiated | 215 // Creates a new stream, owned by the caller, to handle a peer-initiated |
216 // stream. Returns nullptr and does error handling if the stream can not be | 216 // stream. Returns nullptr and does error handling if the stream can not be |
217 // created. | 217 // created. |
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 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 // Used for connection-level flow control. | 368 // Used for connection-level flow control. |
369 QuicFlowController flow_controller_; | 369 QuicFlowController flow_controller_; |
370 | 370 |
371 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 371 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
372 }; | 372 }; |
373 | 373 |
374 } // namespace net | 374 } // namespace net |
375 | 375 |
376 #endif // NET_QUIC_QUIC_SESSION_H_ | 376 #endif // NET_QUIC_QUIC_SESSION_H_ |
OLD | NEW |