diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 09:00:42 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 09:00:42 +0000 |
commit | ba4f8a3a345aa860b99e04fcee04d167582d9979 (patch) | |
tree | a447d2a12ebbd4dd02e1a81af90091d165e118b0 /chrome/browser | |
parent | 06316d67fa3375e0f18fb8af4205d7b009aec7c2 (diff) | |
download | chromium_src-ba4f8a3a345aa860b99e04fcee04d167582d9979.zip chromium_src-ba4f8a3a345aa860b99e04fcee04d167582d9979.tar.gz chromium_src-ba4f8a3a345aa860b99e04fcee04d167582d9979.tar.bz2 |
Add a max retry count to the IME timer
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3183018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/chromeos/cros/input_method_library.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/cros/input_method_library.cc b/chrome/browser/chromeos/cros/input_method_library.cc index 1774bf2..e4a53b3 100644 --- a/chrome/browser/chromeos/cros/input_method_library.cc +++ b/chrome/browser/chromeos/cros/input_method_library.cc @@ -53,7 +53,8 @@ class InputMethodLibraryImpl : public InputMethodLibrary { active_input_method_(kHardwareKeyboardLayout), need_input_method_set_(false), ime_handle_(0), - candidate_window_handle_(0) { + candidate_window_handle_(0), + failure_count_(0) { scoped_ptr<InputMethodDescriptors> input_method_descriptors( CreateFallbackInputMethodDescriptors()); current_input_method_ = input_method_descriptors->at(0); @@ -232,8 +233,19 @@ class InputMethodLibraryImpl : public InputMethodLibrary { } else { if (!timer_.IsRunning()) { static const int64 kTimerIntervalInMsec = 100; + failure_count_ = 0; timer_.Start(base::TimeDelta::FromMilliseconds(kTimerIntervalInMsec), this, &InputMethodLibraryImpl::FlushImeConfig); + } else { + static const int kMaxRetries = 15; + ++failure_count_; + if (failure_count_ > kMaxRetries) { + LOG(ERROR) << "FlushImeConfig: Max retries exceeded. " << + "active_input_method: " << active_input_method_ << + " pending_config_requests.size: " << + pending_config_requests_.size(); + timer_.Stop(); + } } } if (active_input_methods_are_changed) { @@ -449,6 +461,7 @@ class InputMethodLibraryImpl : public InputMethodLibrary { } void SetDeferImeStartup(bool defer) { + LOG(INFO) << "Setting DeferImeStartup to " << defer; defer_ime_startup_ = defer; } // A reference to the language api, to allow callbacks when the input method @@ -490,6 +503,8 @@ class InputMethodLibraryImpl : public InputMethodLibrary { int ime_handle_; int candidate_window_handle_; + int failure_count_; + DISALLOW_COPY_AND_ASSIGN(InputMethodLibraryImpl); }; |