If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

|nsWifiScannerDBus| uses shared DBus connection

RESOLVED WONTFIX

Status

()

Core
Geolocation
RESOLVED WONTFIX
a year ago
a year ago

People

(Reporter: tzimmermann, Assigned: tzimmermann)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: btpp-active)

Attachments

(1 attachment)

This is a follow-up bug to bug 1264887.

|nsWifiScannerDBus| shares a DBus connection with other modules in Firefox. It's safer to have each component use it's own, private connection.

We had such a problem with Bluetooth: it was sharing it's DBus connection with the UI main loop and both modules where polling the connection on different threads concurrently. DBus messages were received on either thread, which led to issues with thread-synchronization. Giving Bluetooth it's own connection solved this problem.
Created attachment 8744293 [details] [diff] [review]
[01] Bug 1266705: Use separate DBus connection for Wifi
Attachment #8744293 - Flags: review?(josh)
Whiteboard: btpp-active
Comment on attachment 8744293 [details] [diff] [review]
[01] Bug 1266705: Use separate DBus connection for Wifi

Review of attachment 8744293 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the comment addressed.

::: netwerk/wifi/nsWifiScannerDBus.cpp
@@ +13,5 @@
>  {
>    MOZ_ASSERT(mAccessPoints);
>  
> +  mConnection = already_AddRefed<DBusConnection>(
> +    dbus_bus_get_private(DBUS_BUS_SYSTEM, nullptr));

https://dbus.freedesktop.org/doc/api/html/group__DBusBus.html#ga9c62186f19cf3bd3c7c604bdcefb4e09 says we should call dbus_connection_close on the connection before unreffing it, and we currently don't.
Attachment #8744293 - Flags: review?(josh) → review+
> > +  mConnection = already_AddRefed<DBusConnection>(
> > +    dbus_bus_get_private(DBUS_BUS_SYSTEM, nullptr));
> 
> https://dbus.freedesktop.org/doc/api/html/group__DBusBus.
> html#ga9c62186f19cf3bd3c7c604bdcefb4e09 says we should call
> dbus_connection_close on the connection before unreffing it, and we
> currently don't.

That's a good point. I'll add code to close the connection to the unref helper function, and add a comment in this patch.
Depends on: 1267214
Probably not worth it ATM.
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.