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

Unified Diff: net/http/http_network_transaction.cc

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.h ('k') | net/http/http_proxy_client_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 2e5b4375aa66e1de06004ed7a136d9481abcb432..609c98df7a0d82893d2839f9b734cdf12ea41f2a 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -314,13 +314,18 @@ int HttpNetworkTransaction::RestartWithAuth(
}
pending_auth_target_ = HttpAuth::AUTH_NONE;
- auth_controllers_[target]->ResetAuth(username, password);
-
if (target == HttpAuth::AUTH_PROXY && using_ssl_ && proxy_info_.is_http()) {
DCHECK(establishing_tunnel_);
+ DCHECK(auth_controllers_[target].get() == NULL);
next_state_ = STATE_INIT_CONNECTION;
+ auth_controllers_[target].reset(new HttpAuthController(target,
+ AuthURL(target),
+ session_));
+ auth_controllers_[target]->SetCredentials(username, password);
ResetStateForRestart();
} else {
+ auth_controllers_[target]->SetCredentials(username, password);
+ auth_controllers_[target]->PrepareForAuthRestart();
PrepareForAuthRestart(target);
}
@@ -706,9 +711,9 @@ int HttpNetworkTransaction::DoInitConnection() {
for (int i = 0; i < HttpAuth::AUTH_NUM_TARGETS; i++) {
HttpAuth::Target target = static_cast<HttpAuth::Target>(i);
if (!auth_controllers_[target].get())
- auth_controllers_[target] = new HttpAuthController(target,
- AuthURL(target),
- session_);
+ auth_controllers_[target].reset(new HttpAuthController(target,
+ AuthURL(target),
+ session_));
}
bool want_spdy = alternate_protocol_mode_ == kUsingAlternateProtocol
@@ -765,14 +770,15 @@ int HttpNetworkTransaction::DoInitConnection() {
request_->referrer, disable_resolver_cache);
if (proxy_info_.is_http()) {
- scoped_refptr<HttpAuthController> http_proxy_auth;
+ scoped_ptr<HttpAuthController> http_proxy_auth;
if (using_ssl_) {
- http_proxy_auth = auth_controllers_[HttpAuth::AUTH_PROXY];
+ http_proxy_auth.reset(
+ auth_controllers_[HttpAuth::AUTH_PROXY].release());
establishing_tunnel_ = true;
}
http_proxy_params = new HttpProxySocketParams(proxy_tcp_params,
request_->url, endpoint_,
- http_proxy_auth,
+ http_proxy_auth.release(),
using_ssl_);
} else {
DCHECK(proxy_info_.is_socks());
« no previous file with comments | « net/http/http_network_transaction.h ('k') | net/http/http_proxy_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698