accessibility: Fix CFI bad cast errors.
Running content_unittests on Android with CFI bad cast checks enabled [1] revealed two bad cast errors in accessibility: a bad cast from CountedBrowserAccessibility to BrowserAccessibilityAndroid in browser_accessibility_manager_android.cc:69 and from TestBrowserAccessibilityManager to BrowserAccessibilityManagerAndroid in browser_accessibility_android.cc:148. In the former case, the code from BrowserAccessibilityAndroid can easily be inlined into the caller, so this patch does that. In the latter case, the caller is accessing a field that is only present on BrowserAccessibilityManagerAndroid, so the fix is to derive TestBrowserAccessibilityManager from BrowserAccessibilityManagerAndroid on Android platforms. This change hopefully fixes the memory error that was detected by asan. In a followup I plan to attempt to re-enable these tests on Android with asan. [1] https://build.chromium.org/p/chromium.clang/builders/ToTAndroidCFI/builds/397/steps/content_unittests%20on%20Android Bug: 469376 Change-Id: I4560451ec276ab1057feac3ef906daf5fc045ca3 Reviewed-on: https://chromium-review.googlesource.com/780884 Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org> Reviewed-by:Dominic Mazzoni <dmazzoni@chromium.org> Cr-Commit-Position: refs/heads/master@{#518352}
Showing
Please register or sign in to comment