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

Side by Side Diff: content/browser/udev_linux.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "content/browser/udev_linux.h" 5 #include "content/browser/udev_linux.h"
6 6
7 #include <libudev.h> 7 #include <libudev.h>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 10
(...skipping 14 matching lines...) Expand all
25 int ret = udev_monitor_filter_add_match_subsystem_devtype( 25 int ret = udev_monitor_filter_add_match_subsystem_devtype(
26 monitor_, filters[i].subsystem, filters[i].devtype); 26 monitor_, filters[i].subsystem, filters[i].devtype);
27 CHECK_EQ(0, ret); 27 CHECK_EQ(0, ret);
28 } 28 }
29 29
30 int ret = udev_monitor_enable_receiving(monitor_); 30 int ret = udev_monitor_enable_receiving(monitor_);
31 CHECK_EQ(0, ret); 31 CHECK_EQ(0, ret);
32 monitor_fd_ = udev_monitor_get_fd(monitor_); 32 monitor_fd_ = udev_monitor_get_fd(monitor_);
33 CHECK_GE(monitor_fd_, 0); 33 CHECK_GE(monitor_fd_, 0);
34 34
35 bool success = MessageLoopForIO::current()->WatchFileDescriptor(monitor_fd_, 35 bool success = base::MessageLoopForIO::current()->WatchFileDescriptor(
36 true, MessageLoopForIO::WATCH_READ, &monitor_watcher_, this); 36 monitor_fd_,
37 true,
38 base::MessageLoopForIO::WATCH_READ,
39 &monitor_watcher_,
40 this);
37 CHECK(success); 41 CHECK(success);
38 } 42 }
39 43
40 UdevLinux::~UdevLinux() { 44 UdevLinux::~UdevLinux() {
41 monitor_watcher_.StopWatchingFileDescriptor(); 45 monitor_watcher_.StopWatchingFileDescriptor();
42 udev_monitor_unref(monitor_); 46 udev_monitor_unref(monitor_);
43 udev_unref(udev_); 47 udev_unref(udev_);
44 } 48 }
45 49
46 udev* UdevLinux::udev_handle() { 50 udev* UdevLinux::udev_handle() {
(...skipping 10 matching lines...) Expand all
57 return; 61 return;
58 62
59 callback_.Run(dev); 63 callback_.Run(dev);
60 udev_device_unref(dev); 64 udev_device_unref(dev);
61 } 65 }
62 66
63 void UdevLinux::OnFileCanWriteWithoutBlocking(int fd) { 67 void UdevLinux::OnFileCanWriteWithoutBlocking(int fd) {
64 } 68 }
65 69
66 } // namespace content 70 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/system_message_window_win_unittest.cc ('k') | content/browser/web_contents/interstitial_page_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698