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

Issue 2200613003: Cache proxy view return value to avoid deadlock (Closed)

Created:
4 years, 4 months ago by Changwan Ryu
Modified:
4 years, 4 months ago
Reviewers:
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@2785
Target Ref:
refs/pending/branch-heads/2785
Project:
chromium
Visibility:
Public.

Description

Cache proxy view return value to avoid deadlock If WebView has an active IME but the Android app calls InputMethodManager#hideSoftInputFromWindow() on a non-UI thread, then a deadlock may happen. One example case is when JavaScript triggers it through JavascriptInterface (therefore, on JavaBridge thread.) The deadlock scenario is as follows: 1) InputMethodManager#hideSoftFromWindow() calls ThreadedInputConnectionProxyView#getWindowToken() on JavaBridge thread while holding InputMethodManager#mH. Then getWindowToken() waits for UI thread to become available. 2) At almost same time, InputMethodManager#restartInput() was waiting for InputMethodManager#mH on UI thread This deadlock can be avoided by caching return values as atomic objects. Alternative approach I've tried: check the current thread and block it only when it's IME thread - this may still leave room for deadlock between IME thread and UI thread. BUG=630937 Review-Url: https://codereview.chromium.org/2175263002 Cr-Commit-Position: refs/heads/master@{#408925} (cherry picked from commit 43ceb11f9abf67fea18e8a731a9ef61f5cfe22fc) Committed: https://chromium.googlesource.com/chromium/src/+/28ceae2df36aa9368b2a04179ce23a03d44ea328

Patch Set 1 #

Messages

Total messages: 2 (1 generated)
Changwan Ryu
4 years, 4 months ago (2016-08-01 08:32:33 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
28ceae2df36aa9368b2a04179ce23a03d44ea328.

Powered by Google App Engine
This is Rietveld 408576698