зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
This commit is contained in:
Родитель
983dac4418
Коммит
93acdfad59
|
@ -101,7 +101,7 @@ class AccessibleNode : public nsISupports, public nsWrapperCache {
|
|||
explicit AccessibleNode(nsINode* aNode);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS;
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AccessibleNode);
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AccessibleNode);
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
|
||||
dom::ParentObject GetParentObject() const;
|
||||
|
|
|
@ -38,7 +38,7 @@ class DominatorTree final : public nsISupports, public nsWrapperCache {
|
|||
};
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS;
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DominatorTree);
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DominatorTree);
|
||||
|
||||
nsISupports* GetParentObject() const { return mParent; }
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ class HeapSnapshot final : public nsISupports, public nsWrapperCache {
|
|||
nsAString& outSnapshotId);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(HeapSnapshot)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(HeapSnapshot)
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(HeapSnapshot)
|
||||
|
||||
nsISupports* GetParentObject() const { return mParent; }
|
||||
|
|
|
@ -38,7 +38,7 @@ class DocGroup;
|
|||
class BrowsingContextGroup final : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(BrowsingContextGroup)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(BrowsingContextGroup)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(BrowsingContextGroup)
|
||||
|
||||
// Interact with the list of synced contexts. This controls the lifecycle of
|
||||
// the BrowsingContextGroup and contexts loaded within them.
|
||||
|
|
|
@ -574,7 +574,7 @@ NS_INTERFACE_MAP_END
|
|||
NS_IMPL_CYCLE_COLLECTING_ADDREF(WindowContext)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(WindowContext)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(WindowContext)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WindowContext)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(WindowContext)
|
||||
if (gWindowContexts) {
|
||||
|
@ -593,8 +593,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(WindowContext)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNonSyntheticChildren)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(WindowContext)
|
||||
|
||||
} // namespace dom
|
||||
|
||||
namespace ipc {
|
||||
|
|
|
@ -100,7 +100,7 @@ class WindowContext : public nsISupports, public nsWrapperCache {
|
|||
MOZ_DECL_SYNCED_CONTEXT(WindowContext, MOZ_EACH_WC_FIELD)
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WindowContext)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WindowContext)
|
||||
|
||||
public:
|
||||
static already_AddRefed<WindowContext> GetById(uint64_t aInnerWindowId);
|
||||
|
|
|
@ -264,7 +264,7 @@ NS_INTERFACE_MAP_END
|
|||
NS_IMPL_CYCLE_COLLECTING_ADDREF(ChildSHistory)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(ChildSHistory)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(ChildSHistory)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ChildSHistory)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ChildSHistory)
|
||||
if (tmp->mHistory) {
|
||||
|
@ -278,8 +278,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ChildSHistory)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBrowsingContext, mHistory)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(ChildSHistory)
|
||||
|
||||
JSObject* ChildSHistory::WrapObject(JSContext* cx,
|
||||
JS::Handle<JSObject*> aGivenProto) {
|
||||
return ChildSHistory_Binding::Wrap(cx, this, aGivenProto);
|
||||
|
|
|
@ -37,7 +37,7 @@ class BrowsingContext;
|
|||
class ChildSHistory : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ChildSHistory)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ChildSHistory)
|
||||
nsISupports* GetParentObject() const;
|
||||
JSObject* WrapObject(JSContext* cx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace mozilla::dom {
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(AnimationEffect)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AnimationEffect)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AnimationEffect)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocument, mAnimation)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
|
@ -26,8 +26,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AnimationEffect)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument, mAnimation)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AnimationEffect)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(AnimationEffect)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(AnimationEffect)
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class Document;
|
|||
class AnimationEffect : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationEffect)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AnimationEffect)
|
||||
|
||||
AnimationEffect(Document* aDocument, TimingParams&& aTiming);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace mozilla::dom {
|
|||
|
||||
AnimationTimeline::~AnimationTimeline() { mAnimationOrder.clear(); }
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(AnimationTimeline)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AnimationTimeline)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AnimationTimeline)
|
||||
tmp->mAnimationOrder.clear();
|
||||
|
@ -24,8 +24,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AnimationTimeline)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow, mAnimations)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AnimationTimeline)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(AnimationTimeline)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(AnimationTimeline)
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class AnimationTimeline : public nsISupports, public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationTimeline)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AnimationTimeline)
|
||||
|
||||
nsIGlobalObject* GetParentObject() const { return mWindow; }
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class UnrestrictedDoubleOrKeyframeAnimationOptions;
|
|||
class CSSPseudoElement final : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CSSPseudoElement)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CSSPseudoElement)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CSSPseudoElement)
|
||||
|
||||
protected:
|
||||
virtual ~CSSPseudoElement();
|
||||
|
|
|
@ -58,7 +58,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AbstractRange)
|
|||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(AbstractRange)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AbstractRange)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AbstractRange)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner);
|
||||
|
@ -73,8 +73,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AbstractRange)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEnd)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AbstractRange)
|
||||
|
||||
// NOTE: If you need to change default value of members of AbstractRange,
|
||||
// update nsRange::Create(nsINode* aNode) and ClearForReuse() too.
|
||||
AbstractRange::AbstractRange(nsINode* aNode)
|
||||
|
|
|
@ -42,7 +42,7 @@ class AbstractRange : public nsISupports, public nsWrapperCache {
|
|||
static void Shutdown();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AbstractRange)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AbstractRange)
|
||||
|
||||
const RangeBoundary& StartRef() const { return mStart; }
|
||||
const RangeBoundary& EndRef() const { return mEnd; }
|
||||
|
|
|
@ -43,7 +43,7 @@ Attr::Attr(nsDOMAttributeMap* aAttrMap,
|
|||
// to drop our reference when it goes away.
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(Attr)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Attr)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Attr)
|
||||
if (!nsINode::Traverse(tmp, cb)) {
|
||||
|
@ -52,8 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Attr)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAttrMap)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Attr)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Attr)
|
||||
nsINode::Unlink(tmp);
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAttrMap)
|
||||
|
|
|
@ -74,7 +74,7 @@ class Attr final : public nsINode {
|
|||
static void Initialize();
|
||||
static void Shutdown();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(Attr)
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(Attr)
|
||||
|
||||
// WebIDL
|
||||
virtual JSObject* WrapNode(JSContext* aCx,
|
||||
|
|
|
@ -35,7 +35,7 @@ class BarProp : public nsISupports, public nsWrapperCache {
|
|||
explicit BarProp(nsGlobalWindowInner* aWindow);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(BarProp)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(BarProp)
|
||||
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
||||
|
|
|
@ -66,9 +66,9 @@ Element* CharacterData::GetNameSpaceElement() {
|
|||
return Element::FromNodeOrNull(GetParentNode());
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(CharacterData)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(CharacterData)
|
||||
// Note, _INHERITED macro isn't used here since nsINode implementations are
|
||||
// rather special.
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CharacterData)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CharacterData)
|
||||
return Element::CanSkip(tmp, aRemovingAllowed);
|
||||
|
|
|
@ -190,8 +190,8 @@ class CharacterData : public nsIContent {
|
|||
|
||||
//----------------------------------------
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(
|
||||
CharacterData, nsIContent)
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_INHERITED(CharacterData,
|
||||
nsIContent)
|
||||
|
||||
/**
|
||||
* Compare two CharacterData nodes for text equality.
|
||||
|
|
|
@ -27,7 +27,7 @@ class Crypto final : public nsISupports, public nsWrapperCache {
|
|||
explicit Crypto(nsIGlobalObject* aParent);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Crypto)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Crypto)
|
||||
|
||||
void GetRandomValues(JSContext* aCx, const ArrayBufferView& aArray,
|
||||
JS::MutableHandle<JSObject*> aRetval, ErrorResult& aRv);
|
||||
|
|
|
@ -390,7 +390,7 @@ class MOZ_RAII AutoConstructionStackEntry final {
|
|||
|
||||
} // namespace
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CustomElementRegistry)
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(CustomElementRegistry)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CustomElementRegistry)
|
||||
tmp->mConstructors.clear();
|
||||
|
|
|
@ -34,7 +34,7 @@ class DOMImplementation final : public nsISupports, public nsWrapperCache {
|
|||
nsIURI* aDocumentURI, nsIURI* aBaseURI);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMImplementation)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMImplementation)
|
||||
|
||||
Document* GetParentObject() const { return mOwner; }
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class DOMIntersectionObserverEntry final : public nsISupports,
|
|||
mTarget(aTarget),
|
||||
mIntersectionRatio(aIntersectionRatio) {}
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMIntersectionObserverEntry)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMIntersectionObserverEntry)
|
||||
|
||||
nsISupports* GetParentObject() const { return mOwner; }
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ class DOMMatrixReadOnly : public nsWrapperCache {
|
|||
}
|
||||
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMMatrixReadOnly)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMMatrixReadOnly)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(DOMMatrixReadOnly)
|
||||
|
||||
nsISupports* GetParentObject() const { return mParent; }
|
||||
virtual JSObject* WrapObject(JSContext* cx,
|
||||
|
|
|
@ -28,7 +28,7 @@ class DOMParser final : public nsISupports, public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMParser)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMParser)
|
||||
|
||||
// WebIDL API
|
||||
static already_AddRefed<DOMParser> Constructor(const GlobalObject& aOwner,
|
||||
|
|
|
@ -43,7 +43,7 @@ class DOMPointReadOnly : public nsWrapperCache {
|
|||
const GlobalObject& aGlobal, double aX, double aY, double aZ, double aW);
|
||||
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMPointReadOnly)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMPointReadOnly)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(DOMPointReadOnly)
|
||||
|
||||
double X() const { return mX; }
|
||||
double Y() const { return mY; }
|
||||
|
|
|
@ -41,7 +41,7 @@ class DOMQuad final : public nsWrapperCache {
|
|||
explicit DOMQuad(nsISupports* aParent);
|
||||
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMQuad)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(DOMQuad)
|
||||
|
||||
nsISupports* GetParentObject() const { return mParent; }
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
|
|
|
@ -40,7 +40,7 @@ class DOMRectReadOnly : public nsISupports, public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectReadOnly)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMRectReadOnly)
|
||||
|
||||
explicit DOMRectReadOnly(nsISupports* aParent, double aX = 0, double aY = 0,
|
||||
double aWidth = 0, double aHeight = 0)
|
||||
|
@ -150,7 +150,7 @@ class DOMRectList final : public nsISupports, public nsWrapperCache {
|
|||
explicit DOMRectList(nsISupports* aParent) : mParent(aParent) {}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectList)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMRectList)
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* cx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
|
|
@ -20,7 +20,7 @@ class DOMStringList : public nsISupports, public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMStringList)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMStringList)
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace mozilla::dom {
|
|||
class External : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(External)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(External)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(External)
|
||||
|
||||
explicit External(nsISupports* aParent) : mParent(aParent) {}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ already_AddRefed<File> GetBlobForFormDataStorage(
|
|||
// -------------------------------------------------------------------------
|
||||
// nsISupports
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(FormData)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FormData)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FormData)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner)
|
||||
|
@ -93,8 +93,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(FormData)
|
|||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(FormData)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(FormData)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(FormData)
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class FormData final : public nsISupports,
|
|||
already_AddRefed<FormData> Clone();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FormData)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FormData)
|
||||
|
||||
// nsWrapperCache
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
|
|
|
@ -1251,7 +1251,9 @@ ContentUnbinder* ContentUnbinder::sContentUnbinder = nullptr;
|
|||
|
||||
void FragmentOrElement::ClearContentUnbinder() { ContentUnbinder::UnbindAll(); }
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(FragmentOrElement)
|
||||
// Note, _INHERITED macro isn't used here since nsINode implementations are
|
||||
// rather special.
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FragmentOrElement)
|
||||
|
||||
// We purposefully don't UNLINK_BEGIN_INHERITED here.
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
|
||||
|
@ -1309,8 +1311,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
|
|||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(FragmentOrElement)
|
||||
|
||||
void FragmentOrElement::MarkNodeChildren(nsINode* aNode) {
|
||||
JSObject* o = GetJSObjectChild(aNode);
|
||||
if (o) {
|
||||
|
|
|
@ -116,7 +116,7 @@ class FragmentOrElement : public nsIContent {
|
|||
static void FireNodeInserted(Document* aDoc, nsINode* aParent,
|
||||
nsTArray<nsCOMPtr<nsIContent> >& aNodes);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_INHERITED(
|
||||
FragmentOrElement, nsIContent)
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,7 +38,7 @@ class IdleDeadline final : public nsISupports, public nsWrapperCache {
|
|||
bool DidTimeout() const;
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IdleDeadline)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(IdleDeadline)
|
||||
|
||||
private:
|
||||
~IdleDeadline();
|
||||
|
|
|
@ -23,7 +23,7 @@ class IntlUtils final : public nsISupports, public nsWrapperCache {
|
|||
explicit IntlUtils(nsPIDOMWindowInner* aWindow);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IntlUtils)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(IntlUtils)
|
||||
|
||||
nsPIDOMWindowInner* GetParentObject() const { return mWindow; }
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class Location final : public nsISupports,
|
|||
Location(nsPIDOMWindowInner* aWindow, BrowsingContext* aBrowsingContext);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Location)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Location)
|
||||
|
||||
// WebIDL API:
|
||||
void Assign(const nsAString& aUrl, nsIPrincipal& aSubjectPrincipal,
|
||||
|
|
|
@ -130,7 +130,7 @@ NS_INTERFACE_MAP_END
|
|||
NS_IMPL_CYCLE_COLLECTING_ADDREF(Navigator)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(Navigator)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(Navigator)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Navigator)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Navigator)
|
||||
tmp->Invalidate();
|
||||
|
@ -165,8 +165,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXRSystem)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Navigator)
|
||||
|
||||
void Navigator::Invalidate() {
|
||||
// Don't clear mWindow here so we know we've got a non-null mWindow
|
||||
// until we're unlinked.
|
||||
|
|
|
@ -91,7 +91,7 @@ class Navigator final : public nsISupports, public nsWrapperCache {
|
|||
explicit Navigator(nsPIDOMWindowInner* aInnerWindow);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Navigator)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Navigator)
|
||||
|
||||
void Invalidate();
|
||||
nsPIDOMWindowInner* GetWindow() const { return mWindow; }
|
||||
|
|
|
@ -18,7 +18,7 @@ class PlacesWeakCallbackWrapper final : public nsWrapperCache,
|
|||
public SupportsWeakPtr {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PlacesWeakCallbackWrapper)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PlacesWeakCallbackWrapper)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(PlacesWeakCallbackWrapper)
|
||||
|
||||
explicit PlacesWeakCallbackWrapper(nsISupports* aParent,
|
||||
PlacesEventCallback& aCallback);
|
||||
|
|
|
@ -203,9 +203,7 @@ void ResizeObservation::UpdateLastReportedSize(const gfx::Size& aSize) {
|
|||
}
|
||||
|
||||
// Only needed for refcounted objects.
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(ResizeObserver)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(ResizeObserver)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ResizeObserver)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ResizeObserver)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner, mDocument, mActiveTargets,
|
||||
|
|
|
@ -119,7 +119,7 @@ class ResizeObserver final : public nsISupports, public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ResizeObserver)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ResizeObserver)
|
||||
|
||||
ResizeObserver(nsCOMPtr<nsPIDOMWindowInner>&& aOwner, Document* aDocument,
|
||||
ResizeObserverCallback& aCb)
|
||||
|
@ -213,7 +213,7 @@ class ResizeObserver final : public nsISupports, public nsWrapperCache {
|
|||
class ResizeObserverEntry final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ResizeObserverEntry)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ResizeObserverEntry)
|
||||
|
||||
ResizeObserverEntry(nsISupports* aOwner, Element& aTarget,
|
||||
const gfx::Size& aBorderBoxSize,
|
||||
|
@ -274,7 +274,7 @@ class ResizeObserverEntry final : public nsISupports, public nsWrapperCache {
|
|||
class ResizeObserverSize final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ResizeObserverSize)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ResizeObserverSize)
|
||||
|
||||
ResizeObserverSize(nsISupports* aOwner, const gfx::Size& aSize,
|
||||
const WritingMode aWM)
|
||||
|
|
|
@ -19,7 +19,7 @@ class ScreenLuminance final : public nsWrapperCache {
|
|||
public:
|
||||
// Ref counting and cycle collection
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(ScreenLuminance)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(ScreenLuminance)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(ScreenLuminance)
|
||||
|
||||
// WebIDL methods
|
||||
double Min() const { return mMin; }
|
||||
|
|
|
@ -611,7 +611,7 @@ DocGroup* Selection::GetDocGroup() const {
|
|||
return doc ? doc->GetDocGroup() : nullptr;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(Selection)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Selection)
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Selection)
|
||||
|
@ -642,7 +642,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Selection)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectionChangeEventDispatcher)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectionListeners)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Selection)
|
||||
|
||||
// QueryInterface implementation for Selection
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Selection)
|
||||
|
|
|
@ -72,7 +72,7 @@ class Selection final : public nsSupportsWeakReference,
|
|||
nsFrameSelection* aFrameSelection);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Selection)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Selection)
|
||||
|
||||
/**
|
||||
* Match this up with EndbatchChanges. will stop ui updates while multiple
|
||||
|
|
|
@ -27,7 +27,7 @@ class GlobalObject;
|
|||
class StructuredCloneTester final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StructuredCloneTester)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StructuredCloneTester)
|
||||
|
||||
static already_AddRefed<StructuredCloneTester> Constructor(
|
||||
const GlobalObject& aGlobal, const bool aSerializable,
|
||||
|
|
|
@ -23,7 +23,7 @@ class StyleSheetList final : public nsStubMutationObserver,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StyleSheetList)
|
||||
|
||||
NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class SubtleCrypto final : public nsISupports, public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SubtleCrypto)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SubtleCrypto)
|
||||
|
||||
public:
|
||||
explicit SubtleCrypto(nsIGlobalObject* aParent);
|
||||
|
|
|
@ -103,7 +103,7 @@ CallbackTimeoutHandler::CallbackTimeoutHandler(
|
|||
mArgs = std::move(aArguments);
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CallbackTimeoutHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(CallbackTimeoutHandler)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CallbackTimeoutHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
|
||||
|
|
|
@ -26,7 +26,7 @@ class nsAttrChildContentList : public nsINodeList {
|
|||
explicit nsAttrChildContentList(nsINode* aNode) : mNode(aNode) {}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsAttrChildContentList)
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(nsAttrChildContentList)
|
||||
|
||||
// nsWrapperCache
|
||||
virtual JSObject* WrapObject(JSContext* cx,
|
||||
|
|
|
@ -41,7 +41,7 @@ using namespace mozilla::dom;
|
|||
|
||||
nsBaseContentList::~nsBaseContentList() = default;
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsBaseContentList)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsBaseContentList)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsBaseContentList)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mElements)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
|
@ -50,7 +50,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsBaseContentList)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElements)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsBaseContentList)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsBaseContentList)
|
||||
if (nsCCUncollectableMarker::sGeneration && tmp->HasKnownLiveWrapper()) {
|
||||
|
|
|
@ -50,7 +50,7 @@ class nsBaseContentList : public nsINodeList {
|
|||
|
||||
uint32_t Length() override { return mElements.Length(); }
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsBaseContentList)
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(nsBaseContentList)
|
||||
|
||||
void AppendElement(nsIContent* aContent) {
|
||||
MOZ_ASSERT(aContent);
|
||||
|
|
|
@ -45,7 +45,7 @@ void nsDOMAttributeMap::DropReference() {
|
|||
mContent = nullptr;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMAttributeMap)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMAttributeMap)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMAttributeMap)
|
||||
tmp->DropReference();
|
||||
|
@ -60,8 +60,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMAttributeMap)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContent)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsDOMAttributeMap)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsDOMAttributeMap)
|
||||
if (tmp->HasKnownLiveWrapper()) {
|
||||
if (tmp->mContent) {
|
||||
|
|
|
@ -97,7 +97,7 @@ class nsDOMAttributeMap final : public nsISupports, public nsWrapperCache {
|
|||
explicit nsDOMAttributeMap(Element* aContent);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMAttributeMap)
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(nsDOMAttributeMap)
|
||||
|
||||
void DropReference();
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class nsDOMCaretPosition : public nsISupports, public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCaretPosition)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMCaretPosition)
|
||||
|
||||
nsDOMCaretPosition(nsINode* aNode, uint32_t aOffset);
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class nsDOMMutationRecord final : public nsISupports, public nsWrapperCache {
|
|||
}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMMutationRecord)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMMutationRecord)
|
||||
|
||||
void GetType(mozilla::dom::DOMString& aRetVal) const {
|
||||
aRetVal.SetKnownLiveAtom(mType, mozilla::dom::DOMString::eNullNotExpected);
|
||||
|
|
|
@ -41,7 +41,7 @@ class nsDOMTokenList : public nsISupports, public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMTokenList)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMTokenList)
|
||||
|
||||
nsDOMTokenList(Element* aElement, nsAtom* aAttrAtom,
|
||||
const mozilla::dom::DOMTokenListSupportedTokenArray = nullptr);
|
||||
|
|
|
@ -129,7 +129,7 @@ class nsFrameLoader final : public nsStubMutationObserver,
|
|||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_FRAMELOADER_IID)
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsFrameLoader)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsFrameLoader)
|
||||
|
||||
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
||||
nsresult CheckForRecursiveLoad(nsIURI* aURI);
|
||||
|
|
|
@ -29,7 +29,7 @@ class ErrorResult;
|
|||
class nsHistory final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsHistory)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsHistory)
|
||||
|
||||
public:
|
||||
explicit nsHistory(nsPIDOMWindowInner* aInnerWindow);
|
||||
|
|
|
@ -2279,7 +2279,7 @@ void nsJSArgArray::ReleaseJSObjects() {
|
|||
}
|
||||
|
||||
// QueryInterface implementation for nsJSArgArray
|
||||
NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(nsJSArgArray)
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsJSArgArray)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSArgArray)
|
||||
tmp->ReleaseJSObjects();
|
||||
|
|
|
@ -28,7 +28,7 @@ class nsMimeTypeArray final : public nsISupports, public nsWrapperCache {
|
|||
const mozilla::Array<RefPtr<nsMimeType>, 2>& aMimeTypes);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsMimeTypeArray)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsMimeTypeArray)
|
||||
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
|
@ -69,7 +69,7 @@ class nsMimeTypeArray final : public nsISupports, public nsWrapperCache {
|
|||
class nsMimeType final : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsMimeType)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsMimeType)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(nsMimeType)
|
||||
|
||||
nsMimeType(nsPluginElement* aPluginElement, const nsAString& aName);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class nsPluginArray final : public nsSupportsWeakReference,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPluginArray)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsPluginArray)
|
||||
|
||||
explicit nsPluginArray(nsPIDOMWindowInner* aWindow);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
@ -76,7 +76,7 @@ class nsPluginArray final : public nsSupportsWeakReference,
|
|||
class nsPluginElement final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPluginElement)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsPluginElement)
|
||||
|
||||
explicit nsPluginElement(nsPluginArray* aPluginArray,
|
||||
nsPIDOMWindowInner* aWindow, const nsAString& aName);
|
||||
|
|
|
@ -52,7 +52,7 @@ nsWindowRoot::~nsWindowRoot() {
|
|||
JSActorService::UnregisterChromeEventTarget(this);
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsWindowRoot)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsWindowRoot)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsWindowRoot)
|
||||
JSActorService::UnregisterChromeEventTarget(tmp);
|
||||
|
@ -69,8 +69,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsWindowRoot)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsWindowRoot)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsWindowRoot)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
|
|
|
@ -64,7 +64,7 @@ class nsWindowRoot final : public nsPIWindowRoot {
|
|||
|
||||
JSObject* WrapObject(JSContext*, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsWindowRoot)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsWindowRoot)
|
||||
|
||||
void AddBrowser(nsIRemoteTab* aBrowser) override;
|
||||
void RemoveBrowser(nsIRemoteTab* aBrowser) override;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "js/TypeDecls.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsISupportsUtils.h"
|
||||
#include <type_traits>
|
||||
|
||||
namespace mozilla::dom {
|
||||
class ContentProcessMessageManager;
|
||||
|
@ -422,6 +423,123 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
|
|||
else
|
||||
|
||||
// Cycle collector macros for wrapper caches.
|
||||
//
|
||||
// The NS_DECL_*WRAPPERCACHE_* macros make it easier to mark classes as holding
|
||||
// just a single pointer to a JS value. That information is then used for
|
||||
// certain GC optimizations.
|
||||
|
||||
#define NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(_class, _base) \
|
||||
class NS_CYCLE_COLLECTION_INNERCLASS \
|
||||
: public nsXPCOMCycleCollectionParticipant { \
|
||||
public: \
|
||||
constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags = 0) \
|
||||
: nsXPCOMCycleCollectionParticipant(aFlags | \
|
||||
FlagMaybeSingleZoneJSHolder) {} \
|
||||
\
|
||||
private: \
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base) \
|
||||
NS_IMETHOD_(void) \
|
||||
Trace(void* p, const TraceCallbacks& cb, void* closure) override; \
|
||||
NS_IMETHOD_(void) \
|
||||
TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
|
||||
NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class) \
|
||||
}; \
|
||||
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class) \
|
||||
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; \
|
||||
NOT_INHERITED_CANT_OVERRIDE
|
||||
|
||||
#define NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class) \
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(_class, _class)
|
||||
|
||||
#define NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(_class, \
|
||||
_base_class) \
|
||||
class NS_CYCLE_COLLECTION_INNERCLASS \
|
||||
: public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) { \
|
||||
public: \
|
||||
constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags) \
|
||||
: NS_CYCLE_COLLECTION_CLASSNAME(_base_class)( \
|
||||
aFlags | FlagMaybeSingleZoneJSHolder) {} \
|
||||
\
|
||||
private: \
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class) \
|
||||
NS_IMETHOD_(void) \
|
||||
Trace(void* p, const TraceCallbacks& cb, void* closure) override; \
|
||||
NS_IMETHOD_(void) \
|
||||
TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
|
||||
NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class) \
|
||||
}; \
|
||||
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class) \
|
||||
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
|
||||
|
||||
#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_AMBIGUOUS( \
|
||||
_class, _base) \
|
||||
class NS_CYCLE_COLLECTION_INNERCLASS \
|
||||
: public nsXPCOMCycleCollectionParticipant { \
|
||||
public: \
|
||||
constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags) \
|
||||
: nsXPCOMCycleCollectionParticipant(aFlags | FlagMightSkip | \
|
||||
FlagMaybeSingleZoneJSHolder) {} \
|
||||
\
|
||||
private: \
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base) \
|
||||
NS_IMETHOD_(void) \
|
||||
Trace(void* p, const TraceCallbacks& cb, void* closure) override; \
|
||||
NS_IMETHOD_(void) \
|
||||
TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
|
||||
NS_IMETHOD_(bool) CanSkipReal(void* p, bool aRemovingAllowed) override; \
|
||||
NS_IMETHOD_(bool) CanSkipInCCReal(void* p) override; \
|
||||
NS_IMETHOD_(bool) CanSkipThisReal(void* p) override; \
|
||||
NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class) \
|
||||
}; \
|
||||
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class) \
|
||||
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; \
|
||||
NOT_INHERITED_CANT_OVERRIDE
|
||||
|
||||
#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(_class) \
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_AMBIGUOUS(_class, \
|
||||
_class)
|
||||
|
||||
#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_INHERITED( \
|
||||
_class, _base_class) \
|
||||
class NS_CYCLE_COLLECTION_INNERCLASS \
|
||||
: public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) { \
|
||||
public: \
|
||||
constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags = 0) \
|
||||
: NS_CYCLE_COLLECTION_CLASSNAME(_base_class)( \
|
||||
aFlags | FlagMightSkip | FlagMaybeSingleZoneJSHolder) {} \
|
||||
\
|
||||
private: \
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base_class) \
|
||||
NS_IMETHOD_(void) \
|
||||
Trace(void* p, const TraceCallbacks& cb, void* closure) override; \
|
||||
NS_IMETHOD_(void) \
|
||||
TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
|
||||
NS_IMETHOD_(bool) CanSkipReal(void* p, bool aRemovingAllowed) override; \
|
||||
NS_IMETHOD_(bool) CanSkipInCCReal(void* p) override; \
|
||||
NS_IMETHOD_(bool) CanSkipThisReal(void* p) override; \
|
||||
NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class) \
|
||||
}; \
|
||||
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class) \
|
||||
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
|
||||
|
||||
#define NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(_class) \
|
||||
void DeleteCycleCollectable(void) { delete this; } \
|
||||
class NS_CYCLE_COLLECTION_INNERCLASS : public nsScriptObjectTracer { \
|
||||
public: \
|
||||
constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags = 0) \
|
||||
: nsScriptObjectTracer(aFlags | FlagMaybeSingleZoneJSHolder) {} \
|
||||
\
|
||||
private: \
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class) \
|
||||
NS_IMETHOD_(void) \
|
||||
Trace(void* p, const TraceCallbacks& cb, void* closure) override; \
|
||||
NS_IMETHOD_(void) \
|
||||
TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
|
||||
static constexpr nsScriptObjectTracer* GetParticipant() { \
|
||||
return &_class::NS_CYCLE_COLLECTION_INNERNAME; \
|
||||
} \
|
||||
}; \
|
||||
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER \
|
||||
tmp->TraceWrapper(aCallbacks, aClosure);
|
||||
|
@ -429,33 +547,39 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
|
|||
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
|
||||
tmp->ReleaseWrapper(p);
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class) \
|
||||
static_assert(std::is_base_of<nsWrapperCache, _class>::value, \
|
||||
"Class should inherit nsWrapperCache"); \
|
||||
NS_IMPL_CYCLE_COLLECTION_SINGLE_ZONE_SCRIPT_HOLDER_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_class) \
|
||||
TraceWrapper(p, aCallbacks, aClosure); \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END \
|
||||
void NS_CYCLE_COLLECTION_CLASSNAME(_class)::TraceWrapper( \
|
||||
void* p, const TraceCallbacks& aCallbacks, void* aClosure) { \
|
||||
_class* tmp = DowncastCCParticipant<_class>(p); \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER \
|
||||
}
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(_class, ...) \
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WEAK(_class, ...) \
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
|
||||
|
@ -463,11 +587,10 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WEAK_PTR(_class, ...) \
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
|
||||
|
@ -475,24 +598,33 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
// This is used for wrapper cached classes that inherit from cycle
|
||||
// collected non-wrapper cached classes.
|
||||
#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_INHERITED(_class, _base, ...) \
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
|
||||
#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_INHERITED(_class, _base, ...) \
|
||||
static_assert(!std::is_base_of<nsWrapperCache, _base>::value, \
|
||||
"Base class should not inherit nsWrapperCache"); \
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base) \
|
||||
/* Assert somewhere, in this case in the traverse method, that the */ \
|
||||
/* parent isn't a single zone holder*/ \
|
||||
MOZ_ASSERT(!_base::NS_CYCLE_COLLECTION_INNERNAME.IsSingleZoneJSHolder()); \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
// if NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WITH_JS_MEMBERS is used to implement
|
||||
// a wrappercache class, one needs to use
|
||||
// NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS and its variants in the class
|
||||
// declaration.
|
||||
#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WITH_JS_MEMBERS( \
|
||||
class_, native_members_, js_members_) \
|
||||
static_assert(std::is_base_of<nsWrapperCache, class_>::value, \
|
||||
"Class should inherit nsWrapperCache"); \
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(class_) \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(class_) \
|
||||
using ::ImplCycleCollectionUnlink; \
|
||||
|
|
|
@ -31,7 +31,7 @@ NS_INTERFACE_MAP_END
|
|||
NS_IMPL_CYCLE_COLLECTING_ADDREF(CallbackObject)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(CallbackObject)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CallbackObject)
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(CallbackObject)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CallbackObject)
|
||||
tmp->ClearJSReferences();
|
||||
|
|
|
@ -20010,11 +20010,11 @@ class CGJSImplClass(CGBindingImplClass):
|
|||
]
|
||||
isupportsDecl = "NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n"
|
||||
ccDecl = (
|
||||
"NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(%s)\n" % descriptor.name
|
||||
"NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(%s)\n" % descriptor.name
|
||||
)
|
||||
extradefinitions = fill(
|
||||
"""
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(${ifaceName})
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(${ifaceName})
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(${ifaceName})
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mImpl)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)
|
||||
|
@ -20025,7 +20025,6 @@ class CGJSImplClass(CGBindingImplClass):
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(${ifaceName})
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(${ifaceName})
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(${ifaceName})
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(${ifaceName})
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace mozilla::dom {
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(SimpleGlobalObject)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SimpleGlobalObject)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SimpleGlobalObject)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
|
@ -32,8 +32,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(SimpleGlobalObject)
|
|||
tmp->TraverseObjectsInGlobal(cb);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(SimpleGlobalObject)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(SimpleGlobalObject)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(SimpleGlobalObject)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SimpleGlobalObject)
|
||||
|
|
|
@ -50,8 +50,7 @@ class SimpleGlobalObject : public nsIGlobalObject, public nsWrapperCache {
|
|||
JS::UndefinedHandleValue);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(SimpleGlobalObject,
|
||||
nsIGlobalObject)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SimpleGlobalObject)
|
||||
|
||||
// Gets the GlobalType of this SimpleGlobalObject.
|
||||
GlobalType Type() const { return mType; }
|
||||
|
|
|
@ -39,7 +39,7 @@ static nsCString FormatStackString(JSContext* cx, JSPrincipals* aPrincipals,
|
|||
|
||||
} // namespace
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(nsScriptErrorWithStack)
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsScriptErrorWithStack)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsScriptErrorWithStack)
|
||||
tmp->mException.setUndefined();
|
||||
|
|
|
@ -29,7 +29,7 @@ class TestInterfaceAsyncIterableDouble final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceAsyncIterableDouble)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceAsyncIterableDouble)
|
||||
|
||||
explicit TestInterfaceAsyncIterableDouble(nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
|
|
@ -28,7 +28,7 @@ class TestInterfaceAsyncIterableDoubleUnion final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(
|
||||
TestInterfaceAsyncIterableDoubleUnion)
|
||||
|
||||
explicit TestInterfaceAsyncIterableDoubleUnion(nsPIDOMWindowInner* aParent);
|
||||
|
|
|
@ -29,7 +29,7 @@ class TestInterfaceAsyncIterableSingle : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceAsyncIterableSingle)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceAsyncIterableSingle)
|
||||
|
||||
explicit TestInterfaceAsyncIterableSingle(nsPIDOMWindowInner* aParent,
|
||||
bool aFailToInit = false);
|
||||
|
|
|
@ -28,7 +28,7 @@ class TestInterfaceIterableDouble final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceIterableDouble)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceIterableDouble)
|
||||
|
||||
explicit TestInterfaceIterableDouble(nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
|
|
@ -27,7 +27,7 @@ class TestInterfaceIterableDoubleUnion final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceIterableDoubleUnion)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceIterableDoubleUnion)
|
||||
|
||||
explicit TestInterfaceIterableDoubleUnion(nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
|
|
@ -27,7 +27,7 @@ class TestInterfaceIterableSingle final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceIterableSingle)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceIterableSingle)
|
||||
|
||||
explicit TestInterfaceIterableSingle(nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace mozilla::dom {
|
|||
class TestInterfaceLength final : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(TestInterfaceLength)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(TestInterfaceLength)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(TestInterfaceLength)
|
||||
|
||||
public:
|
||||
TestInterfaceLength() = default;
|
||||
|
|
|
@ -25,7 +25,7 @@ class GlobalObject;
|
|||
class TestInterfaceMaplike final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceMaplike)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceMaplike)
|
||||
|
||||
explicit TestInterfaceMaplike(nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
|
|
@ -26,7 +26,7 @@ class TestInterfaceMaplikeJSObject final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceMaplikeJSObject)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceMaplikeJSObject)
|
||||
|
||||
explicit TestInterfaceMaplikeJSObject(nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
|
|
@ -27,7 +27,7 @@ class TestInterfaceMaplikeObject final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceMaplikeObject)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceMaplikeObject)
|
||||
|
||||
explicit TestInterfaceMaplikeObject(nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
|
|
@ -31,7 +31,7 @@ class TestInterfaceObservableArray final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceObservableArray)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceObservableArray)
|
||||
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
|
|
|
@ -25,7 +25,7 @@ class GlobalObject;
|
|||
class TestInterfaceSetlike final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceSetlike)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceSetlike)
|
||||
explicit TestInterfaceSetlike(JSContext* aCx, nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
|
|
|
@ -26,7 +26,7 @@ class TestInterfaceSetlikeNode final : public nsISupports,
|
|||
public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceSetlikeNode)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceSetlikeNode)
|
||||
explicit TestInterfaceSetlikeNode(JSContext* aCx,
|
||||
nsPIDOMWindowInner* aParent);
|
||||
nsPIDOMWindowInner* GetParentObject() const;
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace mozilla::dom {
|
|||
class TestTrialInterface final : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(TestTrialInterface)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(TestTrialInterface)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(TestTrialInterface)
|
||||
|
||||
public:
|
||||
TestTrialInterface() = default;
|
||||
|
|
|
@ -20,7 +20,7 @@ class WrapperCachedNonISupportsTestInterface final : public nsWrapperCache {
|
|||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(
|
||||
WrapperCachedNonISupportsTestInterface)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(
|
||||
WrapperCachedNonISupportsTestInterface)
|
||||
|
||||
public:
|
||||
|
|
|
@ -114,7 +114,7 @@ class Cache final : public nsISupports,
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Cache)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Cache)
|
||||
};
|
||||
|
||||
} // namespace cache
|
||||
|
|
|
@ -108,7 +108,7 @@ class CacheStorage final : public nsISupports,
|
|||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CacheStorage)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CacheStorage)
|
||||
};
|
||||
|
||||
} // namespace cache
|
||||
|
|
|
@ -19,7 +19,7 @@ class CanvasRenderingContext2D;
|
|||
class CanvasGradient : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasGradient)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasGradient)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CanvasGradient)
|
||||
|
||||
enum class Type : uint8_t { LINEAR = 0, RADIAL, CONIC };
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ struct DOMMatrix2DInit;
|
|||
class CanvasPath final : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPath)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPath)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CanvasPath)
|
||||
|
||||
nsCOMPtr<nsISupports> GetParentObject() { return mParent; }
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class CanvasPattern final : public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPattern)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPattern)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CanvasPattern)
|
||||
|
||||
enum class RepeatMode : uint8_t { REPEAT, REPEATX, REPEATY, NOREPEAT };
|
||||
|
||||
|
|
|
@ -905,7 +905,7 @@ CanvasShutdownObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
|||
NS_IMPL_CYCLE_COLLECTING_ADDREF(CanvasRenderingContext2D)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(CanvasRenderingContext2D)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(CanvasRenderingContext2D)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CanvasRenderingContext2D)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CanvasRenderingContext2D)
|
||||
// Make sure we remove ourselves from the list of demotable contexts (raw
|
||||
|
@ -954,8 +954,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D)
|
|||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(CanvasRenderingContext2D)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CanvasRenderingContext2D)
|
||||
if (nsCCUncollectableMarker::sGeneration && tmp->HasKnownLiveWrapper()) {
|
||||
dom::Element* canvasElement = tmp->mCanvasElement;
|
||||
|
|
|
@ -482,7 +482,7 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
|
|||
// nsISupports interface + CC
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(
|
||||
CanvasRenderingContext2D)
|
||||
|
||||
enum class CanvasMultiGetterType : uint8_t {
|
||||
|
|
|
@ -269,7 +269,7 @@ class WebGLBufferJS final : public nsWrapperCache, public webgl::ObjectJS {
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLBufferJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLBufferJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLBufferJS)
|
||||
|
||||
explicit WebGLBufferJS(const ClientWebGLContext& webgl)
|
||||
: webgl::ObjectJS(webgl) {}
|
||||
|
@ -301,7 +301,7 @@ class WebGLFramebufferJS final : public nsWrapperCache, public webgl::ObjectJS {
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLFramebufferJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLFramebufferJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLFramebufferJS)
|
||||
|
||||
explicit WebGLFramebufferJS(const ClientWebGLContext&, bool opaque = false);
|
||||
|
||||
|
@ -333,7 +333,7 @@ class WebGLProgramJS final : public nsWrapperCache, public webgl::ObjectJS {
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLProgramJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLProgramJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLProgramJS)
|
||||
// Must come first!
|
||||
// If the REFCOUNTING macro isn't declared first, the AddRef at
|
||||
// mInnerRef->js will panic when REFCOUNTING's "owning thread" var is still
|
||||
|
@ -395,7 +395,7 @@ class WebGLQueryJS final : public nsWrapperCache,
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQueryJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQueryJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLQueryJS)
|
||||
|
||||
explicit WebGLQueryJS(const ClientWebGLContext& webgl)
|
||||
: webgl::ObjectJS(webgl) {}
|
||||
|
@ -415,7 +415,7 @@ class WebGLRenderbufferJS final : public nsWrapperCache,
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLRenderbufferJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLRenderbufferJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLRenderbufferJS)
|
||||
|
||||
private:
|
||||
bool mHasBeenBound = false; // !IsRenderbuffer until Bind
|
||||
|
@ -434,7 +434,7 @@ class WebGLSamplerJS final : public nsWrapperCache, public webgl::ObjectJS {
|
|||
// IsSampler without Bind
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSamplerJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSamplerJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLSamplerJS)
|
||||
|
||||
explicit WebGLSamplerJS(const ClientWebGLContext& webgl)
|
||||
: webgl::ObjectJS(webgl) {}
|
||||
|
@ -453,7 +453,7 @@ class WebGLShaderJS final : public nsWrapperCache, public webgl::ObjectJS {
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLShaderJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLShaderJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLShaderJS)
|
||||
|
||||
private:
|
||||
const GLenum mType;
|
||||
|
@ -495,7 +495,7 @@ class WebGLSyncJS final : public nsWrapperCache,
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSyncJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSyncJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLSyncJS)
|
||||
|
||||
explicit WebGLSyncJS(const ClientWebGLContext& webgl)
|
||||
: webgl::ObjectJS(webgl) {}
|
||||
|
@ -516,7 +516,7 @@ class WebGLTextureJS final : public nsWrapperCache, public webgl::ObjectJS {
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTextureJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTextureJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLTextureJS)
|
||||
|
||||
explicit WebGLTextureJS(const ClientWebGLContext& webgl)
|
||||
: webgl::ObjectJS(webgl) {}
|
||||
|
@ -542,7 +542,7 @@ class WebGLTransformFeedbackJS final : public nsWrapperCache,
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTransformFeedbackJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTransformFeedbackJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLTransformFeedbackJS)
|
||||
|
||||
explicit WebGLTransformFeedbackJS(const ClientWebGLContext&);
|
||||
|
||||
|
@ -567,7 +567,7 @@ class WebGLUniformLocationJS final : public nsWrapperCache,
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLUniformLocationJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLUniformLocationJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLUniformLocationJS)
|
||||
|
||||
WebGLUniformLocationJS(const ClientWebGLContext& webgl,
|
||||
std::weak_ptr<webgl::LinkResult> parent, uint32_t loc,
|
||||
|
@ -595,7 +595,7 @@ class WebGLVertexArrayJS final : public nsWrapperCache, public webgl::ObjectJS {
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLVertexArrayJS)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLVertexArrayJS)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLVertexArrayJS)
|
||||
|
||||
explicit WebGLVertexArrayJS(const ClientWebGLContext&);
|
||||
|
||||
|
@ -713,7 +713,7 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
|
|||
// ----------------------------- Lifetime and DOM ---------------------------
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ClientWebGLContext)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ClientWebGLContext)
|
||||
|
||||
JSObject* WrapObject(JSContext* cx,
|
||||
JS::Handle<JSObject*> givenProto) override {
|
||||
|
|
|
@ -19,7 +19,7 @@ class ClientWebGLExtensionBase : public nsWrapperCache {
|
|||
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(ClientWebGLExtensionBase)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(ClientWebGLExtensionBase)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(ClientWebGLExtensionBase)
|
||||
|
||||
protected:
|
||||
explicit ClientWebGLExtensionBase(ClientWebGLContext& context)
|
||||
|
|
|
@ -79,7 +79,7 @@ struct ImageBitmapCloneData final {
|
|||
class ImageBitmap final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageBitmap)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ImageBitmap)
|
||||
|
||||
nsCOMPtr<nsIGlobalObject> GetParentObject() const { return mParent; }
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class ImageBitmapRenderingContext final
|
|||
// nsISupports interface + CC
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageBitmapRenderingContext)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ImageBitmapRenderingContext)
|
||||
|
||||
void GetCanvas(
|
||||
Nullable<OwningHTMLCanvasElementOrOffscreenCanvas>& retval) const;
|
||||
|
|
|
@ -38,13 +38,20 @@ class OffscreenCanvasShutdownObserver final {
|
|||
OffscreenCanvasRenderingContext2D* mOwner;
|
||||
};
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_INHERITED(
|
||||
OffscreenCanvasRenderingContext2D, CanvasRenderingContext2D)
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED(OffscreenCanvasRenderingContext2D,
|
||||
CanvasRenderingContext2D)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(OffscreenCanvasRenderingContext2D)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_END_INHERITING(CanvasRenderingContext2D)
|
||||
|
||||
// Need to use NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED
|
||||
// and dummy trace since we're missing some _SKIPPABLE_ macros without
|
||||
// SCRIPT_HOLDER.
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(
|
||||
OffscreenCanvasRenderingContext2D, CanvasRenderingContext2D)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(OffscreenCanvasRenderingContext2D)
|
||||
return tmp->HasKnownLiveWrapper();
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
|
||||
|
|
|
@ -27,7 +27,7 @@ struct XRWebGLLayerInit;
|
|||
class XRWebGLLayer final : public nsWrapperCache {
|
||||
public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(XRWebGLLayer)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(XRWebGLLayer)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(XRWebGLLayer)
|
||||
|
||||
explicit XRWebGLLayer(
|
||||
nsISupports* aParent, XRSession& aSession, bool aIgnoreDepthValues,
|
||||
|
|
|
@ -80,7 +80,7 @@ class Client final : public nsISupports, public nsWrapperCache {
|
|||
ErrorResult& aRv);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(mozilla::dom::Client)
|
||||
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(mozilla::dom::Client)
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче