| 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..1b9fb0eec3c120f49e65f5667390278de561b2c6
|
| --- /dev/null
|
| +++ b/net/quic/quartc/quartc_packet_writer.h
|
| @@ -0,0 +1,43 @@
|
| +// Copyright (c) 2016 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::Observer::OnCanWrite() is called.
|
| + 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_
|
|
|