Fix deadlock during WebView initialization.
We cannot hold onto a lock that could potentially block the UI thread, while calling into any getter in WebViewChromiumAwInit related to chromium initialization. This is because those getters 1. hold a lock, 2. post a chromium-initialization task to the UI thread, and then 3. wait for the task to finish after releasing the lock in 1 So if thread X holds another lock, and calls a WebViewChromiumAwInit getter, a deadlock occurs if the UI thread tries to hold onto that other lock before running the chromium-initialization task. We fix this issue by providing a getLock() method on WebViewChromiumAwInit for WebViewChromiumFactoryProvider to re-use the existing lock to guard its member variables (instead of using another lock). Bug: 812203 Change-Id: I2e8d69f2667bce1e4312cc821fc804d44b6deaba Reviewed-on: https://chromium-review.googlesource.com/922823 Commit-Queue: Gustav Sennton <gsennton@chromium.org> Reviewed-by:Bo <boliu@chromium.org> Cr-Commit-Position: refs/heads/master@{#537298}
Showing
Please register or sign in to comment