Index: Source/core/platform/Scrollbar.h |
diff --git a/Source/core/platform/Scrollbar.h b/Source/core/platform/Scrollbar.h |
index f8de1fa6a2dc5680c5d9c8eba3f1bc3bac7bbb7e..ab44f3051f2f3bb6a44f9b1f3c3a9ad7a1b80287 100644 |
--- a/Source/core/platform/Scrollbar.h |
+++ b/Source/core/platform/Scrollbar.h |
@@ -192,6 +192,21 @@ private: |
float scrollableAreaCurrentPos() const; |
}; |
+inline Scrollbar* toScrollbar(Widget* widget) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollbar()); |
+ return static_cast<Scrollbar*>(widget); |
+} |
+ |
+inline const Scrollbar* toScrollbar(const Widget* widget) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollbar()); |
+ return static_cast<const Scrollbar*>(widget); |
+} |
+ |
+// This will catch anyone doing an unnecessary cast. |
+void toScrollbar(const Scrollbar*); |
+ |
} // namespace WebCore |
#endif // Scrollbar_h |