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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 bool is_server() const { return connection_->is_server(); } | 205 bool is_server() const { return connection_->is_server(); } |
206 | 206 |
207 QuicFlowController* flow_controller() { return flow_controller_.get(); } | 207 QuicFlowController* flow_controller() { return flow_controller_.get(); } |
208 | 208 |
209 size_t get_max_open_streams() const { return max_open_streams_; } | 209 size_t get_max_open_streams() const { return max_open_streams_; } |
210 | 210 |
211 protected: | 211 protected: |
212 typedef base::hash_map<QuicStreamId, QuicDataStream*> DataStreamMap; | 212 typedef base::hash_map<QuicStreamId, QuicDataStream*> DataStreamMap; |
213 | 213 |
214 // Creates a new stream, owned by the caller, to handle a peer-initiated | 214 // Creates a new stream, owned by the caller, to handle a peer-initiated |
215 // stream. Returns NULL and does error handling if the stream can not be | 215 // stream. Returns nullptr and does error handling if the stream can not be |
216 // created. | 216 // created. |
217 virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) = 0; | 217 virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) = 0; |
218 | 218 |
219 // Create a new stream, owned by the caller, to handle a locally-initiated | 219 // Create a new stream, owned by the caller, to handle a locally-initiated |
220 // stream. Returns NULL if max streams have already been opened. | 220 // stream. Returns nullptr if max streams have already been opened. |
221 virtual QuicDataStream* CreateOutgoingDataStream() = 0; | 221 virtual QuicDataStream* CreateOutgoingDataStream() = 0; |
222 | 222 |
223 // Return the reserved crypto stream. | 223 // Return the reserved crypto stream. |
224 virtual QuicCryptoStream* GetCryptoStream() = 0; | 224 virtual QuicCryptoStream* GetCryptoStream() = 0; |
225 | 225 |
226 // Adds 'stream' to the active stream map. | 226 // Adds 'stream' to the active stream map. |
227 virtual void ActivateStream(QuicDataStream* stream); | 227 virtual void ActivateStream(QuicDataStream* stream); |
228 | 228 |
229 // Returns the stream id for a new stream. | 229 // Returns the stream id for a new stream. |
230 QuicStreamId GetNextStreamId(); | 230 QuicStreamId GetNextStreamId(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 322 |
323 // Used for session level flow control. | 323 // Used for session level flow control. |
324 scoped_ptr<QuicFlowController> flow_controller_; | 324 scoped_ptr<QuicFlowController> flow_controller_; |
325 | 325 |
326 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 326 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
327 }; | 327 }; |
328 | 328 |
329 } // namespace net | 329 } // namespace net |
330 | 330 |
331 #endif // NET_QUIC_QUIC_SESSION_H_ | 331 #endif // NET_QUIC_QUIC_SESSION_H_ |
OLD | NEW |