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

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev.cc

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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <errno.h> 5 #include <errno.h>
6 #include <linux/input.h> 6 #include <linux/input.h>
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ui/events/ozone/evdev/event_converter_evdev.h" 9 #include "ui/events/ozone/evdev/event_converter_evdev.h"
10 10
(...skipping 19 matching lines...) Expand all
30 path_(path), 30 path_(path),
31 input_device_(id, 31 input_device_(id,
32 type, 32 type,
33 name, 33 name,
34 GetInputPathInSys(path), 34 GetInputPathInSys(path),
35 vendor_id, 35 vendor_id,
36 product_id), 36 product_id),
37 controller_(FROM_HERE) {} 37 controller_(FROM_HERE) {}
38 38
39 EventConverterEvdev::~EventConverterEvdev() { 39 EventConverterEvdev::~EventConverterEvdev() {
40 DCHECK(!enabled_);
41 DCHECK(!watching_);
42 } 40 }
43 41
44 void EventConverterEvdev::Start() { 42 void EventConverterEvdev::Start() {
45 base::MessageLoopForUI::current()->WatchFileDescriptor( 43 base::MessageLoopForUI::current()->WatchFileDescriptor(
46 fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this); 44 fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this);
47 watching_ = true; 45 watching_ = true;
48 } 46 }
49 47
50 void EventConverterEvdev::Stop() { 48 void EventConverterEvdev::Stop() {
51 controller_.StopWatchingFileDescriptor(); 49 controller_.StopWatchingFileDescriptor();
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 155
158 base::TimeTicks EventConverterEvdev::TimeTicksFromInputEvent( 156 base::TimeTicks EventConverterEvdev::TimeTicksFromInputEvent(
159 const input_event& event) { 157 const input_event& event) {
160 base::TimeTicks timestamp = 158 base::TimeTicks timestamp =
161 ui::EventTimeStampFromSeconds(event.time.tv_sec) + 159 ui::EventTimeStampFromSeconds(event.time.tv_sec) +
162 base::TimeDelta::FromMicroseconds(event.time.tv_usec); 160 base::TimeDelta::FromMicroseconds(event.time.tv_usec);
163 ValidateEventTimeClock(&timestamp); 161 ValidateEventTimeClock(&timestamp);
164 return timestamp; 162 return timestamp;
165 } 163 }
166 } // namespace ui 164 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698