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

Issue 2323983003: DO NOT SUBMIT: Bundle IME-related messages into one for batch edit (Closed)

Created:
4 years, 3 months ago by Changwan Ryu
Modified:
4 years, 3 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, creis+watch_chromium.org, danakj+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, jam, jbauman+watch_chromium.org, kalyank, kinuko+watch, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, nona+watch_chromium.org, piman+watch_chromium.org, shuchen+watch_chromium.org, sievers+watch_chromium.org, James Su, yusukes+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[WIP] Bundle IME-related messages into one for batch edit Android's InputConnection spec says that batch edit should not update display until batch edit ends. https://developer.android.com/reference/android/view/inputmethod/ InputConnection.html#beginBatchEdit() By bundling IME-related messages and run them in one message loop, display should not be updated during batch edit. Since RenderWidget has some logic before calling InputMethodController methods, batching messages at IPC::Message level seems natural. Currently, the IME logic is split across RenderWidget and RenderFrameImpl, which I don't think is necessary. In order to handle batch and run IME- related messages in one message queue, I'm merging the logic and place it in RenderWidget. One possibly changed behavior is InputConnection#get*() methods in the middle of batch edit. Previously, we returned results based on the previous calls inside batch edit. With this change, we return results based on states before entering batch edit. It is not explicit in the spec, but we think of batch edit as a bundle of operations that do not depend on the intermediate states. By sending IME messages in the batch edit mode at once, we can also solve other issues regarding beginBatchEdit(), such as crbug.com/643473 (we do not update selection change caused by operation just before beginBatchEdit() is called.), and crbug.com/643477 (allow webview apps to call InputConnection methods on non-IME thread) BUG=644574, 643473, 643477 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Patch Set 1 #

Patch Set 2 : fixed tests #

Patch Set 3 : fixed tests #

Patch Set 4 : fix webviewtest build and add comment #

Patch Set 5 : rebased #

Total comments: 2

Patch Set 6 : really fixing build error #

Patch Set 7 : fixed nits and fixed blimp test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+372 lines, -251 lines) Patch
M blimp/engine/feature/engine_render_widget_feature_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/browser_plugin/browser_plugin_guest.cc View 1 chunk +1 line, -4 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 chunk +0 lines, -4 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M content/browser/renderer_host/ime_adapter_android.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/ime_adapter_android.cc View 1 4 chunks +30 lines, -14 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.h View 1 2 3 4 5 6 2 chunks +14 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 6 4 chunks +31 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 3 chunks +3 lines, -5 lines 0 comments Download
M content/common/input_messages.h View 1 3 chunks +9 lines, -5 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java View 2 chunks +12 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java View 1 2 4 chunks +18 lines, -2 lines 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java View 1 2 1 chunk +24 lines, -9 lines 0 comments Download
M content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java View 1 2 2 chunks +17 lines, -10 lines 0 comments Download
M content/public/browser/render_widget_host.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M content/public/test/text_input_test_utils.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 1 chunk +0 lines, -5 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 2 chunks +0 lines, -31 lines 0 comments Download
M content/renderer/render_view_browsertest.cc View 1 2 3 4 3 chunks +14 lines, -27 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 3 4 3 chunks +19 lines, -9 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 4 chunks +43 lines, -7 lines 0 comments Download
M content/renderer/render_widget_browsertest.cc View 1 2 3 4 2 chunks +32 lines, -0 lines 0 comments Download
M content/test/test_render_frame.h View 1 1 chunk +0 lines, -6 lines 0 comments Download
M content/test/test_render_frame.cc View 1 2 chunks +0 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.h View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 1 chunk +0 lines, -47 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 1 chunk +56 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebViewTest.cpp View 1 2 3 4 17 chunks +29 lines, -35 lines 0 comments Download
M third_party/WebKit/public/web/WebLocalFrame.h View 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/public/web/WebWidget.h View 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (34 generated)
Changwan Ryu
aelias@, I haven't fully tested against all the different OEM phones, but this works well ...
4 years, 3 months ago (2016-09-09 03:19:58 UTC) #17
aelias_OOO_until_Jul13
This looks reasonable. I believe there is no chance of a flicker because message loop ...
4 years, 3 months ago (2016-09-09 04:50:20 UTC) #26
Changwan Ryu
https://codereview.chromium.org/2323983003/diff/80001/content/browser/renderer_host/render_widget_host_impl.h File content/browser/renderer_host/render_widget_host_impl.h (right): https://codereview.chromium.org/2323983003/diff/80001/content/browser/renderer_host/render_widget_host_impl.h#newcode855 content/browser/renderer_host/render_widget_host_impl.h:855: bool in_batch_edit_mode_; On 2016/09/09 04:50:20, aelias wrote: > nit: ...
4 years, 3 months ago (2016-09-09 06:28:48 UTC) #33
Changwan Ryu
also adding yukawa@ for the changed get*() methods behavior
4 years, 3 months ago (2016-09-09 06:31:43 UTC) #36
yukawa
On 2016/09/09 06:31:43, Changwan Ryu wrote: > also adding yukawa@ for the changed get*() methods ...
4 years, 3 months ago (2016-09-12 19:45:54 UTC) #39
aelias_OOO_until_Jul13
On 2016/09/12 at 19:45:54, yukawa wrote: > > I'm concerned that changing the semantics here ...
4 years, 3 months ago (2016-09-12 22:44:27 UTC) #40
Changwan Ryu
4 years, 3 months ago (2016-09-13 00:09:18 UTC) #41
On 2016/09/12 22:44:27, aelias wrote:
> On 2016/09/12 at 19:45:54, yukawa wrote:
> > 
> > I'm concerned that changing the semantics here would cause some non-trivial
> > compatibility issues, because built-in EditText (to be precise
> > EditableInputConnection#get*() methods still return the results based on
> > states when those methods are called, not on states before entering batch
> > edit.
> 
> Yeah... the elegance of this queueing approach is attractive to me, but maybe
> it's not possible.  I was considering various options for get*-specific hacks
we
> could add to this, but the trouble is that the sum of those hacks amounts to
> just not having done the queueing in the first place.
> 
> I'm inclined to favor renderer-side approach
> https://codereview.chromium.org/2309983002/ the most now.  I've learned there
is
> an existing rendering-freeze state we can reuse,
> RenderWidgetCompositor::setDeferCommits(), which CC folks have told me should
be
> safe to reuse for this purpose.

Thanks for the reviews, yukawa@ and aelias@!
I'll try setDeferCommits and get back to you next week.

Powered by Google App Engine
This is Rietveld 408576698