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

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

Issue 340433002: Port QuicServer to Chrome network stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments and fix blocked writers using callbacks Created 6 years, 6 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 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 29 matching lines...) Expand all
40 // called after connecting if the helper is not available before. 40 // called after connecting if the helper is not available before.
41 // |on_can_write| will be triggered when fake-unblocking; ownership will be 41 // |on_can_write| will be triggered when fake-unblocking; ownership will be
42 // assumed. 42 // assumed.
43 void Initialize(QuicEpollConnectionHelper* helper, Delegate* on_can_write); 43 void Initialize(QuicEpollConnectionHelper* helper, Delegate* on_can_write);
44 44
45 // QuicPacketWriter methods: 45 // QuicPacketWriter methods:
46 virtual WriteResult WritePacket( 46 virtual WriteResult WritePacket(
47 const char* buffer, 47 const char* buffer,
48 size_t buf_len, 48 size_t buf_len,
49 const IPAddressNumber& self_address, 49 const IPAddressNumber& self_address,
50 const IPEndPoint& peer_address) OVERRIDE; 50 const IPEndPoint& peer_address,
51 base::Callback<void(WriteResult wr)> callback) OVERRIDE;
51 52
52 virtual bool IsWriteBlocked() const OVERRIDE; 53 virtual bool IsWriteBlocked() const OVERRIDE;
53 54
54 virtual void SetWritable() OVERRIDE; 55 virtual void SetWritable() OVERRIDE;
55 56
56 // Writes out any packet which should have been sent by now 57 // Writes out any packet which should have been sent by now
57 // to the contained writer and returns the time 58 // to the contained writer and returns the time
58 // for the next delayed packet to be written. 59 // for the next delayed packet to be written.
59 QuicTime ReleaseOldPackets(); 60 QuicTime ReleaseOldPackets();
60 61
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 QuicByteCount buffer_size_; 149 QuicByteCount buffer_size_;
149 150
150 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); 151 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter);
151 }; 152 };
152 153
153 } // namespace test 154 } // namespace test
154 } // namespace tools 155 } // namespace tools
155 } // namespace net 156 } // namespace net
156 157
157 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ 158 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698