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

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

Issue 300963004: cc: Add message passing mechanism to micro benchmarking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months 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_CONTROLLER_H_ 5 #ifndef CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_H_
6 #define CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_H_ 6 #define CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 10 matching lines...) Expand all
21 21
22 class LayerTreeHost; 22 class LayerTreeHost;
23 class LayerTreeHostImpl; 23 class LayerTreeHostImpl;
24 class CC_EXPORT MicroBenchmarkController { 24 class CC_EXPORT MicroBenchmarkController {
25 public: 25 public:
26 explicit MicroBenchmarkController(LayerTreeHost* host); 26 explicit MicroBenchmarkController(LayerTreeHost* host);
27 ~MicroBenchmarkController(); 27 ~MicroBenchmarkController();
28 28
29 void DidUpdateLayers(); 29 void DidUpdateLayers();
30 30
31 bool ScheduleRun(const std::string& micro_benchmark_name, 31 int ScheduleRun(const std::string& micro_benchmark_name,
vmpstr 2014/05/28 21:16:25 Make a comment about the return value, please.
ernstm 2014/05/28 21:51:55 Done.
32 scoped_ptr<base::Value> value, 32 scoped_ptr<base::Value> value,
33 const MicroBenchmark::DoneCallback& callback); 33 const MicroBenchmark::DoneCallback& callback);
34
35 bool SendMessage(int id, scoped_ptr<base::Value> value);
34 36
35 void ScheduleImplBenchmarks(LayerTreeHostImpl* host_impl); 37 void ScheduleImplBenchmarks(LayerTreeHostImpl* host_impl);
36 38
37 private: 39 private:
38 void CleanUpFinishedBenchmarks(); 40 void CleanUpFinishedBenchmarks();
41 int GetNextIdAndIncrement();
39 42
40 LayerTreeHost* host_; 43 LayerTreeHost* host_;
41 ScopedPtrVector<MicroBenchmark> benchmarks_; 44 ScopedPtrVector<MicroBenchmark> benchmarks_;
45 int next_id_;
vmpstr 2014/05/28 21:16:25 I think we only have one controller, but maybe mak
ernstm 2014/05/28 21:51:55 Done.
42 scoped_refptr<base::MessageLoopProxy> main_controller_message_loop_; 46 scoped_refptr<base::MessageLoopProxy> main_controller_message_loop_;
43 47
44 DISALLOW_COPY_AND_ASSIGN(MicroBenchmarkController); 48 DISALLOW_COPY_AND_ASSIGN(MicroBenchmarkController);
45 }; 49 };
46 50
47 } // namespace cc 51 } // namespace cc
48 52
49 #endif // CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_H_ 53 #endif // CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698