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

Unified Diff: net/tools/quic/quic_simple_server_packet_writer.h

Issue 2180003004: Remove inability to call QuicSimpleServerPacketWriter::WritePacket directly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | net/tools/quic/quic_simple_server_packet_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_simple_server_packet_writer.h
diff --git a/net/tools/quic/quic_simple_server_packet_writer.h b/net/tools/quic/quic_simple_server_packet_writer.h
index 3a6b562d63976871e1c46934f965e61f3f1b473a..598e35f96f496121f69412cba8f002129fc350c7 100644
--- a/net/tools/quic/quic_simple_server_packet_writer.h
+++ b/net/tools/quic/quic_simple_server_packet_writer.h
@@ -33,15 +33,19 @@ class QuicSimpleServerPacketWriter : public QuicPacketWriter {
QuicBlockedWriterInterface* blocked_writer);
~QuicSimpleServerPacketWriter() override;
- // Use this method to write packets rather than WritePacket:
- // QuicSimpleServerPacketWriter requires a callback to exist for every
- // write, which will be called once the write completes.
- virtual WriteResult WritePacketWithCallback(const char* buffer,
- size_t buf_len,
- const IPAddress& self_address,
- const IPEndPoint& peer_address,
- PerPacketOptions* options,
- WriteCallback callback);
+ // Wraps WritePacket, and ensures that |callback| is run on successful write.
+ WriteResult WritePacketWithCallback(const char* buffer,
+ size_t buf_len,
+ const IPAddress& self_address,
+ const IPEndPoint& peer_address,
+ PerPacketOptions* options,
+ WriteCallback callback);
+
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddress& self_address,
+ const IPEndPoint& peer_address,
+ PerPacketOptions* options) override;
void OnWriteComplete(int rv);
@@ -51,14 +55,6 @@ class QuicSimpleServerPacketWriter : public QuicPacketWriter {
void SetWritable() override;
QuicByteCount GetMaxPacketSize(const IPEndPoint& peer_address) const override;
- protected:
- // Do not call WritePacket on its own -- use WritePacketWithCallback
- WriteResult WritePacket(const char* buffer,
- size_t buf_len,
- const IPAddress& self_address,
- const IPEndPoint& peer_address,
- PerPacketOptions* options) override;
-
private:
UDPServerSocket* socket_;
« no previous file with comments | « no previous file | net/tools/quic/quic_simple_server_packet_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698