OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |