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

Unified Diff: Source/core/accessibility/AccessibilityMenuListOption.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/AccessibilityMenuListOption.h
diff --git a/Source/core/accessibility/AccessibilityMenuListOption.h b/Source/core/accessibility/AccessibilityMenuListOption.h
index 91ca5ef648383a1de12e9ad5512c9b6cb5fb6440..0cda8db0894ddffe7c3ad18b8e7ebf4d6b77990a 100644
--- a/Source/core/accessibility/AccessibilityMenuListOption.h
+++ b/Source/core/accessibility/AccessibilityMenuListOption.h
@@ -61,6 +61,21 @@ private:
RefPtr<HTMLElement> m_element;
};
+inline AccessibilityMenuListOption* toAccessibilityMenuListOption(AccessibilityObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isMenuListOption());
+ return static_cast<AccessibilityMenuListOption*>(object);
+}
+
+inline const AccessibilityMenuListOption* toAccessibilityMenuListOption(const AccessibilityObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isMenuListOption());
+ return static_cast<const AccessibilityMenuListOption*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toAccessibilityMenuListOption(const AccessibilityMenuListOption*);
+
} // namespace WebCore
#endif // AccessibilityMenuListOption_h
« no previous file with comments | « Source/core/accessibility/AccessibilityMenuList.cpp ('k') | Source/core/accessibility/AccessibilityMenuListPopup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698