Chromium Code Reviews| Index: chrome/browser/storage_monitor/udev_util_linux.h |
| =================================================================== |
| --- chrome/browser/storage_monitor/udev_util_linux.h (revision 202209) |
| +++ chrome/browser/storage_monitor/udev_util_linux.h (working copy) |
| @@ -9,7 +9,7 @@ |
| #include <string> |
| -#include "base/memory/scoped_generic_obj.h" |
| +#include "base/memory/scoped_ptr.h" |
| namespace base { |
| class FilePath; |
| @@ -17,25 +17,19 @@ |
| namespace chrome { |
| -// ScopedGenericObj functor for UdevObjectRelease(). |
| -class ScopedReleaseUdevObject { |
| - public: |
| - void operator()(struct udev* udev) const { |
| - udev_unref(udev); |
| - } |
| +// Deleter for ScopedUdevObject. |
| +struct UdevDeleter { |
| + void operator()(struct udev* udev); |
| }; |
| -typedef ScopedGenericObj<struct udev*, |
| - ScopedReleaseUdevObject> ScopedUdevObject; |
| +typedef scoped_ptr<struct udev, UdevDeleter> ScopedUdevObject; |
| -// ScopedGenericObj functor for UdevDeviceObjectRelease(). |
| -class ScopedReleaseUdevDeviceObject { |
| +// Deleter for ScopedUdevDeviceObject(). |
| +struct UdevDeviceDeleter { |
| public: |
|
vandebo (ex-Chrome)
2013/05/28 19:01:07
nit: remove public
Lei Zhang
2013/05/28 20:37:18
Done.
|
| - void operator()(struct udev_device* device) const { |
| - udev_device_unref(device); |
| - } |
| + void operator()(struct udev_device* device); |
| }; |
| -typedef ScopedGenericObj<struct udev_device*, |
| - ScopedReleaseUdevDeviceObject> ScopedUdevDeviceObject; |
| +typedef scoped_ptr<struct udev_device, UdevDeviceDeleter> |
| + ScopedUdevDeviceObject; |
| // Wrapper function for udev_device_get_property_value() that also checks for |
| // valid but empty values. |