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

Unified Diff: components/storage_monitor/udev_util_linux.cc

Issue 302093009: Linux: Unify udev scopers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/storage_monitor/udev_util_linux.h ('k') | device/hid/device_monitor_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/storage_monitor/udev_util_linux.cc
diff --git a/components/storage_monitor/udev_util_linux.cc b/components/storage_monitor/udev_util_linux.cc
index 142a54e28ea3ba412e3135031ea0941dc87c8d62..5a3a1173e4216a25d43b284c3605793cb65b8259 100644
--- a/components/storage_monitor/udev_util_linux.cc
+++ b/components/storage_monitor/udev_util_linux.cc
@@ -5,17 +5,10 @@
#include "components/storage_monitor/udev_util_linux.h"
#include "base/files/file_path.h"
+#include "device/udev_linux/udev.h"
namespace storage_monitor {
-void UdevDeleter::operator()(struct udev* udev) {
- udev_unref(udev);
-}
-
-void UdevDeviceDeleter::operator()(struct udev_device* device) {
- udev_device_unref(device);
-}
-
std::string GetUdevDevicePropertyValue(struct udev_device* udev_device,
const char* key) {
const char* value = udev_device_get_property_value(udev_device, key);
@@ -25,10 +18,10 @@ std::string GetUdevDevicePropertyValue(struct udev_device* udev_device,
bool GetUdevDevicePropertyValueByPath(const base::FilePath& device_path,
const char* key,
std::string* result) {
- ScopedUdevObject udev(udev_new());
+ device::ScopedUdevPtr udev(udev_new());
if (!udev.get())
return false;
- ScopedUdevDeviceObject device(udev_device_new_from_syspath(
+ device::ScopedUdevDevicePtr device(udev_device_new_from_syspath(
udev.get(), device_path.value().c_str()));
if (!device.get())
return false;
« no previous file with comments | « components/storage_monitor/udev_util_linux.h ('k') | device/hid/device_monitor_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698