Commit 47781a53 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Convert base::Bind() call in device/udev_linux/.

Also enforce modern Bind/Callback in device/udev_linux/. Also fix lint
errors.

Bug: 714018
Change-Id: Ic312e3a1df3ec63a4d2bc8bb5f2f52e7728f1006
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1869286Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708092}
parent 98310e5b
...@@ -409,7 +409,6 @@ _NOT_CONVERTED_TO_MODERN_BIND_AND_CALLBACK = '|'.join(( ...@@ -409,7 +409,6 @@ _NOT_CONVERTED_TO_MODERN_BIND_AND_CALLBACK = '|'.join((
'^device/bluetooth/', '^device/bluetooth/',
'^device/fido/', '^device/fido/',
'^device/gamepad/', '^device/gamepad/',
'^device/udev_linux/',
'^device/vr/', '^device/vr/',
'^extensions/', '^extensions/',
'^gin/', '^gin/',
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "device/udev_linux/udev_watcher.h" #include "device/udev_linux/udev_watcher.h"
#include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/threading/scoped_blocking_call.h" #include "base/threading/scoped_blocking_call.h"
...@@ -115,8 +117,8 @@ UdevWatcher::UdevWatcher(ScopedUdevPtr udev, ...@@ -115,8 +117,8 @@ UdevWatcher::UdevWatcher(ScopedUdevPtr udev,
observer_(observer), observer_(observer),
udev_filters_(filters) { udev_filters_(filters) {
file_watcher_ = base::FileDescriptorWatcher::WatchReadable( file_watcher_ = base::FileDescriptorWatcher::WatchReadable(
monitor_fd, monitor_fd, base::BindRepeating(&UdevWatcher::OnMonitorReadable,
base::Bind(&UdevWatcher::OnMonitorReadable, base::Unretained(this))); base::Unretained(this)));
} }
void UdevWatcher::OnMonitorReadable() { void UdevWatcher::OnMonitorReadable() {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define DEVICE_UDEV_LINUX_UDEV_WATCHER_H_ #define DEVICE_UDEV_LINUX_UDEV_WATCHER_H_
#include <memory> #include <memory>
#include <string>
#include <vector> #include <vector>
#include "base/files/file_descriptor_watcher_posix.h" #include "base/files/file_descriptor_watcher_posix.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment