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

Unified Diff: chrome/browser/geolocation/wifi_data_provider_linux.cc

Issue 2804042: Incomplete changes to make scoped_ptr_malloc use plain functions. (Closed)
Patch Set: chrome now builds & links Created 10 years, 5 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 | « base/scoped_ptr.h ('k') | chrome/browser/gtk/certificate_dialogs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « base/scoped_ptr.h ('k') | chrome/browser/gtk/certificate_dialogs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698