- add sources.
[platform/framework/web/crosswalk.git] / src / cc / debug / micro_benchmark.h
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.
4
5 #ifndef CC_DEBUG_MICRO_BENCHMARK_H_
6 #define CC_DEBUG_MICRO_BENCHMARK_H_
7
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace base {
12 class Value;
13 }  // namespace base
14
15 namespace cc {
16
17 class LayerTreeHost;
18 class Layer;
19 class PictureLayer;
20 class MicroBenchmark {
21  public:
22   typedef base::Callback<void(scoped_ptr<base::Value>)> DoneCallback;
23
24   explicit MicroBenchmark(const DoneCallback& callback);
25   virtual ~MicroBenchmark();
26
27   bool IsDone() const;
28   virtual void DidUpdateLayers(LayerTreeHost* host);
29
30   virtual void RunOnLayer(Layer* layer);
31   virtual void RunOnLayer(PictureLayer* layer);
32
33  protected:
34   void NotifyDone(scoped_ptr<base::Value> result);
35
36  private:
37   DoneCallback callback_;
38   bool is_done_;
39 };
40
41 }  // namespace cc
42
43 #endif  // CC_DEBUG_MICRO_BENCHMARK_H_