Bug 1136729: Make destructor of |SocketBase| protected, r=qdot

The destructor methods of ref-counted classes are supposed to
be non-public to prevent accidential deletion. This patch fixes
|SocketBase|'s destructor.
This commit is contained in:
Thomas Zimmermann 2015-03-02 10:23:52 +01:00
Родитель 6561622ac7
Коммит 94a9c39fe7
2 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -168,11 +168,6 @@ UnixSocketRawData::Send(int aFd)
// SocketBase
//
SocketBase::~SocketBase()
{
MOZ_ASSERT(mConnectionStatus == SOCKET_DISCONNECTED);
}
SocketConnectionStatus
SocketBase::GetConnectionStatus() const
{
@ -247,6 +242,11 @@ SocketBase::SocketBase()
, mConnectDelayMs(0)
{ }
SocketBase::~SocketBase()
{
MOZ_ASSERT(mConnectionStatus == SOCKET_DISCONNECTED);
}
void
SocketBase::SetConnectionStatus(SocketConnectionStatus aConnectionStatus)
{

Просмотреть файл

@ -211,8 +211,6 @@ class SocketBase
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SocketBase)
virtual ~SocketBase();
SocketConnectionStatus GetConnectionStatus() const;
int GetSuggestedConnectDelayMs() const;
@ -256,6 +254,7 @@ public:
protected:
SocketBase();
virtual ~SocketBase();
void SetConnectionStatus(SocketConnectionStatus aConnectionStatus);