diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 17:53:22 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 17:53:22 +0000 |
commit | 0c9bf87fe0b87849105fc7a2ea16280e48ee9089 (patch) | |
tree | 8858b7c1f6c1071b2a0f93a92c72f08dcb0ad96d /net/spdy/spdy_stream.h | |
parent | 27030d8d5d54002e1baaf19fefd909ebfb82de40 (diff) | |
download | chromium_src-0c9bf87fe0b87849105fc7a2ea16280e48ee9089.zip chromium_src-0c9bf87fe0b87849105fc7a2ea16280e48ee9089.tar.gz chromium_src-0c9bf87fe0b87849105fc7a2ea16280e48ee9089.tar.bz2 |
Add chunked uploads support to SPDY
As part of this, I had to move the chunked encoding part from UploadData::Element::SetChunk
to HttpStreamParser::DoSendBody as SPDY doesn't have this encoded format and UploadData
needs to serve both.
BUG=none
TEST=net_unittests (2 new tests added)
Committed and rolled back: http://src.chromium.org/viewvc/chrome?view=rev&revision=76892
Review URL: http://codereview.chromium.org/6292013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76930 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_stream.h')
-rw-r--r-- | net/spdy/spdy_stream.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h index 9a055c2..6d6b09c 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, |