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

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

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/events_x_unittest.cc ('k') | ui/events/x/touch_factory_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/touch_factory_x11.h
diff --git a/ui/events/x/touch_factory_x11.h b/ui/events/x/touch_factory_x11.h
index 4d8a989fd8f87fe20a68a3c89e6a990ad5c6abaf..051f3de0bc04057cf2e58a89faad542fd7785623 100644
--- a/ui/events/x/touch_factory_x11.h
+++ b/ui/events/x/touch_factory_x11.h
@@ -68,6 +68,10 @@ class EVENTS_BASE_EXPORT TouchFactory {
// isn't one already, allocates a new slot ID and sets up the mapping.
int GetSlotForTrackingID(uint32 tracking_id);
+ // Increases the number of times |ReleaseSlotForTrackingID| needs to be called
+ // on a given tracking id before it will actually be released.
+ void AcquireSlotForTrackingID(uint32 tracking_id);
+
// Releases the slot ID mapping to tracking ID.
void ReleaseSlotForTrackingID(uint32 tracking_id);
@@ -130,6 +134,10 @@ class EVENTS_BASE_EXPORT TouchFactory {
// Touch screen <vid, pid>s.
std::set<std::pair<int, int> > touchscreen_ids_;
+ // Maps from a tracking id to the number of times |ReleaseSlotForTrackingID|
+ // must be called before the tracking id is released.
+ std::map<uint32, int> tracking_id_refcounts_;
+
// Maximum simultaneous touch points supported by device. In the case of
// devices with multiple digitizers (e.g. multiple touchscreens), the value
// is the maximum of the set of maximum supported contacts by each individual
« no previous file with comments | « ui/events/x/events_x_unittest.cc ('k') | ui/events/x/touch_factory_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698