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

Unified Diff: content/renderer/render_widget.cc

Issue 2522353002: Remove the CHECK in RenderWidget::GetInputMethodController (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 2d27a73bd52c0b5f31f1ef5b3fdbee254a315783..1cf201845233b06f3c088ecb6dbb320a7c63d1a3 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -2305,9 +2305,15 @@ blink::WebWidget* RenderWidget::GetWebWidget() const {
blink::WebInputMethodController* RenderWidget::GetInputMethodController()
const {
- // TODO(ekaramad): Remove this CHECK when GetWebWidget() is
- // always a WebFrameWidget.
- CHECK(GetWebWidget()->isWebFrameWidget());
+ // TODO(ekaramad): Remove this condition when GetWebWidget() is always a
+ // WebFrameWidget, or find a better way to obtain the WebFrameWidget for
+ // this RenderWidget.
+ if (!GetWebWidget()->isWebFrameWidget()) {
+ // It is possible to get here if this is a top-level RenderWidget and an IME
+ // IPC is received during page navigation, in which case GetWebWidget()
+ // yields a WebViewImpl instead of a WebFrameWiget.
+ return nullptr;
EhsanK 2016/11/24 01:21:39 I should also note that this method can return nul
+ }
return static_cast<blink::WebFrameWidget*>(GetWebWidget())
->getActiveWebInputMethodController();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698