| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_QUIC_DEFAULT_PACKET_WRITER_H_ | 5 #ifndef NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ |
| 6 #define NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ | 6 #define NET_QUIC_QUIC_DEFAULT_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 12 matching lines...) Expand all Loading... |
| 23 class NET_EXPORT_PRIVATE QuicChromiumPacketWriter : public QuicPacketWriter { | 23 class NET_EXPORT_PRIVATE QuicChromiumPacketWriter : public QuicPacketWriter { |
| 24 public: | 24 public: |
| 25 QuicChromiumPacketWriter(); | 25 QuicChromiumPacketWriter(); |
| 26 explicit QuicChromiumPacketWriter(Socket* socket); | 26 explicit QuicChromiumPacketWriter(Socket* socket); |
| 27 ~QuicChromiumPacketWriter() override; | 27 ~QuicChromiumPacketWriter() override; |
| 28 | 28 |
| 29 // QuicPacketWriter | 29 // QuicPacketWriter |
| 30 WriteResult WritePacket(const char* buffer, | 30 WriteResult WritePacket(const char* buffer, |
| 31 size_t buf_len, | 31 size_t buf_len, |
| 32 const IPAddressNumber& self_address, | 32 const IPAddressNumber& self_address, |
| 33 const IPEndPoint& peer_address) override; | 33 const IPEndPoint& peer_address, |
| 34 PerPacketOptions* options) override; |
| 34 bool IsWriteBlockedDataBuffered() const override; | 35 bool IsWriteBlockedDataBuffered() const override; |
| 35 bool IsWriteBlocked() const override; | 36 bool IsWriteBlocked() const override; |
| 36 void SetWritable() override; | 37 void SetWritable() override; |
| 37 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; | 38 QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override; |
| 38 | 39 |
| 39 void OnWriteComplete(int rv); | 40 void OnWriteComplete(int rv); |
| 40 void SetConnection(QuicConnection* connection) { connection_ = connection; } | 41 void SetConnection(QuicConnection* connection) { connection_ = connection; } |
| 41 | 42 |
| 42 protected: | 43 protected: |
| 43 void set_write_blocked(bool is_blocked) { write_blocked_ = is_blocked; } | 44 void set_write_blocked(bool is_blocked) { write_blocked_ = is_blocked; } |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 Socket* socket_; | 47 Socket* socket_; |
| 47 QuicConnection* connection_; | 48 QuicConnection* connection_; |
| 48 | 49 |
| 49 // Whether a write is currently in flight. | 50 // Whether a write is currently in flight. |
| 50 bool write_blocked_; | 51 bool write_blocked_; |
| 51 | 52 |
| 52 base::WeakPtrFactory<QuicChromiumPacketWriter> weak_factory_; | 53 base::WeakPtrFactory<QuicChromiumPacketWriter> weak_factory_; |
| 53 | 54 |
| 54 DISALLOW_COPY_AND_ASSIGN(QuicChromiumPacketWriter); | 55 DISALLOW_COPY_AND_ASSIGN(QuicChromiumPacketWriter); |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace net | 58 } // namespace net |
| 58 | 59 |
| 59 #endif // NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ | 60 #endif // NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_ |
| OLD | NEW |