| OLD | NEW | 
|---|
| 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 | 
| OLD | NEW | 
|---|