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

Unified Diff: ui/events/ozone/evdev/touch_event_converter_evdev.h

Issue 891703004: Seeing crashes likely from negative touch indexes, check for them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch to vector 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
Index: ui/events/ozone/evdev/touch_event_converter_evdev.h
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev.h b/ui/events/ozone/evdev/touch_event_converter_evdev.h
index edf0ef945b3b3b34203a99961ff20fc43abb917b..4d521f55c2f210145178836a49a1d561983cba74 100644
--- a/ui/events/ozone/evdev/touch_event_converter_evdev.h
+++ b/ui/events/ozone/evdev/touch_event_converter_evdev.h
@@ -24,9 +24,7 @@ class DeviceEventDispatcherEvdev;
class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
: public EventConverterEvdev {
public:
- enum {
- MAX_FINGERS = 11
- };
+ enum { MAX_FINGERS = 20 };
TouchEventConverterEvdev(int fd,
base::FilePath path,
int id,
@@ -47,6 +45,7 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
struct InProgressEvents {
InProgressEvents();
+ bool altered_;
float x_;
float y_;
int id_; // Device reported "unique" touch point id; -1 means not active
@@ -96,14 +95,10 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
gfx::Size native_size_;
// Touch point currently being updated from the /dev/input/event* stream.
- int current_slot_;
-
- // Bit field tracking which in-progress touch points have been modified
- // without a syn event.
- std::bitset<MAX_FINGERS> altered_slots_;
+ size_t current_slot_;
// In-progress touch points.
- InProgressEvents events_[MAX_FINGERS];
+ std::vector<InProgressEvents> events_;
DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev);
};

Powered by Google App Engine
This is Rietveld 408576698