| 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_H_ | 5 #ifndef CC_DEBUG_MICRO_BENCHMARK_H_ | 
| 6 #define CC_DEBUG_MICRO_BENCHMARK_H_ | 6 #define CC_DEBUG_MICRO_BENCHMARK_H_ | 
| 7 | 7 | 
| 8 #include "base/callback.h" | 8 #include "base/callback.h" | 
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" | 
| 10 | 10 | 
| 11 namespace base { | 11 namespace base { | 
| 12 class Value; | 12 class Value; | 
|  | 13 class MessageLoopProxy; | 
| 13 }  // namespace base | 14 }  // namespace base | 
| 14 | 15 | 
| 15 namespace cc { | 16 namespace cc { | 
| 16 | 17 | 
| 17 class LayerTreeHost; | 18 class LayerTreeHost; | 
| 18 class Layer; | 19 class Layer; | 
| 19 class PictureLayer; | 20 class PictureLayer; | 
|  | 21 class MicroBenchmarkImpl; | 
| 20 class MicroBenchmark { | 22 class MicroBenchmark { | 
| 21  public: | 23  public: | 
| 22   typedef base::Callback<void(scoped_ptr<base::Value>)> DoneCallback; | 24   typedef base::Callback<void(scoped_ptr<base::Value>)> DoneCallback; | 
| 23 | 25 | 
| 24   explicit MicroBenchmark(const DoneCallback& callback); | 26   explicit MicroBenchmark(const DoneCallback& callback); | 
| 25   virtual ~MicroBenchmark(); | 27   virtual ~MicroBenchmark(); | 
| 26 | 28 | 
| 27   bool IsDone() const; | 29   bool IsDone() const; | 
| 28   virtual void DidUpdateLayers(LayerTreeHost* host); | 30   virtual void DidUpdateLayers(LayerTreeHost* host); | 
| 29 | 31 | 
| 30   virtual void RunOnLayer(Layer* layer); | 32   virtual void RunOnLayer(Layer* layer); | 
| 31   virtual void RunOnLayer(PictureLayer* layer); | 33   virtual void RunOnLayer(PictureLayer* layer); | 
| 32 | 34 | 
|  | 35   bool ProcessedForBenchmarkImpl() const; | 
|  | 36   scoped_ptr<MicroBenchmarkImpl> GetBenchmarkImpl( | 
|  | 37       scoped_refptr<base::MessageLoopProxy> origin_loop); | 
|  | 38 | 
| 33  protected: | 39  protected: | 
| 34   void NotifyDone(scoped_ptr<base::Value> result); | 40   void NotifyDone(scoped_ptr<base::Value> result); | 
| 35 | 41 | 
|  | 42   virtual scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( | 
|  | 43       scoped_refptr<base::MessageLoopProxy> origin_loop); | 
|  | 44 | 
| 36  private: | 45  private: | 
| 37   DoneCallback callback_; | 46   DoneCallback callback_; | 
| 38   bool is_done_; | 47   bool is_done_; | 
|  | 48   bool processed_for_benchmark_impl_; | 
| 39 }; | 49 }; | 
| 40 | 50 | 
| 41 }  // namespace cc | 51 }  // namespace cc | 
| 42 | 52 | 
| 43 #endif  // CC_DEBUG_MICRO_BENCHMARK_H_ | 53 #endif  // CC_DEBUG_MICRO_BENCHMARK_H_ | 
| OLD | NEW | 
|---|