diff options
author | vmpstr <vmpstr@chromium.org> | 2015-11-18 02:41:28 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-18 10:42:27 +0000 |
commit | a370ef52788ea0f6c410b05ec40a74ee9bf3a647 (patch) | |
tree | 3a17b8c71c12f28b9aab3c6d82b30afda9b7a060 /cc/debug/micro_benchmark_controller_impl.cc | |
parent | 93a4c577dd608bc72ac31ea396201590a23b46c5 (diff) | |
download | chromium_src-a370ef52788ea0f6c410b05ec40a74ee9bf3a647.zip chromium_src-a370ef52788ea0f6c410b05ec40a74ee9bf3a647.tar.gz chromium_src-a370ef52788ea0f6c410b05ec40a74ee9bf3a647.tar.bz2 |
cc: Remove ScopedPtrVector and cc::remove_if.
This patch removes ScopedPtrVector and cc::remove_if. It depends on
https://codereview.chromium.org/1441613002 for TakeBack.
R=danakj
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1437413002
Cr-Commit-Position: refs/heads/master@{#360318}
Diffstat (limited to 'cc/debug/micro_benchmark_controller_impl.cc')
-rw-r--r-- | cc/debug/micro_benchmark_controller_impl.cc | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/cc/debug/micro_benchmark_controller_impl.cc b/cc/debug/micro_benchmark_controller_impl.cc index 821ba5f..31ff2c0 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()); } |