dschinazi | 1c99fcf | 2019-12-13 11:54:22 -0800 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef QUICHE_QUIC_MASQUE_MASQUE_EPOLL_CLIENT_H_ |
| 6 | #define QUICHE_QUIC_MASQUE_MASQUE_EPOLL_CLIENT_H_ |
| 7 | |
| 8 | #include "net/third_party/quiche/src/quic/masque/masque_client_session.h" |
| 9 | #include "net/third_party/quiche/src/quic/platform/api/quic_export.h" |
| 10 | #include "net/third_party/quiche/src/quic/tools/quic_client.h" |
| 11 | |
| 12 | namespace quic { |
| 13 | |
| 14 | // QUIC client that implements MASQUE. |
| 15 | class QUIC_NO_EXPORT MasqueEpollClient : public QuicClient, |
| 16 | public MasqueClientSession::Owner { |
| 17 | public: |
| 18 | // Constructs a MasqueEpollClient, performs a synchronous DNS lookup. |
| 19 | static std::unique_ptr<MasqueEpollClient> Create( |
| 20 | const std::string& host, |
| 21 | int port, |
| 22 | QuicEpollServer* epoll_server, |
| 23 | std::unique_ptr<ProofVerifier> proof_verifier); |
| 24 | |
| 25 | // From QuicClient. |
| 26 | std::unique_ptr<QuicSession> CreateQuicClientSession( |
| 27 | const ParsedQuicVersionVector& supported_versions, |
| 28 | QuicConnection* connection) override; |
| 29 | |
| 30 | // Client session for this client. |
| 31 | MasqueClientSession* masque_client_session(); |
| 32 | |
| 33 | // Convenience accessor for the underlying connection ID. |
| 34 | QuicConnectionId connection_id(); |
| 35 | |
| 36 | // Send a MASQUE client connection ID unregister command to the server. |
| 37 | void UnregisterClientConnectionId( |
| 38 | QuicConnectionId client_connection_id) override; |
| 39 | |
| 40 | private: |
| 41 | // Constructor is private, use Create() instead. |
| 42 | MasqueEpollClient(QuicSocketAddress server_address, |
| 43 | const QuicServerId& server_id, |
| 44 | QuicEpollServer* epoll_server, |
| 45 | std::unique_ptr<ProofVerifier> proof_verifier, |
| 46 | const std::string& authority); |
| 47 | |
| 48 | // Disallow copy and assign. |
| 49 | MasqueEpollClient(const MasqueEpollClient&) = delete; |
| 50 | MasqueEpollClient& operator=(const MasqueEpollClient&) = delete; |
| 51 | |
dschinazi | 1c99fcf | 2019-12-13 11:54:22 -0800 | [diff] [blame] | 52 | std::string authority_; |
| 53 | }; |
| 54 | |
| 55 | } // namespace quic |
| 56 | |
| 57 | #endif // QUICHE_QUIC_MASQUE_MASQUE_EPOLL_CLIENT_H_ |