| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/packet_dropping_test_writer.h" | 5 #include "net/tools/quic/test_tools/packet_dropping_test_writer.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "net/tools/quic/quic_epoll_connection_helper.h" | 10 #include "net/tools/quic/quic_epoll_connection_helper.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 PacketDroppingTestWriter* writer_; | 31 PacketDroppingTestWriter* writer_; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // An alarm that is scheduled every time a new packet is to be written at a | 34 // An alarm that is scheduled every time a new packet is to be written at a |
| 35 // later point. | 35 // later point. |
| 36 class DelayAlarm : public QuicAlarm::Delegate { | 36 class DelayAlarm : public QuicAlarm::Delegate { |
| 37 public: | 37 public: |
| 38 explicit DelayAlarm(PacketDroppingTestWriter* writer) | 38 explicit DelayAlarm(PacketDroppingTestWriter* writer) : writer_(writer) {} |
| 39 : writer_(writer) {} | |
| 40 | 39 |
| 41 virtual QuicTime OnAlarm() OVERRIDE { | 40 virtual QuicTime OnAlarm() OVERRIDE { |
| 42 return writer_->ReleaseOldPackets(); | 41 return writer_->ReleaseOldPackets(); |
| 43 } | 42 } |
| 44 | 43 |
| 45 private: | 44 private: |
| 46 PacketDroppingTestWriter* writer_; | 45 PacketDroppingTestWriter* writer_; |
| 47 }; | 46 }; |
| 48 | 47 |
| 49 PacketDroppingTestWriter::PacketDroppingTestWriter() | 48 PacketDroppingTestWriter::PacketDroppingTestWriter() |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 : buffer(buffer, buf_len), | 204 : buffer(buffer, buf_len), |
| 206 self_address(self_address), | 205 self_address(self_address), |
| 207 peer_address(peer_address), | 206 peer_address(peer_address), |
| 208 send_time(send_time) {} | 207 send_time(send_time) {} |
| 209 | 208 |
| 210 PacketDroppingTestWriter::DelayedWrite::~DelayedWrite() {} | 209 PacketDroppingTestWriter::DelayedWrite::~DelayedWrite() {} |
| 211 | 210 |
| 212 } // namespace test | 211 } // namespace test |
| 213 } // namespace tools | 212 } // namespace tools |
| 214 } // namespace net | 213 } // namespace net |
| OLD | NEW |