Index: Source/core/svg/SVGColor.h |
diff --git a/Source/core/svg/SVGColor.h b/Source/core/svg/SVGColor.h |
index 554fe77052b62af0e49a077e244593801cd12778..42875ed651673d783af09466b7e4140f94b1be03 100644 |
--- a/Source/core/svg/SVGColor.h |
+++ b/Source/core/svg/SVGColor.h |
@@ -93,6 +93,22 @@ private: |
SVGColorType m_colorType; |
}; |
+// This will catch anyone doing an unnecessary cast. |
+SVGColor* toSVGColor(const SVGColor*); |
+ |
+inline SVGColor* toSVGColor(CSSValue* value) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isSVGColor()); |
+ return static_cast<SVGColor*>(value); |
+} |
+ |
+inline const SVGColor* toSVGColor(const CSSValue* value) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isSVGColor()); |
+ return static_cast<const SVGColor*>(value); |
+} |
+ |
+ |
} // namespace WebCore |
#endif // SVGColor_h |