| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_EVENTS_OZONE_EVDEV_SCOPED_UDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_SCOPED_UDEV_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_SCOPED_UDEV_H_ | 6 #define UI_EVENTS_OZONE_SCOPED_UDEV_H_ |
| 7 | 7 |
| 8 #include <libudev.h> | 8 #include <libudev.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 | 11 |
| 12 // This file enables management of udev object references using scoped_ptr<> by | 12 // This file enables management of udev object references using scoped_ptr<> by |
| 13 // associating a custom deleter that drops the reference rather than deleting. | 13 // associating a custom deleter that drops the reference rather than deleting. |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 40 // Scoped struct udev_monitor. | 40 // Scoped struct udev_monitor. |
| 41 struct UdevMonitorDeleter { | 41 struct UdevMonitorDeleter { |
| 42 void operator()(struct udev_monitor* udev_monitor) { | 42 void operator()(struct udev_monitor* udev_monitor) { |
| 43 udev_monitor_unref(udev_monitor); | 43 udev_monitor_unref(udev_monitor); |
| 44 } | 44 } |
| 45 }; | 45 }; |
| 46 typedef scoped_ptr<struct udev_monitor, UdevMonitorDeleter> scoped_udev_monitor; | 46 typedef scoped_ptr<struct udev_monitor, UdevMonitorDeleter> scoped_udev_monitor; |
| 47 | 47 |
| 48 } // namespace ui | 48 } // namespace ui |
| 49 | 49 |
| 50 #endif // UI_EVENTS_OZONE_EVDEV_SCOPED_UDEV_H_ | 50 #endif // UI_EVENTS_OZONE_SCOPED_UDEV_H_ |
| OLD | NEW |