Index: net/quic/quic_connection.h |
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h |
index 4d57208caef001a3868d95538db8070f738e9e8a..13952c5fbb11d3a86bb90723117249b2e0bb743b 100644 |
--- a/net/quic/quic_connection.h |
+++ b/net/quic/quic_connection.h |
@@ -236,13 +236,21 @@ class NET_EXPORT_PRIVATE QuicConnection |
BUNDLE_PENDING_ACK = 2, |
}; |
- // Constructs a new QuicConnection for |connection_id| and |address|. |
- // |helper| must outlive this connection, and if |owns_writer| is false, so |
- // must |writer|. |
+ class PacketWriterFactory { |
+ public: |
+ virtual ~PacketWriterFactory() {} |
+ |
+ virtual QuicPacketWriter* Create(QuicConnection* connection) const = 0; |
+ }; |
+ |
+ // Constructs a new QuicConnection for |connection_id| and |address|. Invokes |
+ // writer_factory->Create() to get a writer; |owns_writer| specifies whether |
+ // the connection takes ownership of the returned writer. |helper| must |
+ // outlive this connection. |
QuicConnection(QuicConnectionId connection_id, |
IPEndPoint address, |
QuicConnectionHelperInterface* helper, |
- QuicPacketWriter* writer, |
+ const PacketWriterFactory& writer_factory, |
bool owns_writer, |
bool is_server, |
const QuicVersionVector& supported_versions); |