Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: net/http/http_proxy_client_socket.h

Issue 3039028: Make HttpAuthController not reference counted. (Closed)
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/http/http_proxy_client_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_proxy_client_socket.h
diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h
index 61e81581ccc77a8323483164a979c8b46f647a25..f4cc083e7797cb602a8b4054177ef8f0e42f27d6 100644
--- a/net/http/http_proxy_client_socket.h
+++ b/net/http/http_proxy_client_socket.h
@@ -29,13 +29,12 @@ class IOBuffer;;
class HttpProxyClientSocket : public ClientSocket {
public:
- // Takes ownership of |transport_socket|, which should already be connected
- // by the time Connect() is called. If tunnel is true then on Connect()
- // this socket will establish an Http tunnel.
+ // Takes ownership of |auth| and |transport_socket|, which should already be
+ // connected by the time Connect() is called. If tunnel is true then on
+ // Connect() this socket will establish an Http tunnel.
HttpProxyClientSocket(ClientSocketHandle* transport_socket,
const GURL& request_url, const HostPortPair& endpoint,
- const scoped_refptr<HttpAuthController>& auth,
- bool tunnel);
+ HttpAuthController* auth, bool tunnel);
// On destruction Disconnect() is called.
virtual ~HttpProxyClientSocket();
@@ -43,7 +42,9 @@ class HttpProxyClientSocket : public ClientSocket {
// If Connect (or its callback) returns PROXY_AUTH_REQUESTED, then
// credentials should be added to the HttpAuthController before calling
// RestartWithAuth.
- int RestartWithAuth(CompletionCallback* callback);
+ int RestartWithAuth(const std::wstring& username,
+ const std::wstring& password,
+ CompletionCallback* callback);
// Indicates if RestartWithAuth needs to be called. i.e. if Connect
// returned PROXY_AUTH_REQUESTED. Only valid after Connect has been called.
@@ -53,6 +54,13 @@ class HttpProxyClientSocket : public ClientSocket {
return response_.headers ? &response_ : NULL;
}
+ // Release the auth controller back to the caller. This is used when
+ // we need to continue the auth conversation, but the connection doesn't
+ // support keep alive.
+ HttpAuthController* ReleaseAuthController() {
+ return auth_.release();
+ }
+
// ClientSocket methods:
// Authenticates to the Http Proxy and then passes data freely.
@@ -130,7 +138,7 @@ class HttpProxyClientSocket : public ClientSocket {
// The hostname and port of the endpoint. This is not necessarily the one
// specified by the URL, due to Alternate-Protocol or fixed testing ports.
const HostPortPair endpoint_;
- scoped_refptr<HttpAuthController> auth_;
+ scoped_ptr<HttpAuthController> auth_;
const bool tunnel_;
std::string request_headers_;
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/http/http_proxy_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698