Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: net/tools/quic/test_tools/quic_test_server.h

Issue 965943002: Fixing a bug in the QUIC prober where if we received a GOAWAY before (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Remove_dead_method_QuicUnackedPacketMap_RestoreInFlight_86690324
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_server.h ('k') | net/tools/quic/test_tools/quic_test_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/test_tools/quic_test_server.h
diff --git a/net/tools/quic/test_tools/quic_test_server.h b/net/tools/quic/test_tools/quic_test_server.h
new file mode 100644
index 0000000000000000000000000000000000000000..1e56e4315e46765c3b6b32983e2961e73c5afad4
--- /dev/null
+++ b/net/tools/quic/test_tools/quic_test_server.h
@@ -0,0 +1,51 @@
+// Copyright 2015 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.
+
+#ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_SERVER_H_
Ryan Hamilton 2015/02/28 00:29:48 Do we need this file? or is it only used by intern
ramant (doing other things) 2015/02/28 01:06:01 We don't use this. It is used only internally. Wil
+#define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_SERVER_H_
+
+#include "net/tools/quic/quic_dispatcher.h"
+#include "net/tools/quic/quic_server.h"
+#include "net/tools/quic/quic_server_session.h"
+
+namespace net {
+
+namespace tools {
+
+namespace test {
+
+// A test server which enables easy creation of custom QuicServerSessions
+//
+// Eventually this may be extended to allow custom QuicConnections etc.
+class QuicTestServer : public QuicServer {
+ public:
+ typedef std::function<QuicServerSession*(const QuicConfig& config,
+ QuicConnection* connection,
+ QuicServerSessionVisitor* visitor)>
+ SessionCreationFunction;
+
+ // Create a custom dispatcher which creates custom sessions.
+ QuicDispatcher* CreateQuicDispatcher() override;
+
+ void SetSessionCreator(const SessionCreationFunction& function);
+};
+
+// Useful test sessions for the QuicTestServer.
+
+// Test session which sends a GOAWAY immedaitely on creation, before crypto
+// credentials have even been established.
+class ImmediateGoAwaySession : public QuicServerSession {
+ public:
+ ImmediateGoAwaySession(const QuicConfig& config,
+ QuicConnection* connection,
+ QuicServerSessionVisitor* visitor);
+};
+
+} // namespace test
+
+} // namespace tools
+
+} // namespace net
+
+#endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_SERVER_H_
« no previous file with comments | « net/tools/quic/quic_server.h ('k') | net/tools/quic/test_tools/quic_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698