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

Issue 2755723002: Fixed an IME bug due to a race in TextInputStateChanged

Created:
3 years, 9 months ago by EhsanK
Modified:
3 years, 9 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, shuchen+watch_chromium.org, jam, nona+watch_chromium.org, darin-cc_chromium.org, James Su
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixed an IME bug due to a race in TextInputStateChanged BrowserPlugin-based guests are hidden from the frame tree and embedder RenderWidgetHostViews. Any IME update, including TextInputState goes to embedder's RWHV with the embedder RWHV not knowing it is actually from a separate process. This is prone to bugs and race conditions. For example, leaving an <input> inside embedder to get into another one inside <guest> might lead to ui::TEXT_INPUT_TYPE_TEXT reported by the guest process overwritten by a ui::TEXT_INPUT_TYPE_NONE from the embedder process. This CL will stop RenderWidgetHostImpl fixes this race on the browser side by avoiding sending the update up from RenderWidgetHostImpl to RenderWidgetHostViewBase when there is a focused guest with a focused <input> on the page. BUG=697045

Patch Set 1 #

Patch Set 2 : Make sure TextInputManager exists (for interstitial pages) #

Patch Set 3 : Using BrowserPlugingEmbedder for determinning focused guests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -0 lines) Patch
M content/browser/browser_plugin/browser_plugin_embedder.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/browser_plugin/browser_plugin_embedder.cc View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_delegate.h View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_delegate.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 2 chunks +18 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (15 generated)
EhsanK
Hello Charlie, Could you please review this, or if busy forward to someone who could? ...
3 years, 9 months ago (2017-03-15 20:36:43 UTC) #7
Charlie Reis
On 2017/03/15 20:36:43, EhsanK wrote: > Hello Charlie, > > Could you please review this, ...
3 years, 9 months ago (2017-03-15 23:48:36 UTC) #11
EhsanK
Thanks Charlie! I will be working on a test, perhaps a <webview> IME test which ...
3 years, 9 months ago (2017-03-16 14:50:32 UTC) #13
Changwan Ryu
I'm not too familiar with TextInputManager and desktop code flows, so these might be completely ...
3 years, 9 months ago (2017-03-16 16:51:48 UTC) #14
EhsanK
3 years, 9 months ago (2017-03-24 14:40:00 UTC) #20
On 2017/03/16 16:51:48, Changwan Ryu wrote:
> I'm not too familiar with TextInputManager and desktop code flows, so these
> might be completely out of context, but could you check if the following case
> can happen?
> 
> There are multiple BrowserPluginGuests. One gets the focus first
> but the other gets initialized as blurred. For example, 
> BrowserPluginGuest::Init() called with params.focused=false. Then
> set_focused_guest(false) will be called. Is it possible for BrowserPluginGuest
> to create another unfocused BrowserPluginGuest when focused?

Thanks! This is quite valid. Actually, it does not need be during attach but
simply having nested BrowserPlugins complicates things this way. For instance if
a PDF embedded inside <webview> loses focus we would reset this flag.

I actually ended up using BrowserPluginEmbedder class to search for any focused
guest (BrowserPlugin-based). I am now struggling with finding a proper test
case.

Powered by Google App Engine
This is Rietveld 408576698