DescriptionDon'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
Committed: https://crrev.com/81c62e2d9601d38c44f71857dfabc31e2726cd70
Cr-Commit-Position: refs/heads/master@{#308241}
Patch Set 1 #
Total comments: 4
Patch Set 2 : comments #Patch Set 3 : Just use pending_on_ui_ #Messages
Total messages: 10 (3 generated)
|