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

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: 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') | no next file with comments »
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..421e0264512e8eacc32dea6b1fd78521d41d2a33 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,22 @@ 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 view
+ // (see native_tab_contents_container_viewws.cc) and GetInputMethod
+ // may return NULL;
+ InputMethod* input_method = GetInputMethod();
mmocny 2011/09/21 18:57:53 won't compile, change to: views::InputMethod* ...
+
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698