| 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/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "cc/debug/unittest_only_benchmark_impl.h" | 10 #include "cc/debug/unittest_only_benchmark_impl.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 if (settings->HasKey("run_benchmark_impl")) | 27 if (settings->HasKey("run_benchmark_impl")) |
| 28 settings->GetBoolean("run_benchmark_impl", &create_impl_benchmark_); | 28 settings->GetBoolean("run_benchmark_impl", &create_impl_benchmark_); |
| 29 } | 29 } |
| 30 | 30 |
| 31 UnittestOnlyBenchmark::~UnittestOnlyBenchmark() { | 31 UnittestOnlyBenchmark::~UnittestOnlyBenchmark() { |
| 32 weak_ptr_factory_.InvalidateWeakPtrs(); | 32 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void UnittestOnlyBenchmark::DidUpdateLayers(LayerTreeHost* host) { | 35 void UnittestOnlyBenchmark::DidUpdateLayers(LayerTreeHost* host) { |
| 36 NotifyDone(scoped_ptr<base::Value>()); | 36 NotifyDone(nullptr); |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool UnittestOnlyBenchmark::ProcessMessage(scoped_ptr<base::Value> value) { | 39 bool UnittestOnlyBenchmark::ProcessMessage(scoped_ptr<base::Value> value) { |
| 40 base::DictionaryValue* message = nullptr; | 40 base::DictionaryValue* message = nullptr; |
| 41 value->GetAsDictionary(&message); | 41 value->GetAsDictionary(&message); |
| 42 bool can_handle; | 42 bool can_handle; |
| 43 if (message->HasKey("can_handle")) { | 43 if (message->HasKey("can_handle")) { |
| 44 message->GetBoolean("can_handle", &can_handle); | 44 message->GetBoolean("can_handle", &can_handle); |
| 45 if (can_handle) | 45 if (can_handle) |
| 46 return true; | 46 return true; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 return make_scoped_ptr<MicroBenchmarkImpl>(nullptr); | 58 return make_scoped_ptr<MicroBenchmarkImpl>(nullptr); |
| 59 | 59 |
| 60 return make_scoped_ptr(new UnittestOnlyBenchmarkImpl( | 60 return make_scoped_ptr(new UnittestOnlyBenchmarkImpl( |
| 61 origin_loop, | 61 origin_loop, |
| 62 nullptr, | 62 nullptr, |
| 63 base::Bind(&UnittestOnlyBenchmark::RecordImplResults, | 63 base::Bind(&UnittestOnlyBenchmark::RecordImplResults, |
| 64 weak_ptr_factory_.GetWeakPtr()))); | 64 weak_ptr_factory_.GetWeakPtr()))); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace cc | 67 } // namespace cc |
| OLD | NEW |