1 // Copyright (c) 2022 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_TOOLS_QUIC_CLIENT_FACTORY_H_ 6 #define QUICHE_QUIC_TOOLS_QUIC_CLIENT_FACTORY_H_ 7 8 #include "quiche/quic/core/crypto/proof_verifier.h" 9 #include "quiche/quic/core/crypto/quic_crypto_client_config.h" 10 #include "quiche/quic/core/quic_config.h" 11 #include "quiche/quic/core/quic_versions.h" 12 #include "quiche/quic/tools/quic_spdy_client_base.h" 13 14 namespace quic { 15 16 // Interface implemented by Factories to create QuicClients. 17 class ClientFactoryInterface { 18 public: 19 virtual ~ClientFactoryInterface() = default; 20 21 // Creates a new client configured to connect to |host_for_lookup:port| 22 // supporting |versions|, using |host_for_handshake| for handshake and 23 // |verifier| to verify proofs. 24 virtual std::unique_ptr<QuicSpdyClientBase> CreateClient( 25 std::string host_for_handshake, std::string host_for_lookup, 26 // AF_INET, AF_INET6, or AF_UNSPEC(=don't care). 27 int address_family_for_lookup, uint16_t port, 28 ParsedQuicVersionVector versions, const QuicConfig& config, 29 std::unique_ptr<ProofVerifier> verifier, 30 std::unique_ptr<SessionCache> session_cache) = 0; 31 }; 32 33 } // namespace quic 34 35 #endif // QUICHE_QUIC_TOOLS_QUIC_CLIENT_FACTORY_H_ 36