Don't schedule more invokeFunctors than necessary.
The problematic sequence of events is as follows: 1. ShouldRequestOnNonUiThread, which posts a closure (request_draw_gl_closure_) to UI thread 2. That closure gets run on UI thread, and it schedules the invokeFunctor with Android framework 3. Before the corresponding invokeFunctor actually happens on RT (which is DrawGL process mode), ShouldRequestOnUiTdread is called on the UI thread. At this point, pending_non_ui_ is not null, we cancel the callback, which does nothing, because WebView has already scheduled an invokeFunctor with the Android framework in Step 2. Then we schedule another invokeFunctor immediately on the UI thread. So there are 2 invokeFunctors queued in Android framework in this case. This CL tries keep track of whether or not we've queued an invokeFunctor in Android framework already. BUG=442013 Review URL: https://codereview.chromium.org/801923003 Cr-Commit-Position: refs/heads/master@{#308241}
Showing
Please register or sign in to comment