Chromium Code Reviews| Index: net/quic/quartc/quartc_packet_writer.h |
| diff --git a/net/quic/quartc/quartc_packet_writer.h b/net/quic/quartc/quartc_packet_writer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..60875b4e1dce9a549ea7215677eb858a1729f56a |
| --- /dev/null |
| +++ b/net/quic/quartc/quartc_packet_writer.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |
| +#define NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |
| + |
| +#include "net/quic/core/quic_packet_writer.h" |
| +#include "net/quic/quartc/quartc_session_interface.h" |
| + |
| +namespace net { |
| + |
| +// This class writes the packets to network layer with a |transport_| which will |
| +// be implemented on WebRTC side. |
| +class NET_EXPORT_PRIVATE QuartcPacketWriter : public QuicPacketWriter { |
| + public: |
| + QuartcPacketWriter(QuartcSessionInterface::Transport* transport); |
| + // Called from QuicConnection when the session has packets to write. |
| + WriteResult WritePacket(const char* buffer, |
| + size_t buf_len, |
| + const IPAddress& self_address, |
| + const IPEndPoint& peer_address, |
| + PerPacketOptions* options) override; |
| + // If this is set to false, then QuicConnection buffers unsent packets. |
| + bool IsWriteBlockedDataBuffered() const override; |
| + // Whether the underneath |transport_| is blocked. If this returns true, |
| + // outgoing QUIC packets are queued by QuicConnection until |
| + // Transport::OnCanWrite() is called. |
|
skvlad-chromium
2016/09/22 01:54:25
Did you mean Transport::Observer::OnCanWrite()?
zhihuang1
2016/09/22 18:53:52
Ah, yes. Thanks for pointing out.
|
| + bool IsWriteBlocked() const override; |
| + // Maximum size of the QUIC packet which can be written. |
| + QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; |
| + // This method is not used because the network layer in WebRTC will determine |
| + // the write states. |
| + void SetWritable() override; |
| + |
| + private: |
| + // QuartcPacketWriter will not own the transport. |
| + QuartcSessionInterface::Transport* transport_ = nullptr; |
| +}; |
| + |
| +} // namespace net |
| + |
| +#endif // NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |