| 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 #ifndef NET_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ | 5 #ifndef NET_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ |
| 6 #define NET_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ | 6 #define NET_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "net/base/net_export.h" | |
| 12 #include "net/quic/core/crypto/crypto_framer.h" | 11 #include "net/quic/core/crypto/crypto_framer.h" |
| 13 #include "net/quic/core/crypto/crypto_utils.h" | 12 #include "net/quic/core/crypto/crypto_utils.h" |
| 14 #include "net/quic/core/quic_config.h" | 13 #include "net/quic/core/quic_config.h" |
| 15 #include "net/quic/core/quic_packets.h" | 14 #include "net/quic/core/quic_packets.h" |
| 16 #include "net/quic/core/quic_stream.h" | 15 #include "net/quic/core/quic_stream.h" |
| 16 #include "net/quic/platform/api/quic_export.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 class CryptoHandshakeMessage; | 20 class CryptoHandshakeMessage; |
| 21 class QuicSession; | 21 class QuicSession; |
| 22 | 22 |
| 23 // Crypto handshake messages in QUIC take place over a reserved stream with the | 23 // Crypto handshake messages in QUIC take place over a reserved stream with the |
| 24 // id 1. Each endpoint (client and server) will allocate an instance of a | 24 // id 1. Each endpoint (client and server) will allocate an instance of a |
| 25 // subclass of QuicCryptoStream to send and receive handshake messages. (In the | 25 // subclass of QuicCryptoStream to send and receive handshake messages. (In the |
| 26 // normal 1-RTT handshake, the client will send a client hello, CHLO, message. | 26 // normal 1-RTT handshake, the client will send a client hello, CHLO, message. |
| 27 // The server will receive this message and respond with a server hello message, | 27 // The server will receive this message and respond with a server hello message, |
| 28 // SHLO. At this point both sides will have established a crypto context they | 28 // SHLO. At this point both sides will have established a crypto context they |
| 29 // can use to send encrypted messages. | 29 // can use to send encrypted messages. |
| 30 // | 30 // |
| 31 // For more details: | 31 // For more details: |
| 32 // https://docs.google.com/document/d/1g5nIXAIkN_Y-7XJW5K45IblHd_L2f5LTaDUDwvZ5L
6g/edit?usp=sharing | 32 // https://docs.google.com/document/d/1g5nIXAIkN_Y-7XJW5K45IblHd_L2f5LTaDUDwvZ5L
6g/edit?usp=sharing |
| 33 class NET_EXPORT_PRIVATE QuicCryptoStream | 33 class QUIC_EXPORT_PRIVATE QuicCryptoStream |
| 34 : public QuicStream, | 34 : public QuicStream, |
| 35 public CryptoFramerVisitorInterface { | 35 public CryptoFramerVisitorInterface { |
| 36 public: | 36 public: |
| 37 explicit QuicCryptoStream(QuicSession* session); | 37 explicit QuicCryptoStream(QuicSession* session); |
| 38 | 38 |
| 39 ~QuicCryptoStream() override; | 39 ~QuicCryptoStream() override; |
| 40 | 40 |
| 41 // Returns the per-packet framing overhead associated with sending a | 41 // Returns the per-packet framing overhead associated with sending a |
| 42 // handshake message for |version|. | 42 // handshake message for |version|. |
| 43 static QuicByteCount CryptoMessageFramingOverhead(QuicVersion version); | 43 static QuicByteCount CryptoMessageFramingOverhead(QuicVersion version); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 CryptoFramer crypto_framer_; | 87 CryptoFramer crypto_framer_; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStream); | 89 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStream); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace net | 92 } // namespace net |
| 93 | 93 |
| 94 #endif // NET_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ | 94 #endif // NET_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ |
| OLD | NEW |