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

Unified Diff: net/quic/quic_connection.h

Issue 475113005: Refactoring: Create per-connection packet writers in QuicDispatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add new files to net/BUILD.gn 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
« no previous file with comments | « net/quic/quic_client_session_test.cc ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « net/quic/quic_client_session_test.cc ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698