Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_PROXY_CLIENT_SOCKET_H_ | 5 #ifndef NET_HTTP_PROXY_CLIENT_SOCKET_H_ |
| 6 #define NET_HTTP_PROXY_CLIENT_SOCKET_H_ | 6 #define NET_HTTP_PROXY_CLIENT_SOCKET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "net/socket/stream_socket.h" | 9 #include "net/socket/stream_socket.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 class HttpStream; | 13 class HttpStream; |
| 14 class HttpResponseInfo; | 14 class HttpResponseInfo; |
| 15 class HttpAuthController; | |
| 15 | 16 |
| 16 class NET_EXPORT_PRIVATE ProxyClientSocket : public StreamSocket { | 17 class NET_EXPORT_PRIVATE ProxyClientSocket : public StreamSocket { |
| 17 public: | 18 public: |
| 18 ProxyClientSocket() {} | 19 ProxyClientSocket() {} |
| 19 virtual ~ProxyClientSocket() {} | 20 virtual ~ProxyClientSocket() {} |
| 20 | 21 |
| 21 // Returns the HttpResponseInfo (including HTTP Headers) from | 22 // Returns the HttpResponseInfo (including HTTP Headers) from |
| 22 // the response to the CONNECT request. | 23 // the response to the CONNECT request. |
| 23 virtual const HttpResponseInfo* GetConnectResponseInfo() const = 0; | 24 virtual const HttpResponseInfo* GetConnectResponseInfo() const = 0; |
| 24 | 25 |
| 25 // Transfers ownership of a newly created HttpStream to the caller | 26 // Transfers ownership of a newly created HttpStream to the caller |
| 26 // which can be used to read the response body. | 27 // which can be used to read the response body. |
| 27 virtual HttpStream* CreateConnectResponseStream() = 0; | 28 virtual HttpStream* CreateConnectResponseStream() = 0; |
| 28 | 29 |
| 30 // Returns the HttpAuthController which can be used | |
| 31 // to interact with an HTTP Proxy Authorization Required (407) request. | |
| 32 virtual const scoped_refptr<HttpAuthController>& auth_controller() = 0; | |
|
cbentzel
2012/01/20 02:09:46
Nit: Should be named GetAuthController. auth_contr
Ryan Hamilton
2012/01/20 04:20:04
Done.
| |
| 33 | |
| 34 // If Connect (or its callback) returns PROXY_AUTH_REQUESTED, then | |
| 35 // credentials should be added to the HttpAuthController before calling | |
| 36 // RestartWithAuth. | |
| 37 virtual int RestartWithAuth(const CompletionCallback& callback) = 0; | |
| 38 | |
| 29 private: | 39 private: |
| 30 DISALLOW_COPY_AND_ASSIGN(ProxyClientSocket); | 40 DISALLOW_COPY_AND_ASSIGN(ProxyClientSocket); |
| 31 }; | 41 }; |
| 32 | 42 |
| 33 } // namespace net | 43 } // namespace net |
| 34 | 44 |
| 35 #endif // NET_HTTP_PROXY_CLIENT_SOCKET_H_ | 45 #endif // NET_HTTP_PROXY_CLIENT_SOCKET_H_ |
| OLD | NEW |