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

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

Issue 143083003: ozone: Add some tracing for platform & evdev (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add platform name to event Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/events/ozone/event_converter_ozone.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/events/ozone/evdev/event_factory.h" 5 #include "ui/events/ozone/evdev/event_factory.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/input.h> 9 #include <linux/input.h>
10 #include <poll.h> 10 #include <poll.h>
11 #include <unistd.h> 11 #include <unistd.h>
12 12
13 #include "base/debug/trace_event.h"
13 #include "base/files/file_enumerator.h" 14 #include "base/files/file_enumerator.h"
14 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
15 #include "base/threading/thread_restrictions.h" 16 #include "base/threading/thread_restrictions.h"
16 #include "ui/events/ozone/evdev/event_device_info.h" 17 #include "ui/events/ozone/evdev/event_device_info.h"
17 #include "ui/events/ozone/evdev/key_event_converter.h" 18 #include "ui/events/ozone/evdev/key_event_converter.h"
18 #include "ui/events/ozone/evdev/touch_event_converter.h" 19 #include "ui/events/ozone/evdev/touch_event_converter.h"
19 #include "ui/events/ozone/event_factory_ozone.h" 20 #include "ui/events/ozone/event_factory_ozone.h"
20 21
21 namespace ui { 22 namespace ui {
22 23
(...skipping 11 matching lines...) Expand all
34 return devinfo.HasEventType(EV_ABS) && !IsTouchPad(devinfo); 35 return devinfo.HasEventType(EV_ABS) && !IsTouchPad(devinfo);
35 } 36 }
36 37
37 } // namespace 38 } // namespace
38 39
39 EventFactoryEvdev::EventFactoryEvdev() {} 40 EventFactoryEvdev::EventFactoryEvdev() {}
40 41
41 EventFactoryEvdev::~EventFactoryEvdev() {} 42 EventFactoryEvdev::~EventFactoryEvdev() {}
42 43
43 void EventFactoryEvdev::AttachInputDevice(const base::FilePath& path) { 44 void EventFactoryEvdev::AttachInputDevice(const base::FilePath& path) {
45 TRACE_EVENT1("ozone", "AttachInputDevice", "path", path.value());
46
44 int fd = open(path.value().c_str(), O_RDONLY | O_NONBLOCK); 47 int fd = open(path.value().c_str(), O_RDONLY | O_NONBLOCK);
45 if (fd < 0) { 48 if (fd < 0) {
46 PLOG(ERROR) << "Cannot open '" << path.value(); 49 PLOG(ERROR) << "Cannot open '" << path.value();
47 return; 50 return;
48 } 51 }
49 52
50 EventDeviceInfo devinfo; 53 EventDeviceInfo devinfo;
51 if (!devinfo.Initialize(fd)) { 54 if (!devinfo.Initialize(fd)) {
52 LOG(ERROR) << "failed to get device information for " << path.value(); 55 LOG(ERROR) << "failed to get device information for " << path.value();
53 close(fd); 56 close(fd);
(...skipping 24 matching lines...) Expand all
78 base::ThreadRestrictions::AssertIOAllowed(); 81 base::ThreadRestrictions::AssertIOAllowed();
79 82
80 base::FileEnumerator file_enum( 83 base::FileEnumerator file_enum(
81 base::FilePath("/dev/input"), false, base::FileEnumerator::FILES); 84 base::FilePath("/dev/input"), false, base::FileEnumerator::FILES);
82 for (base::FilePath path = file_enum.Next(); !path.empty(); 85 for (base::FilePath path = file_enum.Next(); !path.empty();
83 path = file_enum.Next()) 86 path = file_enum.Next())
84 AttachInputDevice(path); 87 AttachInputDevice(path);
85 } 88 }
86 89
87 } // namespace ui 90 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/event_converter_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698