Commit 5bc3c54e authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[wrapper-tracing] Fix tracing across all SVG* elements

Bug: 
Change-Id: I9e206d26a2c11fbf5193170108c8f4354d32fb4e
Reviewed-on: https://chromium-review.googlesource.com/567500Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485948}
parent fdef07af
...@@ -135,7 +135,8 @@ SVGAngleTearOff* SVGAngleTearOff::CreateDetached() { ...@@ -135,7 +135,8 @@ SVGAngleTearOff* SVGAngleTearOff::CreateDetached() {
} }
DEFINE_TRACE_WRAPPERS(SVGAngleTearOff) { DEFINE_TRACE_WRAPPERS(SVGAngleTearOff) {
visitor->TraceWrappers(contextElement()); SVGPropertyTearOff<SVGAngle>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -48,7 +48,8 @@ class SVGAnimatedBoolean final : public SVGAnimatedProperty<SVGBoolean>, ...@@ -48,7 +48,8 @@ class SVGAnimatedBoolean final : public SVGAnimatedProperty<SVGBoolean>,
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGBoolean>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
protected: protected:
......
...@@ -71,7 +71,7 @@ class SVGAnimatedEnumeration : public SVGAnimatedEnumerationBase { ...@@ -71,7 +71,7 @@ class SVGAnimatedEnumeration : public SVGAnimatedEnumerationBase {
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGAnimatedEnumerationBase::TraceWrappers(visitor);
} }
protected: protected:
......
...@@ -47,6 +47,11 @@ class SVGAnimatedEnumerationBase ...@@ -47,6 +47,11 @@ class SVGAnimatedEnumerationBase
void setBaseVal(unsigned short, ExceptionState&); void setBaseVal(unsigned short, ExceptionState&);
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
SVGAnimatedProperty<SVGEnumerationBase>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
}
protected: protected:
SVGAnimatedEnumerationBase(SVGElement* context_element, SVGAnimatedEnumerationBase(SVGElement* context_element,
const QualifiedName& attribute_name, const QualifiedName& attribute_name,
......
...@@ -50,7 +50,8 @@ DEFINE_TRACE(SVGAnimatedInteger) { ...@@ -50,7 +50,8 @@ DEFINE_TRACE(SVGAnimatedInteger) {
} }
DEFINE_TRACE_WRAPPERS(SVGAnimatedInteger) { DEFINE_TRACE_WRAPPERS(SVGAnimatedInteger) {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGInteger>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -53,7 +53,8 @@ SVGParsingError SVGAnimatedLength::SetBaseValueAsString(const String& value) { ...@@ -53,7 +53,8 @@ SVGParsingError SVGAnimatedLength::SetBaseValueAsString(const String& value) {
} }
DEFINE_TRACE_WRAPPERS(SVGAnimatedLength) { DEFINE_TRACE_WRAPPERS(SVGAnimatedLength) {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGLength>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -52,7 +52,8 @@ class SVGAnimatedLengthList final : public SVGAnimatedProperty<SVGLengthList>, ...@@ -52,7 +52,8 @@ class SVGAnimatedLengthList final : public SVGAnimatedProperty<SVGLengthList>,
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGLengthList>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
protected: protected:
......
...@@ -50,7 +50,8 @@ DEFINE_TRACE(SVGAnimatedNumber) { ...@@ -50,7 +50,8 @@ DEFINE_TRACE(SVGAnimatedNumber) {
} }
DEFINE_TRACE_WRAPPERS(SVGAnimatedNumber) { DEFINE_TRACE_WRAPPERS(SVGAnimatedNumber) {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGNumber>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -50,7 +50,8 @@ class SVGAnimatedNumberList final : public SVGAnimatedProperty<SVGNumberList>, ...@@ -50,7 +50,8 @@ class SVGAnimatedNumberList final : public SVGAnimatedProperty<SVGNumberList>,
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGNumberList>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
protected: protected:
......
...@@ -50,7 +50,8 @@ class SVGAnimatedPreserveAspectRatio ...@@ -50,7 +50,8 @@ class SVGAnimatedPreserveAspectRatio
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGPreserveAspectRatio>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
protected: protected:
......
...@@ -48,7 +48,8 @@ class SVGAnimatedRect : public SVGAnimatedProperty<SVGRect>, ...@@ -48,7 +48,8 @@ class SVGAnimatedRect : public SVGAnimatedProperty<SVGRect>,
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGRect>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
protected: protected:
......
...@@ -20,7 +20,8 @@ String SVGAnimatedString::animVal() { ...@@ -20,7 +20,8 @@ String SVGAnimatedString::animVal() {
} }
DEFINE_TRACE_WRAPPERS(SVGAnimatedString) { DEFINE_TRACE_WRAPPERS(SVGAnimatedString) {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGString>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -54,7 +54,8 @@ class SVGAnimatedTransformList final ...@@ -54,7 +54,8 @@ class SVGAnimatedTransformList final
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGAnimatedProperty<SVGTransformList>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
protected: protected:
......
...@@ -52,7 +52,9 @@ class SVGLengthListTearOff final ...@@ -52,7 +52,9 @@ class SVGLengthListTearOff final
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGListPropertyTearOffHelper<SVGLengthListTearOff,
SVGLengthList>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
private: private:
......
...@@ -250,7 +250,8 @@ SVGLengthTearOff* SVGLengthTearOff::CreateDetached() { ...@@ -250,7 +250,8 @@ SVGLengthTearOff* SVGLengthTearOff::CreateDetached() {
} }
DEFINE_TRACE_WRAPPERS(SVGLengthTearOff) { DEFINE_TRACE_WRAPPERS(SVGLengthTearOff) {
visitor->TraceWrappers(contextElement()); SVGPropertyTearOff<SVGLength>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -52,7 +52,9 @@ class SVGNumberListTearOff final ...@@ -52,7 +52,9 @@ class SVGNumberListTearOff final
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGListPropertyTearOffHelper<SVGNumberListTearOff,
SVGNumberList>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
private: private:
......
...@@ -58,7 +58,8 @@ SVGNumberTearOff* SVGNumberTearOff::CreateDetached() { ...@@ -58,7 +58,8 @@ SVGNumberTearOff* SVGNumberTearOff::CreateDetached() {
} }
DEFINE_TRACE_WRAPPERS(SVGNumberTearOff) { DEFINE_TRACE_WRAPPERS(SVGNumberTearOff) {
visitor->TraceWrappers(contextElement()); SVGPropertyTearOff<SVGNumber>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -51,7 +51,9 @@ class SVGPointListTearOff final ...@@ -51,7 +51,9 @@ class SVGPointListTearOff final
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() { DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappers(contextElement()); SVGListPropertyTearOffHelper<SVGPointListTearOff,
SVGPointList>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
private: private:
......
...@@ -73,7 +73,8 @@ SVGPointTearOff* SVGPointTearOff::CreateDetached(const FloatPoint& point) { ...@@ -73,7 +73,8 @@ SVGPointTearOff* SVGPointTearOff::CreateDetached(const FloatPoint& point) {
} }
DEFINE_TRACE_WRAPPERS(SVGPointTearOff) { DEFINE_TRACE_WRAPPERS(SVGPointTearOff) {
visitor->TraceWrappers(contextElement()); SVGPropertyTearOff<SVGPoint>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -82,7 +82,8 @@ SVGPreserveAspectRatioTearOff::SVGPreserveAspectRatioTearOff( ...@@ -82,7 +82,8 @@ SVGPreserveAspectRatioTearOff::SVGPreserveAspectRatioTearOff(
attribute_name) {} attribute_name) {}
DEFINE_TRACE_WRAPPERS(SVGPreserveAspectRatioTearOff) { DEFINE_TRACE_WRAPPERS(SVGPreserveAspectRatioTearOff) {
visitor->TraceWrappers(contextElement()); SVGPropertyTearOff<SVGPreserveAspectRatio>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -85,7 +85,8 @@ SVGRectTearOff* SVGRectTearOff::CreateDetached(const FloatRect& rect) { ...@@ -85,7 +85,8 @@ SVGRectTearOff* SVGRectTearOff::CreateDetached(const FloatRect& rect) {
} }
DEFINE_TRACE_WRAPPERS(SVGRectTearOff) { DEFINE_TRACE_WRAPPERS(SVGRectTearOff) {
visitor->TraceWrappers(contextElement()); SVGPropertyTearOff<SVGRect>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -45,6 +45,7 @@ SVGStringListTearOff::SVGStringListTearOff( ...@@ -45,6 +45,7 @@ SVGStringListTearOff::SVGStringListTearOff(
attribute_name) {} attribute_name) {}
DEFINE_TRACE_WRAPPERS(SVGStringListTearOff) { DEFINE_TRACE_WRAPPERS(SVGStringListTearOff) {
visitor->TraceWrappers(contextElement()); SVGPropertyTearOff<SVGStringList>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} }
...@@ -62,7 +62,9 @@ SVGTransformTearOff* SVGTransformListTearOff::consolidate( ...@@ -62,7 +62,9 @@ SVGTransformTearOff* SVGTransformListTearOff::consolidate(
} }
DEFINE_TRACE_WRAPPERS(SVGTransformListTearOff) { DEFINE_TRACE_WRAPPERS(SVGTransformListTearOff) {
visitor->TraceWrappers(contextElement()); SVGListPropertyTearOffHelper<SVGTransformListTearOff,
SVGTransformList>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
} }
} // namespace blink } // namespace blink
...@@ -52,6 +52,11 @@ DEFINE_TRACE(SVGTransformTearOff) { ...@@ -52,6 +52,11 @@ DEFINE_TRACE(SVGTransformTearOff) {
SVGPropertyTearOff<SVGTransform>::Trace(visitor); SVGPropertyTearOff<SVGTransform>::Trace(visitor);
} }
DEFINE_TRACE_WRAPPERS(SVGTransformTearOff) {
SVGPropertyTearOff<SVGTransform>::TraceWrappers(visitor);
ScriptWrappable::TraceWrappers(visitor);
}
SVGTransformTearOff* SVGTransformTearOff::CreateDetached() { SVGTransformTearOff* SVGTransformTearOff::CreateDetached() {
return Create(SVGTransform::Create(blink::kSvgTransformMatrix), nullptr, return Create(SVGTransform::Create(blink::kSvgTransformMatrix), nullptr,
kPropertyIsNotAnimVal, QualifiedName::Null()); kPropertyIsNotAnimVal, QualifiedName::Null());
...@@ -130,8 +135,4 @@ void SVGTransformTearOff::setSkewY(float y, ExceptionState& exception_state) { ...@@ -130,8 +135,4 @@ void SVGTransformTearOff::setSkewY(float y, ExceptionState& exception_state) {
CommitChange(); CommitChange();
} }
DEFINE_TRACE_WRAPPERS(SVGTransformTearOff) {
visitor->TraceWrappers(contextElement());
}
} // namespace blink } // namespace blink
...@@ -81,6 +81,10 @@ class SVGAnimatedPropertyBase ...@@ -81,6 +81,10 @@ class SVGAnimatedPropertyBase
DEFINE_INLINE_VIRTUAL_TRACE() {} DEFINE_INLINE_VIRTUAL_TRACE() {}
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappersWithManualWriteBarrier(context_element_.Get());
}
protected: protected:
SVGAnimatedPropertyBase(AnimatedPropertyType, SVGAnimatedPropertyBase(AnimatedPropertyType,
SVGElement*, SVGElement*,
......
...@@ -182,6 +182,10 @@ class SVGListPropertyTearOffHelper : public SVGPropertyTearOff<ListProperty> { ...@@ -182,6 +182,10 @@ class SVGListPropertyTearOffHelper : public SVGPropertyTearOff<ListProperty> {
return CreateItemTearOff(value); return CreateItemTearOff(value);
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
SVGPropertyTearOff<ListProperty>::TraceWrappers(visitor);
}
protected: protected:
SVGListPropertyTearOffHelper( SVGListPropertyTearOffHelper(
ListPropertyType* target, ListPropertyType* target,
......
...@@ -66,11 +66,18 @@ class SVGPropertyTearOffBase ...@@ -66,11 +66,18 @@ class SVGPropertyTearOffBase
DCHECK(context_element); DCHECK(context_element);
DCHECK(attribute_name != QualifiedName::Null()); DCHECK(attribute_name != QualifiedName::Null());
context_element_ = context_element; context_element_ = context_element;
// Requires SVGPropertyTearOffBase to be the left-most class in the
// inheritance hierarchy.
ScriptWrappableVisitor::WriteBarrier(this, context_element_.Get());
attribute_name_ = attribute_name; attribute_name_ = attribute_name;
} }
DEFINE_INLINE_VIRTUAL_TRACE() {} DEFINE_INLINE_VIRTUAL_TRACE() {}
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
visitor->TraceWrappersWithManualWriteBarrier(context_element_.Get());
}
static void ThrowReadOnly(ExceptionState&); static void ThrowReadOnly(ExceptionState&);
protected: protected:
...@@ -108,6 +115,10 @@ class SVGPropertyTearOff : public SVGPropertyTearOffBase { ...@@ -108,6 +115,10 @@ class SVGPropertyTearOff : public SVGPropertyTearOffBase {
SVGPropertyTearOffBase::Trace(visitor); SVGPropertyTearOffBase::Trace(visitor);
} }
DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {
SVGPropertyTearOffBase::TraceWrappers(visitor);
}
protected: protected:
SVGPropertyTearOff(Property* target, SVGPropertyTearOff(Property* target,
SVGElement* context_element, SVGElement* context_element,
......
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