| 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_ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 struct HttpRequestInfo; | 23 struct HttpRequestInfo; |
| 24 class HttpRequestHeaders; | 24 class HttpRequestHeaders; |
| 25 class HttpStreamParser; | 25 class HttpStreamParser; |
| 26 class IOBuffer; | 26 class IOBuffer; |
| 27 | 27 |
| 28 class HttpBasicStream : public HttpStream { | 28 class HttpBasicStream : public HttpStream { |
| 29 public: | 29 public: |
| 30 // Constructs a new HttpBasicStream. InitializeStream must be called to | 30 // Constructs a new HttpBasicStream. InitializeStream must be called to |
| 31 // initialize it correctly. | 31 // initialize it correctly. |
| 32 HttpBasicStream(ClientSocketHandle* connection, bool using_proxy); | 32 HttpBasicStream(ClientSocketHandle* connection, bool using_proxy); |
| 33 virtual ~HttpBasicStream(); | 33 ~HttpBasicStream() override; |
| 34 | 34 |
| 35 // HttpStream methods: | 35 // HttpStream methods: |
| 36 virtual int InitializeStream(const HttpRequestInfo* request_info, | 36 int InitializeStream(const HttpRequestInfo* request_info, |
| 37 RequestPriority priority, | 37 RequestPriority priority, |
| 38 const BoundNetLog& net_log, | 38 const BoundNetLog& net_log, |
| 39 const CompletionCallback& callback) override; | 39 const CompletionCallback& callback) override; |
| 40 | 40 |
| 41 virtual int SendRequest(const HttpRequestHeaders& headers, | 41 int SendRequest(const HttpRequestHeaders& headers, |
| 42 HttpResponseInfo* response, | 42 HttpResponseInfo* response, |
| 43 const CompletionCallback& callback) override; | 43 const CompletionCallback& callback) override; |
| 44 | 44 |
| 45 virtual UploadProgress GetUploadProgress() const override; | 45 UploadProgress GetUploadProgress() const override; |
| 46 | 46 |
| 47 virtual int ReadResponseHeaders(const CompletionCallback& callback) override; | 47 int ReadResponseHeaders(const CompletionCallback& callback) override; |
| 48 | 48 |
| 49 virtual int ReadResponseBody(IOBuffer* buf, | 49 int ReadResponseBody(IOBuffer* buf, |
| 50 int buf_len, | 50 int buf_len, |
| 51 const CompletionCallback& callback) override; | 51 const CompletionCallback& callback) override; |
| 52 | 52 |
| 53 virtual void Close(bool not_reusable) override; | 53 void Close(bool not_reusable) override; |
| 54 | 54 |
| 55 virtual HttpStream* RenewStreamForAuth() override; | 55 HttpStream* RenewStreamForAuth() override; |
| 56 | 56 |
| 57 virtual bool IsResponseBodyComplete() const override; | 57 bool IsResponseBodyComplete() const override; |
| 58 | 58 |
| 59 virtual bool CanFindEndOfResponse() const override; | 59 bool CanFindEndOfResponse() const override; |
| 60 | 60 |
| 61 virtual bool IsConnectionReused() const override; | 61 bool IsConnectionReused() const override; |
| 62 | 62 |
| 63 virtual void SetConnectionReused() override; | 63 void SetConnectionReused() override; |
| 64 | 64 |
| 65 virtual bool IsConnectionReusable() const override; | 65 bool IsConnectionReusable() const override; |
| 66 | 66 |
| 67 virtual int64 GetTotalReceivedBytes() const override; | 67 int64 GetTotalReceivedBytes() const override; |
| 68 | 68 |
| 69 virtual bool GetLoadTimingInfo( | 69 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
| 70 LoadTimingInfo* load_timing_info) const override; | |
| 71 | 70 |
| 72 virtual void GetSSLInfo(SSLInfo* ssl_info) override; | 71 void GetSSLInfo(SSLInfo* ssl_info) override; |
| 73 | 72 |
| 74 virtual void GetSSLCertRequestInfo( | 73 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override; |
| 75 SSLCertRequestInfo* cert_request_info) override; | |
| 76 | 74 |
| 77 virtual bool IsSpdyHttpStream() const override; | 75 bool IsSpdyHttpStream() const override; |
| 78 | 76 |
| 79 virtual void Drain(HttpNetworkSession* session) override; | 77 void Drain(HttpNetworkSession* session) override; |
| 80 | 78 |
| 81 virtual void SetPriority(RequestPriority priority) override; | 79 void SetPriority(RequestPriority priority) override; |
| 82 | 80 |
| 83 private: | 81 private: |
| 84 HttpStreamParser* parser() const { return state_.parser(); } | 82 HttpStreamParser* parser() const { return state_.parser(); } |
| 85 | 83 |
| 86 HttpBasicState state_; | 84 HttpBasicState state_; |
| 87 | 85 |
| 88 DISALLOW_COPY_AND_ASSIGN(HttpBasicStream); | 86 DISALLOW_COPY_AND_ASSIGN(HttpBasicStream); |
| 89 }; | 87 }; |
| 90 | 88 |
| 91 } // namespace net | 89 } // namespace net |
| 92 | 90 |
| 93 #endif // NET_HTTP_HTTP_BASIC_STREAM_H_ | 91 #endif // NET_HTTP_HTTP_BASIC_STREAM_H_ |
| OLD | NEW |