Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Unified Diff: net/http/http_stream.h

Issue 3079002: Refactor SpdyHttpStream to implement HttpStream. Required adding a new... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/http/http_stream.h
===================================================================
--- net/http/http_stream.h (revision 53864)
+++ net/http/http_stream.h (working copy)
@@ -22,19 +22,25 @@
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 @@
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

Powered by Google App Engine
This is Rietveld 408576698