Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: net/quic/quic_connection.h

Issue 467963002: Refactoring: Create per-connection packet writers in QuicDispatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More review comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_connection.h
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h
index ee5955ffd42391364f30176cd0e0a618bd6f658f..73d62df5a1bc81dbb689a366b030bedf1834787a 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);

Powered by Google App Engine
This is Rietveld 408576698