| Index: net/quic/quic_default_packet_writer.h
|
| diff --git a/net/quic/quic_default_packet_writer.h b/net/quic/quic_default_packet_writer.h
|
| index 66b6a0f4f72181be441d80c5fd1492a503469393..1d815c285a9baf47e18297eede1197febcd0150a 100644
|
| --- a/net/quic/quic_default_packet_writer.h
|
| +++ b/net/quic/quic_default_packet_writer.h
|
| @@ -27,16 +27,20 @@ class NET_EXPORT_PRIVATE QuicDefaultPacketWriter : public QuicPacketWriter {
|
|
|
| // QuicPacketWriter
|
| virtual WriteResult WritePacket(
|
| - const char* buffer, size_t buf_len,
|
| - const net::IPAddressNumber& self_address,
|
| - const net::IPEndPoint& peer_address) OVERRIDE;
|
| + const char* buffer,
|
| + size_t buf_len,
|
| + const IPAddressNumber& self_address,
|
| + const IPEndPoint& peer_address,
|
| + base::Callback<void(WriteResult wr)> callback) OVERRIDE;
|
| virtual bool IsWriteBlockedDataBuffered() const OVERRIDE;
|
| virtual bool IsWriteBlocked() const OVERRIDE;
|
| virtual void SetWritable() OVERRIDE;
|
|
|
| void OnWriteComplete(int rv);
|
| - void SetConnection(QuicConnection* connection) {
|
| - connection_ = connection;
|
| +
|
| + // Set the writer to notify when writes complete.
|
| + void SetWriterToUnblock(QuicBlockedWriterInterface* blocked_writer) {
|
| + blocked_writer_ = blocked_writer;
|
| }
|
|
|
| protected:
|
| @@ -47,7 +51,14 @@ class NET_EXPORT_PRIVATE QuicDefaultPacketWriter : public QuicPacketWriter {
|
| private:
|
| base::WeakPtrFactory<QuicDefaultPacketWriter> weak_factory_;
|
| DatagramClientSocket* socket_;
|
| - QuicConnection* connection_;
|
| +
|
| + // To be notified after every successful write.
|
| + QuicBlockedWriterInterface* blocked_writer_;
|
| +
|
| + // To be called after every successful write. May be null.
|
| + base::Callback<void(WriteResult wr)> callback_;
|
| +
|
| + // Whether a write is currently in flight.
|
| bool write_blocked_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter);
|
|
|