| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/debug/unittest_only_benchmark.h" | 5 #include "cc/debug/unittest_only_benchmark.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 return; | 26 return; |
| 27 | 27 |
| 28 if (settings->HasKey("run_benchmark_impl")) | 28 if (settings->HasKey("run_benchmark_impl")) |
| 29 settings->GetBoolean("run_benchmark_impl", &create_impl_benchmark_); | 29 settings->GetBoolean("run_benchmark_impl", &create_impl_benchmark_); |
| 30 } | 30 } |
| 31 | 31 |
| 32 UnittestOnlyBenchmark::~UnittestOnlyBenchmark() { | 32 UnittestOnlyBenchmark::~UnittestOnlyBenchmark() { |
| 33 weak_ptr_factory_.InvalidateWeakPtrs(); | 33 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void UnittestOnlyBenchmark::DidUpdateLayers(LayerTree* layer_tree) { | 36 void UnittestOnlyBenchmark::DidUpdateLayers(LayerTreeHost* layer_tree_host) { |
| 37 NotifyDone(nullptr); | 37 NotifyDone(nullptr); |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool UnittestOnlyBenchmark::ProcessMessage(std::unique_ptr<base::Value> value) { | 40 bool UnittestOnlyBenchmark::ProcessMessage(std::unique_ptr<base::Value> value) { |
| 41 base::DictionaryValue* message = nullptr; | 41 base::DictionaryValue* message = nullptr; |
| 42 value->GetAsDictionary(&message); | 42 value->GetAsDictionary(&message); |
| 43 bool can_handle; | 43 bool can_handle; |
| 44 if (message->HasKey("can_handle")) { | 44 if (message->HasKey("can_handle")) { |
| 45 message->GetBoolean("can_handle", &can_handle); | 45 message->GetBoolean("can_handle", &can_handle); |
| 46 if (can_handle) | 46 if (can_handle) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 59 if (!create_impl_benchmark_) | 59 if (!create_impl_benchmark_) |
| 60 return base::WrapUnique<MicroBenchmarkImpl>(nullptr); | 60 return base::WrapUnique<MicroBenchmarkImpl>(nullptr); |
| 61 | 61 |
| 62 return base::WrapUnique(new UnittestOnlyBenchmarkImpl( | 62 return base::WrapUnique(new UnittestOnlyBenchmarkImpl( |
| 63 origin_task_runner, nullptr, | 63 origin_task_runner, nullptr, |
| 64 base::Bind(&UnittestOnlyBenchmark::RecordImplResults, | 64 base::Bind(&UnittestOnlyBenchmark::RecordImplResults, |
| 65 weak_ptr_factory_.GetWeakPtr()))); | 65 weak_ptr_factory_.GetWeakPtr()))); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace cc | 68 } // namespace cc |
| OLD | NEW |