| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // HttpBasicStream is a simple implementation of HttpStream. It assumes it is | 5 // HttpBasicStream is a simple implementation of HttpStream. It assumes it is |
| 6 // not sharing a sharing with any other HttpStreams, therefore it just reads and | 6 // not sharing a sharing with any other HttpStreams, therefore it just reads and |
| 7 // writes directly to the Http Stream. | 7 // writes directly to the Http Stream. |
| 8 | 8 |
| 9 #ifndef NET_HTTP_HTTP_BASIC_STREAM_H_ | 9 #ifndef NET_HTTP_HTTP_BASIC_STREAM_H_ |
| 10 #define NET_HTTP_HTTP_BASIC_STREAM_H_ | 10 #define NET_HTTP_HTTP_BASIC_STREAM_H_ |
| 11 | 11 |
| 12 #include <stdint.h> | 12 #include <stdint.h> |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
| 19 #include "net/http/http_basic_state.h" | 19 #include "net/http/http_basic_state.h" |
| 20 #include "net/http/http_stream.h" | 20 #include "net/http/http_stream.h" |
| 21 | 21 |
| 22 namespace net { | 22 namespace net { |
| 23 | 23 |
| 24 class BoundNetLog; | 24 class NetLogWithSource; |
| 25 class ClientSocketHandle; | 25 class ClientSocketHandle; |
| 26 class HttpResponseInfo; | 26 class HttpResponseInfo; |
| 27 struct HttpRequestInfo; | 27 struct HttpRequestInfo; |
| 28 class HttpRequestHeaders; | 28 class HttpRequestHeaders; |
| 29 class HttpStreamParser; | 29 class HttpStreamParser; |
| 30 class IOBuffer; | 30 class IOBuffer; |
| 31 | 31 |
| 32 class NET_EXPORT_PRIVATE HttpBasicStream : public HttpStream { | 32 class NET_EXPORT_PRIVATE HttpBasicStream : public HttpStream { |
| 33 public: | 33 public: |
| 34 // Constructs a new HttpBasicStream. InitializeStream must be called to | 34 // Constructs a new HttpBasicStream. InitializeStream must be called to |
| 35 // initialize it correctly. | 35 // initialize it correctly. |
| 36 HttpBasicStream(std::unique_ptr<ClientSocketHandle> connection, | 36 HttpBasicStream(std::unique_ptr<ClientSocketHandle> connection, |
| 37 bool using_proxy, | 37 bool using_proxy, |
| 38 bool http_09_on_non_default_ports_enabled); | 38 bool http_09_on_non_default_ports_enabled); |
| 39 ~HttpBasicStream() override; | 39 ~HttpBasicStream() override; |
| 40 | 40 |
| 41 // HttpStream methods: | 41 // HttpStream methods: |
| 42 int InitializeStream(const HttpRequestInfo* request_info, | 42 int InitializeStream(const HttpRequestInfo* request_info, |
| 43 RequestPriority priority, | 43 RequestPriority priority, |
| 44 const BoundNetLog& net_log, | 44 const NetLogWithSource& net_log, |
| 45 const CompletionCallback& callback) override; | 45 const CompletionCallback& callback) override; |
| 46 | 46 |
| 47 int SendRequest(const HttpRequestHeaders& headers, | 47 int SendRequest(const HttpRequestHeaders& headers, |
| 48 HttpResponseInfo* response, | 48 HttpResponseInfo* response, |
| 49 const CompletionCallback& callback) override; | 49 const CompletionCallback& callback) override; |
| 50 | 50 |
| 51 int ReadResponseHeaders(const CompletionCallback& callback) override; | 51 int ReadResponseHeaders(const CompletionCallback& callback) override; |
| 52 | 52 |
| 53 int ReadResponseBody(IOBuffer* buf, | 53 int ReadResponseBody(IOBuffer* buf, |
| 54 int buf_len, | 54 int buf_len, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 HttpStreamParser* parser() const { return state_.parser(); } | 92 HttpStreamParser* parser() const { return state_.parser(); } |
| 93 | 93 |
| 94 HttpBasicState state_; | 94 HttpBasicState state_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(HttpBasicStream); | 96 DISALLOW_COPY_AND_ASSIGN(HttpBasicStream); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace net | 99 } // namespace net |
| 100 | 100 |
| 101 #endif // NET_HTTP_HTTP_BASIC_STREAM_H_ | 101 #endif // NET_HTTP_HTTP_BASIC_STREAM_H_ |
| OLD | NEW |