Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index 2a38d89abd927b0b02e7fc59ef82f798688b6708..ff249d91dd3f80fdca8d785b2a8b3c0b2beb4b8f 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -93,6 +93,8 @@ LayerTreeImpl::LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl) |
} |
LayerTreeImpl::~LayerTreeImpl() { |
+ BreakSwapPromises(SwapPromise::SWAP_FAILS); |
+ |
// Need to explicitly clear the tree prior to destroying this so that |
// the LayerTreeImpl pointer is still valid in the LayerImpl dtor. |
DCHECK(!root_layer_); |
@@ -905,8 +907,6 @@ gfx::Vector2dF LayerTreeImpl::GetDelegatedScrollOffset(LayerImpl* layer) { |
void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { |
DCHECK(swap_promise); |
- if (swap_promise_list_.size() > kMaxQueuedSwapPromiseNumber) |
- BreakSwapPromises(SwapPromise::SWAP_PROMISE_LIST_OVERFLOW); |
swap_promise_list_.push_back(swap_promise.Pass()); |
} |