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

Unified Diff: content/browser/renderer_host/gamepad_browser_message_filter.cc

Issue 873453003: Fix top crasher with ipc fuzzer. Convert hard checks on |is_started| in Gamepad into dchecks and ba… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc
Patch Set: fix typo Created 5 years, 11 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: content/browser/renderer_host/gamepad_browser_message_filter.cc
diff --git a/content/browser/renderer_host/gamepad_browser_message_filter.cc b/content/browser/renderer_host/gamepad_browser_message_filter.cc
index ef66a5cbd30b16335594311b6e4a52857826aaa5..c03e478827e00d5142077d59eb6e84034c4d319a 100644
--- a/content/browser/renderer_host/gamepad_browser_message_filter.cc
+++ b/content/browser/renderer_host/gamepad_browser_message_filter.cc
@@ -46,14 +46,20 @@ void GamepadBrowserMessageFilter::OnGamepadDisconnected(
void GamepadBrowserMessageFilter::OnGamepadStartPolling(
base::SharedMemoryHandle* renderer_handle) {
GamepadService* service = GamepadService::GetInstance();
- CHECK(!is_started_);
+ DCHECK(!is_started_);
+ if (is_started_)
+ return;
+
is_started_ = true;
service->ConsumerBecameActive(this);
*renderer_handle = service->GetSharedMemoryHandleForProcess(PeerHandle());
}
void GamepadBrowserMessageFilter::OnGamepadStopPolling() {
- CHECK(is_started_);
+ DCHECK(is_started_);
+ if (!is_started_)
+ return;
+
is_started_ = false;
GamepadService::GetInstance()->ConsumerBecameInactive(this);
}
« 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