summaryrefslogtreecommitdiffstats
path: root/net/http/http_proxy_client_socket.cc
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/http_proxy_client_socket.cc
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/http_proxy_client_socket.cc')
-rw-r--r--net/http/http_proxy_client_socket.cc30
1 files changed, 16 insertions, 14 deletions
diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc
index 8e6631a..1a2bac5 100644
--- a/net/http/http_proxy_client_socket.cc
+++ b/net/http/http_proxy_client_socket.cc
@@ -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.
@@ -17,7 +17,6 @@
#include "net/http/http_basic_stream.h"
#include "net/http/http_net_log_params.h"
#include "net/http/http_network_session.h"
-#include "net/http/http_proxy_utils.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_stream_parser.h"
@@ -84,6 +83,20 @@ int HttpProxyClientSocket::RestartWithAuth(const CompletionCallback& callback) {
return rv;
}
+const scoped_refptr<HttpAuthController>&
+HttpProxyClientSocket::GetAuthController() const {
+ return auth_;
+}
+
+bool HttpProxyClientSocket::IsUsingSpdy() const {
+ return using_spdy_;
+}
+
+SSLClientSocket::NextProto
+HttpProxyClientSocket::GetProtocolNegotiated() const {
+ return protocol_negotiated_;
+}
+
const HttpResponseInfo* HttpProxyClientSocket::GetConnectResponseInfo() const {
return response_.headers ? &response_ : NULL;
}
@@ -274,17 +287,6 @@ int HttpProxyClientSocket::DidDrainBodyForAuthRestart(bool keep_alive) {
return OK;
}
-int HttpProxyClientSocket::HandleAuthChallenge() {
- DCHECK(response_.headers);
-
- int rv = auth_->HandleAuthChallenge(response_.headers, false, true, net_log_);
- response_.auth_challenge = auth_->auth_info();
- if (rv == OK)
- return ERR_PROXY_AUTH_REQUESTED;
-
- return rv;
-}
-
void HttpProxyClientSocket::LogBlockedTunnelResponse(int response_code) const {
LOG(WARNING) << "Blocked proxy response with status " << response_code
<< " to CONNECT request for "
@@ -459,7 +461,7 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) {
// authentication code is smart enough to avoid being tricked by an
// active network attacker.
// The next state is intentionally not set as it should be STATE_NONE;
- return HandleAuthChallenge();
+ return HandleProxyAuthChallenge(auth_, &response_, net_log_);
default:
if (is_https_proxy_)