Title: [169204] branches/safari-537.77-branch/Source/WTF
- Revision
- 169204
- Author
- [email protected]
- Date
- 2014-05-22 09:50:09 -0700 (Thu, 22 May 2014)
Log Message
Merged r157717. <rdar://problem/16975484>
Modified Paths
Diff
Modified: branches/safari-537.77-branch/Source/WTF/ChangeLog (169203 => 169204)
--- branches/safari-537.77-branch/Source/WTF/ChangeLog 2014-05-22 16:23:05 UTC (rev 169203)
+++ branches/safari-537.77-branch/Source/WTF/ChangeLog 2014-05-22 16:50:09 UTC (rev 169204)
@@ -1,3 +1,22 @@
+2014-05-22 Lucas Forschler <[email protected]>
+
+ Merge r157717
+
+ 2013-10-21 Gyuyoung Kim <[email protected]>
+
+ Make TYPE_CASTS_BASE more flexible
+ https://bugs.webkit.org/show_bug.cgi?id=122951
+
+ Reviewed by Andreas Kling.
+
+ TYPE_CASTS_BASE is being used by node|element type casts. However, it is difficult
+ to be used by other type casts. For instance, CSSValue, Accessibility and so on.
+ This patch modifies TYPE_CASTS_BASE which can support other type casts.
+
+ Besides TYPE_CASTS_BASE body is moved from node.h to Assertions.h.
+
+ * wtf/Assertions.h:
+
2014-05-02 Matthew Hanson <[email protected]>
Merge r167548.
Modified: branches/safari-537.77-branch/Source/WTF/wtf/Assertions.h (169203 => 169204)
--- branches/safari-537.77-branch/Source/WTF/wtf/Assertions.h 2014-05-22 16:23:05 UTC (rev 169203)
+++ branches/safari-537.77-branch/Source/WTF/wtf/Assertions.h 2014-05-22 16:50:09 UTC (rev 169204)
@@ -380,4 +380,30 @@
#define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED()
#endif
+/* TYPE CAST */
+
+#define TYPE_CASTS_BASE(ToClassName, argumentType, argumentName, pointerPredicate, referencePredicate) \
+inline ToClassName* to##ToClassName(argumentType* argumentName) \
+{ \
+ ASSERT_WITH_SECURITY_IMPLICATION(!argumentName || (pointerPredicate)); \
+ return static_cast<ToClassName*>(argumentName); \
+} \
+inline const ToClassName* to##ToClassName(const argumentType* argumentName) \
+{ \
+ ASSERT_WITH_SECURITY_IMPLICATION(!argumentName || (pointerPredicate)); \
+ return static_cast<const ToClassName*>(argumentName); \
+} \
+inline ToClassName& to##ToClassName(argumentType& argumentName) \
+{ \
+ ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \
+ return static_cast<ToClassName&>(argumentName); \
+} \
+inline const ToClassName& to##ToClassName(const argumentType& argumentName) \
+{ \
+ ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \
+ return static_cast<const ToClassName&>(argumentName); \
+} \
+void to##ToClassName(const ToClassName*); \
+void to##ToClassName(const ToClassName&);
+
#endif /* WTF_Assertions_h */
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes