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
3 // found in the LICENSE file.
5 #include "cc/debug/micro_benchmark_impl.h"
8 #include "base/callback.h"
9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/single_thread_task_runner.h"
12 #include "base/values.h"
18 void RunCallback(const MicroBenchmarkImpl::DoneCallback
& callback
,
19 scoped_ptr
<base::Value
> result
) {
20 callback
.Run(result
.Pass());
25 MicroBenchmarkImpl::MicroBenchmarkImpl(
26 const DoneCallback
& callback
,
27 scoped_refptr
<base::SingleThreadTaskRunner
> origin_task_runner
)
28 : callback_(callback
),
30 origin_task_runner_(origin_task_runner
) {
33 MicroBenchmarkImpl::~MicroBenchmarkImpl() {}
35 bool MicroBenchmarkImpl::IsDone() const {
39 void MicroBenchmarkImpl::DidCompleteCommit(LayerTreeHostImpl
* host
) {}
41 void MicroBenchmarkImpl::NotifyDone(scoped_ptr
<base::Value
> result
) {
42 origin_task_runner_
->PostTask(
43 FROM_HERE
, base::Bind(RunCallback
, callback_
, base::Passed(&result
)));
47 void MicroBenchmarkImpl::RunOnLayer(LayerImpl
* layer
) {}
49 void MicroBenchmarkImpl::RunOnLayer(PictureLayerImpl
* layer
) {}