| Index: net/quic/quic_session.h
|
| diff --git a/net/quic/quic_session.h b/net/quic/quic_session.h
|
| index 963a53a37fed9671a35f83a171e01edd82bb4fad..9d2d2b7cf5ed8b287e79c0e294cf5e3b90624695 100644
|
| --- a/net/quic/quic_session.h
|
| +++ b/net/quic/quic_session.h
|
| @@ -31,6 +31,23 @@ class QuicSessionPeer;
|
|
|
| class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
| public:
|
| + // CryptoHandshakeEvent enumerates the events generated by a QuicCryptoStream.
|
| + enum CryptoHandshakeEvent {
|
| + // ENCRYPTION_FIRST_ESTABLISHED indicates that a full client hello has been
|
| + // sent by a client and that subsequent packets will be encrypted. (Client
|
| + // only.)
|
| + ENCRYPTION_FIRST_ESTABLISHED,
|
| + // ENCRYPTION_REESTABLISHED indicates that a client hello was rejected by
|
| + // the server and thus the encryption key has been updated. Therefore the
|
| + // connection should resend any packets that were sent under
|
| + // ENCRYPTION_INITIAL. (Client only.)
|
| + ENCRYPTION_REESTABLISHED,
|
| + // HANDSHAKE_CONFIRMED, in a client, indicates the the server has accepted
|
| + // our handshake. In a server it indicates that a full, valid client hello
|
| + // has been received. (Client and server.)
|
| + HANDSHAKE_CONFIRMED,
|
| + };
|
| +
|
| QuicSession(QuicConnection* connection, bool is_server);
|
|
|
| virtual ~QuicSession();
|
| @@ -65,13 +82,23 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
| // Removes the stream associated with 'stream_id' from the active stream map.
|
| virtual void CloseStream(QuicStreamId stream_id);
|
|
|
| - // Returns true once the crypto handshake is complete.
|
| - virtual bool IsCryptoHandshakeComplete();
|
| -
|
| - // Called by the QuicCryptoStream when the handshake completes.
|
| - // If |error| is QUIC_NO_ERROR then the handshake was succesful,
|
| - // otherwise it failed.
|
| - virtual void OnCryptoHandshakeComplete(QuicErrorCode error);
|
| + // Returns true if outgoing packets will be encrypted, even if the server
|
| + // hasn't confirmed the handshake yet.
|
| + virtual bool IsEncryptionEstablished();
|
| +
|
| + // For a client, returns true if the server has confirmed our handshake. For
|
| + // a server, returns true if a full, valid client hello has been received.
|
| + virtual bool IsCryptoHandshakeConfirmed();
|
| +
|
| + // Called by the QuicCryptoStream when the handshake enters a new state.
|
| + //
|
| + // Clients will call this function in the order:
|
| + // ENCRYPTION_FIRST_ESTABLISHED
|
| + // zero or more ENCRYPTION_REESTABLISHED
|
| + // HANDSHAKE_CONFIRMED
|
| + //
|
| + // Servers will simply call it once with HANDSHAKE_CONFIRMED.
|
| + virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event);
|
|
|
| // Returns true if the stream existed previously and has been closed.
|
| // Returns false if the stream is still active or if the stream has
|
|
|