summaryrefslogtreecommitdiffstats
path: root/net/http/proxy_client_socket.h
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-25 00:15:32 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-25 00:15:32 +0000
commitc0fe941d06a1a4f718c48c1fa6e5b8fb4406fa67 (patch)
tree1104d89c26f14d27f49ba05f091eddab3ae713d9 /net/http/proxy_client_socket.h
parentdea048aea15816f6d719a2fa723c7fdf441700c0 (diff)
downloadchromium_src-c0fe941d06a1a4f718c48c1fa6e5b8fb4406fa67.zip
chromium_src-c0fe941d06a1a4f718c48c1fa6e5b8fb4406fa67.tar.gz
chromium_src-c0fe941d06a1a4f718c48c1fa6e5b8fb4406fa67.tar.bz2
Minor refactor of ProxyClientSocket.
Adds GetAuthController and RestartWithAuth from Http/Spdy ProxyClientSocket. BUG=115659 Review URL: http://codereview.chromium.org/9442020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/proxy_client_socket.h')
-rw-r--r--net/http/proxy_client_socket.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/net/http/proxy_client_socket.h b/net/http/proxy_client_socket.h
index 451e098..f22dcbe 100644
--- a/net/http/proxy_client_socket.h
+++ b/net/http/proxy_client_socket.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,12 +6,20 @@
#define NET_HTTP_PROXY_CLIENT_SOCKET_H_
#pragma once
+#include <string>
+
+#include "net/socket/ssl_client_socket.h"
#include "net/socket/stream_socket.h"
namespace net {
+class HostPortPair;
+class HttpAuthController;
class HttpStream;
class HttpResponseInfo;
+class HttpRequestHeaders;
+struct HttpRequestInfo;
+class HttpAuthController;
class NET_EXPORT_PRIVATE ProxyClientSocket : public StreamSocket {
public:
@@ -26,6 +34,38 @@ class NET_EXPORT_PRIVATE ProxyClientSocket : public StreamSocket {
// which can be used to read the response body.
virtual HttpStream* CreateConnectResponseStream() = 0;
+ // Returns the HttpAuthController which can be used
+ // to interact with an HTTP Proxy Authorization Required (407) request.
+ virtual const scoped_refptr<HttpAuthController>& GetAuthController() const
+ = 0;
+
+ // If Connect (or its callback) returns PROXY_AUTH_REQUESTED, then
+ // credentials should be added to the HttpAuthController before calling
+ // RestartWithAuth.
+ virtual int RestartWithAuth(const CompletionCallback& callback) = 0;
+
+ // Returns true of the connection to the proxy is using SPDY.
+ virtual bool IsUsingSpdy() const = 0;
+
+ // Returns the protocol negotiated with the proxy.
+ virtual SSLClientSocket::NextProto GetProtocolNegotiated() const = 0;
+
+ protected:
+ // The HTTP CONNECT method for establishing a tunnel connection is documented
+ // in draft-luotonen-web-proxy-tunneling-01.txt and RFC 2817, Sections 5.2
+ // and 5.3.
+ static void BuildTunnelRequest(const HttpRequestInfo& request_info,
+ const HttpRequestHeaders& auth_headers,
+ const HostPortPair& endpoint,
+ std::string* request_line,
+ HttpRequestHeaders* request_headers);
+
+ // When an auth challenge (407 response) is received during tunnel
+ // construction/ this method should be called.
+ static int HandleProxyAuthChallenge(HttpAuthController* auth,
+ HttpResponseInfo* response,
+ const BoundNetLog& net_log);
+
private:
DISALLOW_COPY_AND_ASSIGN(ProxyClientSocket);
};