Index: net/spdy/spdy_stream.h |
diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h |
index 9a055c2ab9e3cf30365770e99ec1c0a0c47fbaa7..6d6b09c57a69653036637a2ccdb0c412a25bc9dd 100644 |
--- a/net/spdy/spdy_stream.h |
+++ b/net/spdy/spdy_stream.h |
@@ -16,6 +16,7 @@ |
#include "googleurl/src/gurl.h" |
#include "net/base/bandwidth_metrics.h" |
#include "net/base/io_buffer.h" |
+#include "net/base/upload_data.h" |
#include "net/base/net_log.h" |
#include "net/spdy/spdy_framer.h" |
#include "net/spdy/spdy_protocol.h" |
@@ -34,7 +35,9 @@ class SSLInfo; |
// a SpdyNetworkTransaction) will maintain a reference to the stream. When |
// initiated by the server, only the SpdySession will maintain any reference, |
// until such a time as a client object requests a stream for the path. |
-class SpdyStream : public base::RefCounted<SpdyStream> { |
+class SpdyStream |
+ : public base::RefCounted<SpdyStream>, |
+ public ChunkCallback { |
public: |
// Delegate handles protocol specific behavior of spdy stream. |
class Delegate { |
@@ -50,9 +53,10 @@ class SpdyStream : public base::RefCounted<SpdyStream> { |
virtual int OnSendBody() = 0; |
// Called when data has been sent. |status| indicates network error |
- // or number of bytes has been sent. |
- // Returns true if no more data to be sent. |
- virtual bool OnSendBodyComplete(int status) = 0; |
+ // or number of bytes that has been sent. On return, |eof| is set to true |
+ // if no more data is available to send in the request body. |
+ // Returns network error code. OK when it successfully sent data. |
+ virtual int OnSendBodyComplete(int status, bool* eof) = 0; |
// Called when the SYN_STREAM, SYN_REPLY, or HEADERS frames are received. |
// Normal streams will receive a SYN_REPLY and optional HEADERS frames. |
@@ -73,6 +77,9 @@ class SpdyStream : public base::RefCounted<SpdyStream> { |
// Called when SpdyStream is closed. |
virtual void OnClose(int status) = 0; |
+ // Sets the callback to be invoked when a new chunk is available to upload. |
+ virtual void set_chunk_callback(ChunkCallback* callback) = 0; |
+ |
protected: |
friend class base::RefCounted<Delegate>; |
virtual ~Delegate() {} |
@@ -222,6 +229,9 @@ class SpdyStream : public base::RefCounted<SpdyStream> { |
// true. |
GURL GetUrl() const; |
+ // ChunkCallback methods. |
+ virtual void OnChunkAvailable(); |
+ |
private: |
enum State { |
STATE_NONE, |