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: Source/core/accessibility/AccessibilityScrollbar.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
Index: Source/core/accessibility/AccessibilityScrollbar.h
diff --git a/Source/core/accessibility/AccessibilityScrollbar.h b/Source/core/accessibility/AccessibilityScrollbar.h
index fe0714aa3eb2a6634672ea12d4654713260ed566..7696f62c88ea163ef43f08da38e3832444d45949 100644
--- a/Source/core/accessibility/AccessibilityScrollbar.h
+++ b/Source/core/accessibility/AccessibilityScrollbar.h
@@ -64,6 +64,21 @@ private:
RefPtr<Scrollbar> m_scrollbar;
};
+inline AccessibilityScrollbar* toAccessibilityScrollbar(AccessibilityObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isAccessibilityScrollbar());
+ return static_cast<AccessibilityScrollbar*>(object);
+}
+
+inline const AccessibilityScrollbar* toAccessibilityScrollbar(const AccessibilityObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isAccessibilityScrollbar());
+ return static_cast<const AccessibilityScrollbar*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toAccessibilityScrollbar(const AccessibilityScrollbar*);
+
} // namespace WebCore
#endif // AccessibilityScrollbar_h
« no previous file with comments | « Source/core/accessibility/AccessibilityScrollView.cpp ('k') | Source/core/accessibility/AccessibilityTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698