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

Unified Diff: third_party/WebKit/Source/core/svg/properties/SVGProperty.h

Issue 1412123015: Replace open-coded toSVG<type> with DEFINE_SVG_PROPERTY_TYPE_CASTS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: third_party/WebKit/Source/core/svg/properties/SVGProperty.h
diff --git a/third_party/WebKit/Source/core/svg/properties/SVGProperty.h b/third_party/WebKit/Source/core/svg/properties/SVGProperty.h
index 27d06f02d4f53b49cf253778e75edf5257dc7c54..210bb70fccdb7f09746f591e514f104342bbe342 100644
--- a/third_party/WebKit/Source/core/svg/properties/SVGProperty.h
+++ b/third_party/WebKit/Source/core/svg/properties/SVGProperty.h
@@ -107,6 +107,15 @@ private:
SVGPropertyBase* m_ownerList;
};
+#define DEFINE_SVG_PROPERTY_TYPE_CASTS(thisType)\
+ DEFINE_TYPE_CASTS(thisType, SVGPropertyBase, value, value->type() == thisType::classType(), value.type() == thisType::classType());\
+ inline PassRefPtrWillBeRawPtr<thisType> to##thisType(PassRefPtrWillBeRawPtr<SVGPropertyBase> passBase)\
+ {\
+ RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase;\
+ ASSERT(base->type() == thisType::classType());\
+ return static_pointer_cast<thisType>(base.release());\
+ }
+
}
#endif // SVGProperty_h

Powered by Google App Engine
This is Rietveld 408576698