OLD | NEW |
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 DEVICE_HID_DEVICE_MONITOR_LINUX_H_ | 5 #ifndef DEVICE_HID_DEVICE_MONITOR_LINUX_H_ |
6 #define DEVICE_HID_DEVICE_MONITOR_LINUX_H_ | 6 #define DEVICE_HID_DEVICE_MONITOR_LINUX_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
14 #include "base/message_loop/message_pump_libevent.h" | 15 #include "base/message_loop/message_pump_libevent.h" |
15 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
16 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
17 #include "device/udev_linux/scoped_udev.h" | 18 #include "device/udev_linux/scoped_udev.h" |
(...skipping 29 matching lines...) Expand all Loading... |
47 void Enumerate(const EnumerateCallback& callback); | 48 void Enumerate(const EnumerateCallback& callback); |
48 | 49 |
49 // Implements base::MessageLoop::DestructionObserver | 50 // Implements base::MessageLoop::DestructionObserver |
50 void WillDestroyCurrentMessageLoop() override; | 51 void WillDestroyCurrentMessageLoop() override; |
51 | 52 |
52 // Implements base::MessagePumpLibevent::Watcher | 53 // Implements base::MessagePumpLibevent::Watcher |
53 void OnFileCanReadWithoutBlocking(int fd) override; | 54 void OnFileCanReadWithoutBlocking(int fd) override; |
54 void OnFileCanWriteWithoutBlocking(int fd) override; | 55 void OnFileCanWriteWithoutBlocking(int fd) override; |
55 | 56 |
56 private: | 57 private: |
57 friend struct base::DefaultDeleter<DeviceMonitorLinux>; | 58 friend std::default_delete<DeviceMonitorLinux>; |
58 | 59 |
59 ~DeviceMonitorLinux() override; | 60 ~DeviceMonitorLinux() override; |
60 | 61 |
61 ScopedUdevPtr udev_; | 62 ScopedUdevPtr udev_; |
62 ScopedUdevMonitorPtr monitor_; | 63 ScopedUdevMonitorPtr monitor_; |
63 int monitor_fd_; | 64 int monitor_fd_; |
64 base::MessagePumpLibevent::FileDescriptorWatcher monitor_watcher_; | 65 base::MessagePumpLibevent::FileDescriptorWatcher monitor_watcher_; |
65 | 66 |
66 base::ObserverList<Observer, true> observers_; | 67 base::ObserverList<Observer, true> observers_; |
67 | 68 |
68 base::ThreadChecker thread_checker_; | 69 base::ThreadChecker thread_checker_; |
69 | 70 |
70 DISALLOW_COPY_AND_ASSIGN(DeviceMonitorLinux); | 71 DISALLOW_COPY_AND_ASSIGN(DeviceMonitorLinux); |
71 }; | 72 }; |
72 | 73 |
73 } // namespace device | 74 } // namespace device |
74 | 75 |
75 #endif // DEVICE_HID_DEVICE_MONITOR_LINUX_H_ | 76 #endif // DEVICE_HID_DEVICE_MONITOR_LINUX_H_ |
OLD | NEW |