Commit 104865d0 authored by Vlad Tsyrklevich's avatar Vlad Tsyrklevich Committed by Commit Bot

a11y: Deprecate use of base::ProtectedMemory

base::ProtectedMemory is being deprecated because it's not widely used
enough to make a security impact and justify its maintenance burden.
Replace use of base::ProtectedMemory with raw function pointers. The
indirect call here is already unchecked due to the blacklist entry added
in https://crrev.com/c/1888716

Bug: 1018834
Change-Id: I68dc018737be985e0bf968d37d117321f53d86ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1890986
Commit-Queue: Martin Robinson <mrobinson@igalia.com>
Reviewed-by: default avatarMartin Robinson <mrobinson@igalia.com>
Auto-Submit: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711170}
parent a6c2a5f8
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/memory/protected_memory_cfi.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/accessibility/platform/ax_platform_node_auralinux.h" #include "ui/accessibility/platform/ax_platform_node_auralinux.h"
#include "ui/accessibility/platform/ax_platform_node_unittest.h" #include "ui/accessibility/platform/ax_platform_node_unittest.h"
...@@ -981,13 +980,9 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueChangedSignal) { ...@@ -981,13 +980,9 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueChangedSignal) {
// There's a chance we may be compiled with a newer version of ATK and then // There's a chance we may be compiled with a newer version of ATK and then
// run with an older one, so we need to do a runtime check for this method // run with an older one, so we need to do a runtime check for this method
// that is available in ATK 2.12 instead of linking directly. // that is available in ATK 2.12 instead of linking directly.
static PROTECTED_MEMORY_SECTION base::ProtectedMemory<SetValueFunction> SetValueFunction atk_value_set_value = reinterpret_cast<SetValueFunction>(
g_atk_value_set_value; dlsym(RTLD_DEFAULT, "atk_value_set_value"));
static base::ProtectedMemory<SetValueFunction>::Initializer if (!atk_value_set_value) {
init_atk_value_set_value(&g_atk_value_set_value,
reinterpret_cast<SetValueFunction>(
dlsym(RTLD_DEFAULT, "atk_value_set_value")));
if (!*g_atk_value_set_value) {
LOG(WARNING) << "Skipping TestAtkValueChangedSignal" LOG(WARNING) << "Skipping TestAtkValueChangedSignal"
" because ATK version < 2.12 detected."; " because ATK version < 2.12 detected.";
return; return;
...@@ -1012,7 +1007,7 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueChangedSignal) { ...@@ -1012,7 +1007,7 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueChangedSignal) {
}), }),
&saw_value_change); &saw_value_change);
base::UnsanitizedCfiCall(g_atk_value_set_value)(ATK_VALUE(root_object), 24.0); atk_value_set_value(ATK_VALUE(root_object), 24.0);
GetRootPlatformNode()->NotifyAccessibilityEvent( GetRootPlatformNode()->NotifyAccessibilityEvent(
ax::mojom::Event::kValueChanged); ax::mojom::Event::kValueChanged);
...@@ -1023,8 +1018,7 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueChangedSignal) { ...@@ -1023,8 +1018,7 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueChangedSignal) {
EXPECT_TRUE(saw_value_change); EXPECT_TRUE(saw_value_change);
saw_value_change = false; saw_value_change = false;
base::UnsanitizedCfiCall(g_atk_value_set_value)(ATK_VALUE(root_object), atk_value_set_value(ATK_VALUE(root_object), 100.0);
100.0);
GetRootPlatformNode()->NotifyAccessibilityEvent( GetRootPlatformNode()->NotifyAccessibilityEvent(
ax::mojom::Event::kValueChanged); ax::mojom::Event::kValueChanged);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment