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

Side by Side Diff: ui/events/ozone/evdev/touch_event_converter_evdev.h

Issue 2639043002: Fix double-close in EventConverterEvdevImpl (Closed)
Patch Set: remove base::debug::Alias Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ 6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <bitset> 11 #include <bitset>
12 #include <memory> 12 #include <memory>
13 13
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/message_loop/message_pump_libevent.h" 17 #include "base/message_loop/message_pump_libevent.h"
18 #include "ui/events/event_constants.h" 18 #include "ui/events/event_constants.h"
19 #include "ui/events/ozone/evdev/event_converter_evdev.h" 19 #include "ui/events/ozone/evdev/event_converter_evdev.h"
20 #include "ui/events/ozone/evdev/event_device_info.h" 20 #include "ui/events/ozone/evdev/event_device_info.h"
21 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" 21 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
22 #include "ui/events/ozone/evdev/scoped_input_device.h"
22 #include "ui/events/ozone/evdev/touch_evdev_debug_buffer.h" 23 #include "ui/events/ozone/evdev/touch_evdev_debug_buffer.h"
23 24
24 namespace ui { 25 namespace ui {
25 26
26 class DeviceEventDispatcherEvdev; 27 class DeviceEventDispatcherEvdev;
27 class TouchNoiseFinder; 28 class TouchNoiseFinder;
28 struct InProgressTouchEvdev; 29 struct InProgressTouchEvdev;
29 30
30 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev 31 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
31 : public EventConverterEvdev { 32 : public EventConverterEvdev {
32 public: 33 public:
33 TouchEventConverterEvdev(int fd, 34 TouchEventConverterEvdev(ScopedInputDevice fd,
34 base::FilePath path, 35 base::FilePath path,
35 int id, 36 int id,
36 const EventDeviceInfo& devinfo, 37 const EventDeviceInfo& devinfo,
37 DeviceEventDispatcherEvdev* dispatcher); 38 DeviceEventDispatcherEvdev* dispatcher);
38 ~TouchEventConverterEvdev() override; 39 ~TouchEventConverterEvdev() override;
39 40
40 // EventConverterEvdev: 41 // EventConverterEvdev:
41 bool HasTouchscreen() const override; 42 bool HasTouchscreen() const override;
42 bool HasPen() const override; 43 bool HasPen() const override;
43 gfx::Size GetTouchscreenSize() const override; 44 gfx::Size GetTouchscreenSize() const override;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void ReportEvents(base::TimeTicks timestamp); 82 void ReportEvents(base::TimeTicks timestamp);
82 83
83 void UpdateTrackingId(int slot, int tracking_id); 84 void UpdateTrackingId(int slot, int tracking_id);
84 void ReleaseTouches(); 85 void ReleaseTouches();
85 void ReleaseButtons(); 86 void ReleaseButtons();
86 // Normalize pressure value to [0, 1]. 87 // Normalize pressure value to [0, 1].
87 float ScalePressure(int32_t value); 88 float ScalePressure(int32_t value);
88 89
89 int NextTrackingId(); 90 int NextTrackingId();
90 91
92 // Input device file descriptor.
93 ScopedInputDevice input_device_fd_;
94
91 // Dispatcher for events. 95 // Dispatcher for events.
92 DeviceEventDispatcherEvdev* dispatcher_; 96 DeviceEventDispatcherEvdev* dispatcher_;
93 97
94 // Set if we drop events in kernel (SYN_DROPPED) or in process. 98 // Set if we drop events in kernel (SYN_DROPPED) or in process.
95 bool dropped_events_ = false; 99 bool dropped_events_ = false;
96 100
97 // Device has multitouch capability. 101 // Device has multitouch capability.
98 bool has_mt_ = false; 102 bool has_mt_ = false;
99 103
100 // Device supports pen input. 104 // Device supports pen input.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 145
142 // Callback to enable/disable palm suppression. 146 // Callback to enable/disable palm suppression.
143 base::Callback<void(bool)> enable_palm_suppression_callback_; 147 base::Callback<void(bool)> enable_palm_suppression_callback_;
144 148
145 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); 149 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev);
146 }; 150 };
147 151
148 } // namespace ui 152 } // namespace ui
149 153
150 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ 154 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698