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

Unified Diff: chromeos_input_method.cc

Issue 2627009: Swap D-Bus and IBus initialization order to avoid race conditions. (Closed) Base URL: ssh://git@gitrw.chromium.org//cros.git
Patch Set: Created 10 years, 6 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: chromeos_input_method.cc
diff --git a/chromeos_input_method.cc b/chromeos_input_method.cc
index 0c8571ca56a3347e96c4b9a4d7218f8a311a8754..9b6b962f3c1f4e0a0f97168575f74cb03003822e 100644
--- a/chromeos_input_method.cc
+++ b/chromeos_input_method.cc
@@ -535,21 +535,7 @@ class InputMethodStatusConnection {
// Initializes IBus and DBus connections.
bool Init() {
- // Establish IBus connection between ibus-daemon to retrieve the list of
- // available input method engines, change the current input method engine,
- // and so on.
ibus_init();
- ibus_ = ibus_bus_new();
-
- // Check the IBus connection status.
- if (!ibus_) {
- LOG(ERROR) << "ibus_bus_new() failed";
- return false;
- }
- if (!ibus_bus_is_connected(ibus_)) {
- DLOG(INFO) << "ibus_bus_is_connected() failed";
- return false;
- }
// Establish a DBus connection between the candidate_window process for
// Chromium OS to handle signals (e.g. "FocusIn") from the process.
@@ -584,6 +570,21 @@ class InputMethodStatusConnection {
G_CALLBACK(DBusProxyDestroyCallback),
this);
+ // Establish IBus connection between ibus-daemon to retrieve the list of
+ // available input method engines, change the current input method engine,
+ // and so on.
+ ibus_ = ibus_bus_new();
+
+ // Check the IBus connection status.
+ if (!ibus_) {
+ LOG(ERROR) << "ibus_bus_new() failed";
+ return false;
+ }
+ if (!ibus_bus_is_connected(ibus_)) {
+ DLOG(INFO) << "ibus_bus_is_connected() failed";
+ return false;
+ }
+
// Register the callback function for IBusBus signals.
g_signal_connect(ibus_,
"disconnected",
« 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