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

Unified Diff: Source/core/accessibility/AccessibilityMenuListPopup.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/AccessibilityMenuListPopup.h
diff --git a/Source/core/accessibility/AccessibilityMenuListPopup.h b/Source/core/accessibility/AccessibilityMenuListPopup.h
index 1f53a0f6a351c5e8f68a495c6bd01931991009f8..acb4f4015b5836ef4130043870c49edbd719a2fd 100644
--- a/Source/core/accessibility/AccessibilityMenuListPopup.h
+++ b/Source/core/accessibility/AccessibilityMenuListPopup.h
@@ -44,7 +44,6 @@ public:
void didUpdateActiveOption(int optionIndex);
-
private:
AccessibilityMenuListPopup();
@@ -62,6 +61,21 @@ private:
AccessibilityMenuListOption* menuListOptionAccessibilityObject(HTMLElement*) const;
};
+inline AccessibilityMenuListPopup* toAccessibilityMenuListPopup(AccessibilityObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isMenuListPopup());
+ return static_cast<AccessibilityMenuListPopup*>(object);
+}
+
+inline const AccessibilityMenuListPopup* toAccessibilityMenuListPopup(const AccessibilityObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isMenuListPopup());
+ return static_cast<const AccessibilityMenuListPopup*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toAccessibilityMenuListPopup(const AccessibilityMenuListPopup*);
+
} // namespace WebCore
#endif // AccessibilityMenuListPopup_h
« no previous file with comments | « Source/core/accessibility/AccessibilityMenuListOption.h ('k') | Source/core/accessibility/AccessibilityMenuListPopup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698