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

Unified Diff: cc/layers/layer.cc

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 4796f73472f4f00d218318ca4d9b64978aa78aa0..96c34daa493b3e11f635e61f726731b4612a0cac 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -413,9 +413,10 @@ void Layer::RequestCopyOfOutput(
DCHECK(IsPropertyChangeAllowed());
bool had_no_copy_requests = copy_requests_.empty();
if (void* source = request->source()) {
- auto it = std::find_if(
- copy_requests_.begin(), copy_requests_.end(),
- [source](const CopyOutputRequest* x) { return x->source() == source; });
+ auto it = std::find_if(copy_requests_.begin(), copy_requests_.end(),
+ [source](const scoped_ptr<CopyOutputRequest>& x) {
+ return x->source() == source;
+ });
if (it != copy_requests_.end())
copy_requests_.erase(it);
}
@@ -1296,13 +1297,11 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
// Wrap the copy_requests_ in a PostTask to the main thread.
bool had_copy_requests = !copy_requests_.empty();
- ScopedPtrVector<CopyOutputRequest> main_thread_copy_requests;
- for (ScopedPtrVector<CopyOutputRequest>::iterator it = copy_requests_.begin();
- it != copy_requests_.end();
- ++it) {
+ std::vector<scoped_ptr<CopyOutputRequest>> main_thread_copy_requests;
+ for (auto it = copy_requests_.begin(); it != copy_requests_.end(); ++it) {
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner =
layer_tree_host()->task_runner_provider()->MainThreadTaskRunner();
- scoped_ptr<CopyOutputRequest> original_request = copy_requests_.take(it);
+ scoped_ptr<CopyOutputRequest> original_request = std::move(*it);
const CopyOutputRequest& original_request_ref = *original_request;
scoped_ptr<CopyOutputRequest> main_thread_request =
CopyOutputRequest::CreateRelayRequest(
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698