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

Side by Side Diff: ui/events/ozone/device/udev/device_manager_udev.h

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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
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 #ifndef UI_EVENTS_OZONE_DEVICE_UDEV_DEVICE_MANAGER_UDEV_H_ 5 #ifndef UI_EVENTS_OZONE_DEVICE_UDEV_DEVICE_MANAGER_UDEV_H_
6 #define UI_EVENTS_OZONE_DEVICE_UDEV_DEVICE_MANAGER_UDEV_H_ 6 #define UI_EVENTS_OZONE_DEVICE_UDEV_DEVICE_MANAGER_UDEV_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_pump_libevent.h" 9 #include "base/message_loop/message_pump_libevent.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
11 #include "device/udev_linux/scoped_udev.h" 11 #include "device/udev_linux/scoped_udev.h"
12 #include "ui/events/ozone/device/device_manager.h" 12 #include "ui/events/ozone/device/device_manager.h"
13 13
14 namespace ui { 14 namespace ui {
15 15
16 class DeviceEvent; 16 class DeviceEvent;
17 class DeviceEventObserver; 17 class DeviceEventObserver;
18 18
19 class DeviceManagerUdev 19 class DeviceManagerUdev
20 : public DeviceManager, base::MessagePumpLibevent::Watcher { 20 : public DeviceManager, base::MessagePumpLibevent::Watcher {
21 public: 21 public:
22 DeviceManagerUdev(); 22 DeviceManagerUdev();
23 ~DeviceManagerUdev() override; 23 ~DeviceManagerUdev() override;
24 24
25 private: 25 private:
26 scoped_ptr<DeviceEvent> ProcessMessage(udev_device* device); 26 std::unique_ptr<DeviceEvent> ProcessMessage(udev_device* device);
27 27
28 // Creates a device-monitor to look for device add/remove/change events. 28 // Creates a device-monitor to look for device add/remove/change events.
29 void CreateMonitor(); 29 void CreateMonitor();
30 30
31 // DeviceManager overrides: 31 // DeviceManager overrides:
32 void ScanDevices(DeviceEventObserver* observer) override; 32 void ScanDevices(DeviceEventObserver* observer) override;
33 void AddObserver(DeviceEventObserver* observer) override; 33 void AddObserver(DeviceEventObserver* observer) override;
34 void RemoveObserver(DeviceEventObserver* observer) override; 34 void RemoveObserver(DeviceEventObserver* observer) override;
35 35
36 // base::MessagePumpLibevent::Watcher overrides: 36 // base::MessagePumpLibevent::Watcher overrides:
37 void OnFileCanReadWithoutBlocking(int fd) override; 37 void OnFileCanReadWithoutBlocking(int fd) override;
38 void OnFileCanWriteWithoutBlocking(int fd) override; 38 void OnFileCanWriteWithoutBlocking(int fd) override;
39 39
40 device::ScopedUdevPtr udev_; 40 device::ScopedUdevPtr udev_;
41 device::ScopedUdevMonitorPtr monitor_; 41 device::ScopedUdevMonitorPtr monitor_;
42 42
43 base::MessagePumpLibevent::FileDescriptorWatcher controller_; 43 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
44 44
45 base::ObserverList<DeviceEventObserver> observers_; 45 base::ObserverList<DeviceEventObserver> observers_;
46 46
47 DISALLOW_COPY_AND_ASSIGN(DeviceManagerUdev); 47 DISALLOW_COPY_AND_ASSIGN(DeviceManagerUdev);
48 }; 48 };
49 49
50 } // namespace ui 50 } // namespace ui
51 51
52 #endif // UI_EVENTS_OZONE_DEVICE_UDEV_DEVICE_MANAGER_UDEV_H_ 52 #endif // UI_EVENTS_OZONE_DEVICE_UDEV_DEVICE_MANAGER_UDEV_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/device/device_manager.cc ('k') | ui/events/ozone/device/udev/device_manager_udev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698