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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2188093002: cc: Complete swap promise for aborted commit after pending activation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: post rebase fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/proxy_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index ff5da70a7e7ec633092d56de8cc7282b1316b21e..975e82e4d4edfdeaddd244af4c8bb1fb63dd7afd 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <algorithm>
+#include <iterator>
#include <limits>
#include <set>
@@ -424,7 +425,7 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
next_activation_forces_redraw_ = false;
}
- target_tree->PassSwapPromises(&swap_promise_list_);
+ target_tree->PassSwapPromises(std::move(swap_promise_list_));
target_tree->set_top_controls_shrink_blink_size(
top_controls_shrink_blink_size_);
@@ -1483,11 +1484,18 @@ void LayerTreeImpl::QueuePinnedSwapPromise(
}
void LayerTreeImpl::PassSwapPromises(
- std::vector<std::unique_ptr<SwapPromise>>* new_swap_promise) {
+ std::vector<std::unique_ptr<SwapPromise>> new_swap_promises) {
for (const auto& swap_promise : swap_promise_list_)
swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS);
swap_promise_list_.clear();
- swap_promise_list_.swap(*new_swap_promise);
+ swap_promise_list_.swap(new_swap_promises);
+}
+
+void LayerTreeImpl::AppendSwapPromises(
+ std::vector<std::unique_ptr<SwapPromise>> new_swap_promises) {
+ std::move(new_swap_promises.begin(), new_swap_promises.end(),
+ std::back_inserter(swap_promise_list_));
+ new_swap_promises.clear();
}
void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) {
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698