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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_views.cc

Issue 7976028: Fix infinite loop in GetInputMethod. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 9 years, 3 months 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 | views/widget/widget.cc » ('j') | views/widget/widget.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host_view_views.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc
index 920d81c7c3fdce550075a331c609ca49e79952cf..af4e092fe23c8d239eb2a488c5f85cbd64011bdc 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_views.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc
@@ -271,14 +271,21 @@ void RenderWidgetHostViewViews::ImeUpdateTextInputState(
// as true. We need to support "can_compose_inline=false" for PPAPI plugins
// that may want to avoid drawing composition-text by themselves and pass
// the responsibility to the browser.
- DCHECK(GetInputMethod());
+
+ // This is async message and by the time the ipc arrived,
+ // RWHVV may be detached from Top level widget, in which case
+ // GetInputMethod may return NULL;
+ views::InputMethod* input_method = GetInputMethod();
+
if (text_input_type_ != type) {
text_input_type_ = type;
- GetInputMethod()->OnTextInputTypeChanged(this);
+ if (input_method)
+ input_method->OnTextInputTypeChanged(this);
}
if (caret_bounds_ != caret_rect) {
caret_bounds_ = caret_rect;
- GetInputMethod()->OnCaretBoundsChanged(this);
+ if (input_method)
+ input_method->OnCaretBoundsChanged(this);
}
}
« no previous file with comments | « no previous file | views/widget/widget.cc » ('j') | views/widget/widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698