1 // Copyright 2013 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_BENCHMARKS_MICRO_BENCHMARK_IMPL_H_
6 #define CC_BENCHMARKS_MICRO_BENCHMARK_IMPL_H_
8 #include "base/functional/callback.h"
9 #include "base/memory/scoped_refptr.h"
10 #include "base/values.h"
11 #include "cc/cc_export.h"
14 class SingleThreadTaskRunner;
19 class LayerTreeHostImpl;
21 class PictureLayerImpl;
22 class CC_EXPORT MicroBenchmarkImpl {
24 using DoneCallback = base::OnceCallback<void(base::Value::Dict)>;
26 explicit MicroBenchmarkImpl(
27 DoneCallback callback,
28 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner);
29 virtual ~MicroBenchmarkImpl();
32 virtual void DidCompleteCommit(LayerTreeHostImpl* host);
34 virtual void RunOnLayer(LayerImpl* layer);
35 virtual void RunOnLayer(PictureLayerImpl* layer);
38 void NotifyDone(base::Value::Dict result);
41 DoneCallback callback_;
43 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_;
48 #endif // CC_BENCHMARKS_MICRO_BENCHMARK_IMPL_H_