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

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

Issue 1240953002: Allow QuicClient to set connection MTU before the handshake is sent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Cleanup_changes_97160447
Patch Set: Created 5 years, 5 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_simple_client_bin.cc ('k') | net/tools/quic/test_tools/limited_mtu_test_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/test_tools/limited_mtu_test_writer.h
diff --git a/net/tools/quic/test_tools/limited_mtu_test_writer.h b/net/tools/quic/test_tools/limited_mtu_test_writer.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3021651bc10f9613cda224dee597bdcb1ecb3a0
--- /dev/null
+++ b/net/tools/quic/test_tools/limited_mtu_test_writer.h
@@ -0,0 +1,39 @@
+// Copyright (c) 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_LIMITED_MTU_TEST_WRITER_H_
+#define NET_TOOLS_QUIC_TEST_TOOLS_LIMITED_MTU_TEST_WRITER_H_
+
+#include "base/basictypes.h"
+#include "net/quic/quic_protocol.h"
+#include "net/tools/quic/quic_packet_writer_wrapper.h"
+
+namespace net {
+namespace tools {
+namespace test {
+
+// Simulates a connection over a link with fixed MTU. Drops packets which
+// exceed the MTU and passes the rest of them as-is.
+class LimitedMtuTestWriter : public QuicPacketWriterWrapper {
+ public:
+ explicit LimitedMtuTestWriter(QuicByteCount mtu);
+ ~LimitedMtuTestWriter() override;
+
+ // Inherited from QuicPacketWriterWrapper.
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
+
+ private:
+ QuicByteCount mtu_;
+
+ DISALLOW_COPY_AND_ASSIGN(LimitedMtuTestWriter);
+};
+
+} // namespace test
+} // namespace tools
+} // namespace net
+
+#endif // NET_TOOLS_QUIC_TEST_TOOLS_LIMITED_MTU_TEST_WRITER_H_
« no previous file with comments | « net/tools/quic/quic_simple_client_bin.cc ('k') | net/tools/quic/test_tools/limited_mtu_test_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698