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

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

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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
6 #define NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ 6 #define NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 18 matching lines...) Expand all
29 public: 29 public:
30 class Delegate { 30 class Delegate {
31 public: 31 public:
32 virtual ~Delegate() {} 32 virtual ~Delegate() {}
33 virtual void OnPacketSent(WriteResult result) = 0; 33 virtual void OnPacketSent(WriteResult result) = 0;
34 virtual void OnCanWrite() = 0; 34 virtual void OnCanWrite() = 0;
35 }; 35 };
36 36
37 PacketDroppingTestWriter(); 37 PacketDroppingTestWriter();
38 38
39 virtual ~PacketDroppingTestWriter(); 39 ~PacketDroppingTestWriter() override;
40 40
41 // Must be called before blocking, reordering or delaying (loss is OK). May be 41 // Must be called before blocking, reordering or delaying (loss is OK). May be
42 // called after connecting if the helper is not available before. 42 // called after connecting if the helper is not available before.
43 // |on_can_write| will be triggered when fake-unblocking; ownership will be 43 // |on_can_write| will be triggered when fake-unblocking; ownership will be
44 // assumed. 44 // assumed.
45 void Initialize(QuicEpollConnectionHelper* helper, Delegate* on_can_write); 45 void Initialize(QuicEpollConnectionHelper* helper, Delegate* on_can_write);
46 46
47 // QuicPacketWriter methods: 47 // QuicPacketWriter methods:
48 virtual WriteResult WritePacket( 48 WriteResult WritePacket(const char* buffer,
49 const char* buffer, 49 size_t buf_len,
50 size_t buf_len, 50 const IPAddressNumber& self_address,
51 const IPAddressNumber& self_address, 51 const IPEndPoint& peer_address) override;
52 const IPEndPoint& peer_address) override;
53 52
54 virtual bool IsWriteBlocked() const override; 53 bool IsWriteBlocked() const override;
55 54
56 virtual void SetWritable() override; 55 void SetWritable() override;
57 56
58 // Writes out any packet which should have been sent by now 57 // Writes out any packet which should have been sent by now
59 // to the contained writer and returns the time 58 // to the contained writer and returns the time
60 // for the next delayed packet to be written. 59 // for the next delayed packet to be written.
61 QuicTime ReleaseOldPackets(); 60 QuicTime ReleaseOldPackets();
62 61
63 void OnCanWrite(); 62 void OnCanWrite();
64 63
65 // The percent of time a packet is simulated as being lost. 64 // The percent of time a packet is simulated as being lost.
66 void set_fake_packet_loss_percentage(int32 fake_packet_loss_percentage) { 65 void set_fake_packet_loss_percentage(int32 fake_packet_loss_percentage) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 QuicByteCount buffer_size_; 149 QuicByteCount buffer_size_;
151 150
152 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); 151 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter);
153 }; 152 };
154 153
155 } // namespace test 154 } // namespace test
156 } // namespace tools 155 } // namespace tools
157 } // namespace net 156 } // namespace net
158 157
159 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ 158 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
OLDNEW
« no previous file with comments | « net/tools/quic/test_tools/mock_epoll_server.h ('k') | net/tools/quic/test_tools/packet_dropping_test_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698