diff options
author | shuchen <shuchen@chromium.org> | 2015-04-21 09:55:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-21 16:55:53 +0000 |
commit | 8fb27d99f16a2024aefbc0a623a458a6e9944737 (patch) | |
tree | 7d78510154b68c91335f729b8c411c395a2bf89d /ui/base/ime/chromeos/mock_ime_engine_handler.cc | |
parent | 234275517b63271e72486c99d2a81325b392a875 (diff) | |
download | chromium_src-8fb27d99f16a2024aefbc0a623a458a6e9944737.zip chromium_src-8fb27d99f16a2024aefbc0a623a458a6e9944737.tar.gz chromium_src-8fb27d99f16a2024aefbc0a623a458a6e9944737.tar.bz2 |
Improves perf by avoid small memory allocation for key event handling if IME extension doesn't want to handle the key event.
Currently there are 2 places allocate small memory for each key event:
1) In InputMethodChromeOS::DispatchKeyEvent(): https://code.google.com/p/chromium/codesearch#chromium/src/ui/base/ime/input_method_chromeos.cc&l=143
2) In InputMethodEngine::ProcessKeyEvent(): https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/chromeos/input_method/input_method_engine.cc&l=603
Those allocations can be avoided for key events what IMEs are not interested in.
BUG=478373
TEST=Verified on linux_chromeos.
Review URL: https://codereview.chromium.org/1094273002
Cr-Commit-Position: refs/heads/master@{#326056}
Diffstat (limited to 'ui/base/ime/chromeos/mock_ime_engine_handler.cc')
-rw-r--r-- | ui/base/ime/chromeos/mock_ime_engine_handler.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/base/ime/chromeos/mock_ime_engine_handler.cc b/ui/base/ime/chromeos/mock_ime_engine_handler.cc index 5645494..867ef19 100644 --- a/ui/base/ime/chromeos/mock_ime_engine_handler.cc +++ b/ui/base/ime/chromeos/mock_ime_engine_handler.cc @@ -49,6 +49,10 @@ void MockIMEEngineHandler::Reset() { ++reset_call_count_; } +bool MockIMEEngineHandler::IsInterestedInKeyEvent() const { + return true; +} + void MockIMEEngineHandler::ProcessKeyEvent( const ui::KeyEvent& key_event, const KeyEventDoneCallback& callback) { |