Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3417)

Unified Diff: device/gamepad/gamepad_provider.cc

Issue 2679633002: [Gamepad API] Fix gamepad crash that happens when a gamepad is disconnected
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/gamepad/gamepad_provider.cc
diff --git a/device/gamepad/gamepad_provider.cc b/device/gamepad/gamepad_provider.cc
index 7982918455721a8352065d6eafdc6bef3523c3b8..b598ee9fcc020307f827e9f3e7c9929906d37d0a 100644
--- a/device/gamepad/gamepad_provider.cc
+++ b/device/gamepad/gamepad_provider.cc
@@ -253,7 +253,9 @@ void GamepadProvider::DoPoll() {
PadState& state = pad_states_.get()[i];
if (!state.active_state && state.source != GAMEPAD_SOURCE_NONE) {
- OnGamepadConnectionChange(false, i, buffer->items[i]);
+ blink::WebGamepad& pad = buffer->items[i];
+ pad.connected = false;
+ OnGamepadConnectionChange(false, i, pad);
ClearPadState(state);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698