Skip to content

Commit

Permalink
gamepad: Return an invalid handle after ReportBadMessage
Browse files Browse the repository at this point in the history
Bug: 1285449
Change-Id: I746c539577f7bdf69cbe4212ac380e0c92a5c771
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3373944
Auto-Submit: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961125}
  • Loading branch information
nondebug authored and Chromium LUCI CQ committed Jan 19, 2022
1 parent 5f09826 commit 0081bb3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions device/gamepad/gamepad_monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ void GamepadMonitor::GamepadStartPolling(GamepadStartPollingCallback callback) {
GamepadService* service = GamepadService::GetInstance();
if (!service->ConsumerBecameActive(this)) {
mojo::ReportBadMessage("GamepadMonitor::GamepadStartPolling failed");
std::move(callback).Run(base::ReadOnlySharedMemoryRegion());
return;
}
std::move(callback).Run(service->DuplicateSharedMemoryRegion());
}
Expand Down

0 comments on commit 0081bb3

Please sign in to comment.