[A11yPerformance] De-virtualize structs/classes
A practice of putting `virtual ~Foo()` in a struct/class as a matter of
habit adds a pointer-sized field to each instance (to hold the vtable)
and forces virtual dispatch for every call to the destructor. There is
no upside to this practice. This CL removes all such occurrences and
fixes one case where a class meant for derivation was missing the
virtual dtor.
Bug: 40919326
AX-Relnotes: n/a.
Change-Id: I17727d4e043d8210da55d76bc0decf27a708f289
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6347279
Reviewed-by: Aaron Leventhal <[email protected]>
Auto-Submit: Greg Thompson <[email protected]>
Commit-Queue: Aaron Leventhal <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1431769}
diff --git a/ui/accessibility/ax_action_handler_registry.h b/ui/accessibility/ax_action_handler_registry.h
index e50f0fe..68ef623 100644
--- a/ui/accessibility/ax_action_handler_registry.h
+++ b/ui/accessibility/ax_action_handler_registry.h
@@ -52,7 +52,7 @@
// Get the single instance of this class.
static AXActionHandlerRegistry* GetInstance();
- virtual ~AXActionHandlerRegistry();
+ ~AXActionHandlerRegistry();
AXActionHandlerRegistry(const AXActionHandlerRegistry&) = delete;
AXActionHandlerRegistry& operator=(const AXActionHandlerRegistry&) = delete;