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 #ifndef CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ | 5 #ifndef CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ |
6 #define CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ | 6 #define CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
14 class Value; | 15 class Value; |
15 } // namespace base | 16 } // namespace base |
16 | 17 |
17 namespace cc { | 18 namespace cc { |
18 | 19 |
19 class LayerTreeHostImpl; | 20 class LayerTreeHostImpl; |
20 class LayerImpl; | 21 class LayerImpl; |
21 class PictureLayerImpl; | 22 class PictureLayerImpl; |
22 class CC_EXPORT MicroBenchmarkImpl { | 23 class CC_EXPORT MicroBenchmarkImpl { |
23 public: | 24 public: |
24 typedef base::Callback<void(scoped_ptr<base::Value>)> DoneCallback; | 25 typedef base::Callback<void(std::unique_ptr<base::Value>)> DoneCallback; |
25 | 26 |
26 explicit MicroBenchmarkImpl( | 27 explicit MicroBenchmarkImpl( |
27 const DoneCallback& callback, | 28 const DoneCallback& callback, |
28 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner); | 29 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner); |
29 virtual ~MicroBenchmarkImpl(); | 30 virtual ~MicroBenchmarkImpl(); |
30 | 31 |
31 bool IsDone() const; | 32 bool IsDone() const; |
32 virtual void DidCompleteCommit(LayerTreeHostImpl* host); | 33 virtual void DidCompleteCommit(LayerTreeHostImpl* host); |
33 | 34 |
34 virtual void RunOnLayer(LayerImpl* layer); | 35 virtual void RunOnLayer(LayerImpl* layer); |
35 virtual void RunOnLayer(PictureLayerImpl* layer); | 36 virtual void RunOnLayer(PictureLayerImpl* layer); |
36 | 37 |
37 protected: | 38 protected: |
38 void NotifyDone(scoped_ptr<base::Value> result); | 39 void NotifyDone(std::unique_ptr<base::Value> result); |
39 | 40 |
40 private: | 41 private: |
41 DoneCallback callback_; | 42 DoneCallback callback_; |
42 bool is_done_; | 43 bool is_done_; |
43 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; | 44 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; |
44 }; | 45 }; |
45 | 46 |
46 } // namespace cc | 47 } // namespace cc |
47 | 48 |
48 #endif // CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ | 49 #endif // CC_DEBUG_MICRO_BENCHMARK_IMPL_H_ |
OLD | NEW |