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

Side by Side Diff: net/http/http_stream_parser.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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_ 5 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_
6 #define NET_HTTP_HTTP_STREAM_PARSER_H_ 6 #define NET_HTTP_HTTP_STREAM_PARSER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 11 matching lines...) Expand all
22 struct HttpRequestInfo; 22 struct HttpRequestInfo;
23 23
24 class HttpStreamParser { 24 class HttpStreamParser {
25 public: 25 public:
26 // Any data in |read_buffer| will be used before reading from the socket 26 // Any data in |read_buffer| will be used before reading from the socket
27 // and any data left over after parsing the stream will be put into 27 // and any data left over after parsing the stream will be put into
28 // |read_buffer|. The left over data will start at offset 0 and the 28 // |read_buffer|. The left over data will start at offset 0 and the
29 // buffer's offset will be set to the first free byte. |read_buffer| may 29 // buffer's offset will be set to the first free byte. |read_buffer| may
30 // have its capacity changed. 30 // have its capacity changed.
31 HttpStreamParser(ClientSocketHandle* connection, 31 HttpStreamParser(ClientSocketHandle* connection,
32 const HttpRequestInfo* request,
32 GrowableIOBuffer* read_buffer, 33 GrowableIOBuffer* read_buffer,
33 const BoundNetLog& net_log); 34 const BoundNetLog& net_log);
34 ~HttpStreamParser(); 35 ~HttpStreamParser();
35 36
36 // These functions implement the interface described in HttpStream with 37 // These functions implement the interface described in HttpStream with
37 // some additional functionality 38 // some additional functionality
38 int SendRequest(const HttpRequestInfo* request, const std::string& headers, 39 int SendRequest(const std::string& headers, UploadDataStream* request_body,
39 UploadDataStream* request_body, HttpResponseInfo* response, 40 HttpResponseInfo* response, CompletionCallback* callback);
40 CompletionCallback* callback);
41 41
42 int ReadResponseHeaders(CompletionCallback* callback); 42 int ReadResponseHeaders(CompletionCallback* callback);
43 43
44 int ReadResponseBody(IOBuffer* buf, int buf_len, 44 int ReadResponseBody(IOBuffer* buf, int buf_len,
45 CompletionCallback* callback); 45 CompletionCallback* callback);
46 46
47 uint64 GetUploadProgress() const; 47 uint64 GetUploadProgress() const;
48 48
49 HttpResponseInfo* GetResponseInfo(); 49 HttpResponseInfo* GetResponseInfo();
50 50
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 // Callback to be used when doing IO. 168 // Callback to be used when doing IO.
169 CompletionCallbackImpl<HttpStreamParser> io_callback_; 169 CompletionCallbackImpl<HttpStreamParser> io_callback_;
170 170
171 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); 171 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser);
172 }; 172 };
173 173
174 } // namespace net 174 } // namespace net
175 175
176 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ 176 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698