Commit 908e349c authored by zork@chromium.org's avatar zork@chromium.org

Prevent initialization of the Input Method Manager after the APP_TERMINATING message has been sent.


R=derat@chromium.org
BUG=chromium-os:12402
TEST=None


Review URL: http://codereview.chromium.org/7747015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98404 0039d316-1c4b-4281-b951-d872f2087c98
parent 5fd82d91
......@@ -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_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment