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

Unified Diff: net/quic/quic_per_connection_packet_writer.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_http_stream_test.cc ('k') | net/quic/quic_per_connection_packet_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e88a37d6ad9d17489e732b6c18f0780ddc8594df 100644
--- a/net/quic/quic_per_connection_packet_writer.h
+++ b/net/quic/quic_per_connection_packet_writer.h
@@ -5,13 +5,9 @@
#ifndef NET_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_
#define NET_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_
-#include "base/basictypes.h"
#include "base/memory/weak_ptr.h"
-#include "net/base/ip_endpoint.h"
#include "net/quic/quic_connection.h"
#include "net/quic/quic_packet_writer.h"
-#include "net/quic/quic_protocol.h"
-#include "net/quic/quic_types.h"
namespace net {
@@ -21,16 +17,18 @@ 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
+ // Default implementation of the QuicPacketWriter interface: Passes everything
+ // to |shared_writer_|.
virtual WriteResult WritePacket(const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
@@ -43,8 +41,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);
};
« no previous file with comments | « net/quic/quic_http_stream_test.cc ('k') | net/quic/quic_per_connection_packet_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698