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

Side by Side Diff: media/capture/device_monitor_udev.h

Issue 2224643002: Move device monitors out of //media/capture into //media/device_monitors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « media/capture/device_monitor_mac.mm ('k') | media/capture/device_monitor_udev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // This class is used to detect device change and notify base::SystemMonitor
6 // on Linux.
7
8 #ifndef MEDIA_CAPTURE_DEVICE_MONITOR_UDEV_H_
9 #define MEDIA_CAPTURE_DEVICE_MONITOR_UDEV_H_
10
11 #include <memory>
12
13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h"
15 #include "base/message_loop/message_loop.h"
16 #include "base/single_thread_task_runner.h"
17 #include "media/capture/capture_export.h"
18
19 extern "C" {
20 struct udev_device;
21 }
22
23 namespace device {
24 class UdevLinux;
25 }
26
27 namespace media {
28
29 class CAPTURE_EXPORT DeviceMonitorLinux
30 : public base::MessageLoop::DestructionObserver {
31 public:
32 explicit DeviceMonitorLinux(
33 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
34 ~DeviceMonitorLinux() override;
35
36 // TODO(mcasas): Consider adding a StartMonitoring() method like
37 // DeviceMonitorMac to reduce startup impact time.
38
39 private:
40 // This object is deleted on the constructor thread after |io_task_runner_|
41 // has been destroyed. Need to know when the latter is being destroyed so that
42 // we can delete |udev_|.
43 void WillDestroyCurrentMessageLoop() override;
44
45 void Initialize();
46 void OnDevicesChanged(udev_device* device);
47
48 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
49
50 std::unique_ptr<device::UdevLinux> udev_;
51
52 DISALLOW_COPY_AND_ASSIGN(DeviceMonitorLinux);
53 };
54
55 } // namespace media
56
57 #endif // MEDIA_CAPTURE_DEVICE_MONITOR_UDEV_H_
OLDNEW
« no previous file with comments | « media/capture/device_monitor_mac.mm ('k') | media/capture/device_monitor_udev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698