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

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

Issue 678073004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 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"
11 #include "net/tools/quic/quic_socket_utils.h" 11 #include "net/tools/quic/quic_socket_utils.h"
12 12
13 namespace net { 13 namespace net {
14 namespace tools { 14 namespace tools {
15 namespace test { 15 namespace test {
16 16
17 // An alarm that is scheduled if a blocked socket is simulated to indicate 17 // An alarm that is scheduled if a blocked socket is simulated to indicate
18 // it's writable again. 18 // it's writable again.
19 class WriteUnblockedAlarm : public QuicAlarm::Delegate { 19 class WriteUnblockedAlarm : public QuicAlarm::Delegate {
20 public: 20 public:
21 explicit WriteUnblockedAlarm(PacketDroppingTestWriter* writer) 21 explicit WriteUnblockedAlarm(PacketDroppingTestWriter* writer)
22 : writer_(writer) {} 22 : writer_(writer) {}
23 23
24 virtual QuicTime OnAlarm() override { 24 QuicTime OnAlarm() override {
25 DVLOG(1) << "Unblocking socket."; 25 DVLOG(1) << "Unblocking socket.";
26 writer_->OnCanWrite(); 26 writer_->OnCanWrite();
27 return QuicTime::Zero(); 27 return QuicTime::Zero();
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) : writer_(writer) {} 38 explicit DelayAlarm(PacketDroppingTestWriter* writer) : writer_(writer) {}
39 39
40 virtual QuicTime OnAlarm() override { 40 QuicTime OnAlarm() override { return writer_->ReleaseOldPackets(); }
41 return writer_->ReleaseOldPackets();
42 }
43 41
44 private: 42 private:
45 PacketDroppingTestWriter* writer_; 43 PacketDroppingTestWriter* writer_;
46 }; 44 };
47 45
48 PacketDroppingTestWriter::PacketDroppingTestWriter() 46 PacketDroppingTestWriter::PacketDroppingTestWriter()
49 : clock_(nullptr), 47 : clock_(nullptr),
50 cur_buffer_size_(0), 48 cur_buffer_size_(0),
51 config_mutex_(), 49 config_mutex_(),
52 fake_packet_loss_percentage_(0), 50 fake_packet_loss_percentage_(0),
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 : buffer(buffer, buf_len), 204 : buffer(buffer, buf_len),
207 self_address(self_address), 205 self_address(self_address),
208 peer_address(peer_address), 206 peer_address(peer_address),
209 send_time(send_time) {} 207 send_time(send_time) {}
210 208
211 PacketDroppingTestWriter::DelayedWrite::~DelayedWrite() {} 209 PacketDroppingTestWriter::DelayedWrite::~DelayedWrite() {}
212 210
213 } // namespace test 211 } // namespace test
214 } // namespace tools 212 } // namespace tools
215 } // namespace net 213 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/test_tools/packet_dropping_test_writer.h ('k') | net/tools/quic/test_tools/quic_test_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698