summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 21:48:53 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 21:48:53 +0000
commit07fb7246ace233e9193f347891f65daf280e5d09 (patch)
tree77c82c9fdff02c3586d4795a5b88aa16675726e3 /chrome
parent1591bbce0bc9966372e17e6dcd866ed6ebf308db (diff)
downloadchromium_src-07fb7246ace233e9193f347891f65daf280e5d09.zip
chromium_src-07fb7246ace233e9193f347891f65daf280e5d09.tar.gz
chromium_src-07fb7246ace233e9193f347891f65daf280e5d09.tar.bz2
linux: initialize glib-dbus threading during startup
Rather than scattering init calls through the code, just inititialize it once. (In particular, the gnome-keyring support also needs this function called, and I didn't want to copy it one more time.) TEST=no threading-related crash during gnome-keyring startup Review URL: http://codereview.chromium.org/2873015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50652 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_dll_main.cc5
-rw-r--r--chrome/browser/geolocation/wifi_data_provider_linux.cc4
-rw-r--r--chrome/browser/password_manager/native_backend_kwallet_x.cc6
3 files changed, 5 insertions, 10 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index d6eda18..7ff3f14 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -24,6 +24,7 @@
#endif
#if defined(USE_X11)
+#include <dbus/dbus-glib.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <gtk/gtk.h>
@@ -851,6 +852,10 @@ int ChromeMain(int argc, char** argv) {
// definitely harmless, so retained as a reminder of this
// requirement for gconf.
g_type_init();
+ // We use glib-dbus for geolocation and it's possible other libraries
+ // (e.g. gnome-keyring) will use it, so initialize its threading here
+ // as well.
+ dbus_g_thread_init();
// gtk_init() can change |argc| and |argv|.
gtk_init(&argc, &argv);
SetUpGLibLogHandler();
diff --git a/chrome/browser/geolocation/wifi_data_provider_linux.cc b/chrome/browser/geolocation/wifi_data_provider_linux.cc
index 9896679..14b265b 100644
--- a/chrome/browser/geolocation/wifi_data_provider_linux.cc
+++ b/chrome/browser/geolocation/wifi_data_provider_linux.cc
@@ -149,10 +149,6 @@ bool NetworkManagerWlanApi::Init() {
// get caught up with that nonsense here, lets just assert our requirement.
CHECK(g_thread_supported());
- // We should likely do this higher up too, the docs say it must only be done
- // once but there's no way to know if it already was or not.
- dbus_g_thread_init();
-
// Get a connection to the session bus.
connection_ = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error_);
if (CheckError())
diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc
index 501ce1f..0cc4bf2 100644
--- a/chrome/browser/password_manager/native_backend_kwallet_x.cc
+++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc
@@ -40,12 +40,6 @@ NativeBackendKWallet::~NativeBackendKWallet() {
}
bool NativeBackendKWallet::Init() {
- // Initialize threading in dbus-glib - it should be fine for
- // dbus_g_thread_init to be called multiple times.
- if (!g_thread_supported())
- g_thread_init(NULL);
- dbus_g_thread_init();
-
// Get a connection to the session bus.
connection_ = dbus_g_bus_get(DBUS_BUS_SESSION, &error_);
if (CheckError())