Commit 5568b9ca authored by David Tseng's avatar David Tseng Committed by Commit Bot

Ensure there is a valid ARC bridge service when performing an a11y action

It is possible that, before performing an action, the ARC++ container crashed.

Ensure that we don't also crash Chrome by dereferencing nullptr.

Bug: 902107
Change-Id: I09de402a41dfead09cee4685bc610a227740f9a5
Reviewed-on: https://chromium-review.googlesource.com/c/1318740
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarYuki Awano <yawano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606117}
parent e3457f5b
...@@ -492,6 +492,12 @@ void ArcAccessibilityHelperBridge::OnAction( ...@@ -492,6 +492,12 @@ void ArcAccessibilityHelperBridge::OnAction(
auto* instance = ARC_GET_INSTANCE_FOR_METHOD( auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
arc_bridge_service_->accessibility_helper(), PerformAction); arc_bridge_service_->accessibility_helper(), PerformAction);
if (!instance) {
// This case should probably destroy all trees.
OnActionResult(data, false);
return;
}
instance->PerformAction( instance->PerformAction(
std::move(action_data), std::move(action_data),
base::BindOnce(&ArcAccessibilityHelperBridge::OnActionResult, base::BindOnce(&ArcAccessibilityHelperBridge::OnActionResult,
......
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