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

Unified Diff: ui/events/x/touch_factory_x11.cc

Issue 400213002: Refcount touch tracking ids to prevent freeing them too early. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use ui::TouchEvents in test. Created 6 years, 5 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/x/touch_factory_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/touch_factory_x11.cc
diff --git a/ui/events/x/touch_factory_x11.cc b/ui/events/x/touch_factory_x11.cc
index e6a2fe2724cad4d1d1c03e03d2e9338c7248444b..2ad0118b031a04743e8fa36b323e5b316d91e054 100644
--- a/ui/events/x/touch_factory_x11.cc
+++ b/ui/events/x/touch_factory_x11.cc
@@ -254,8 +254,14 @@ int TouchFactory::GetSlotForTrackingID(uint32 tracking_id) {
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() {
« no previous file with comments | « ui/events/x/touch_factory_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698