diff --git a/content/base/src/ResponsiveImageSelector.cpp b/content/base/src/ResponsiveImageSelector.cpp index 0a1da94860d..74a002f3f12 100644 --- a/content/base/src/ResponsiveImageSelector.cpp +++ b/content/base/src/ResponsiveImageSelector.cpp @@ -22,7 +22,10 @@ using namespace mozilla::dom; namespace mozilla { namespace dom { -NS_IMPL_ISUPPORTS0(ResponsiveImageSelector); +NS_IMPL_CYCLE_COLLECTION(ResponsiveImageSelector, mContent) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(ResponsiveImageSelector, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(ResponsiveImageSelector, Release) static bool ParseInteger(const nsAString& aString, int32_t& aInt) diff --git a/content/base/src/ResponsiveImageSelector.h b/content/base/src/ResponsiveImageSelector.h index da69c2df70f..027cac63edf 100644 --- a/content/base/src/ResponsiveImageSelector.h +++ b/content/base/src/ResponsiveImageSelector.h @@ -9,6 +9,7 @@ #include "nsISupports.h" #include "nsIContent.h" #include "nsString.h" +#include "nsCycleCollectionParticipant.h" class nsMediaQuery; class nsCSSValue; @@ -18,11 +19,13 @@ namespace dom { class ResponsiveImageCandidate; -class ResponsiveImageSelector : public nsISupports +class ResponsiveImageSelector { friend class ResponsiveImageCandidate; public: - NS_DECL_ISUPPORTS + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(ResponsiveImageSelector) + NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(ResponsiveImageSelector) + explicit ResponsiveImageSelector(nsIContent* aContent); // NOTE ABOUT CURRENT SELECTION diff --git a/content/html/content/src/HTMLImageElement.cpp b/content/html/content/src/HTMLImageElement.cpp index 7c8d3501ff6..42ba380b287 100644 --- a/content/html/content/src/HTMLImageElement.cpp +++ b/content/html/content/src/HTMLImageElement.cpp @@ -116,6 +116,9 @@ HTMLImageElement::~HTMLImageElement() NS_IMPL_ADDREF_INHERITED(HTMLImageElement, Element) NS_IMPL_RELEASE_INHERITED(HTMLImageElement, Element) +NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLImageElement, + nsGenericHTMLElement, + mResponsiveSelector) // QueryInterface implementation for HTMLImageElement NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLImageElement) diff --git a/content/html/content/src/HTMLImageElement.h b/content/html/content/src/HTMLImageElement.h index 315d21b1843..bcd716ab9dd 100644 --- a/content/html/content/src/HTMLImageElement.h +++ b/content/html/content/src/HTMLImageElement.h @@ -12,6 +12,7 @@ #include "nsIDOMHTMLImageElement.h" #include "imgRequestProxy.h" #include "Units.h" +#include "nsCycleCollectionParticipant.h" // Only needed for IsPictureEnabled() #include "mozilla/dom/HTMLPictureElement.h" @@ -37,6 +38,9 @@ public: const Optional& aHeight, ErrorResult& aError); + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLImageElement, + nsGenericHTMLElement) + // nsISupports NS_DECL_ISUPPORTS_INHERITED