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

Unified Diff: ui/events/gestures/gesture_recognizer_impl.cc

Issue 466323004: The GestureRecognizer should never map an ID to a NULL consumer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nullptr Created 6 years 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: ui/events/gestures/gesture_recognizer_impl.cc
diff --git a/ui/events/gestures/gesture_recognizer_impl.cc b/ui/events/gestures/gesture_recognizer_impl.cc
index 950bec9b3a93e8378aac99a092a457f016532f8c..acd964305897a83cd34598cc3c90f005ea282013 100644
--- a/ui/events/gestures/gesture_recognizer_impl.cc
+++ b/ui/events/gestures/gesture_recognizer_impl.cc
@@ -83,10 +83,13 @@ GestureConsumer* GestureRecognizerImpl::GetTouchLockedTarget(
GestureConsumer* GestureRecognizerImpl::GetTargetForGestureEvent(
const GestureEvent& event) {
- GestureConsumer* target = NULL;
int touch_id = event.details().oldest_touch_id();
- target = touch_id_target_for_gestures_[touch_id];
- return target;
+ if (!touch_id_target_for_gestures_.count(touch_id)) {
+ NOTREACHED() << "Touch ID does not map to a valid GestureConsumer.";
+ return nullptr;
+ }
+
+ return touch_id_target_for_gestures_.at(touch_id);
}
GestureConsumer* GestureRecognizerImpl::GetTargetForLocation(
« 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