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

Unified Diff: device/udev_linux/scoped_udev.h

Issue 666653002: Cleanup: Merge device/udev_linux/udev.{cc,h} into device/udev_linux/scoped_udev.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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 | « device/udev_linux/BUILD.gn ('k') | device/udev_linux/udev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/udev_linux/scoped_udev.h
diff --git a/device/udev_linux/udev.h b/device/udev_linux/scoped_udev.h
similarity index 61%
rename from device/udev_linux/udev.h
rename to device/udev_linux/scoped_udev.h
index cffb6723cc40eeec0f0ec424f5e9adaed0c87efb..54df387834460e72212fc93ddcaf8f38f98afa64 100644
--- a/device/udev_linux/udev.h
+++ b/device/udev_linux/scoped_udev.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef DEVICE_UDEV_LINUX_UDEV_H_
-#define DEVICE_UDEV_LINUX_UDEV_H_
+#ifndef DEVICE_UDEV_LINUX_SCOPED_UDEV_H_
+#define DEVICE_UDEV_LINUX_SCOPED_UDEV_H_
#include <libudev.h>
@@ -16,16 +16,24 @@
namespace device {
struct UdevDeleter {
- void operator()(udev* dev) const;
+ void operator()(udev* dev) const {
+ udev_unref(dev);
+ }
};
struct UdevEnumerateDeleter {
- void operator()(udev_enumerate* enumerate) const;
+ void operator()(udev_enumerate* enumerate) const {
+ udev_enumerate_unref(enumerate);
+ }
};
struct UdevDeviceDeleter {
- void operator()(udev_device* device) const;
+ void operator()(udev_device* device) const {
+ udev_device_unref(device);
+ }
};
struct UdevMonitorDeleter {
- void operator()(udev_monitor* monitor) const;
+ void operator()(udev_monitor* monitor) const {
+ udev_monitor_unref(monitor);
+ }
};
typedef scoped_ptr<udev, UdevDeleter> ScopedUdevPtr;
@@ -35,4 +43,4 @@ typedef scoped_ptr<udev_monitor, UdevMonitorDeleter> ScopedUdevMonitorPtr;
} // namespace device
-#endif // DEVICE_UDEV_LINUX_UDEV_H_
+#endif // DEVICE_UDEV_LINUX_SCOPED_UDEV_H_
« no previous file with comments | « device/udev_linux/BUILD.gn ('k') | device/udev_linux/udev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698