| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ | 5 #ifndef NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |
| 6 #define NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ | 6 #define NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |
| 7 | 7 |
| 8 #include "net/quic/core/quic_packet_writer.h" | 8 #include "net/quic/core/quic_packet_writer.h" |
| 9 #include "net/quic/quartc/quartc_session_interface.h" | 9 #include "net/quic/quartc/quartc_session_interface.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 // Implements a QuicPacketWriter using a | 13 // Implements a QuicPacketWriter using a |
| 14 // QuartcSessionInterface::PacketTransport, which allows a QuicConnection to | 14 // QuartcSessionInterface::PacketTransport, which allows a QuicConnection to |
| 15 // use(for example), a WebRTC IceTransport. | 15 // use(for example), a WebRTC IceTransport. |
| 16 class QuartcPacketWriter : public QuicPacketWriter { | 16 class QUIC_EXPORT_PRIVATE QuartcPacketWriter : public QuicPacketWriter { |
| 17 public: | 17 public: |
| 18 QuartcPacketWriter(QuartcSessionInterface::PacketTransport* packet_transport, | 18 QuartcPacketWriter(QuartcSessionInterface::PacketTransport* packet_transport, |
| 19 QuicByteCount max_packet_size); | 19 QuicByteCount max_packet_size); |
| 20 ~QuartcPacketWriter() override {} | 20 ~QuartcPacketWriter() override {} |
| 21 | 21 |
| 22 // The QuicConnection calls WritePacket and the QuicPacketWriter writes them | 22 // The QuicConnection calls WritePacket and the QuicPacketWriter writes them |
| 23 // to the QuartcSessionInterface::PacketTransport. | 23 // to the QuartcSessionInterface::PacketTransport. |
| 24 WriteResult WritePacket(const char* buffer, | 24 WriteResult WritePacket(const char* buffer, |
| 25 size_t buf_len, | 25 size_t buf_len, |
| 26 const QuicIpAddress& self_address, | 26 const QuicIpAddress& self_address, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 48 private: | 48 private: |
| 49 // QuartcPacketWriter will not own the transport. | 49 // QuartcPacketWriter will not own the transport. |
| 50 QuartcSessionInterface::PacketTransport* packet_transport_; | 50 QuartcSessionInterface::PacketTransport* packet_transport_; |
| 51 // The maximum size of the packet can be written by this writer. | 51 // The maximum size of the packet can be written by this writer. |
| 52 QuicByteCount max_packet_size_; | 52 QuicByteCount max_packet_size_; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace net | 55 } // namespace net |
| 56 | 56 |
| 57 #endif // NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ | 57 #endif // NET_QUIC_QUARTC_QUARTC_PACKET_WRITER_H_ |
| OLD | NEW |