Bug 1500366 - register all DBus connection to be handled by gmain loop, r=jhorak
authorMartin Stransky <stransky@redhat.com>
Fri, 19 Oct 2018 10:11:46 +0000
changeset 500680 0ffed4de7dc0a1ba399a33168e657549d8c559b5
parent 500679 6eaed80ae36ffeaffe0bad1e969e5c92e1c9922c
child 500681 96304d13c406be1eb813e7c8cadabd04a8aad12d
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak
bugs1500366
milestone64.0a1
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
Bug 1500366 - register all DBus connection to be handled by gmain loop, r=jhorak Differential Revision: https://phabricator.services.mozilla.com/D9230
netwerk/wifi/nsWifiScannerDBus.cpp
netwerk/wifi/nsWifiScannerDBus.h
toolkit/components/remote/nsDBusRemoteService.cpp
widget/xremoteclient/DBusRemoteClient.cpp
--- a/netwerk/wifi/nsWifiScannerDBus.cpp
+++ b/netwerk/wifi/nsWifiScannerDBus.cpp
@@ -12,16 +12,17 @@ nsWifiScannerDBus::nsWifiScannerDBus(nsC
 : mAccessPoints(aAccessPoints)
 {
   MOZ_ASSERT(mAccessPoints);
 
   mConnection =
     already_AddRefed<DBusConnection>(dbus_bus_get(DBUS_BUS_SYSTEM, nullptr));
 
   if (mConnection) {
+    dbus_connection_setup_with_g_main(mConnection, nullptr);
     dbus_connection_set_exit_on_disconnect(mConnection, false);
   }
 
   MOZ_COUNT_CTOR(nsWifiScannerDBus);
 }
 
 nsWifiScannerDBus::~nsWifiScannerDBus()
 {
--- a/netwerk/wifi/nsWifiScannerDBus.h
+++ b/netwerk/wifi/nsWifiScannerDBus.h
@@ -4,16 +4,17 @@
 
 #ifndef NSWIFIAPSCANNERDBUS_H_
 #define NSWIFIAPSCANNERDBUS_H_
 
 #include "nsCOMArray.h"
 
 #define DBUS_API_SUBJECT_TO_CHANGE
 #include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
 
 class nsWifiAccessPoint;
 
 namespace mozilla {
 
 class nsWifiScannerDBus final
 {
 public:
--- a/toolkit/components/remote/nsDBusRemoteService.cpp
+++ b/toolkit/components/remote/nsDBusRemoteService.cpp
@@ -169,16 +169,17 @@ nsDBusRemoteService::Startup(const char*
     return NS_ERROR_INVALID_ARG;
 
   mConnection = already_AddRefed<DBusConnection>(
     dbus_bus_get(DBUS_BUS_SESSION, nullptr));
   if (!mConnection) {
     return NS_ERROR_FAILURE;
   }
   dbus_connection_set_exit_on_disconnect(mConnection, false);
+  dbus_connection_setup_with_g_main(mConnection, nullptr);
 
   mAppName = aAppName;
   ToLowerCase(mAppName);
 
   // D-Bus names can contain only [a-z][A-Z][0-9]_
   // characters so adjust the profile string properly.
   nsAutoCString profileName;
   nsresult rv = mozilla::Base64Encode(nsAutoCString(aProfileName), profileName);
--- a/widget/xremoteclient/DBusRemoteClient.cpp
+++ b/widget/xremoteclient/DBusRemoteClient.cpp
@@ -38,16 +38,17 @@ DBusRemoteClient::Init()
     return NS_OK;
 
   mConnection = already_AddRefed<DBusConnection>(
     dbus_bus_get(DBUS_BUS_SESSION, nullptr));
   if (!mConnection)
     return NS_ERROR_FAILURE;
 
   dbus_connection_set_exit_on_disconnect(mConnection, false);
+  dbus_connection_setup_with_g_main(mConnection, nullptr);
 
   return NS_OK;
 }
 
 void
 DBusRemoteClient::Shutdown (void)
 {
   MOZ_LOG(sRemoteLm, LogLevel::Debug, ("DBusRemoteClient::Shutdown"));