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

Unified Diff: net/quic/quic_packet_writer.h

Issue 1660533002: Landing Recent QUIC changes until 01/26/2016 18:14 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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_one_block_arena_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_writer.h
diff --git a/net/quic/quic_packet_writer.h b/net/quic/quic_packet_writer.h
index 4c9963adc0ca7e67c5fbf85541314a81bb494c25..0c5b02b7dd79d0378db7bce6ceba699c1d0f56c2 100644
--- a/net/quic/quic_packet_writer.h
+++ b/net/quic/quic_packet_writer.h
@@ -14,6 +14,21 @@ namespace net {
struct WriteResult;
+class NET_EXPORT_PRIVATE PerPacketOptions {
+ public:
+ PerPacketOptions() = default;
+ virtual ~PerPacketOptions() {}
+
+ // Returns a heap-allocated copy of |this|.
+ virtual PerPacketOptions* Clone() const = 0;
+
+ private:
+ PerPacketOptions(PerPacketOptions&& other) = delete;
+ PerPacketOptions& operator=(PerPacketOptions&& other) = delete;
+
+ DISALLOW_COPY_AND_ASSIGN(PerPacketOptions);
+};
+
// An interface between writers and the entity managing the
// socket (in our case the QuicDispatcher). This allows the Dispatcher to
// control writes, and manage any writers who end up write blocked.
@@ -21,14 +36,17 @@ class NET_EXPORT_PRIVATE QuicPacketWriter {
public:
virtual ~QuicPacketWriter() {}
- // Sends the packet out to the peer. If the write succeeded, the result's
- // status is WRITE_STATUS_OK and bytes_written is populated. If the write
- // failed, the result's status is WRITE_STATUS_BLOCKED or WRITE_STATUS_ERROR
- // and error_code is populated.
+ // Sends the packet out to the peer, with some optional per-packet options.
+ // If the write succeeded, the result's status is WRITE_STATUS_OK and
+ // bytes_written is populated. If the write failed, the result's status is
+ // WRITE_STATUS_BLOCKED or WRITE_STATUS_ERROR and error_code is populated.
+ // Options must be either null, or created for the particular QuicPacketWriter
+ // implementation. Options may be ignored, depending on the implementation.
virtual WriteResult WritePacket(const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) = 0;
+ const IPEndPoint& peer_address,
+ PerPacketOptions* options) = 0;
// Returns true if the writer buffers and subsequently rewrites data
// when an attempt to write results in the underlying socket becoming
« no previous file with comments | « net/quic/quic_one_block_arena_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698