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 3 // found in the LICENSE file. 4 5 #include "net/tools/quic/test_tools/quic_dispatcher_peer.h" 6 7 #include "net/tools/quic/quic_dispatcher.h" 8 #include "net/tools/quic/quic_packet_writer_wrapper.h" 9 10 namespace net { 11 namespace tools { 12 namespace test { 13 14 // static 15 void QuicDispatcherPeer::SetTimeWaitListManager( 16 QuicDispatcher* dispatcher, 17 QuicTimeWaitListManager* time_wait_list_manager) { 18 dispatcher->time_wait_list_manager_.reset(time_wait_list_manager); 19 } 20 21 // static 22 void QuicDispatcherPeer::UseWriter(QuicDispatcher* dispatcher, 23 QuicPacketWriterWrapper* writer) { 24 writer->set_writer(dispatcher->writer_.release()); 25 dispatcher->writer_.reset(writer); 26 } 27 28 // static 29 QuicPacketWriter* QuicDispatcherPeer::GetWriter(QuicDispatcher* dispatcher) { 30 return dispatcher->writer_.get(); 31 } 32 33 // static 34 void QuicDispatcherPeer::SetPacketWriterFactory( 35 QuicDispatcher* dispatcher, 36 QuicDispatcher::PacketWriterFactory* packet_writer_factory) { 37 dispatcher->packet_writer_factory_.reset(packet_writer_factory); 38 } 39 40 // static 41 QuicEpollConnectionHelper* QuicDispatcherPeer::GetHelper( 42 QuicDispatcher* dispatcher) { 43 return dispatcher->helper_.get(); 44 } 45 46 // static 47 QuicConnection* QuicDispatcherPeer::CreateQuicConnection( 48 QuicDispatcher* dispatcher, 49 QuicConnectionId connection_id, 50 const IPEndPoint& server, 51 const IPEndPoint& client) { 52 return dispatcher->CreateQuicConnection(connection_id, 53 server, 54 client); 55 } 56 57 // static 58 QuicDispatcher::WriteBlockedList* QuicDispatcherPeer::GetWriteBlockedList( 59 QuicDispatcher* dispatcher) { 60 return &dispatcher->write_blocked_list_; 61 } 62 63 } // namespace test 64 } // namespace tools 65 } // namespace net 66