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

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: Fix non-linux platforms. 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
« ui/events/x/events_x.cc ('K') | « 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 9df436c803002538e61d8ec06b8bc48699d13ed1..536804a6cc342fd1bc5d7abcd4e5a29917868cac 100644
--- a/ui/events/x/touch_factory_x11.cc
+++ b/ui/events/x/touch_factory_x11.cc
@@ -250,8 +250,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() {
« ui/events/x/events_x.cc ('K') | « 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