Index: net/quic/quic_per_connection_packet_writer.h |
diff --git a/net/quic/quic_per_connection_packet_writer.h b/net/quic/quic_per_connection_packet_writer.h |
index 96a37b61d6fe18d02638b04e1b5df298e76252e9..bf72b0f0d4ad654bee708c535cab46c077e6352f 100644 |
--- a/net/quic/quic_per_connection_packet_writer.h |
+++ b/net/quic/quic_per_connection_packet_writer.h |
@@ -21,14 +21,15 @@ class QuicServerPacketWriter; |
// writes to the shared QuicServerPacketWriter complete. |
// This class is necessary because multiple connections can share the same |
// QuicServerPacketWriter, so it has no way to know which connection to notify. |
-// TODO(dmz) Try to merge with Chrome's default packet writer |
class QuicPerConnectionPacketWriter : public QuicPacketWriter { |
public: |
- QuicPerConnectionPacketWriter(QuicServerPacketWriter* writer); |
+ // Does not take ownership of |shared_writer| or |connection|. |
+ QuicPerConnectionPacketWriter(QuicServerPacketWriter* shared_writer, |
+ QuicConnection* connection); |
virtual ~QuicPerConnectionPacketWriter(); |
- // Set the connection to notify after writes complete. |
- void set_connection(QuicConnection* connection) { connection_ = connection; } |
+ QuicPacketWriter* shared_writer() const; |
+ QuicConnection* connection() const { return connection_; } |
// QuicPacketWriter |
virtual WriteResult WritePacket(const char* buffer, |
@@ -43,8 +44,8 @@ class QuicPerConnectionPacketWriter : public QuicPacketWriter { |
void OnWriteComplete(WriteResult result); |
base::WeakPtrFactory<QuicPerConnectionPacketWriter> weak_factory_; |
- QuicServerPacketWriter* writer_; // Not owned. |
- QuicConnection* connection_; |
+ QuicServerPacketWriter* shared_writer_; // Not owned. |
+ QuicConnection* connection_; // Not owned. |
DISALLOW_COPY_AND_ASSIGN(QuicPerConnectionPacketWriter); |
}; |