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

Unified Diff: ui/events/x/events_x.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
« no previous file with comments | « ui/events/win/events_win.cc ('k') | ui/events/x/touch_factory_x11.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/events_x.cc
diff --git a/ui/events/x/events_x.cc b/ui/events/x/events_x.cc
index 03b7e28d8de9704453e90d7dde5a6e126667863b..d463221eaa58a8b4b772b17e301a3370b6ec3f00 100644
--- a/ui/events/x/events_x.cc
+++ b/ui/events/x/events_x.cc
@@ -644,6 +644,18 @@ void ReleaseCopiedNativeEvent(const base::NativeEvent& event) {
delete event;
}
+void IncrementTouchIdRefCount(const base::NativeEvent& xev) {
+ ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance();
+ double tracking_id;
+ if (!manager->GetEventData(
+ *xev, ui::DeviceDataManagerX11::DT_TOUCH_TRACKING_ID, &tracking_id)) {
+ return;
+ }
+
+ ui::TouchFactory* factory = ui::TouchFactory::GetInstance();
+ factory->AcquireSlotForTrackingID(tracking_id);
sadrul 2014/07/22 16:49:16 Should we do this automagically from GetTouchId()
tdresser 2014/07/22 20:17:08 As we just discussed in person, I think there's a
+}
+
void ClearTouchIdIfReleased(const base::NativeEvent& xev) {
ui::EventType type = ui::EventTypeFromNative(xev);
if (type == ui::ET_TOUCH_CANCELLED ||
« no previous file with comments | « ui/events/win/events_win.cc ('k') | ui/events/x/touch_factory_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698