summaryrefslogtreecommitdiff
path: root/mozilla-1500366.patch
blob: 1f5d4d50354246fd0ef382bb4683897b4c17bae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
changeset:   441749:bb66c2fdcbe2
tag:         tip
user:        Martin Stransky <stransky@redhat.com>
date:        Fri Oct 19 12:01:02 2018 +0200
summary:     Bug 1500366 - register all DBus connection to be handled by gmain loop, r=jhorak

diff --git a/netwerk/wifi/nsWifiScannerDBus.cpp b/netwerk/wifi/nsWifiScannerDBus.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()
 {
diff --git a/netwerk/wifi/nsWifiScannerDBus.h b/netwerk/wifi/nsWifiScannerDBus.h
--- 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:
diff --git a/toolkit/components/remote/nsDBusRemoteService.cpp b/toolkit/components/remote/nsDBusRemoteService.cpp
--- 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);
diff --git a/widget/xremoteclient/DBusRemoteClient.cpp b/widget/xremoteclient/DBusRemoteClient.cpp
--- 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"));

bgstack15