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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2536943004: Fix a crash occuring during the destruction of TextInputManager on Android. (Closed)
Patch Set: Fixed a typo. 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
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 981dc1e25c1d669152ca2d4b6cb1ba79b43a038b..70e60c498cc393e92437b5e5b3a2fa0585a0380a 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -767,8 +767,12 @@ void RenderWidgetHostViewAndroid::OnUpdateTextInputStateCalled(
RenderWidgetHostViewBase* updated_view,
bool did_change_state) {
DCHECK_EQ(text_input_manager_, text_input_manager);
+ // If there are no active widgets, the TextInputState.type should be reported
+ // as none.
const TextInputState& state =
- *GetTextInputManager()->GetTextInputState(updated_view);
+ GetTextInputManager()->GetActiveWidget()
+ ? *GetTextInputManager()->GetTextInputState()
+ : TextInputState();
if (state.is_non_ime_change && updated_view->GetRenderWidgetHost()) {
// Sends an acknowledgement to the renderer of a processed IME event.
updated_view->GetRenderWidgetHost()->Send(

Powered by Google App Engine
This is Rietveld 408576698