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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager.cc

Issue 7747015: Prevent initialization of the Input Method Manager after the APP_TERMINATING message has been sent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code Review Fixes Created 9 years, 4 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/chromeos/input_method/input_method_manager.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager.cc b/chrome/browser/chromeos/input_method/input_method_manager.cc
index 1852c3326df4a91a01dea9ada5cf59ecf3f2fab0..1f49f499726758fce42bb85c8e35779f28a64b99 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager.cc
@@ -75,6 +75,7 @@ class InputMethodManagerImpl : public InputMethodManager,
#if !defined(TOUCH_UI)
candidate_window_controller_(NULL),
#endif
+ shutting_down_(false),
ibus_daemon_process_handle_(base::kNullProcessHandle) {
// Observe APP_TERMINATING to stop input method daemon gracefully.
// We should not use APP_EXITING here since logout might be canceled by
@@ -832,6 +833,11 @@ class InputMethodManagerImpl : public InputMethodManager,
return false;
}
+ if (shutting_down_) {
+ NOTREACHED() << "Trying to launch input method while shutting down";
+ return false;
+ }
+
#if !defined(TOUCH_UI)
if (!candidate_window_controller_.get()) {
candidate_window_controller_.reset(
@@ -904,6 +910,7 @@ class InputMethodManagerImpl : public InputMethodManager,
const NotificationDetails& details) {
// Stop the input method daemon on browser shutdown.
if (type == content::NOTIFICATION_APP_TERMINATING) {
+ shutting_down_ = true;
notification_registrar_.RemoveAll();
StopInputMethodDaemon();
#if !defined(TOUCH_UI)
@@ -966,6 +973,9 @@ class InputMethodManagerImpl : public InputMethodManager,
candidate_window_controller_;
#endif
+ // True if we've received the APP_TERMINATING notification.
+ bool shutting_down_;
+
// The process handle of the IBus daemon. kNullProcessHandle if it's not
// running.
base::ProcessHandle ibus_daemon_process_handle_;
« 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