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

Unified Diff: net/http/http_proxy_client_socket_pool.cc

Issue 3084011: Mange ciricular reference to HttpNetworkTransaction in HttpProxyClientSocktPool. (Closed)
Patch Set: Improve comment 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_proxy_client_socket_pool.cc
diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc
index 783c10f0ea82342484cdf79e2432a1de85b68cc8..d5508443c82f0c3d61cb028da88173e86c25569d 100644
--- a/net/http/http_proxy_client_socket_pool.cc
+++ b/net/http/http_proxy_client_socket_pool.cc
@@ -24,7 +24,7 @@ HttpProxySocketParams::HttpProxySocketParams(
: tcp_params_(proxy_server),
request_url_(request_url),
endpoint_(endpoint),
- session_(session),
+ session_(tunnel ? session : NULL),
tunnel_(tunnel) {
}
@@ -146,7 +146,14 @@ int HttpProxyConnectJob::DoHttpProxyConnect() {
proxy_server,
params_->session(),
params_->tunnel()));
- return socket_->Connect(&callback_);
+ int result = socket_->Connect(&callback_);
+
+ // Clear the circular reference to HttpNetworkSession (|params_| reference
+ // HttpNetworkSession, which reference HttpProxyClientSocketPool, which
+ // references |this|) here because it is safe to do so now but not at other
+ // points. This may cancel this ConnectJob.
+ params_ = NULL;
+ return result;
}
int HttpProxyConnectJob::DoHttpProxyConnectComplete(int result) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698