Closed Bug 1266705 Opened 8 years ago Closed 8 years ago

|nsWifiScannerDBus| uses shared DBus connection

Categories

(Core :: DOM: Geolocation, defect)

Unspecified
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: tzimmermann, Assigned: tzimmermann)

References

Details

(Whiteboard: btpp-active)

Attachments

(1 file)

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.
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
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: