WebView: Fetch resource package ID on main thread.
WebViewDelegate.getPackageId sometimes throws an exception complaining that it's unable to find the WebView package in the resource table. This looks like it might be some kind of obscure race caused by doing it on a background thread at the same time as WebView initialisation (which in some cases can also be manipulating the resource table). The goal of the background thread is to parallelize work for a startup time benefit, but the call to getPackageId is actually very fast (the expensive part is calling R.onResourcesLoaded). So, just do the package ID lookup on the main thread first and pass the ID in to the background task, in the hope that this avoids this hypothetical race. Bug: 995400 Change-Id: Id4479cdda54ee7b1aec273a491fa0f0f64ed348c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854466Reviewed-by:Changwan Ryu <changwan@chromium.org> Commit-Queue: Richard Coles <torne@chromium.org> Cr-Commit-Position: refs/heads/master@{#705102}
Showing
Please register or sign in to comment