1 // Copyright 2013 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.
5 #ifndef NET_HTTP_PROXY_CONNECT_REDIRECT_HTTP_STREAM_H_
6 #define NET_HTTP_PROXY_CONNECT_REDIRECT_HTTP_STREAM_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/load_timing_info.h"
11 #include "net/http/http_stream.h"
15 // A dummy HttpStream with no body used when a redirect is returned
17 class ProxyConnectRedirectHttpStream : public HttpStream {
19 // |load_timing_info| is the info that should be returned by
20 // GetLoadTimingInfo(), or NULL if there is none. Does not take
21 // ownership of |load_timing_info|.
22 explicit ProxyConnectRedirectHttpStream(LoadTimingInfo* load_timing_info);
23 ~ProxyConnectRedirectHttpStream() override;
25 // All functions below are expected not to be called except for the
28 int InitializeStream(const HttpRequestInfo* request_info,
29 RequestPriority priority,
30 const BoundNetLog& net_log,
31 const CompletionCallback& callback) override;
32 int SendRequest(const HttpRequestHeaders& request_headers,
33 HttpResponseInfo* response,
34 const CompletionCallback& callback) override;
35 int ReadResponseHeaders(const CompletionCallback& callback) override;
36 int ReadResponseBody(IOBuffer* buf,
38 const CompletionCallback& callback) override;
40 // This function may be called.
41 void Close(bool not_reusable) override;
43 bool IsResponseBodyComplete() const override;
45 // This function may be called.
46 bool CanFindEndOfResponse() const override;
48 bool IsConnectionReused() const override;
49 void SetConnectionReused() override;
50 bool IsConnectionReusable() const override;
52 int64 GetTotalReceivedBytes() const override;
54 // This function may be called.
55 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
57 void GetSSLInfo(SSLInfo* ssl_info) override;
58 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
59 bool IsSpdyHttpStream() const override;
60 void Drain(HttpNetworkSession* session) override;
62 // This function may be called.
63 void SetPriority(RequestPriority priority) override;
65 UploadProgress GetUploadProgress() const override;
66 HttpStream* RenewStreamForAuth() override;
69 bool has_load_timing_info_;
70 LoadTimingInfo load_timing_info_;
75 #endif // NET_HTTP_PROXY_CONNECT_REDIRECT_HTTP_STREAM_H_