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

Unified Diff: ui/events/ozone/evdev/input_device_factory_evdev.h

Issue 2833243002: Fix unsafe destruction order of InputDeviceFactoryEvdev (Closed)
Patch Set: Created 3 years, 8 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
Index: ui/events/ozone/evdev/input_device_factory_evdev.h
diff --git a/ui/events/ozone/evdev/input_device_factory_evdev.h b/ui/events/ozone/evdev/input_device_factory_evdev.h
index 44cb0e7ad7062a7610c0463dbf7b30cad105a395..b4ff3339827b8eed2b3147e983046f4dc5584afc 100644
--- a/ui/events/ozone/evdev/input_device_factory_evdev.h
+++ b/ui/events/ozone/evdev/input_device_factory_evdev.h
@@ -98,9 +98,6 @@ class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdev {
const std::string& name,
bool value);
- // Owned per-device event converters (by path).
- std::map<base::FilePath, std::unique_ptr<EventConverterEvdev>> converters_;
-
// Task runner for our thread.
scoped_refptr<base::TaskRunner> task_runner_;
@@ -137,6 +134,10 @@ class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdev {
// Device settings. These primarily affect libgestures behavior.
InputDeviceSettingsEvdev input_device_settings_;
+ // Owned per-device event converters (by path).
+ // NB: This should be destroyed early, before any shared state.
+ std::map<base::FilePath, std::unique_ptr<EventConverterEvdev>> converters_;
+
// Support weak pointers for attach & detach callbacks.
base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698