| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const std::string& error_details, | 93 const std::string& error_details, |
| 94 ConnectionCloseSource source) override; | 94 ConnectionCloseSource source) override; |
| 95 void OnWriteBlocked() override; | 95 void OnWriteBlocked() override; |
| 96 void OnSuccessfulVersionNegotiation(const QuicVersion& version) override; | 96 void OnSuccessfulVersionNegotiation(const QuicVersion& version) override; |
| 97 void OnCanWrite() override; | 97 void OnCanWrite() override; |
| 98 void OnCongestionWindowChange(QuicTime /*now*/) override {} | 98 void OnCongestionWindowChange(QuicTime /*now*/) override {} |
| 99 void OnConnectionMigration(PeerAddressChangeType type) override {} | 99 void OnConnectionMigration(PeerAddressChangeType type) override {} |
| 100 // Deletes streams that are safe to be deleted now that it's safe to do so (no | 100 // Deletes streams that are safe to be deleted now that it's safe to do so (no |
| 101 // other operations are being done on the streams at this time). | 101 // other operations are being done on the streams at this time). |
| 102 void PostProcessAfterData() override; | 102 void PostProcessAfterData() override; |
| 103 // Adds a connection level WINDOW_UPDATE frame. |
| 104 void OnAckNeedsRetransmittableFrame() override; |
| 103 bool WillingAndAbleToWrite() const override; | 105 bool WillingAndAbleToWrite() const override; |
| 104 bool HasPendingHandshake() const override; | 106 bool HasPendingHandshake() const override; |
| 105 bool HasOpenDynamicStreams() const override; | 107 bool HasOpenDynamicStreams() const override; |
| 106 void OnPathDegrading() override; | 108 void OnPathDegrading() override; |
| 107 | 109 |
| 108 // Called on every incoming packet. Passes |packet| through to |connection_|. | 110 // Called on every incoming packet. Passes |packet| through to |connection_|. |
| 109 virtual void ProcessUdpPacket(const QuicSocketAddress& self_address, | 111 virtual void ProcessUdpPacket(const QuicSocketAddress& self_address, |
| 110 const QuicSocketAddress& peer_address, | 112 const QuicSocketAddress& peer_address, |
| 111 const QuicReceivedPacket& packet); | 113 const QuicReceivedPacket& packet); |
| 112 | 114 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // exists, the connection is closed. | 287 // exists, the connection is closed. |
| 286 // Caller does not own the returned stream. | 288 // Caller does not own the returned stream. |
| 287 QuicStream* GetOrCreateDynamicStream(QuicStreamId stream_id); | 289 QuicStream* GetOrCreateDynamicStream(QuicStreamId stream_id); |
| 288 | 290 |
| 289 // Performs the work required to close |stream_id|. If |locally_reset| | 291 // Performs the work required to close |stream_id|. If |locally_reset| |
| 290 // then the stream has been reset by this endpoint, not by the peer. | 292 // then the stream has been reset by this endpoint, not by the peer. |
| 291 virtual void CloseStreamInner(QuicStreamId stream_id, bool locally_reset); | 293 virtual void CloseStreamInner(QuicStreamId stream_id, bool locally_reset); |
| 292 | 294 |
| 293 // When a stream is closed locally, it may not yet know how many bytes the | 295 // When a stream is closed locally, it may not yet know how many bytes the |
| 294 // peer sent on that stream. | 296 // peer sent on that stream. |
| 295 // When this data arrives (via stream frame w. FIN, or RST) this method | 297 // When this data arrives (via stream frame w. FIN, trailing headers, or RST) |
| 296 // is called, and correctly updates the connection level flow controller. | 298 // this method is called, and correctly updates the connection level flow |
| 297 void UpdateFlowControlOnFinalReceivedByteOffset( | 299 // controller. |
| 298 QuicStreamId id, | 300 virtual void OnFinalByteOffsetReceived(QuicStreamId id, |
| 299 QuicStreamOffset final_byte_offset); | 301 QuicStreamOffset final_byte_offset); |
| 300 | 302 |
| 301 // Return true if given stream is peer initiated. | 303 // Return true if given stream is peer initiated. |
| 302 bool IsIncomingStream(QuicStreamId id) const; | 304 bool IsIncomingStream(QuicStreamId id) const; |
| 303 | 305 |
| 304 StaticStreamMap& static_streams() { return static_stream_map_; } | 306 StaticStreamMap& static_streams() { return static_stream_map_; } |
| 305 const StaticStreamMap& static_streams() const { return static_stream_map_; } | 307 const StaticStreamMap& static_streams() const { return static_stream_map_; } |
| 306 | 308 |
| 307 DynamicStreamMap& dynamic_streams() { return dynamic_stream_map_; } | 309 DynamicStreamMap& dynamic_streams() { return dynamic_stream_map_; } |
| 308 const DynamicStreamMap& dynamic_streams() const { | 310 const DynamicStreamMap& dynamic_streams() const { |
| 309 return dynamic_stream_map_; | 311 return dynamic_stream_map_; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 // The stream id which was last popped in OnCanWrite, or 0, if not under the | 443 // The stream id which was last popped in OnCanWrite, or 0, if not under the |
| 442 // call stack of OnCanWrite. | 444 // call stack of OnCanWrite. |
| 443 QuicStreamId currently_writing_stream_id_; | 445 QuicStreamId currently_writing_stream_id_; |
| 444 | 446 |
| 445 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 447 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
| 446 }; | 448 }; |
| 447 | 449 |
| 448 } // namespace net | 450 } // namespace net |
| 449 | 451 |
| 450 #endif // NET_QUIC_CORE_QUIC_SESSION_H_ | 452 #endif // NET_QUIC_CORE_QUIC_SESSION_H_ |
| OLD | NEW |