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

Unified Diff: net/http/http_basic_stream.h

Issue 249031: Refactor HttpNetworkTransaction: Parse stream in HttpStream (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « no previous file | net/http/http_basic_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_basic_stream.h
===================================================================
--- net/http/http_basic_stream.h (revision 29289)
+++ net/http/http_basic_stream.h (working copy)
@@ -9,33 +9,51 @@
#ifndef NET_HTTP_HTTP_BASIC_STREAM_H_
#define NET_HTTP_HTTP_BASIC_STREAM_H_
+#include <string>
+
#include "base/basictypes.h"
+#include "net/base/io_buffer.h"
#include "net/http/http_stream.h"
-#include "net/socket/client_socket_handle.h"
+#include "net/http/http_stream_parser.h"
namespace net {
+class ClientSocketHandle;
+class HttpRequestInfo;
+class HttpResponseInfo;
+class UploadDataStream;
+
class HttpBasicStream : public HttpStream {
public:
- explicit HttpBasicStream(ClientSocketHandle* handle) : handle_(handle) {}
+ explicit HttpBasicStream(ClientSocketHandle* handle);
virtual ~HttpBasicStream() {}
// HttpStream methods:
- virtual int Read(IOBuffer* buf,
- int buf_len,
- CompletionCallback* callback) {
- return handle_->socket()->Read(buf, buf_len, callback);
- }
+ virtual int SendRequest(const HttpRequestInfo* request,
+ const std::string& headers,
+ UploadDataStream* request_body,
+ CompletionCallback* callback);
- virtual int Write(IOBuffer* buf,
- int buf_len,
- CompletionCallback* callback) {
- return handle_->socket()->Write(buf, buf_len, callback);
- }
+ virtual uint64 GetUploadProgress() const;
+ virtual int ReadResponseHeaders(CompletionCallback* callback);
+
+ virtual HttpResponseInfo* GetResponseInfo() const;
+
+ virtual int ReadResponseBody(IOBuffer* buf, int buf_len,
+ CompletionCallback* callback);
+
+ virtual bool IsResponseBodyComplete() const;
+
+ virtual bool CanFindEndOfResponse() const;
+
+ virtual bool IsMoreDataBuffered() const;
+
private:
- ClientSocketHandle* const handle_;
+ scoped_refptr<GrowableIOBuffer> read_buf_;
+ scoped_ptr<HttpStreamParser> parser_;
+
DISALLOW_COPY_AND_ASSIGN(HttpBasicStream);
};
« no previous file with comments | « no previous file | net/http/http_basic_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698