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_QUIC_CRYPTO_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_CRYPTO_STREAM_H_ |
6 #define NET_QUIC_QUIC_CRYPTO_STREAM_H_ | 6 #define NET_QUIC_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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // hello message, SHLO. At this point both sides will have established | 28 // hello message, SHLO. At this point both sides will have established |
29 // a crypto context they can use to send encrypted messages. | 29 // a crypto context they can use to send encrypted messages. |
30 // | 30 // |
31 // For more details: http://goto.google.com/quic-crypto | 31 // For more details: http://goto.google.com/quic-crypto |
32 class NET_EXPORT_PRIVATE QuicCryptoStream | 32 class NET_EXPORT_PRIVATE QuicCryptoStream |
33 : public ReliableQuicStream, | 33 : public ReliableQuicStream, |
34 public CryptoFramerVisitorInterface { | 34 public CryptoFramerVisitorInterface { |
35 public: | 35 public: |
36 explicit QuicCryptoStream(QuicSession* session); | 36 explicit QuicCryptoStream(QuicSession* session); |
37 | 37 |
| 38 // Returns the per-packet framing overhead associated with sending a |
| 39 // handshake message for |version|. |
| 40 static QuicByteCount CryptoMessageFramingOverhead(QuicVersion version); |
| 41 |
38 // CryptoFramerVisitorInterface implementation | 42 // CryptoFramerVisitorInterface implementation |
39 void OnError(CryptoFramer* framer) override; | 43 void OnError(CryptoFramer* framer) override; |
40 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override; | 44 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override; |
41 | 45 |
42 // ReliableQuicStream implementation | 46 // ReliableQuicStream implementation |
43 void OnDataAvailable() override; | 47 void OnDataAvailable() override; |
44 | 48 |
45 // Sends |message| to the peer. | 49 // Sends |message| to the peer. |
46 // TODO(wtc): return a success/failure status. | 50 // TODO(wtc): return a success/failure status. |
47 void SendHandshakeMessage(const CryptoHandshakeMessage& message); | 51 void SendHandshakeMessage(const CryptoHandshakeMessage& message); |
(...skipping 30 matching lines...) Expand all Loading... |
78 | 82 |
79 private: | 83 private: |
80 CryptoFramer crypto_framer_; | 84 CryptoFramer crypto_framer_; |
81 | 85 |
82 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStream); | 86 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStream); |
83 }; | 87 }; |
84 | 88 |
85 } // namespace net | 89 } // namespace net |
86 | 90 |
87 #endif // NET_QUIC_QUIC_CRYPTO_STREAM_H_ | 91 #endif // NET_QUIC_QUIC_CRYPTO_STREAM_H_ |
OLD | NEW |