Bug 888685 - Remove nsISupports from remaining SVG DOM classes r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D84915
This commit is contained in:
longsonr 2020-08-07 22:50:28 +00:00
Родитель 2de46c6ff5
Коммит aed118e1f6
15 изменённых файлов: 38 добавлений и 90 удалений

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

@ -14,13 +14,8 @@ namespace dom {
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedEnumeration,
mSVGElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGAnimatedEnumeration)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGAnimatedEnumeration)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGAnimatedEnumeration)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGAnimatedEnumeration, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGAnimatedEnumeration, Release)
JSObject* DOMSVGAnimatedEnumeration::WrapObject(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {

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

@ -14,10 +14,10 @@
namespace mozilla {
namespace dom {
class DOMSVGAnimatedEnumeration : public nsISupports, public nsWrapperCache {
class DOMSVGAnimatedEnumeration : public nsWrapperCache {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGAnimatedEnumeration)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedEnumeration)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedEnumeration)
SVGElement* GetParentObject() const { return mSVGElement; }

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

@ -14,13 +14,8 @@ namespace dom {
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedInteger,
mSVGElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGAnimatedInteger)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGAnimatedInteger)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGAnimatedInteger)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGAnimatedInteger, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGAnimatedInteger, Release)
JSObject* DOMSVGAnimatedInteger::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {

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

@ -14,10 +14,10 @@
namespace mozilla {
namespace dom {
class DOMSVGAnimatedInteger : public nsISupports, public nsWrapperCache {
class DOMSVGAnimatedInteger : public nsWrapperCache {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGAnimatedInteger)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedInteger)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedInteger)
SVGElement* GetParentObject() const { return mSVGElement; }

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

@ -14,13 +14,8 @@ namespace dom {
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedNumber,
mSVGElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGAnimatedNumber)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGAnimatedNumber)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGAnimatedNumber)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGAnimatedNumber, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGAnimatedNumber, Release)
JSObject* DOMSVGAnimatedNumber::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {

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

@ -15,10 +15,10 @@
namespace mozilla {
namespace dom {
class DOMSVGAnimatedNumber : public nsISupports, public nsWrapperCache {
class DOMSVGAnimatedNumber : public nsWrapperCache {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGAnimatedNumber)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedNumber)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedNumber)
SVGElement* GetParentObject() const { return mSVGElement; }

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

@ -50,14 +50,8 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGLength)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGLength)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGLength)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGLength)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(DOMSVGLength) // pseudo-interface
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGLength, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGLength, Release)
DOMSVGLength::DOMSVGLength(DOMSVGLengthList* aList, uint8_t aAttrEnum,
uint32_t aListIndex, bool aIsAnimValItem)

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

