summaryrefslogtreecommitdiffstats
path: root/net/http/http_stream.h
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 18:41:40 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 18:41:40 +0000
commitc638a85ae6661dde9397c17fb17c2d48eb2fe147 (patch)
tree11157aa6f25057a265cf2c3c91f7d724fbd782f3 /net/http/http_stream.h
parent524ff896f45f1a36409d32ac024a6db343d3c685 (diff)
downloadchromium_src-c638a85ae6661dde9397c17fb17c2d48eb2fe147.zip
chromium_src-c638a85ae6661dde9397c17fb17c2d48eb2fe147.tar.gz
chromium_src-c638a85ae6661dde9397c17fb17c2d48eb2fe147.tar.bz2
I've refactored HttpStream, SpdyHttpStream and HttpBasicStream so that
SpdyHttpStream now implements (a slightly wider) HttpStream interface. BUG=50268 TEST=none Review URL: http://codereview.chromium.org/3079002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_stream.h')
-rw-r--r--net/http/http_stream.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/http/http_stream.h b/net/http/http_stream.h
index e3fbeb3..2cdbc39 100644
--- a/net/http/http_stream.h
+++ b/net/http/http_stream.h
@@ -22,19 +22,25 @@ struct HttpRequestInfo;
class HttpResponseInfo;
class IOBuffer;
class UploadDataStream;
+class BoundNetLog;
class HttpStream {
public:
HttpStream() {}
virtual ~HttpStream() {}
+ // Initialize stream. Must be called before calling SendRequest().
+ // Returns a net error code, possibly ERR_IO_PENDING.
+ virtual int InitializeStream(const HttpRequestInfo* request_info,
+ const BoundNetLog& net_log,
+ CompletionCallback* callback) = 0;
+
// Writes the headers and uploads body data to the underlying socket.
// ERR_IO_PENDING is returned if the operation could not be completed
// synchronously, in which case the result will be passed to the callback
// when available. Returns OK on success. The HttpStream takes ownership
// of the request_body.
- virtual int SendRequest(const HttpRequestInfo* request,
- const std::string& request_headers,
+ virtual int SendRequest(const std::string& request_headers,
UploadDataStream* request_body,
HttpResponseInfo* response,
CompletionCallback* callback) = 0;
@@ -50,7 +56,7 @@ class HttpStream {
virtual int ReadResponseHeaders(CompletionCallback* callback) = 0;
// Provides access to HttpResponseInfo (owned by HttpStream).
- virtual HttpResponseInfo* GetResponseInfo() const = 0;
+ virtual const HttpResponseInfo* GetResponseInfo() const = 0;
// Reads response body data, up to |buf_len| bytes. |buf_len| should be a
// reasonable size (<2MB). The number of bytes read is returned, or an