Skip to content

Commit

Permalink
[WebView] Remove |mHasPendingInvalidate| in PopupTouchHandleDrawable
Browse files Browse the repository at this point in the history
There is no need to use this flag, we can check |mInvalidationRunnable|
is null or not directly.

Bug: 836558
Change-Id: Ib82786489ff6963825f021a1f537e7b61a20ab30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2300997
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789069}
  • Loading branch information
Shimi Zhang authored and Commit Bot committed Jul 16, 2020
1 parent 0abb2e3 commit 80feabf
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public class PopupTouchHandleDrawable extends View implements DisplayAndroidObse
// Deferred runnable to avoid invalidating outside of frame dispatch,
// in turn avoiding issues with sync barrier insertion.
private Runnable mInvalidationRunnable;
private boolean mHasPendingInvalidate;

private boolean mNeedsUpdateDrawable;

Expand Down Expand Up @@ -459,15 +458,12 @@ private void doInvalidate() {
}

private void scheduleInvalidate() {
if (mInvalidationRunnable == null) {
mInvalidationRunnable = () -> {
mHasPendingInvalidate = false;
doInvalidate();
};
}
if (mInvalidationRunnable != null) return;

if (mHasPendingInvalidate) return;
mHasPendingInvalidate = true;
mInvalidationRunnable = () -> {
mInvalidationRunnable = null;
doInvalidate();
};
postOnAnimation(mInvalidationRunnable);
}

Expand Down

0 comments on commit 80feabf

Please sign in to comment.