| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 // QuicConnectionVisitorInterface methods: | 62 // QuicConnectionVisitorInterface methods: |
| 63 virtual bool OnStreamFrames( | 63 virtual bool OnStreamFrames( |
| 64 const std::vector<QuicStreamFrame>& frames) OVERRIDE; | 64 const std::vector<QuicStreamFrame>& frames) OVERRIDE; |
| 65 virtual void OnRstStream(const QuicRstStreamFrame& frame) OVERRIDE; | 65 virtual void OnRstStream(const QuicRstStreamFrame& frame) OVERRIDE; |
| 66 virtual void OnGoAway(const QuicGoAwayFrame& frame) OVERRIDE; | 66 virtual void OnGoAway(const QuicGoAwayFrame& frame) OVERRIDE; |
| 67 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE; | 67 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE; |
| 68 virtual void OnWriteBlocked() OVERRIDE {} | 68 virtual void OnWriteBlocked() OVERRIDE {} |
| 69 virtual void OnSuccessfulVersionNegotiation( | 69 virtual void OnSuccessfulVersionNegotiation( |
| 70 const QuicVersion& version) OVERRIDE {} | 70 const QuicVersion& version) OVERRIDE {} |
| 71 virtual void OnConfigNegotiated() OVERRIDE; | |
| 72 virtual bool OnCanWrite() OVERRIDE; | 71 virtual bool OnCanWrite() OVERRIDE; |
| 73 virtual bool HasPendingHandshake() const OVERRIDE; | 72 virtual bool HasPendingHandshake() const OVERRIDE; |
| 74 | 73 |
| 75 // Called by the headers stream when headers have been received for a stream. | 74 // Called by the headers stream when headers have been received for a stream. |
| 76 virtual void OnStreamHeaders(QuicStreamId stream_id, | 75 virtual void OnStreamHeaders(QuicStreamId stream_id, |
| 77 base::StringPiece headers_data); | 76 base::StringPiece headers_data); |
| 78 // Called by the headers stream when headers with a priority have been | 77 // Called by the headers stream when headers with a priority have been |
| 79 // received for this stream. This method will only be called for server | 78 // received for this stream. This method will only be called for server |
| 80 // streams. | 79 // streams. |
| 81 virtual void OnStreamHeadersPriority(QuicStreamId stream_id, | 80 virtual void OnStreamHeadersPriority(QuicStreamId stream_id, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 virtual void CloseStream(QuicStreamId stream_id); | 120 virtual void CloseStream(QuicStreamId stream_id); |
| 122 | 121 |
| 123 // Returns true if outgoing packets will be encrypted, even if the server | 122 // Returns true if outgoing packets will be encrypted, even if the server |
| 124 // hasn't confirmed the handshake yet. | 123 // hasn't confirmed the handshake yet. |
| 125 virtual bool IsEncryptionEstablished(); | 124 virtual bool IsEncryptionEstablished(); |
| 126 | 125 |
| 127 // For a client, returns true if the server has confirmed our handshake. For | 126 // For a client, returns true if the server has confirmed our handshake. For |
| 128 // a server, returns true if a full, valid client hello has been received. | 127 // a server, returns true if a full, valid client hello has been received. |
| 129 virtual bool IsCryptoHandshakeConfirmed(); | 128 virtual bool IsCryptoHandshakeConfirmed(); |
| 130 | 129 |
| 130 // Called by the QuicCryptoStream when a new QuicConfig has been negotiated. |
| 131 virtual void OnConfigNegotiated(); |
| 132 |
| 131 // Called by the QuicCryptoStream when the handshake enters a new state. | 133 // Called by the QuicCryptoStream when the handshake enters a new state. |
| 132 // | 134 // |
| 133 // Clients will call this function in the order: | 135 // Clients will call this function in the order: |
| 134 // ENCRYPTION_FIRST_ESTABLISHED | 136 // ENCRYPTION_FIRST_ESTABLISHED |
| 135 // zero or more ENCRYPTION_REESTABLISHED | 137 // zero or more ENCRYPTION_REESTABLISHED |
| 136 // HANDSHAKE_CONFIRMED | 138 // HANDSHAKE_CONFIRMED |
| 137 // | 139 // |
| 138 // Servers will simply call it once with HANDSHAKE_CONFIRMED. | 140 // Servers will simply call it once with HANDSHAKE_CONFIRMED. |
| 139 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event); | 141 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event); |
| 140 | 142 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 325 |
| 324 // Indicate if there is pending data for the crypto stream. | 326 // Indicate if there is pending data for the crypto stream. |
| 325 bool has_pending_handshake_; | 327 bool has_pending_handshake_; |
| 326 | 328 |
| 327 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 329 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
| 328 }; | 330 }; |
| 329 | 331 |
| 330 } // namespace net | 332 } // namespace net |
| 331 | 333 |
| 332 #endif // NET_QUIC_QUIC_SESSION_H_ | 334 #endif // NET_QUIC_QUIC_SESSION_H_ |
| OLD | NEW |