diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 07:43:26 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 07:43:26 +0000 |
commit | 91e9253e23325eaee915ab6fcd8ecae718b9108b (patch) | |
tree | 0a450537f55cb01d9941fa487ade238a4b6893ff /net/http/http_proxy_client_socket_pool.cc | |
parent | 394816e907ab5e328899e41a402537c0ff3c0381 (diff) | |
download | chromium_src-91e9253e23325eaee915ab6fcd8ecae718b9108b.zip chromium_src-91e9253e23325eaee915ab6fcd8ecae718b9108b.tar.gz chromium_src-91e9253e23325eaee915ab6fcd8ecae718b9108b.tar.bz2 |
Mange ciricular reference to HttpNetworkTransaction in HttpProxyClientSocktPool.
Without explicit management of the cirucular reference to HttpNetworkTransaction, it can get deleted at inopportune times and cause undesirable effects (i.e. triggering a pool to delete itself while in the middle of other operations). This change breaks the cirucular reference at points in execution where it is safe.
BUG=50822, 49254
TEST=green reliability bot
Review URL: http://codereview.chromium.org/3084011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54715 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_proxy_client_socket_pool.cc')
-rw-r--r-- | net/http/http_proxy_client_socket_pool.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc index 783c10f..d550844 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) { |