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

Side by Side Diff: net/tools/quic/test_tools/limited_mtu_test_writer.cc

Issue 1660533002: Landing Recent QUIC changes until 01/26/2016 18:14 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/tools/quic/test_tools/limited_mtu_test_writer.h" 5 #include "net/tools/quic/test_tools/limited_mtu_test_writer.h"
6 6
7 namespace net { 7 namespace net {
8 namespace test { 8 namespace test {
9 9
10 LimitedMtuTestWriter::LimitedMtuTestWriter(QuicByteCount mtu) : mtu_(mtu) {} 10 LimitedMtuTestWriter::LimitedMtuTestWriter(QuicByteCount mtu) : mtu_(mtu) {}
11 11
12 LimitedMtuTestWriter::~LimitedMtuTestWriter() {} 12 LimitedMtuTestWriter::~LimitedMtuTestWriter() {}
13 13
14 WriteResult LimitedMtuTestWriter::WritePacket( 14 WriteResult LimitedMtuTestWriter::WritePacket(
15 const char* buffer, 15 const char* buffer,
16 size_t buf_len, 16 size_t buf_len,
17 const IPAddressNumber& self_address, 17 const IPAddressNumber& self_address,
18 const IPEndPoint& peer_address) { 18 const IPEndPoint& peer_address,
19 PerPacketOptions* options) {
19 if (buf_len > mtu_) { 20 if (buf_len > mtu_) {
20 // Drop the packet. 21 // Drop the packet.
21 return WriteResult(WRITE_STATUS_OK, buf_len); 22 return WriteResult(WRITE_STATUS_OK, buf_len);
22 } 23 }
23 24
24 return QuicPacketWriterWrapper::WritePacket(buffer, buf_len, self_address, 25 return QuicPacketWriterWrapper::WritePacket(buffer, buf_len, self_address,
25 peer_address); 26 peer_address, options);
26 } 27 }
27 28
28 } // namespace test 29 } // namespace test
29 } // namespace net 30 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/test_tools/limited_mtu_test_writer.h ('k') | net/tools/quic/test_tools/packet_dropping_test_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698