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

Unified Diff: net/quic/chromium/quic_chromium_packet_writer.h

Issue 2319343004: Makes migration on write error asynchronous to avoid reentrancy issues (Closed)
Patch Set: synced and rebased Created 4 years, 3 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/chromium/quic_chromium_packet_writer.h
diff --git a/net/quic/chromium/quic_chromium_packet_writer.h b/net/quic/chromium/quic_chromium_packet_writer.h
index 72b25adb9004ae305a5c8a78a616a500f1fa2920..c6b2f72c1981b7110dcef87d39e377078efbb70f 100644
--- a/net/quic/chromium/quic_chromium_packet_writer.h
+++ b/net/quic/chromium/quic_chromium_packet_writer.h
@@ -32,8 +32,10 @@ class NET_EXPORT_PRIVATE QuicChromiumPacketWriter : public QuicPacketWriter {
// |error_code| otherwise.
virtual int HandleWriteError(int error_code,
scoped_refptr<StringIOBuffer> last_packet) = 0;
+
// Called to propagate the final write error to the delegate.
virtual void OnWriteError(int error_code) = 0;
+
// Called when the writer is unblocked due to a write completion.
virtual void OnWriteUnblocked() = 0;
};
@@ -46,8 +48,10 @@ class NET_EXPORT_PRIVATE QuicChromiumPacketWriter : public QuicPacketWriter {
// |delegate| must outlive writer.
void set_delegate(Delegate* delegate) { delegate_ = delegate; }
+ void set_write_blocked(bool write_blocked) { write_blocked_ = write_blocked; }
+
// Writes |packet| to the socket and returns the error code from the write.
- int WritePacketToSocket(StringIOBuffer* packet);
+ WriteResult WritePacketToSocket(scoped_refptr<StringIOBuffer> packet);
// QuicPacketWriter
WriteResult WritePacket(const char* buffer,
@@ -62,9 +66,6 @@ class NET_EXPORT_PRIVATE QuicChromiumPacketWriter : public QuicPacketWriter {
void OnWriteComplete(int rv);
- protected:
- void set_write_blocked(bool is_blocked) { write_blocked_ = is_blocked; }
-
private:
Socket* socket_; // Unowned.
Delegate* delegate_; // Unowned.
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session_test.cc ('k') | net/quic/chromium/quic_chromium_packet_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698