Bug 1027251 - Fix or whitelist dangerous public destructors in ipc/ - r=bent

This commit is contained in:
Benoit Jacob 2014-06-18 22:29:00 -04:00
parent e1501eec81
commit 96b29e0856
2 changed files with 16 additions and 0 deletions

View File

@ -35,6 +35,9 @@ class RefCountedMonitor : public Monitor
{}
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RefCountedMonitor)
private:
~RefCountedMonitor() {}
};
class MessageChannel : HasResultCodes
@ -381,7 +384,9 @@ class MessageChannel : HasResultCodes
RefCountedTask(CancelableTask* aTask)
: mTask(aTask)
{ }
private:
~RefCountedTask() { delete mTask; }
public:
void Run() { mTask->Run(); }
void Cancel() { mTask->Cancel(); }

View File

@ -25,6 +25,17 @@ enum Rights {
}
namespace mozilla {
namespace ipc {
class SharedMemory;
}
template<>
struct HasDangerousPublicDestructor<mozilla::ipc::SharedMemory>
{
static const bool value = true;
};
namespace ipc {
class SharedMemory