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

Side by Side Diff: ui/events/ozone/device/device_manager_manual.cc

Issue 853073003: Fix assertion starting cast_shell (breaking thread IO restrictions). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mistake in presubmit regex Created 5 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
« PRESUBMIT.py ('K') | « PRESUBMIT.py ('k') | no next file » | 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 "ui/events/ozone/device/device_manager_manual.h" 5 #include "ui/events/ozone/device/device_manager_manual.h"
6 6
7 #include "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
8 #include "base/threading/thread_restrictions.h"
8 #include "ui/events/ozone/device/device_event.h" 9 #include "ui/events/ozone/device/device_event.h"
9 #include "ui/events/ozone/device/device_event_observer.h" 10 #include "ui/events/ozone/device/device_event_observer.h"
10 11
11 namespace ui { 12 namespace ui {
12 13
13 DeviceManagerManual::DeviceManagerManual() {} 14 DeviceManagerManual::DeviceManagerManual() {}
14 15
15 DeviceManagerManual::~DeviceManagerManual() {} 16 DeviceManagerManual::~DeviceManagerManual() {}
16 17
17 void DeviceManagerManual::ScanDevices(DeviceEventObserver* observer) { 18 void DeviceManagerManual::ScanDevices(DeviceEventObserver* observer) {
19 base::ThreadRestrictions::ScopedAllowIO allow_io;
18 base::FileEnumerator file_enum(base::FilePath("/dev/input"), 20 base::FileEnumerator file_enum(base::FilePath("/dev/input"),
19 false, 21 false,
20 base::FileEnumerator::FILES, 22 base::FileEnumerator::FILES,
21 "event*[0-9]"); 23 "event*[0-9]");
22 for (base::FilePath path = file_enum.Next(); !path.empty(); 24 for (base::FilePath path = file_enum.Next(); !path.empty();
23 path = file_enum.Next()) { 25 path = file_enum.Next()) {
24 DeviceEvent event(DeviceEvent::INPUT, DeviceEvent::ADD, path); 26 DeviceEvent event(DeviceEvent::INPUT, DeviceEvent::ADD, path);
25 observer->OnDeviceEvent(event); 27 observer->OnDeviceEvent(event);
26 } 28 }
27 } 29 }
28 30
29 void DeviceManagerManual::AddObserver(DeviceEventObserver* observer) {} 31 void DeviceManagerManual::AddObserver(DeviceEventObserver* observer) {}
30 32
31 void DeviceManagerManual::RemoveObserver(DeviceEventObserver* observer) {} 33 void DeviceManagerManual::RemoveObserver(DeviceEventObserver* observer) {}
32 34
33 } // namespace ui 35 } // namespace ui
OLDNEW
« PRESUBMIT.py ('K') | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698