Bug 1458043 - Part 2: Use native refcounting for Promises, r=bz

This commit is contained in:
Nika Layzell 2018-04-30 18:11:25 -04:00
Родитель 84d0194704
Коммит f3af8d0b90
2 изменённых файлов: 5 добавлений и 18 удалений

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

@ -63,13 +63,8 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Promise)
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mPromiseObj);
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(Promise)
NS_IMPL_CYCLE_COLLECTING_RELEASE(Promise)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Promise)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY(Promise)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(Promise, AddRef);
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(Promise, Release);
Promise::Promise(nsIGlobalObject* aGlobal)
: mGlobal(aGlobal)

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

@ -32,21 +32,15 @@ class PromiseInit;
class PromiseNativeHandler;
class PromiseDebugging;
#define NS_PROMISE_IID \
{ 0x1b8d6215, 0x3e67, 0x43ba, \
{ 0x8a, 0xf9, 0x31, 0x5e, 0x8f, 0xce, 0x75, 0x65 } }
class Promise : public nsISupports,
public SupportsWeakPtr<Promise>
class Promise : public SupportsWeakPtr<Promise>
{
friend class PromiseTask;
friend class PromiseWorkerProxy;
friend class PromiseWorkerProxyRunnable;
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_PROMISE_IID)
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Promise)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(Promise)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Promise)
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(Promise)
// Promise creation tries to create a JS reflector for the Promise, so is
@ -204,8 +198,6 @@ private:
JS::Heap<JSObject*> mPromiseObj;
};
NS_DEFINE_STATIC_IID_ACCESSOR(Promise, NS_PROMISE_IID)
} // namespace dom
} // namespace mozilla