Index: Source/core/svg/SVGPaint.h |
diff --git a/Source/core/svg/SVGPaint.h b/Source/core/svg/SVGPaint.h |
index f4f387dde152f64b63ffb32572d4ab58be031c92..9d6379be521004414ebed00aa1c0e6231f9a2a5c 100644 |
--- a/Source/core/svg/SVGPaint.h |
+++ b/Source/core/svg/SVGPaint.h |
@@ -116,6 +116,21 @@ private: |
String m_uri; |
}; |
+// This will catch anyone doing an unnecessary cast. |
+SVGPaint* toSVGPaint(const SVGColor*); |
+ |
+inline SVGPaint* toSVGPaint(CSSValue* value) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isSVGPaint()); |
+ return static_cast<SVGPaint*>(value); |
+} |
+ |
+inline const SVGPaint* toSVGPaint(const CSSValue* value) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isSVGPaint()); |
+ return static_cast<const SVGPaint*>(value); |
+} |
+ |
} // namespace WebCore |
#endif // SVGPaint_h |