1 // Copyright 2014 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/quic_packet_writer_wrapper.h" 6 7 #include "net/quic/quic_types.h" 8 9 namespace net { 10 namespace tools { 11 QuicPacketWriterWrapper()12QuicPacketWriterWrapper::QuicPacketWriterWrapper() {} 13 QuicPacketWriterWrapper(QuicPacketWriter * writer)14QuicPacketWriterWrapper::QuicPacketWriterWrapper(QuicPacketWriter* writer) 15 : writer_(writer) {} 16 ~QuicPacketWriterWrapper()17QuicPacketWriterWrapper::~QuicPacketWriterWrapper() {} 18 WritePacket(const char * buffer,size_t buf_len,const net::IPAddressNumber & self_address,const net::IPEndPoint & peer_address)19WriteResult QuicPacketWriterWrapper::WritePacket( 20 const char* buffer, 21 size_t buf_len, 22 const net::IPAddressNumber& self_address, 23 const net::IPEndPoint& peer_address) { 24 return writer_->WritePacket(buffer, buf_len, self_address, peer_address); 25 } 26 IsWriteBlockedDataBuffered() const27bool QuicPacketWriterWrapper::IsWriteBlockedDataBuffered() const { 28 return writer_->IsWriteBlockedDataBuffered(); 29 } 30 IsWriteBlocked() const31bool QuicPacketWriterWrapper::IsWriteBlocked() const { 32 return writer_->IsWriteBlocked(); 33 } 34 SetWritable()35void QuicPacketWriterWrapper::SetWritable() { 36 writer_->SetWritable(); 37 } 38 set_writer(QuicPacketWriter * writer)39void QuicPacketWriterWrapper::set_writer(QuicPacketWriter* writer) { 40 writer_.reset(writer); 41 } 42 release_writer()43QuicPacketWriter* QuicPacketWriterWrapper::release_writer() { 44 return writer_.release(); 45 } 46 47 } // namespace tools 48 } // namespace net 49