diff options
Diffstat (limited to 'chromium/net/quic/quartc/quartc_stream_interface.h')
-rw-r--r-- | chromium/net/quic/quartc/quartc_stream_interface.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/chromium/net/quic/quartc/quartc_stream_interface.h b/chromium/net/quic/quartc/quartc_stream_interface.h index 304190aa662..cae57f69c44 100644 --- a/chromium/net/quic/quartc/quartc_stream_interface.h +++ b/chromium/net/quic/quartc/quartc_stream_interface.h @@ -9,6 +9,7 @@ #include <stdint.h> #include "net/quic/platform/api/quic_export.h" +#include "net/quic/platform/api/quic_mem_slice_span.h" namespace net { @@ -23,8 +24,8 @@ class QUIC_EXPORT_PRIVATE QuartcStreamInterface { // The QUIC stream ID. virtual uint32_t stream_id() = 0; - // The amount of data sent on this stream. - virtual uint64_t bytes_written() = 0; + // The amount of data buffered on this stream. + virtual uint64_t bytes_buffered() = 0; // Return true if the FIN has been sent. Used by the outgoing streams to // determine if all the data has been sent @@ -32,21 +33,16 @@ class QUIC_EXPORT_PRIVATE QuartcStreamInterface { virtual int stream_error() = 0; - virtual int connection_error() = 0; - struct WriteParameters { - WriteParameters() : fin(false) {} // |fin| is set to be true when there is no more data need to be send // through a particular stream. The receiving side will used it to determine // if the sender finish sending data. - bool fin; + bool fin = false; }; // Sends data reliably and in-order. Returns the amount sent. // Does not buffer data. - virtual void Write(const char* data, - size_t size, - const WriteParameters& param) = 0; + virtual void Write(QuicMemSliceSpan data, const WriteParameters& param) = 0; // Marks this stream as finished writing. Asynchronously sends a FIN and // closes the write-side. The stream will no longer call OnCanWrite(). @@ -83,8 +79,8 @@ class QUIC_EXPORT_PRIVATE QuartcStreamInterface { // error code. virtual void OnClose(QuartcStreamInterface* stream) = 0; - // Called when more data may be written to a stream. - virtual void OnCanWrite(QuartcStreamInterface* stream) = 0; + // Called when the contents of the stream's buffer changes. + virtual void OnBufferChanged(QuartcStreamInterface* stream) = 0; }; // The |delegate| is not owned by QuartcStream. |