OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 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 #ifndef NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |
| 6 #define NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |
| 7 |
| 8 #include "net/quic/core/quic_packet_writer.h" |
| 9 #include "net/quic/quartc/quartc_session_interface.h" |
| 10 |
| 11 namespace net { |
| 12 |
| 13 // This class writes the packets to network layer with a |transport_| which will |
| 14 // be implemented on WebRTC side. |
| 15 class NET_EXPORT_PRIVATE QuartcPacketWriter : public QuicPacketWriter { |
| 16 public: |
| 17 QuartcPacketWriter(QuartcSessionInterface::Transport* transport); |
| 18 // Called from QuicConnection when the session has packets to write. |
| 19 WriteResult WritePacket(const char* buffer, |
| 20 size_t buf_len, |
| 21 const IPAddress& self_address, |
| 22 const IPEndPoint& peer_address, |
| 23 PerPacketOptions* options) override; |
| 24 // If this is set to false, then QuicConnection buffers unsent packets. |
| 25 bool IsWriteBlockedDataBuffered() const override; |
| 26 // Whether the underneath |transport_| is blocked. If this returns true, |
| 27 // outgoing QUIC packets are queued by QuicConnection until |
| 28 // Transport::Observer::OnCanWrite() is called. |
| 29 bool IsWriteBlocked() const override; |
| 30 // Maximum size of the QUIC packet which can be written. |
| 31 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; |
| 32 // This method is not used because the network layer in WebRTC will determine |
| 33 // the write states. |
| 34 void SetWritable() override; |
| 35 |
| 36 private: |
| 37 // QuartcPacketWriter will not own the transport. |
| 38 QuartcSessionInterface::Transport* transport_ = nullptr; |
| 39 }; |
| 40 |
| 41 } // namespace net |
| 42 |
| 43 #endif // NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |
OLD | NEW |