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