Skip to content

Commit

Permalink
Update DisplayLock lifecycle registration for top layer
Browse files Browse the repository at this point in the history
WillStartLifecycleUpdate is only called when the DisplayLockContext is
subscribed to lifecycle updates, and the DisplayLockContext should only
be subscribed to lifecycle updates when NeedsLifecycleNotifications is
true. The DCHECK at the start of WillStartLifecycleUpdate enforces this.

has_pending_top_layer_check_ affects NeedsLifecycleNotifications, which
means that we need to unsubscribe from lifecycle notifications when it
becomes false. This patch adds a line of code to unsubscribe from
notifications when it is set to false.

Running slot-content-visibility-18-crash.html with --iterations=500 was
failing without this patch.

Fixed: 1367977
Change-Id: Ib5aa044d32e87f7dc7f4f8c9ed7cf08e979298ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3923916
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1052500}
  • Loading branch information
josepharhar authored and Chromium LUCI CQ committed Sep 28, 2022
1 parent 584badf commit 181de62
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ void DisplayLockContext::WillStartLifecycleUpdate(const LocalFrameView& view) {
if (has_pending_subtree_checks_ || has_pending_top_layer_check_) {
DetermineIfSubtreeHasTopLayerElement();
has_pending_top_layer_check_ = false;
update_registration = true;
}

if (has_pending_subtree_checks_) {
Expand Down

0 comments on commit 181de62

Please sign in to comment.