Bug 1028148, part 1 - Make SharedMemory's dtor private. r=bent

This commit is contained in:
Andrew McCreight 2014-07-28 09:56:54 -07:00
parent 283067635c
commit 9ac73c4e09
3 changed files with 9 additions and 10 deletions

View File

@ -30,17 +30,11 @@ namespace ipc {
class SharedMemory;
}
template<>
struct HasDangerousPublicDestructor<mozilla::ipc::SharedMemory>
{
static const bool value = true;
};
namespace ipc {
class SharedMemory
{
public:
protected:
virtual ~SharedMemory()
{
MOZ_COUNT_DTOR(SharedMemory);
@ -48,6 +42,7 @@ public:
Destroyed();
}
public:
enum SharedMemoryType {
TYPE_BASIC,
TYPE_SYSV,

View File

@ -20,7 +20,7 @@
namespace mozilla {
namespace ipc {
class SharedMemoryBasic : public SharedMemory
class SharedMemoryBasic MOZ_FINAL : public SharedMemory
{
public:
typedef base::FileDescriptor Handle;
@ -29,8 +29,6 @@ public:
SharedMemoryBasic(const Handle& aHandle);
virtual ~SharedMemoryBasic();
virtual bool Create(size_t aNbytes) MOZ_OVERRIDE;
virtual bool Map(size_t nBytes) MOZ_OVERRIDE;
@ -59,6 +57,8 @@ public:
Handle* aNewHandle);
private:
~SharedMemoryBasic();
void Unmap();
void Destroy();

View File

@ -84,6 +84,10 @@ public:
}
private:
~SharedMemoryBasic()
{
}
base::SharedMemory mSharedMemory;
};