bindings: Makes SVGAnimatedProperty ScriptWrappable.

Makes SVGAnimatedProperty and its subclasses inherit from ScriptWrappable.
This change increases the size of SVGAnimatedProperty and its subclasses
by 8 bytes (on 64-bit env).

BUG=235436

Review URL: https://codereview.chromium.org/720113003

git-svn-id: svn://svn.chromium.org/blink/trunk@185346 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 61745270
......@@ -256,6 +256,25 @@ public: \
private: \
static const WrapperTypeInfo& s_wrapperTypeInfo
// Defines 'wrapperTypeInfo' virtual method, which should never be called.
//
// This macro is used when there exists a class hierarchy with a root class
// and most of the subclasses are script-wrappable but not all of them.
// In that case, the root class can inherit from ScriptWrappable and use
// this macro, and let subclasses have a choice whether or not use
// DEFINE_WRAPPERTYPEINFO macro. The script-wrappable subclasses which have
// corresponding IDL file must call DEFINE_WRAPPERTYPEINFO, and the others
// must not.
#define DEFINE_WRAPPERTYPEINFO_NOT_REACHED() \
public: \
virtual const WrapperTypeInfo* wrapperTypeInfo() const override \
{ \
ASSERT_NOT_REACHED(); \
return 0; \
} \
private: \
typedef void end_of_define_wrappertypeinfo_not_reached_t
} // namespace blink
#endif // ScriptWrappable_h
......@@ -40,6 +40,7 @@ namespace blink {
class SVGMarkerElement;
class SVGAnimatedAngle final : public SVGAnimatedProperty<SVGAngle> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedAngle> create(SVGMarkerElement* contextElement)
{
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
RuntimeEnabled=SVG1DOM,
MeasureAs=SVG1DOM,
......
......@@ -37,6 +37,7 @@
namespace blink {
class SVGAnimatedBoolean final : public SVGAnimatedProperty<SVGBoolean> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedBoolean> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGBoolean> initialValue)
{
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
RuntimeEnabled=SVG1DOM,
......
......@@ -25,7 +25,6 @@
[
ImplementedAs=SVGAnimatedEnumerationBase,
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
RuntimeEnabled=SVG1DOM,
......
......@@ -37,6 +37,7 @@
namespace blink {
class SVGAnimatedEnumerationBase : public SVGAnimatedProperty<SVGEnumerationBase> {
DEFINE_WRAPPERTYPEINFO();
public:
virtual ~SVGAnimatedEnumerationBase();
......
......@@ -41,6 +41,7 @@ class SVGAnimatedIntegerOptionalInteger;
// SVG Spec: http://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedInteger
class SVGAnimatedInteger : public SVGAnimatedProperty<SVGInteger> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedInteger> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGInteger> initialValue)
{
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
RuntimeEnabled=SVG1DOM,
......
......@@ -37,6 +37,7 @@
namespace blink {
class SVGAnimatedLength : public SVGAnimatedProperty<SVGLength> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedLength> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGLength> initialValue, SVGLengthNegativeValuesMode negativeValuesMode)
{
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
RuntimeEnabled=SVG1DOM,
MeasureAs=SVG1DOM,
......
......@@ -36,7 +36,19 @@
namespace blink {
typedef SVGAnimatedProperty<SVGLengthList> SVGAnimatedLengthList;
// SVG Spec: http://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedLengthList
class SVGAnimatedLengthList final : public SVGAnimatedProperty<SVGLengthList> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedLengthList> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGLengthList> initialValue)
{
return adoptRefWillBeNoop(new SVGAnimatedLengthList(contextElement, attributeName, initialValue));
}
protected:
SVGAnimatedLengthList(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGLengthList> initialValue)
: SVGAnimatedProperty<SVGLengthList>(contextElement, attributeName, initialValue) { }
};
} // namespace blink
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
RuntimeEnabled=SVG1DOM,
MeasureAs=SVG1DOM,
......
......@@ -41,6 +41,7 @@ class SVGAnimatedNumberOptionalNumber;
// SVG Spec: http://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedNumber
class SVGAnimatedNumber : public SVGAnimatedProperty<SVGNumber> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedNumber> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGNumber> initialValue)
{
......
......@@ -25,7 +25,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
RuntimeEnabled=SVG1DOM,
......
......@@ -36,7 +36,19 @@
namespace blink {
typedef SVGAnimatedProperty<SVGNumberList> SVGAnimatedNumberList;
// SVG Spec: http://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedNumberList
class SVGAnimatedNumberList final : public SVGAnimatedProperty<SVGNumberList> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedNumberList> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGNumberList> initialValue)
{
return adoptRefWillBeNoop(new SVGAnimatedNumberList(contextElement, attributeName, initialValue));
}
protected:
SVGAnimatedNumberList(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGNumberList> initialValue)
: SVGAnimatedProperty<SVGNumberList>(contextElement, attributeName, initialValue) { }
};
} // namespace blink
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
RuntimeEnabled=SVG1DOM,
MeasureAs=SVG1DOM,
......
......@@ -37,6 +37,7 @@
namespace blink {
class SVGAnimatedPreserveAspectRatio : public SVGAnimatedProperty<SVGPreserveAspectRatio> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedPreserveAspectRatio> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGPreserveAspectRatio> initialValue)
{
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
RuntimeEnabled=SVG1DOM,
MeasureAs=SVG1DOM,
......
......@@ -37,6 +37,7 @@
namespace blink {
class SVGAnimatedRect : public SVGAnimatedProperty<SVGRect> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedRect> create(SVGElement* contextElement, const QualifiedName& attributeName)
{
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
RuntimeEnabled=SVG1DOM,
MeasureAs=SVG1DOM,
......
......@@ -37,6 +37,7 @@
namespace blink {
class SVGAnimatedString final : public SVGAnimatedProperty<SVGString> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedString> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGString> initialValue)
{
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
RuntimeEnabled=SVG1DOM,
MeasureAs=SVG1DOM,
......
......@@ -36,7 +36,19 @@
namespace blink {
typedef SVGAnimatedProperty<SVGTransformList> SVGAnimatedTransformList;
// SVG Spec: http://www.w3.org/TR/SVG11/coords.html#InterfaceSVGAnimatedTransformList
class SVGAnimatedTransformList final : public SVGAnimatedProperty<SVGTransformList> {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<SVGAnimatedTransformList> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGTransformList> initialValue)
{
return adoptRefWillBeNoop(new SVGAnimatedTransformList(contextElement, attributeName, initialValue));
}
protected:
SVGAnimatedTransformList(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<SVGTransformList> initialValue)
: SVGAnimatedProperty<SVGTransformList>(contextElement, attributeName, initialValue) { }
};
} // namespace blink
......
......@@ -24,7 +24,6 @@
*/
[
NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
RuntimeEnabled=SVG1DOM,
MeasureAs=SVG1DOM,
......
......@@ -46,7 +46,8 @@ namespace blink {
class SVGElement;
class SVGAnimatedPropertyBase : public RefCountedWillBeGarbageCollectedFinalized<SVGAnimatedPropertyBase>, public ScriptWrappableBase {
class SVGAnimatedPropertyBase : public RefCountedWillBeGarbageCollectedFinalized<SVGAnimatedPropertyBase>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO_NOT_REACHED();
WTF_MAKE_NONCOPYABLE(SVGAnimatedPropertyBase);
public:
virtual ~SVGAnimatedPropertyBase();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment