Adds a Http2VisitorInterface method for when the library wants to send serialized frame data to the peer.
This replaces Http2Adapter's GetBytesToWrite(), and will make compatibility with existing usage a little easier.
PiperOrigin-RevId: 375197346
diff --git a/http2/adapter/http2_visitor_interface.h b/http2/adapter/http2_visitor_interface.h
index 12729e7..a7e34e9 100644
--- a/http2/adapter/http2_visitor_interface.h
+++ b/http2/adapter/http2_visitor_interface.h
@@ -50,6 +50,11 @@
Http2VisitorInterface& operator=(const Http2VisitorInterface&) = delete;
virtual ~Http2VisitorInterface() = default;
+ // Called when there are serialized frames to send. Should return how many
+ // bytes were actually sent. Returning 0 indicates that sending is blocked.
+ // Returning -1 indicates an error.
+ virtual ssize_t OnReadyToSend(absl::string_view serialized) = 0;
+
// Called when a connection-level processing error has been encountered.
virtual void OnConnectionError() = 0;