summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quiche/quic/tools/quic_toy_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/third_party/quiche/src/quiche/quic/tools/quic_toy_client.h')
-rw-r--r--chromium/net/third_party/quiche/src/quiche/quic/tools/quic_toy_client.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/chromium/net/third_party/quiche/src/quiche/quic/tools/quic_toy_client.h b/chromium/net/third_party/quiche/src/quiche/quic/tools/quic_toy_client.h
new file mode 100644
index 00000000000..76394825388
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quiche/quic/tools/quic_toy_client.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// A toy client, which connects to a specified port and sends QUIC
+// requests to that endpoint.
+
+#ifndef QUICHE_QUIC_TOOLS_QUIC_TOY_CLIENT_H_
+#define QUICHE_QUIC_TOOLS_QUIC_TOY_CLIENT_H_
+
+#include "quiche/quic/tools/quic_spdy_client_base.h"
+
+namespace quic {
+
+class QuicToyClient {
+ public:
+ class ClientFactory {
+ public:
+ virtual ~ClientFactory() = default;
+
+ // Creates a new client configured to connect to |host_for_lookup:port|
+ // supporting |versions|, using |host_for_handshake| for handshake and
+ // |verifier| to verify proofs.
+ virtual std::unique_ptr<QuicSpdyClientBase> CreateClient(
+ std::string host_for_handshake, std::string host_for_lookup,
+ // AF_INET, AF_INET6, or AF_UNSPEC(=don't care).
+ int address_family_for_lookup, uint16_t port,
+ ParsedQuicVersionVector versions, const QuicConfig& config,
+ std::unique_ptr<ProofVerifier> verifier,
+ std::unique_ptr<SessionCache> session_cache) = 0;
+ };
+
+ // Constructs a new toy client that will use |client_factory| to create the
+ // actual QuicSpdyClientBase instance.
+ QuicToyClient(ClientFactory* client_factory);
+
+ // Connects to the QUIC server based on the various flags defined in the
+ // .cc file, sends requests and prints the responses. Returns 0 on success
+ // and non-zero otherwise.
+ int SendRequestsAndPrintResponses(std::vector<std::string> urls);
+
+ private:
+ ClientFactory* client_factory_; // Unowned.
+};
+
+} // namespace quic
+
+#endif // QUICHE_QUIC_TOOLS_QUIC_TOY_CLIENT_H_