Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1284)

Unified Diff: Source/core/svg/PatternAttributes.h

Issue 678163002: Oilpan: move SVG property hierarchy to the heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased upto r185213 Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/LinearGradientAttributes.h ('k') | Source/core/svg/RadialGradientAttributes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/PatternAttributes.h
diff --git a/Source/core/svg/PatternAttributes.h b/Source/core/svg/PatternAttributes.h
index f7378e4905661486cef1eb5c7d11a11140863880..779e2355f984224f47223d343f15c3ba80ebaebc 100644
--- a/Source/core/svg/PatternAttributes.h
+++ b/Source/core/svg/PatternAttributes.h
@@ -22,13 +22,16 @@
#include "core/svg/SVGLength.h"
#include "core/svg/SVGPreserveAspectRatio.h"
+#include "platform/heap/Handle.h"
#include "platform/transforms/AffineTransform.h"
namespace blink {
class SVGPatternElement;
-struct PatternAttributes {
+class PatternAttributes final {
+ DISALLOW_ALLOCATION();
+public:
PatternAttributes()
: m_x(SVGLength::create(LengthModeWidth))
, m_y(SVGLength::create(LengthModeHeight))
@@ -38,7 +41,7 @@ struct PatternAttributes {
, m_preserveAspectRatio(SVGPreserveAspectRatio::create())
, m_patternUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
, m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
- , m_patternContentElement(0)
+ , m_patternContentElement(nullptr)
, m_xSet(false)
, m_ySet(false)
, m_widthSet(false)
@@ -63,25 +66,25 @@ struct PatternAttributes {
AffineTransform patternTransform() const { return m_patternTransform; }
const SVGPatternElement* patternContentElement() const { return m_patternContentElement; }
- void setX(PassRefPtr<SVGLength> value)
+ void setX(PassRefPtrWillBeRawPtr<SVGLength> value)
{
m_x = value;
m_xSet = true;
}
- void setY(PassRefPtr<SVGLength> value)
+ void setY(PassRefPtrWillBeRawPtr<SVGLength> value)
{
m_y = value;
m_ySet = true;
}
- void setWidth(PassRefPtr<SVGLength> value)
+ void setWidth(PassRefPtrWillBeRawPtr<SVGLength> value)
{
m_width = value;
m_widthSet = true;
}
- void setHeight(PassRefPtr<SVGLength> value)
+ void setHeight(PassRefPtrWillBeRawPtr<SVGLength> value)
{
m_height = value;
m_heightSet = true;
@@ -93,7 +96,7 @@ struct PatternAttributes {
m_viewBoxSet = true;
}
- void setPreserveAspectRatio(PassRefPtr<SVGPreserveAspectRatio> value)
+ void setPreserveAspectRatio(PassRefPtrWillBeRawPtr<SVGPreserveAspectRatio> value)
{
m_preserveAspectRatio = value;
m_preserveAspectRatioSet = true;
@@ -134,18 +137,28 @@ struct PatternAttributes {
bool hasPatternTransform() const { return m_patternTransformSet; }
bool hasPatternContentElement() const { return m_patternContentElementSet; }
+ void trace(Visitor* visitor)
+ {
+ visitor->trace(m_x);
+ visitor->trace(m_y);
+ visitor->trace(m_width);
+ visitor->trace(m_height);
+ visitor->trace(m_preserveAspectRatio);
+ visitor->trace(m_patternContentElement);
+ }
+
private:
// Properties
- RefPtr<SVGLength> m_x;
- RefPtr<SVGLength> m_y;
- RefPtr<SVGLength> m_width;
- RefPtr<SVGLength> m_height;
+ RefPtrWillBeMember<SVGLength> m_x;
+ RefPtrWillBeMember<SVGLength> m_y;
+ RefPtrWillBeMember<SVGLength> m_width;
+ RefPtrWillBeMember<SVGLength> m_height;
FloatRect m_viewBox;
- RefPtr<SVGPreserveAspectRatio> m_preserveAspectRatio;
+ RefPtrWillBeMember<SVGPreserveAspectRatio> m_preserveAspectRatio;
SVGUnitTypes::SVGUnitType m_patternUnits;
SVGUnitTypes::SVGUnitType m_patternContentUnits;
AffineTransform m_patternTransform;
- const SVGPatternElement* m_patternContentElement;
+ RawPtrWillBeMember<const SVGPatternElement> m_patternContentElement;
// Property states
bool m_xSet : 1;
@@ -162,4 +175,4 @@ private:
} // namespace blink
-#endif
+#endif // PatternAttributes_h
« no previous file with comments | « Source/core/svg/LinearGradientAttributes.h ('k') | Source/core/svg/RadialGradientAttributes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698