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 #ifndef NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_H_ | 5 #ifndef NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_H_ |
6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_H_ | 6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace net { | 25 namespace net { |
26 | 26 |
27 class AddressList; | 27 class AddressList; |
28 class ClientSocketHandle; | 28 class ClientSocketHandle; |
29 class GrowableIOBuffer; | 29 class GrowableIOBuffer; |
30 class HttpAuthCache; | 30 class HttpAuthCache; |
31 class HttpStream; | 31 class HttpStream; |
32 class HttpStreamParser; | 32 class HttpStreamParser; |
33 class IOBuffer; | 33 class IOBuffer; |
| 34 class ProxyDelegate; |
34 | 35 |
35 class HttpProxyClientSocket : public ProxyClientSocket { | 36 class HttpProxyClientSocket : public ProxyClientSocket { |
36 public: | 37 public: |
37 // Takes ownership of |transport_socket|, which should already be connected | 38 // Takes ownership of |transport_socket|, which should already be connected |
38 // by the time Connect() is called. If tunnel is true then on Connect() | 39 // by the time Connect() is called. If tunnel is true then on Connect() |
39 // this socket will establish an Http tunnel. | 40 // this socket will establish an Http tunnel. |
40 HttpProxyClientSocket(ClientSocketHandle* transport_socket, | 41 HttpProxyClientSocket(ClientSocketHandle* transport_socket, |
41 const GURL& request_url, | 42 const GURL& request_url, |
42 const std::string& user_agent, | 43 const std::string& user_agent, |
43 const HostPortPair& endpoint, | 44 const HostPortPair& endpoint, |
44 const HostPortPair& proxy_server, | 45 const HostPortPair& proxy_server, |
45 HttpAuthCache* http_auth_cache, | 46 HttpAuthCache* http_auth_cache, |
46 HttpAuthHandlerFactory* http_auth_handler_factory, | 47 HttpAuthHandlerFactory* http_auth_handler_factory, |
47 bool tunnel, | 48 bool tunnel, |
48 bool using_spdy, | 49 bool using_spdy, |
49 NextProto protocol_negotiated, | 50 NextProto protocol_negotiated, |
| 51 ProxyDelegate* proxy_delegate, |
50 bool is_https_proxy); | 52 bool is_https_proxy); |
51 | 53 |
52 // On destruction Disconnect() is called. | 54 // On destruction Disconnect() is called. |
53 virtual ~HttpProxyClientSocket(); | 55 virtual ~HttpProxyClientSocket(); |
54 | 56 |
55 // ProxyClientSocket implementation. | 57 // ProxyClientSocket implementation. |
56 virtual const HttpResponseInfo* GetConnectResponseInfo() const OVERRIDE; | 58 virtual const HttpResponseInfo* GetConnectResponseInfo() const OVERRIDE; |
57 virtual HttpStream* CreateConnectResponseStream() OVERRIDE; | 59 virtual HttpStream* CreateConnectResponseStream() OVERRIDE; |
58 virtual int RestartWithAuth(const CompletionCallback& callback) OVERRIDE; | 60 virtual int RestartWithAuth(const CompletionCallback& callback) OVERRIDE; |
59 virtual const scoped_refptr<HttpAuthController>& GetAuthController() const | 61 virtual const scoped_refptr<HttpAuthController>& GetAuthController() const |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // If true, then SSL is used to communicate with this proxy | 158 // If true, then SSL is used to communicate with this proxy |
157 const bool is_https_proxy_; | 159 const bool is_https_proxy_; |
158 | 160 |
159 std::string request_line_; | 161 std::string request_line_; |
160 HttpRequestHeaders request_headers_; | 162 HttpRequestHeaders request_headers_; |
161 | 163 |
162 // Used only for redirects. | 164 // Used only for redirects. |
163 bool redirect_has_load_timing_info_; | 165 bool redirect_has_load_timing_info_; |
164 LoadTimingInfo redirect_load_timing_info_; | 166 LoadTimingInfo redirect_load_timing_info_; |
165 | 167 |
| 168 const HostPortPair proxy_server_; |
| 169 |
| 170 // This delegate must outlive this proxy client socket. |
| 171 ProxyDelegate* proxy_delegate_; |
| 172 |
166 const BoundNetLog net_log_; | 173 const BoundNetLog net_log_; |
167 | 174 |
168 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocket); | 175 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocket); |
169 }; | 176 }; |
170 | 177 |
171 } // namespace net | 178 } // namespace net |
172 | 179 |
173 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_H_ | 180 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_H_ |
OLD | NEW |