Introduce CachedTextInputInfo class for InputMethodController
This patch Introduces |CachedTextInputInfo| class to cache text content and text offsets of selection and IME composition to avoid redundant calculation of them for improving responsiveness. Background: Browser process calls |InputMethodController::TextInputInfo()| for every frame (16ms) and |GetSelectionOffsets()| for every selection changes. Without caching |TextInputInfo|, these functions do text serializing root editable element or document body for every time even if layout tree isn't changed. Note: |testRunner| doesn't call |GetSelectionOffsets()| because it is called in |RenderFrameImpl::SyncSelectionIfRequired()| and |testRunner| doesn't use it. Note: Speed of |TextInputInfo()| doesn't appeared in performance test, because it is called in |WidgetBase::WillBeginMainFrame()|. So repeated call of |selection.modify()| in JavaScript doesn't call it. Bug: 875155, 892513 Change-Id: Ib7de3849fd94af88db743806e6f8b1624cd944bc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505348 Commit-Queue: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Reviewed-by:Koji Ishii <kojii@chromium.org> Reviewed-by:
Kent Tamura <tkent@chromium.org> Auto-Submit: Yoshifumi Inoue <yosin@chromium.org> Cr-Commit-Position: refs/heads/master@{#824344}
Showing
Please register or sign in to comment