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

Unified Diff: Source/core/platform/Scrollbar.h

Issue 24752002: Cleanup <static_cast>: Switch to toFoo for Accessibility Objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months 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
« no previous file with comments | « Source/core/accessibility/AccessibilityTableRow.cpp ('k') | Source/web/WebAXObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/accessibility/AccessibilityTableRow.cpp ('k') | Source/web/WebAXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698