summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 23:13:09 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 23:13:09 +0000
commit3598c6021c4a79bc954153c6f02140826229e254 (patch)
treeb04ac8b7cee717886e794bd7c6e034d4920d0ed0 /net/socket
parentbe825e07f72cada135d8fca0130bb2beccc0374c (diff)
downloadchromium_src-3598c6021c4a79bc954153c6f02140826229e254.zip
chromium_src-3598c6021c4a79bc954153c6f02140826229e254.tar.gz
chromium_src-3598c6021c4a79bc954153c6f02140826229e254.tar.bz2
Break reference cycle from HttpProxyClientSocket=>HttpNetworkSession=>...
Note that this undoes the fix for http://crbug.com/49387 which is now unnecessary without the cycle. Some other miscellaneous cleanup is thrown in here. BUG=55175 TEST=none Review URL: http://codereview.chromium.org/3418018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/client_socket_pool_base.cc12
-rw-r--r--net/socket/client_socket_pool_base.h4
-rw-r--r--net/socket/ssl_client_socket_pool_unittest.cc5
3 files changed, 6 insertions, 15 deletions
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index 45ce13a..cdfb3f3 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -143,8 +143,7 @@ ClientSocketPoolBaseHelper::ClientSocketPoolBaseHelper(
used_idle_socket_timeout_(used_idle_socket_timeout),
connect_job_factory_(connect_job_factory),
connect_backup_jobs_enabled_(false),
- pool_generation_number_(0),
- in_destructor_(false) {
+ pool_generation_number_(0) {
DCHECK_LE(0, max_sockets_per_group);
DCHECK_LE(max_sockets_per_group, max_sockets);
@@ -152,7 +151,6 @@ ClientSocketPoolBaseHelper::ClientSocketPoolBaseHelper(
}
ClientSocketPoolBaseHelper::~ClientSocketPoolBaseHelper() {
- in_destructor_ = true;
CancelAllConnectJobs();
// Clean up any idle sockets. Assert that we have no remaining active
@@ -458,14 +456,6 @@ void ClientSocketPoolBaseHelper::CleanupIdleSockets(bool force) {
if (idle_socket_count_ == 0)
return;
- // Deleting an SSL socket may remove the last reference to an
- // HttpNetworkSession (in an incognito session), triggering the destruction
- // of pools, potentially causing a recursive call to this function. Hold a
- // reference to |this| to prevent that.
- scoped_refptr<ClientSocketPoolBaseHelper> protect_this;
- if (!in_destructor_)
- protect_this = this;
-
// Current time value. Retrieving it once at the function start rather than
// inside the inner loop, since it shouldn't change by any meaningful amount.
base::TimeTicks now = base::TimeTicks::Now();
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 69bb904..bea0b22 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -29,7 +29,6 @@
#include <string>
#include "base/basictypes.h"
-#include "base/compiler_specific.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
@@ -486,8 +485,7 @@ class ClientSocketPoolBaseHelper
// make sure that they are discarded rather than reused.
int pool_generation_number_;
- // Some parts of this class need to know if the destructor is running.
- bool in_destructor_;
+ DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBaseHelper);
};
} // namespace internal
diff --git a/net/socket/ssl_client_socket_pool_unittest.cc b/net/socket/ssl_client_socket_pool_unittest.cc
index 76ed518..22a5441 100644
--- a/net/socket/ssl_client_socket_pool_unittest.cc
+++ b/net/socket/ssl_client_socket_pool_unittest.cc
@@ -55,7 +55,10 @@ class SSLClientSocketPoolTest : public ClientSocketPoolTest {
HostPortPair("proxy", 443), MEDIUM, GURL(), false)),
http_proxy_socket_params_(new HttpProxySocketParams(
proxy_tcp_socket_params_, NULL, GURL("http://host"), "",
- HostPortPair("host", 80), session_, true)),
+ HostPortPair("host", 80),
+ session_->auth_cache(),
+ session_->http_auth_handler_factory(),
+ true)),
http_proxy_socket_pool_(new HttpProxyClientSocketPool(
kMaxSockets,
kMaxSocketsPerGroup,