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

Unified Diff: cc/debug/micro_benchmark_controller_impl.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/debug/micro_benchmark_controller_impl.h ('k') | cc/layers/delegated_frame_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/micro_benchmark_controller_impl.cc
diff --git a/cc/debug/micro_benchmark_controller_impl.cc b/cc/debug/micro_benchmark_controller_impl.cc
index 821ba5f8d4493c6cacc7d5483937a5bc60e4475e..31ff2c02b5941bdb091ef9925090f968cc82f08b 100644
--- a/cc/debug/micro_benchmark_controller_impl.cc
+++ b/cc/debug/micro_benchmark_controller_impl.cc
@@ -12,20 +12,6 @@
namespace cc {
-namespace {
-
-class IsDonePredicate {
- public:
- typedef const MicroBenchmarkImpl* argument_type;
- typedef bool result_type;
-
- result_type operator()(argument_type benchmark) const {
- return benchmark->IsDone();
- }
-};
-
-} // namespace
-
MicroBenchmarkControllerImpl::MicroBenchmarkControllerImpl(
LayerTreeHostImpl* host)
: host_(host) {
@@ -40,11 +26,9 @@ void MicroBenchmarkControllerImpl::ScheduleRun(
}
void MicroBenchmarkControllerImpl::DidCompleteCommit() {
- for (ScopedPtrVector<MicroBenchmarkImpl>::iterator it = benchmarks_.begin();
- it != benchmarks_.end();
- ++it) {
- DCHECK(!(*it)->IsDone());
- (*it)->DidCompleteCommit(host_);
+ for (const auto& benchmark : benchmarks_) {
+ DCHECK(!benchmark->IsDone());
+ benchmark->DidCompleteCommit(host_);
}
CleanUpFinishedBenchmarks();
@@ -52,7 +36,10 @@ void MicroBenchmarkControllerImpl::DidCompleteCommit() {
void MicroBenchmarkControllerImpl::CleanUpFinishedBenchmarks() {
benchmarks_.erase(
- benchmarks_.partition(std::not1(IsDonePredicate())),
+ std::remove_if(benchmarks_.begin(), benchmarks_.end(),
+ [](const scoped_ptr<MicroBenchmarkImpl>& benchmark) {
+ return benchmark->IsDone();
+ }),
benchmarks_.end());
}
« no previous file with comments | « cc/debug/micro_benchmark_controller_impl.h ('k') | cc/layers/delegated_frame_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698