summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:34:24 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:34:24 +0000
commit5389bc7ba5360633af04b9cf15497d56ce640ead (patch)
tree4518c05f3bad18a5b2f4739fc1a1c187651f9799 /net/socket
parent4070a6b1efcb2dbea12508a0b912cfa3bc86f47e (diff)
downloadchromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.zip
chromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.tar.gz
chromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.tar.bz2
Second patch in making destructors of refcounted objects private.
BUG=26749 Review URL: http://codereview.chromium.org/368001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/client_socket_pool_base.h6
-rw-r--r--net/socket/client_socket_pool_base_unittest.cc2
-rw-r--r--net/socket/tcp_client_socket_win.cc5
-rw-r--r--net/socket/tcp_pinger.h4
4 files changed, 14 insertions, 3 deletions
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 23c194c..b9c28e9 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -168,8 +168,6 @@ class ClientSocketPoolBaseHelper
base::TimeDelta used_idle_socket_timeout,
ConnectJobFactory* connect_job_factory);
- ~ClientSocketPoolBaseHelper();
-
// See ClientSocketPool::RequestSocket for documentation on this function.
// Note that |request| must be heap allocated. If ERR_IO_PENDING is returned,
// then ClientSocketPoolBaseHelper takes ownership of |request|.
@@ -222,6 +220,10 @@ class ClientSocketPoolBaseHelper
void CleanupIdleSockets(bool force);
private:
+ friend class base::RefCounted<ClientSocketPoolBaseHelper>;
+
+ ~ClientSocketPoolBaseHelper();
+
// Entry for a persistent socket which became idle at time |start_time|.
struct IdleSocket {
IdleSocket() : socket(NULL), used(false) {}
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index 5f0695a..437db55 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -327,6 +327,8 @@ class TestClientSocketPool : public ClientSocketPool {
void CleanupTimedOutIdleSockets() { base_.CleanupIdleSockets(false); }
private:
+ ~TestClientSocketPool() {}
+
TestClientSocketPoolBase base_;
DISALLOW_COPY_AND_ASSIGN(TestClientSocketPool);
diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc
index 199dccd..08d1b19 100644
--- a/net/socket/tcp_client_socket_win.cc
+++ b/net/socket/tcp_client_socket_win.cc
@@ -126,7 +126,6 @@ bool ShouldTryNextAddress(int err) {
class TCPClientSocketWin::Core : public base::RefCounted<Core> {
public:
explicit Core(TCPClientSocketWin* socket);
- ~Core();
// Start watching for the end of a read or write operation.
void WatchForRead();
@@ -161,6 +160,8 @@ class TCPClientSocketWin::Core : public base::RefCounted<Core> {
}
private:
+ friend class base::RefCounted<Core>;
+
class ReadDelegate : public base::ObjectWatcher::Delegate {
public:
explicit ReadDelegate(Core* core) : core_(core) {}
@@ -185,6 +186,8 @@ class TCPClientSocketWin::Core : public base::RefCounted<Core> {
Core* const core_;
};
+ ~Core();
+
// The socket that created this object.
TCPClientSocketWin* socket_;
diff --git a/net/socket/tcp_pinger.h b/net/socket/tcp_pinger.h
index af9dc84..ae543c5 100644
--- a/net/socket/tcp_pinger.h
+++ b/net/socket/tcp_pinger.h
@@ -115,6 +115,10 @@ class TCPPinger {
}
private:
+ friend class base::RefCountedThreadSafe<Worker>;
+
+ ~Worker() {}
+
base::WaitableEvent event_;
int net_error_;
net::AddressList addr_;