зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
30d9a9082f
Коммит
8cd834cd62
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче