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

Unified Diff: ui/events/devices/x11/touch_factory_x11.cc

Issue 869433007: Revert of Don't refcount tracking id -> slot id mapping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « ui/events/devices/x11/touch_factory_x11.h ('k') | ui/events/event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/devices/x11/touch_factory_x11.cc
diff --git a/ui/events/devices/x11/touch_factory_x11.cc b/ui/events/devices/x11/touch_factory_x11.cc
index 929c5959b109416334cf0ef74b004a255566ff05..1dce5048d6bff599e5ff41b83035b0885c2a4949 100644
--- a/ui/events/devices/x11/touch_factory_x11.cc
+++ b/ui/events/devices/x11/touch_factory_x11.cc
@@ -250,8 +250,14 @@
return id_generator_.GetGeneratedID(tracking_id);
}
+void TouchFactory::AcquireSlotForTrackingID(uint32 tracking_id) {
+ tracking_id_refcounts_[tracking_id]++;
+}
+
void TouchFactory::ReleaseSlotForTrackingID(uint32 tracking_id) {
- id_generator_.ReleaseNumber(tracking_id);
+ tracking_id_refcounts_[tracking_id]--;
+ if (tracking_id_refcounts_[tracking_id] == 0)
+ id_generator_.ReleaseNumber(tracking_id);
}
bool TouchFactory::IsTouchDevicePresent() {
@@ -264,6 +270,7 @@
touch_events_disabled_ = false;
touch_device_list_.clear();
touchscreen_ids_.clear();
+ tracking_id_refcounts_.clear();
id_generator_.ResetForTest();
}
« no previous file with comments | « ui/events/devices/x11/touch_factory_x11.h ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698