| 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());
|
| }
|
|
|
|
|