| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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_QUARTC_QUARTC_SESSION_H_ | 5 #ifndef NET_QUIC_QUARTC_QUARTC_SESSION_H_ |
| 6 #define NET_QUIC_QUARTC_QUARTC_SESSION_H_ | 6 #define NET_QUIC_QUARTC_QUARTC_SESSION_H_ |
| 7 | 7 |
| 8 #include "net/quic/core/quic_crypto_client_stream.h" | 8 #include "net/quic/core/quic_crypto_client_stream.h" |
| 9 #include "net/quic/core/quic_crypto_server_stream.h" | 9 #include "net/quic/core/quic_crypto_server_stream.h" |
| 10 #include "net/quic/core/quic_crypto_stream.h" | 10 #include "net/quic/core/quic_crypto_stream.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // The session will take the ownership of the configurations. | 87 // The session will take the ownership of the configurations. |
| 88 void SetClientCryptoConfig(QuicCryptoClientConfig* client_config); | 88 void SetClientCryptoConfig(QuicCryptoClientConfig* client_config); |
| 89 | 89 |
| 90 void SetServerCryptoConfig(QuicCryptoServerConfig* server_config); | 90 void SetServerCryptoConfig(QuicCryptoServerConfig* server_config); |
| 91 | 91 |
| 92 protected: | 92 protected: |
| 93 // QuicSession override. | 93 // QuicSession override. |
| 94 QuicStream* CreateIncomingDynamicStream(QuicStreamId id) override; | 94 QuicStream* CreateIncomingDynamicStream(QuicStreamId id) override; |
| 95 std::unique_ptr<QuicStream> CreateStream(QuicStreamId id) override; | 95 std::unique_ptr<QuicStream> CreateStream(QuicStreamId id) override; |
| 96 | 96 |
| 97 QuartcStream* CreateDataStream(QuicStreamId id, SpdyPriority priority); | 97 std::unique_ptr<QuartcStream> CreateDataStream(QuicStreamId id, |
| 98 SpdyPriority priority); |
| 99 // Activates a QuartcStream. The session takes ownership of the stream, but |
| 100 // returns an unowned pointer to the stream for convenience. |
| 101 QuartcStream* ActivateDataStream(std::unique_ptr<QuartcStream> stream); |
| 98 | 102 |
| 99 private: | 103 private: |
| 100 // For crypto handshake. | 104 // For crypto handshake. |
| 101 std::unique_ptr<QuicCryptoStream> crypto_stream_; | 105 std::unique_ptr<QuicCryptoStream> crypto_stream_; |
| 102 const std::string unique_remote_server_id_; | 106 const std::string unique_remote_server_id_; |
| 103 Perspective perspective_; | 107 Perspective perspective_; |
| 104 // Take the ownership of the QuicConnection. | 108 // Take the ownership of the QuicConnection. |
| 105 std::unique_ptr<QuicConnection> connection_; | 109 std::unique_ptr<QuicConnection> connection_; |
| 106 // Not owned by QuartcSession. From the QuartcFactory. | 110 // Not owned by QuartcSession. From the QuartcFactory. |
| 107 QuicConnectionHelperInterface* helper_; | 111 QuicConnectionHelperInterface* helper_; |
| 108 // For recording packet receipt time | 112 // For recording packet receipt time |
| 109 QuicClock* clock_; | 113 QuicClock* clock_; |
| 110 // Not owned by QuartcSession. | 114 // Not owned by QuartcSession. |
| 111 QuartcSessionInterface::Delegate* session_delegate_ = nullptr; | 115 QuartcSessionInterface::Delegate* session_delegate_ = nullptr; |
| 112 // Used by QUIC crypto server stream to track most recently compressed certs. | 116 // Used by QUIC crypto server stream to track most recently compressed certs. |
| 113 std::unique_ptr<QuicCompressedCertsCache> quic_compressed_certs_cache_; | 117 std::unique_ptr<QuicCompressedCertsCache> quic_compressed_certs_cache_; |
| 114 // This helper is needed when create QuicCryptoServerStream. | 118 // This helper is needed when create QuicCryptoServerStream. |
| 115 QuartcCryptoServerStreamHelper stream_helper_; | 119 QuartcCryptoServerStreamHelper stream_helper_; |
| 116 // Config for QUIC crypto client stream, used by the client. | 120 // Config for QUIC crypto client stream, used by the client. |
| 117 std::unique_ptr<QuicCryptoClientConfig> quic_crypto_client_config_; | 121 std::unique_ptr<QuicCryptoClientConfig> quic_crypto_client_config_; |
| 118 // Config for QUIC crypto server stream, used by the server. | 122 // Config for QUIC crypto server stream, used by the server. |
| 119 std::unique_ptr<QuicCryptoServerConfig> quic_crypto_server_config_; | 123 std::unique_ptr<QuicCryptoServerConfig> quic_crypto_server_config_; |
| 120 | 124 |
| 121 DISALLOW_COPY_AND_ASSIGN(QuartcSession); | 125 DISALLOW_COPY_AND_ASSIGN(QuartcSession); |
| 122 }; | 126 }; |
| 123 | 127 |
| 124 } // namespace net | 128 } // namespace net |
| 125 | 129 |
| 126 #endif // NET_QUIC_QUARTC_QUARTC_SESSION_H_ | 130 #endif // NET_QUIC_QUARTC_QUARTC_SESSION_H_ |
| OLD | NEW |