@ -15,18 +15,6 @@
#include "mozilla/Attributes.h"
#include "nsWrapperCache.h"
// We make DOMSVGLength a pseudo-interface to allow us to QI to it in order to
// check that the objects that scripts pass to DOMSVGLengthList methods are our
// *native* length objects.
//
// {A8468350-7F7B-4976-9A7E-3765A1DADF9A}
#define MOZILLA_DOMSVGLENGTH_IID \
{ \
0xA8468350, 0x7F7B, 0x4976, { \
0x9A, 0x7E, 0x37, 0x65, 0xA1, 0xDA, 0xDF, 0x9A \
} \
}
#define MOZ_SVG_LIST_INDEX_BIT_COUNT 22 // supports > 4 million list items
namespace mozilla {
@ -78,7 +66,7 @@ class SVGElement;
* if-else as appropriate. The bug for doing that work is:
* https://bugzilla.mozilla.org/show_bug.cgi?id=571734
*/
class DOMSVGLength final : public nsISupports, public nsWrapperCache {
class DOMSVGLength final : public nsWrapperCache {
template <class T>
friend class AutoChangeLengthListNotifier;
@ -92,9 +80,8 @@ class DOMSVGLength final : public nsISupports, public nsWrapperCache {
~DOMSVGLength();
public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGLENGTH_IID)
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGLength)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGLength)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGLength)
/**
* Generic ctor for DOMSVGLength objects that are created for an attribute.
@ -239,8 +226,6 @@ class DOMSVGLength final : public nsISupports, public nsWrapperCache {
RefPtr<dom::SVGElement> mSVGElement;
};
NS_DEFINE_STATIC_IID_ACCESSOR(DOMSVGLength, MOZILLA_DOMSVGLENGTH_IID)
} // namespace dom
} // namespace mozilla

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

@ -10,7 +10,6 @@
#include "DOMSVGLength.h"
#include "nsError.h"
#include "SVGAnimatedLengthList.h"
#include "nsCOMPtr.h"
#include "mozilla/dom/SVGLengthListBinding.h"
#include <algorithm>
@ -293,7 +292,7 @@ already_AddRefed<DOMSVGLength> DOMSVGLengthList::RemoveItem(
MaybeRemoveItemFromAnimValListAt(index);
// We have to return the removed item, so get it, creating it if necessary:
nsCOMPtr<DOMSVGLength> result = GetItemAt(index);
RefPtr<DOMSVGLength> result = GetItemAt(index);
// Notify the DOM item of removal *before* modifying the lists so that the
// DOM item can copy its *old* value:

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

@ -42,13 +42,8 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGNumber)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGNumber)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGNumber)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGNumber)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGNumber, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGNumber, Release)
DOMSVGNumber::DOMSVGNumber(DOMSVGNumberList* aList, uint8_t aAttrEnum,
uint32_t aListIndex, bool aIsAnimValItem)

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

@ -37,7 +37,7 @@ class SVGSVGElement;
*
* See the comment in DOMSVGLength.h (yes, LENGTH), which applies here too.
*/
class DOMSVGNumber final : public nsISupports, public nsWrapperCache {
class DOMSVGNumber final : public nsWrapperCache {
template <class T>
friend class AutoChangeNumberListNotifier;
@ -51,8 +51,8 @@ class DOMSVGNumber final : public nsISupports, public nsWrapperCache {
}
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGNumber)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGNumber)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGNumber)
/**
* Generic ctor for DOMSVGNumber objects that are created for an attribute.

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

@ -24,13 +24,9 @@ namespace mozilla {
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(
DOMSVGAnimatedPreserveAspectRatio, mSVGElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGAnimatedPreserveAspectRatio)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGAnimatedPreserveAspectRatio)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGAnimatedPreserveAspectRatio)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGAnimatedPreserveAspectRatio, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGAnimatedPreserveAspectRatio,
Release)
JSObject* DOMSVGAnimatedPreserveAspectRatio::WrapObject(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {

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

@ -105,12 +105,12 @@ class SVGAnimatedPreserveAspectRatio final {
};
namespace dom {
class DOMSVGAnimatedPreserveAspectRatio final : public nsISupports,
public nsWrapperCache {
class DOMSVGAnimatedPreserveAspectRatio final : public nsWrapperCache {
~DOMSVGAnimatedPreserveAspectRatio();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(
DOMSVGAnimatedPreserveAspectRatio)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(
DOMSVGAnimatedPreserveAspectRatio)
DOMSVGAnimatedPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal,

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

@ -19,13 +19,8 @@ namespace mozilla {
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGPreserveAspectRatio,
mSVGElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGPreserveAspectRatio)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGPreserveAspectRatio)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGPreserveAspectRatio)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGPreserveAspectRatio, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGPreserveAspectRatio, Release)
static const char* sAlignStrings[] = {
"none", "xMinYMin", "xMidYMin", "xMaxYMin", "xMinYMid",

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

@ -81,11 +81,10 @@ class SVGPreserveAspectRatio final {
namespace dom {
class DOMSVGPreserveAspectRatio final : public nsISupports,
public nsWrapperCache {
class DOMSVGPreserveAspectRatio final : public nsWrapperCache {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPreserveAspectRatio)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGPreserveAspectRatio)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGPreserveAspectRatio)
DOMSVGPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal,
SVGElement* aSVGElement, bool aIsBaseValue)