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 18 matching lines...) Expand all Loading... |
29 // hello message, SHLO. At this point both sides will have established | 29 // hello message, SHLO. At this point both sides will have established |
30 // a crypto context they can use to send encrypted messages. | 30 // a crypto context they can use to send encrypted messages. |
31 // | 31 // |
32 // For more details: http://goto.google.com/quic-crypto | 32 // For more details: http://goto.google.com/quic-crypto |
33 class NET_EXPORT_PRIVATE QuicCryptoStream | 33 class NET_EXPORT_PRIVATE QuicCryptoStream |
34 : public ReliableQuicStream, | 34 : public ReliableQuicStream, |
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; |
| 40 |
39 // Returns the per-packet framing overhead associated with sending a | 41 // Returns the per-packet framing overhead associated with sending a |
40 // handshake message for |version|. | 42 // handshake message for |version|. |
41 static QuicByteCount CryptoMessageFramingOverhead(QuicVersion version); | 43 static QuicByteCount CryptoMessageFramingOverhead(QuicVersion version); |
42 | 44 |
43 // CryptoFramerVisitorInterface implementation | 45 // CryptoFramerVisitorInterface implementation |
44 void OnError(CryptoFramer* framer) override; | 46 void OnError(CryptoFramer* framer) override; |
45 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override; | 47 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override; |
46 | 48 |
47 // ReliableQuicStream implementation | 49 // ReliableQuicStream implementation |
48 void OnDataAvailable() override; | 50 void OnDataAvailable() override; |
(...skipping 23 matching lines...) Expand all Loading... |
72 | 74 |
73 bool encryption_established() const { return encryption_established_; } | 75 bool encryption_established() const { return encryption_established_; } |
74 bool handshake_confirmed() const { return handshake_confirmed_; } | 76 bool handshake_confirmed() const { return handshake_confirmed_; } |
75 | 77 |
76 const QuicCryptoNegotiatedParameters& crypto_negotiated_params() const; | 78 const QuicCryptoNegotiatedParameters& crypto_negotiated_params() const; |
77 | 79 |
78 protected: | 80 protected: |
79 bool encryption_established_; | 81 bool encryption_established_; |
80 bool handshake_confirmed_; | 82 bool handshake_confirmed_; |
81 | 83 |
82 QuicCryptoNegotiatedParameters crypto_negotiated_params_; | 84 scoped_refptr<QuicCryptoNegotiatedParameters> crypto_negotiated_params_; |
83 | 85 |
84 private: | 86 private: |
85 CryptoFramer crypto_framer_; | 87 CryptoFramer crypto_framer_; |
86 | 88 |
87 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStream); | 89 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStream); |
88 }; | 90 }; |
89 | 91 |
90 } // namespace net | 92 } // namespace net |
91 | 93 |
92 #endif // NET_QUIC_QUIC_CRYPTO_STREAM_H_ | 94 #endif // NET_QUIC_QUIC_CRYPTO_STREAM_H_ |
OLD | NEW |