| 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_CORE_QUIC_SESSION_H_ | 7 #ifndef NET_QUIC_CORE_QUIC_SESSION_H_ |
| 8 #define NET_QUIC_CORE_QUIC_SESSION_H_ | 8 #define NET_QUIC_CORE_QUIC_SESSION_H_ |
| 9 | 9 |
| 10 #include <cstddef> | 10 #include <cstddef> |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // then a new stream is created and returned. In all other cases, nullptr is | 238 // then a new stream is created and returned. In all other cases, nullptr is |
| 239 // returned. | 239 // returned. |
| 240 QuicStream* GetOrCreateStream(const QuicStreamId stream_id); | 240 QuicStream* GetOrCreateStream(const QuicStreamId stream_id); |
| 241 | 241 |
| 242 // Mark a stream as draining. | 242 // Mark a stream as draining. |
| 243 virtual void StreamDraining(QuicStreamId id); | 243 virtual void StreamDraining(QuicStreamId id); |
| 244 | 244 |
| 245 // Returns true if this stream should yield writes to another blocked stream. | 245 // Returns true if this stream should yield writes to another blocked stream. |
| 246 bool ShouldYield(QuicStreamId stream_id); | 246 bool ShouldYield(QuicStreamId stream_id); |
| 247 | 247 |
| 248 bool flow_control_invariant() { return flow_control_invariant_; } | |
| 249 | |
| 250 protected: | 248 protected: |
| 251 using StaticStreamMap = QuicSmallMap<QuicStreamId, QuicStream*, 2>; | 249 using StaticStreamMap = QuicSmallMap<QuicStreamId, QuicStream*, 2>; |
| 252 | 250 |
| 253 using DynamicStreamMap = | 251 using DynamicStreamMap = |
| 254 QuicSmallMap<QuicStreamId, std::unique_ptr<QuicStream>, 10>; | 252 QuicSmallMap<QuicStreamId, std::unique_ptr<QuicStream>, 10>; |
| 255 | 253 |
| 256 using ClosedStreams = std::vector<std::unique_ptr<QuicStream>>; | 254 using ClosedStreams = std::vector<std::unique_ptr<QuicStream>>; |
| 257 | 255 |
| 258 // Creates a new stream to handle a peer-initiated stream. | 256 // Creates a new stream to handle a peer-initiated stream. |
| 259 // Caller does not own the returned stream. | 257 // Caller does not own the returned stream. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // The latched error with which the connection was closed. | 429 // The latched error with which the connection was closed. |
| 432 QuicErrorCode error_; | 430 QuicErrorCode error_; |
| 433 | 431 |
| 434 // Used for connection-level flow control. | 432 // Used for connection-level flow control. |
| 435 QuicFlowController flow_controller_; | 433 QuicFlowController flow_controller_; |
| 436 | 434 |
| 437 // The stream id which was last popped in OnCanWrite, or 0, if not under the | 435 // The stream id which was last popped in OnCanWrite, or 0, if not under the |
| 438 // call stack of OnCanWrite. | 436 // call stack of OnCanWrite. |
| 439 QuicStreamId currently_writing_stream_id_; | 437 QuicStreamId currently_writing_stream_id_; |
| 440 | 438 |
| 441 // Latched value of quic_reloadable_flag_quic_flow_control_invariant. | |
| 442 const bool flow_control_invariant_; | |
| 443 | |
| 444 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 439 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
| 445 }; | 440 }; |
| 446 | 441 |
| 447 } // namespace net | 442 } // namespace net |
| 448 | 443 |
| 449 #endif // NET_QUIC_CORE_QUIC_SESSION_H_ | 444 #endif // NET_QUIC_CORE_QUIC_SESSION_H_ |
| OLD | NEW |