Backed out changeset 3e0859b436d6 (bug 1264887)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 19 Apr 2016 12:07:13 +0200
changeset 331728 19e97d9095832773eedec38754966db4beb1d493
parent 331727 764146352ed7021c3fbd0776b1471f0a2dc0f9a4
child 331729 f82e5679db7885fc80f76403a2405a84096cd407
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1264887
milestone48.0a1
backs out3e0859b436d6c3e5b70afc599b814564d600415b
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 3e0859b436d6 (bug 1264887)
netwerk/wifi/nsWifiScannerDBus.cpp
netwerk/wifi/nsWifiScannerDBus.h
--- a/netwerk/wifi/nsWifiScannerDBus.cpp
+++ b/netwerk/wifi/nsWifiScannerDBus.cpp
@@ -7,26 +7,28 @@
 
 namespace mozilla {
 
 nsWifiScannerDBus::nsWifiScannerDBus(nsCOMArray<nsWifiAccessPoint> *aAccessPoints)
 : mAccessPoints(aAccessPoints)
 {
   MOZ_ASSERT(mAccessPoints);
 
-  mConnection =
-    already_AddRefed<DBusConnection>(dbus_bus_get(DBUS_BUS_SYSTEM, nullptr));
+  mConnection = dbus_bus_get(DBUS_BUS_SYSTEM, nullptr);
   MOZ_ASSERT(mConnection);
   dbus_connection_set_exit_on_disconnect(mConnection, false);
 
   MOZ_COUNT_CTOR(nsWifiScannerDBus);
 }
 
 nsWifiScannerDBus::~nsWifiScannerDBus()
 {
+  if (!mConnection) {
+    dbus_connection_unref(mConnection);
+  }
   MOZ_COUNT_DTOR(nsWifiScannerDBus);
 }
 
 nsresult
 nsWifiScannerDBus::Scan()
 {
   return SendMessage("org.freedesktop.NetworkManager",
                      "/org/freedesktop/NetworkManager",
--- a/netwerk/wifi/nsWifiScannerDBus.h
+++ b/netwerk/wifi/nsWifiScannerDBus.h
@@ -5,18 +5,16 @@
 #ifndef NSWIFIAPSCANNERDBUS_H_
 #define NSWIFIAPSCANNERDBUS_H_
 
 #include "nsCOMArray.h"
 
 #define DBUS_API_SUBJECT_TO_CHANGE
 #include <dbus/dbus.h>
 
-#include "mozilla/ipc/DBusConnectionRefPtr.h"
-
 class nsWifiAccessPoint;
 
 namespace mozilla {
 
 class nsWifiScannerDBus final
 {
 public:
   explicit nsWifiScannerDBus(nsCOMArray<nsWifiAccessPoint>* aAccessPoints);
@@ -31,15 +29,15 @@ private:
   nsresult IdentifyDevices(DBusMessage* aMsg);
   nsresult IdentifyDeviceType(DBusMessage* aMsg, const char* aDevicePath);
   nsresult IdentifyAccessPoints(DBusMessage* aMsg);
   nsresult IdentifyAPProperties(DBusMessage* aMsg);
   nsresult StoreSsid(DBusMessageIter* aVariant, nsWifiAccessPoint* aAp);
   nsresult SetMac(DBusMessageIter* aVariant, nsWifiAccessPoint* aAp);
   nsresult GetDBusIterator(DBusMessage* aMsg, DBusMessageIter* aIterArray);
 
-  RefPtr<DBusConnection> mConnection;
+  DBusConnection* mConnection;
   nsCOMArray<nsWifiAccessPoint>* mAccessPoints;
 };
 
 } // mozilla
 
 #endif // NSWIFIAPSCANNERDBUS_H_