Bug 1365894 - Make SystemGroupImpl be a normal ref-counted object. r=ehsan

MozReview-Commit-ID: LUcoBhNx2M5

--HG--
extra : rebase_source : 10010b8cc206c16980c9e1601445f262104f1dd2
This commit is contained in:
James Cheng 2017-10-09 13:40:12 -04:00
Родитель 30d9a9082f
Коммит 8cd834cd62
1 изменённых файлов: 5 добавлений и 13 удалений

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

@ -17,7 +17,7 @@ class SystemGroupImpl final : public SchedulerGroup
{
public:
SystemGroupImpl();
~SystemGroupImpl() {}
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SystemGroupImpl)
static void InitStatic();
static void ShutdownStatic();
@ -25,20 +25,12 @@ public:
static bool Initialized() { return !!sSingleton; }
NS_METHOD_(MozExternalRefCountType) AddRef(void)
{
return 2;
}
NS_METHOD_(MozExternalRefCountType) Release(void)
{
return 1;
}
private:
static UniquePtr<SystemGroupImpl> sSingleton;
~SystemGroupImpl() = default;
static StaticRefPtr<SystemGroupImpl> sSingleton;
};
UniquePtr<SystemGroupImpl> SystemGroupImpl::sSingleton;
StaticRefPtr<SystemGroupImpl> SystemGroupImpl::sSingleton;
SystemGroupImpl::SystemGroupImpl()
{
@ -50,7 +42,7 @@ SystemGroupImpl::InitStatic()
{
MOZ_ASSERT(!sSingleton);
MOZ_ASSERT(NS_IsMainThread());
sSingleton = MakeUnique<SystemGroupImpl>();
sSingleton = new SystemGroupImpl();
}
/* static */ void