| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 ASSERT(contextElement); | 91 ASSERT(contextElement); |
| 92 ASSERT(attributeName != QualifiedName::null()); | 92 ASSERT(attributeName != QualifiedName::null()); |
| 93 m_contextElement = contextElement; | 93 m_contextElement = contextElement; |
| 94 m_attributeName = attributeName; | 94 m_attributeName = attributeName; |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual AnimatedPropertyType type() const = 0; | 97 virtual AnimatedPropertyType type() const = 0; |
| 98 | 98 |
| 99 DEFINE_INLINE_VIRTUAL_TRACE() | 99 DEFINE_INLINE_VIRTUAL_TRACE() |
| 100 { | 100 { |
| 101 visitor->trace(m_contextElement); | |
| 102 } | 101 } |
| 103 | 102 |
| 104 protected: | 103 protected: |
| 105 SVGPropertyTearOffBase(SVGElement* contextElement, PropertyIsAnimValType pro
pertyIsAnimVal, const QualifiedName& attributeName = QualifiedName::null()) | 104 SVGPropertyTearOffBase(SVGElement* contextElement, PropertyIsAnimValType pro
pertyIsAnimVal, const QualifiedName& attributeName = QualifiedName::null()) |
| 106 : m_contextElement(contextElement) | 105 : m_contextElement(contextElement) |
| 107 , m_propertyIsAnimVal(propertyIsAnimVal) | 106 , m_propertyIsAnimVal(propertyIsAnimVal) |
| 108 , m_isReadOnlyProperty(false) | 107 , m_isReadOnlyProperty(false) |
| 109 , m_attributeName(attributeName) | 108 , m_attributeName(attributeName) |
| 110 { | 109 { |
| 111 } | 110 } |
| 112 | 111 |
| 113 private: | 112 private: |
| 114 // These references are kept alive from V8 wrapper to prevent reference cycl
es | 113 // This raw pointer is safe since the SVG element is guaranteed to be kept |
| 115 RawPtrWillBeMember<SVGElement> m_contextElement; | 114 // alive by a V8 wrapper. |
| 115 GC_PLUGIN_IGNORE("crbug.com/528275") |
| 116 SVGElement* m_contextElement; |
| 116 | 117 |
| 117 PropertyIsAnimValType m_propertyIsAnimVal; | 118 PropertyIsAnimValType m_propertyIsAnimVal; |
| 118 bool m_isReadOnlyProperty; | 119 bool m_isReadOnlyProperty; |
| 119 QualifiedName m_attributeName; | 120 QualifiedName m_attributeName; |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 template <typename Property> | 123 template <typename Property> |
| 123 class SVGPropertyTearOff : public SVGPropertyTearOffBase { | 124 class SVGPropertyTearOff : public SVGPropertyTearOffBase { |
| 124 public: | 125 public: |
| 125 Property* target() | 126 Property* target() |
| (...skipping 25 matching lines...) Expand all Loading... |
| 151 ASSERT(m_target); | 152 ASSERT(m_target); |
| 152 } | 153 } |
| 153 | 154 |
| 154 private: | 155 private: |
| 155 RefPtrWillBeMember<Property> m_target; | 156 RefPtrWillBeMember<Property> m_target; |
| 156 }; | 157 }; |
| 157 | 158 |
| 158 } | 159 } |
| 159 | 160 |
| 160 #endif // SVGPropertyTearOff_h | 161 #endif // SVGPropertyTearOff_h |
| OLD | NEW |