Index: chrome/browser/geolocation/wifi_data_provider_linux.cc |
diff --git a/chrome/browser/geolocation/wifi_data_provider_linux.cc b/chrome/browser/geolocation/wifi_data_provider_linux.cc |
index 14b265b04bc4bac74f1c41b4c30b20c523d3e1a6..21577554b4495a75ffe7926d054cb3625117143d 100644 |
--- a/chrome/browser/geolocation/wifi_data_provider_linux.cc |
+++ b/chrome/browser/geolocation/wifi_data_provider_linux.cc |
@@ -30,25 +30,15 @@ const char kNetworkManagerInterface[] = "org.freedesktop.NetworkManager"; |
enum { NM_DEVICE_TYPE_WIFI = 2 }; |
// Utility wrappers to make various GLib & DBus structs into scoped objects. |
-class ScopedGPtrArrayFree { |
- public: |
- void operator()(GPtrArray* x) const { |
- if (x) |
- g_ptr_array_free(x, TRUE); |
- } |
-}; |
+void ScopedGPtrArrayFree(GPtrArray* x) { |
+ g_ptr_array_free(x, TRUE); |
+} |
// Use ScopedGPtrArrayPtr as if it were scoped_ptr<GPtrArray> |
typedef scoped_ptr_malloc<GPtrArray, ScopedGPtrArrayFree> ScopedGPtrArrayPtr; |
-class ScopedGObjectFree { |
- public: |
- void operator()(void* x) const { |
- if (x) |
- g_object_unref(x); |
- } |
-}; |
// Use ScopedDBusGProxyPtr as if it were scoped_ptr<DBusGProxy> |
-typedef scoped_ptr_malloc<DBusGProxy, ScopedGObjectFree> ScopedDBusGProxyPtr; |
+typedef scoped_ptr_malloc<DBusGProxy, FreeFnAdapter<g_object_unref> > |
+ ScopedDBusGProxyPtr; |
// Use ScopedGValue::v as an instance of GValue with automatic cleanup. |
class ScopedGValue { |