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

Side by Side Diff: content/browser/device_monitor_linux.h

Issue 10829073: Add DeviceMonitorLinux in BrowserMainLoop. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: change to always start device monitoring when browser is started Created 8 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 CONTENT_BROWSER_DEVICE_MONITOR_LINUX_H_
9 #define CONTENT_BROWSER_DEVICE_MONITOR_LINUX_H_
10
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop.h"
14
15 extern "C" {
16 struct udev_device;
17 }
18
19 namespace content {
20
21 class UdevLinux;
22
23 class DeviceMonitorLinux : public MessageLoop::DestructionObserver {
24 public:
25 DeviceMonitorLinux();
26 virtual ~DeviceMonitorLinux();
27
28 // This object is deleted on the UI thread after the IO thread has been
29 // destroyed. Need to know when IO thread is being destroyed so that
30 // we can delete udev_.
31 virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
tommi (sloooow) - chröme 2012/07/30 19:45:11 nit: make this private since it's not supposed to
wjia(left Chromium) 2012/07/30 21:00:13 Done.
32
33 private:
34 virtual void Initialize();
35 void OnDevicesChanged(udev_device* device);
36
37 scoped_ptr<UdevLinux> udev_;
38
39 // Hold a pointer to the IO loop to check we delete udev_ on the right thread.
40 MessageLoop* io_loop_;
41
42 DISALLOW_COPY_AND_ASSIGN(DeviceMonitorLinux);
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_BROWSER_DEVICE_MONITOR_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698