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

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

Issue 1030023002: Remove the QuicDispatcher's explicit use of EpollServer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 #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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 fake_bandwidth_(QuicBandwidth::Zero()), 54 fake_bandwidth_(QuicBandwidth::Zero()),
55 buffer_size_(0) { 55 buffer_size_(0) {
56 uint32 seed = base::RandInt(0, std::numeric_limits<int32>::max()); 56 uint32 seed = base::RandInt(0, std::numeric_limits<int32>::max());
57 VLOG(1) << "Seeding packet loss with " << seed; 57 VLOG(1) << "Seeding packet loss with " << seed;
58 simple_random_.set_seed(seed); 58 simple_random_.set_seed(seed);
59 } 59 }
60 60
61 PacketDroppingTestWriter::~PacketDroppingTestWriter() {} 61 PacketDroppingTestWriter::~PacketDroppingTestWriter() {}
62 62
63 void PacketDroppingTestWriter::Initialize( 63 void PacketDroppingTestWriter::Initialize(
64 QuicEpollConnectionHelper* helper, 64 QuicConnectionHelperInterface* helper,
65 Delegate* on_can_write) { 65 Delegate* on_can_write) {
66 clock_ = helper->GetClock(); 66 clock_ = helper->GetClock();
67 write_unblocked_alarm_.reset( 67 write_unblocked_alarm_.reset(
68 helper->CreateAlarm(new WriteUnblockedAlarm(this))); 68 helper->CreateAlarm(new WriteUnblockedAlarm(this)));
69 delay_alarm_.reset( 69 delay_alarm_.reset(
70 helper->CreateAlarm(new DelayAlarm(this))); 70 helper->CreateAlarm(new DelayAlarm(this)));
71 on_can_write_.reset(on_can_write); 71 on_can_write_.reset(on_can_write);
72 } 72 }
73 73
74 WriteResult PacketDroppingTestWriter::WritePacket( 74 WriteResult PacketDroppingTestWriter::WritePacket(
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 : buffer(buffer, buf_len), 204 : buffer(buffer, buf_len),
205 self_address(self_address), 205 self_address(self_address),
206 peer_address(peer_address), 206 peer_address(peer_address),
207 send_time(send_time) {} 207 send_time(send_time) {}
208 208
209 PacketDroppingTestWriter::DelayedWrite::~DelayedWrite() {} 209 PacketDroppingTestWriter::DelayedWrite::~DelayedWrite() {}
210 210
211 } // namespace test 211 } // namespace test
212 } // namespace tools 212 } // namespace tools
213 } // 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_dispatcher_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698