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

Unified Diff: ui/events/ozone/device/udev/device_manager_udev.cc

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 side-by-side diff with in-line comments
Download patch
Index: ui/events/ozone/device/udev/device_manager_udev.cc
diff --git a/ui/events/ozone/device/udev/device_manager_udev.cc b/ui/events/ozone/device/udev/device_manager_udev.cc
index 9550a25dad3153c53cdd664d6ca7db0e3e0f216c..0f21e8f4502a02f7d8350bd61194fbddd74dcb97 100644
--- a/ui/events/ozone/device/udev/device_manager_udev.cc
+++ b/ui/events/ozone/device/udev/device_manager_udev.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "ui/events/ozone/device/device_event.h"
@@ -120,7 +121,7 @@ void DeviceManagerUdev::ScanDevices(DeviceEventObserver* observer) {
if (!device)
continue;
- scoped_ptr<DeviceEvent> event = ProcessMessage(device.get());
+ std::unique_ptr<DeviceEvent> event = ProcessMessage(device.get());
if (event)
observer->OnDeviceEvent(*event.get());
}
@@ -144,7 +145,7 @@ void DeviceManagerUdev::OnFileCanReadWithoutBlocking(int fd) {
if (!device)
return;
- scoped_ptr<DeviceEvent> event = ProcessMessage(device.get());
+ std::unique_ptr<DeviceEvent> event = ProcessMessage(device.get());
if (event)
FOR_EACH_OBSERVER(
DeviceEventObserver, observers_, OnDeviceEvent(*event.get()));
@@ -154,7 +155,8 @@ void DeviceManagerUdev::OnFileCanWriteWithoutBlocking(int fd) {
NOTREACHED();
}
-scoped_ptr<DeviceEvent> DeviceManagerUdev::ProcessMessage(udev_device* device) {
+std::unique_ptr<DeviceEvent> DeviceManagerUdev::ProcessMessage(
+ udev_device* device) {
const char* path = device::udev_device_get_devnode(device);
const char* action = device::udev_device_get_action(device);
const char* subsystem =
@@ -184,7 +186,7 @@ scoped_ptr<DeviceEvent> DeviceManagerUdev::ProcessMessage(udev_device* device) {
else
return nullptr;
- return make_scoped_ptr(
+ return base::WrapUnique(
new DeviceEvent(device_type, action_type, base::FilePath(path)));
}
« no previous file with comments | « ui/events/ozone/device/udev/device_manager_udev.h ('k') | ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698