Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: net/quic/quartc/quartc_packet_writer.h

Issue 2324833004: Define Stable API for WebRTC/Quartc (Closed)
Patch Set: Fix the issues when testing with WebRTC. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 // Implements a QuicPacketWriter using a
14 // QuartcSessionInterface::PacketTransport, which allows a QuicConnection to
15 // use(for example), a WebRTC IceTransport.
16 class NET_EXPORT_PRIVATE QuartcPacketWriter : public QuicPacketWriter {
17 public:
18 QuartcPacketWriter(QuartcSessionInterface::PacketTransport* packet_transport);
19 ~QuartcPacketWriter() override {}
20
21 // The QuicConnection calls WritePacket and the QuicPacketWriter writes them
22 // to the QuartcSessionInterface::PacketTransport.
23 WriteResult WritePacket(const char* buffer,
24 size_t buf_len,
25 const IPAddress& self_address,
26 const IPEndPoint& peer_address,
27 PerPacketOptions* options) override;
28
29 // This is always set to false so that QuicConnection buffers unsent packets.
30 bool IsWriteBlockedDataBuffered() const override;
31
32 // Whether the underneath |transport_| is blocked. If this returns true,
33 // outgoing QUIC packets are queued by QuicConnection until
34 // Transport::Observer::OnCanWrite() is called.
35 bool IsWriteBlocked() const override;
36
37 // Maximum size of the QUIC packet which can be written.
38 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override;
39
40 // This method is not used because the network layer in WebRTC will determine
41 // the writing states.
42 void SetWritable() override;
43
44 private:
45 // QuartcPacketWriter will not own the transport.
46 QuartcSessionInterface::PacketTransport* packet_transport_ = nullptr;
47 };
48
49 } // namespace net
50
51 #endif // NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698