Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5383)

Unified Diff: chrome/browser/geolocation/wifi_data_provider_linux.cc

Issue 1604023: Work-around for DBus crash due to timers firing on the wrong thread.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/geolocation/wifi_data_provider_linux.cc
===================================================================
--- chrome/browser/geolocation/wifi_data_provider_linux.cc (revision 44118)
+++ chrome/browser/geolocation/wifi_data_provider_linux.cc (working copy)
@@ -9,6 +9,8 @@
#include "chrome/browser/geolocation/wifi_data_provider_linux.h"
#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+#include <dbus/dbus.h>
#include <glib.h>
#include "base/scoped_ptr.h"
@@ -157,6 +159,18 @@
return false;
DCHECK(connection_);
+ // dbus-glib queues timers that get fired on the default loop, unfortunately
+ // it isn't thread safe in it's handling of these timers. We can't easily
+ // tell it which loop to queue them on instead, but as we only make
+ // blocking sync calls we don't need timers anyway, so disable them.
+ // See http://crbug.com/40803 TODO(joth): This is not an ideal solution, as
+ // we're reconfiguring the process global system bus connection, so could
+ // impact other users of DBus.
+ dbus_bool_t ok = dbus_connection_set_timeout_functions(
+ dbus_g_connection_get_connection(connection_),
+ NULL, NULL, NULL, NULL, NULL);
+ DCHECK(ok);
+
proxy_.reset(dbus_g_proxy_new_for_name(connection_,
kNetworkManagerServiceName,
kNetworkManagerPath,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698