Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: cc/debug/micro_benchmark.h

Issue 67563002: cc: Plumbing for impl thread micro benchmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: create benchmarkimpl only once Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/debug/micro_benchmark.cc » ('j') | cc/debug/micro_benchmark.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698