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

Issue 801923003: Don't schedule more invokeFunctors than necessary. (Closed)

Created:
6 years ago by hush (inactive)
Modified:
6 years ago
Reviewers:
boliu
CC:
chromium-reviews, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 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_ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -11 lines) Patch
M android_webview/browser/shared_renderer_state.cc View 1 2 6 chunks +23 lines, -11 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
hush (inactive)
PTAL
6 years ago (2014-12-13 00:49:54 UTC) #2
boliu
https://codereview.chromium.org/801923003/diff/1/android_webview/browser/shared_renderer_state.cc File android_webview/browser/shared_renderer_state.cc (right): https://codereview.chromium.org/801923003/diff/1/android_webview/browser/shared_renderer_state.cc#newcode274 android_webview/browser/shared_renderer_state.cc:274: if (draw_info->mode == AwDrawGLInfo::kModeProcess || nit: put it after ...
6 years ago (2014-12-13 01:03:15 UTC) #3
hush (inactive)
https://codereview.chromium.org/801923003/diff/1/android_webview/browser/shared_renderer_state.cc File android_webview/browser/shared_renderer_state.cc (right): https://codereview.chromium.org/801923003/diff/1/android_webview/browser/shared_renderer_state.cc#newcode274 android_webview/browser/shared_renderer_state.cc:274: if (draw_info->mode == AwDrawGLInfo::kModeProcess || On 2014/12/13 01:03:15, boliu ...
6 years ago (2014-12-13 01:17:24 UTC) #4
boliu
lgtm, need a crbug to merge, etc..
6 years ago (2014-12-13 02:02:23 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/801923003/60001
6 years ago (2014-12-13 02:08:46 UTC) #8
commit-bot: I haz the power
Committed patchset #3 (id:60001)
6 years ago (2014-12-13 03:42:39 UTC) #9
commit-bot: I haz the power
6 years ago (2014-12-13 03:43:25 UTC) #10
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/81c62e2d9601d38c44f71857dfabc31e2726cd70
Cr-Commit-Position: refs/heads/master@{#308241}

Powered by Google App Engine
This is Rietveld 408576698