From c638a85ae6661dde9397c17fb17c2d48eb2fe147 Mon Sep 17 00:00:00 2001 From: "rch@chromium.org" Date: Thu, 29 Jul 2010 18:41:40 +0000 Subject: 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 --- net/http/http_stream.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'net/http/http_stream.h') 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 -- cgit v1.1