| 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_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 <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // credentials should be added to the HttpAuthController before calling | 43 // credentials should be added to the HttpAuthController before calling |
| 44 // RestartWithAuth. Not all ProxyClientSocket implementations will be | 44 // RestartWithAuth. Not all ProxyClientSocket implementations will be |
| 45 // restartable. Such implementations should disconnect themselves and | 45 // restartable. Such implementations should disconnect themselves and |
| 46 // return OK. | 46 // return OK. |
| 47 virtual int RestartWithAuth(const CompletionCallback& callback) = 0; | 47 virtual int RestartWithAuth(const CompletionCallback& callback) = 0; |
| 48 | 48 |
| 49 // Returns true of the connection to the proxy is using SPDY. | 49 // Returns true of the connection to the proxy is using SPDY. |
| 50 virtual bool IsUsingSpdy() const = 0; | 50 virtual bool IsUsingSpdy() const = 0; |
| 51 | 51 |
| 52 // Returns the protocol negotiated with the proxy. | 52 // Returns the protocol negotiated with the proxy. |
| 53 virtual SSLClientSocket::NextProto GetProtocolNegotiated() const = 0; | 53 virtual NextProto GetProtocolNegotiated() const = 0; |
| 54 | 54 |
| 55 protected: | 55 protected: |
| 56 // The HTTP CONNECT method for establishing a tunnel connection is documented | 56 // The HTTP CONNECT method for establishing a tunnel connection is documented |
| 57 // in draft-luotonen-web-proxy-tunneling-01.txt and RFC 2817, Sections 5.2 | 57 // in draft-luotonen-web-proxy-tunneling-01.txt and RFC 2817, Sections 5.2 |
| 58 // and 5.3. | 58 // and 5.3. |
| 59 static void BuildTunnelRequest(const HttpRequestInfo& request_info, | 59 static void BuildTunnelRequest(const HttpRequestInfo& request_info, |
| 60 const HttpRequestHeaders& auth_headers, | 60 const HttpRequestHeaders& auth_headers, |
| 61 const HostPortPair& endpoint, | 61 const HostPortPair& endpoint, |
| 62 std::string* request_line, | 62 std::string* request_line, |
| 63 HttpRequestHeaders* request_headers); | 63 HttpRequestHeaders* request_headers); |
| 64 | 64 |
| 65 // When an auth challenge (407 response) is received during tunnel | 65 // When an auth challenge (407 response) is received during tunnel |
| 66 // construction/ this method should be called. | 66 // construction/ this method should be called. |
| 67 static int HandleProxyAuthChallenge(HttpAuthController* auth, | 67 static int HandleProxyAuthChallenge(HttpAuthController* auth, |
| 68 HttpResponseInfo* response, | 68 HttpResponseInfo* response, |
| 69 const BoundNetLog& net_log); | 69 const BoundNetLog& net_log); |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 DISALLOW_COPY_AND_ASSIGN(ProxyClientSocket); | 72 DISALLOW_COPY_AND_ASSIGN(ProxyClientSocket); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace net | 75 } // namespace net |
| 76 | 76 |
| 77 #endif // NET_HTTP_PROXY_CLIENT_SOCKET_H_ | 77 #endif // NET_HTTP_PROXY_CLIENT_SOCKET_H_ |
| OLD | NEW |