Commit 586af386 authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

Do not call IsActiveTree() in LayerTreeImpl destructor

IsActiveTree() indirectly calls active_tree_.get() in LayerTreeHostImpl.
Since std::unique_ptr::reset() nulls out its ptr before deleting the
owned object, IsActiveTree() will always be false, and the swap promises
will always be broken with ACTIVATION_FAILS. This causes
LayerTreeHostTestSwapPromiseDuringCommit to fail when the wait for main
frame or commit condition is removed from LayerTreeTest::EndTest().

R=danakj
BUG=703263

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I3819f76ab8f576c80faccf8db3ecd7ddb9b5954d
Reviewed-on: https://chromium-review.googlesource.com/1145920Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577696}
parent b9d9251e
......@@ -104,9 +104,6 @@ LayerTreeImpl::LayerTreeImpl(
}
LayerTreeImpl::~LayerTreeImpl() {
BreakSwapPromises(IsActiveTree() ? SwapPromise::SWAP_FAILS
: SwapPromise::ACTIVATION_FAILS);
// Need to explicitly clear the tree prior to destroying this so that
// the LayerTreeImpl pointer is still valid in the LayerImpl dtor.
DCHECK(LayerListIsEmpty());
......@@ -115,6 +112,8 @@ LayerTreeImpl::~LayerTreeImpl() {
void LayerTreeImpl::Shutdown() {
DetachLayers();
BreakSwapPromises(IsActiveTree() ? SwapPromise::SWAP_FAILS
: SwapPromise::ACTIVATION_FAILS);
DCHECK(LayerListIsEmpty());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment