OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // HttpPipelinedStream is the pipelined implementation of HttpStream. It has |
| 6 // very little code in it. Instead, it serves as the client's interface to the |
| 7 // pipelined connection, where all the work happens. |
| 8 // |
| 9 // In the case of pipelining failures, these functions may return |
| 10 // ERR_PIPELINE_EVICTION. In that case, the client should retry the HTTP |
| 11 // request without pipelining. |
| 12 |
| 13 #ifndef NET_HTTP_HTTP_PIPELINED_STREAM_H_ |
| 14 #define NET_HTTP_HTTP_PIPELINED_STREAM_H_ |
| 15 #pragma once |
| 16 |
| 17 #include <string> |
| 18 |
| 19 #include "base/basictypes.h" |
| 20 #include "base/memory/scoped_ptr.h" |
| 21 #include "net/http/http_stream.h" |
| 22 |
| 23 namespace net { |
| 24 |
| 25 class BoundNetLog; |
| 26 class HttpPipelinedConnection; |
| 27 class HttpResponseInfo; |
| 28 struct HttpRequestInfo; |
| 29 class HttpRequestHeaders; |
| 30 class HttpStreamParser; |
| 31 class IOBuffer; |
| 32 class UploadDataStream; |
| 33 |
| 34 class HttpPipelinedStream : public HttpStream { |
| 35 public: |
| 36 HttpPipelinedStream(HttpPipelinedConnection* pipeline); |
| 37 virtual ~HttpPipelinedStream(); |
| 38 |
| 39 // HttpStream methods: |
| 40 virtual int InitializeStream(const HttpRequestInfo* request_info, |
| 41 const BoundNetLog& net_log, |
| 42 CompletionCallback* callback); |
| 43 |
| 44 virtual int SendRequest(const HttpRequestHeaders& headers, |
| 45 UploadDataStream* request_body, |
| 46 HttpResponseInfo* response, |
| 47 CompletionCallback* callback); |
| 48 |
| 49 virtual uint64 GetUploadProgress() const; |
| 50 |
| 51 virtual int ReadResponseHeaders(CompletionCallback* callback); |
| 52 |
| 53 virtual const HttpResponseInfo* GetResponseInfo() const; |
| 54 |
| 55 virtual int ReadResponseBody(IOBuffer* buf, int buf_len, |
| 56 CompletionCallback* callback); |
| 57 |
| 58 virtual void Close(bool not_reusable); |
| 59 |
| 60 virtual HttpStream* RenewStreamForAuth(); |
| 61 |
| 62 virtual bool IsResponseBodyComplete() const; |
| 63 |
| 64 virtual bool CanFindEndOfResponse() const; |
| 65 |
| 66 virtual bool IsMoreDataBuffered() const; |
| 67 |
| 68 virtual bool IsConnectionReused() const; |
| 69 |
| 70 virtual void SetConnectionReused(); |
| 71 |
| 72 virtual bool IsConnectionReusable() const; |
| 73 |
| 74 virtual void GetSSLInfo(SSLInfo* ssl_info); |
| 75 |
| 76 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 77 |
| 78 virtual bool IsSpdyHttpStream() const; |
| 79 |
| 80 virtual void LogNumRttVsBytesMetrics() const; |
| 81 |
| 82 private: |
| 83 HttpPipelinedConnection* pipeline_; |
| 84 |
| 85 int pipeline_id_; |
| 86 |
| 87 const HttpRequestInfo* request_info_; |
| 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedStream); |
| 90 }; |
| 91 |
| 92 } // namespace net |
| 93 |
| 94 #endif // NET_HTTP_HTTP_PIPELINED_STREAM_H_ |
OLD | NEW |