Commit 685eb79f authored by ekaramad's avatar ekaramad Committed by Commit bot

Remove an incorrect DCHECK.

The method RenderWidget::GetInputMethodController() can return nullptr in
the following cases:
1- RenderWidget is swapped out.
2- There is no focused frame in the local root which accepts IME.
  2.1 There are no focused local frames.
  2.2 The focused local frame does not belong to the same local root as RenderWidget.
  2.3 The focused local frame cannot accept IME since WebWidget is not focused (e.g., switched tabs).

Therefore, to handle set composition IPC we should not assume controller can
never be nullptr. A valid repro case:
1- Create an OOPIF in a page.
2- Add input in OOPIF.
3- Write javascript code which would randomly take focus away from OOPIF.
4- Activate some IME and start typing.

Eventually, DCHECK fires because the IPC to set composition arrived after
the widget lost the focused frame.

BUG=578168

Review-Url: https://codereview.chromium.org/2558303003
Cr-Commit-Position: refs/heads/master@{#437904}
parent 8f70cde4
...@@ -1518,7 +1518,6 @@ void RenderWidget::OnImeSetComposition( ...@@ -1518,7 +1518,6 @@ void RenderWidget::OnImeSetComposition(
return; return;
ImeEventGuard guard(this); ImeEventGuard guard(this);
blink::WebInputMethodController* controller = GetInputMethodController(); blink::WebInputMethodController* controller = GetInputMethodController();
DCHECK(controller);
if (!controller || if (!controller ||
!controller->setComposition( !controller->setComposition(
text, WebVector<WebCompositionUnderline>(underlines), selection_start, text, WebVector<WebCompositionUnderline>(underlines), selection_start,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment