OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TOOLS_QUIC_SIMPLE_PER_CONNECTION_PACKET_WRITER_H_ | 5 #ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_PER_CONNECTION_PACKET_WRITER_H_ |
6 #define NET_QUIC_TOOLS_QUIC_SIMPLE_PER_CONNECTION_PACKET_WRITER_H_ | 6 #define NET_QUIC_TOOLS_QUIC_SIMPLE_PER_CONNECTION_PACKET_WRITER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 QuicPacketWriter* shared_writer() const; | 30 QuicPacketWriter* shared_writer() const; |
31 void set_connection(QuicConnection* connection) { connection_ = connection; } | 31 void set_connection(QuicConnection* connection) { connection_ = connection; } |
32 QuicConnection* connection() const { return connection_; } | 32 QuicConnection* connection() const { return connection_; } |
33 | 33 |
34 // Default implementation of the QuicPacketWriter interface: Passes everything | 34 // Default implementation of the QuicPacketWriter interface: Passes everything |
35 // to |shared_writer_|. | 35 // to |shared_writer_|. |
36 WriteResult WritePacket(const char* buffer, | 36 WriteResult WritePacket(const char* buffer, |
37 size_t buf_len, | 37 size_t buf_len, |
38 const IPAddressNumber& self_address, | 38 const IPAddressNumber& self_address, |
39 const IPEndPoint& peer_address) override; | 39 const IPEndPoint& peer_address, |
| 40 PerPacketOptions* options) override; |
40 bool IsWriteBlockedDataBuffered() const override; | 41 bool IsWriteBlockedDataBuffered() const override; |
41 bool IsWriteBlocked() const override; | 42 bool IsWriteBlocked() const override; |
42 void SetWritable() override; | 43 void SetWritable() override; |
43 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; | 44 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; |
44 | 45 |
45 private: | 46 private: |
46 void OnWriteComplete(WriteResult result); | 47 void OnWriteComplete(WriteResult result); |
47 | 48 |
48 QuicSimpleServerPacketWriter* shared_writer_; // Not owned. | 49 QuicSimpleServerPacketWriter* shared_writer_; // Not owned. |
49 QuicConnection* connection_; // Not owned. | 50 QuicConnection* connection_; // Not owned. |
50 | 51 |
51 base::WeakPtrFactory<QuicSimplePerConnectionPacketWriter> weak_factory_; | 52 base::WeakPtrFactory<QuicSimplePerConnectionPacketWriter> weak_factory_; |
52 | 53 |
53 DISALLOW_COPY_AND_ASSIGN(QuicSimplePerConnectionPacketWriter); | 54 DISALLOW_COPY_AND_ASSIGN(QuicSimplePerConnectionPacketWriter); |
54 }; | 55 }; |
55 | 56 |
56 } // namespace net | 57 } // namespace net |
57 | 58 |
58 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_PER_CONNECTION_PACKET_WRITER_H_ | 59 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_PER_CONNECTION_PACKET_WRITER_H_ |
OLD | NEW |