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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2245053002: Fix UB with LayerTreeImpl::PassSwapPromises usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 8e0493a8c1af61f5f87ab840f4ae5be1a468df18..63d11cae272a991925f485a9201f618a5d3f36d7 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -511,7 +511,11 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
if (sync_tree->IsActiveTree())
sync_tree->elastic_overscroll()->PushPendingToActive();
- sync_tree->PassSwapPromises(std::move(swap_promise_list_));
brianderson 2016/08/15 17:05:55 Thanks for catching this! It would be more straig
svartmetal 2016/08/15 19:04:33 Fixed. It's OK to use std::vector::clear since it
+ {
+ std::vector<std::unique_ptr<SwapPromise>> to_pass;
+ swap_promise_list_.swap(to_pass);
+ sync_tree->PassSwapPromises(std::move(to_pass));
+ }
sync_tree->set_top_controls_shrink_blink_size(
top_controls_shrink_blink_size_);
« no previous file with comments | « no previous file | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698