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

Unified 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: Fix comments. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: cc/debug/micro_benchmark_controller.h
diff --git a/cc/debug/micro_benchmark_controller.h b/cc/debug/micro_benchmark_controller.h
index 7220dc1778fa7b0cef4570699056b272fba0608d..88f6d9adad9bc278f1b710cc20b9db22c9f70eb1 100644
--- a/cc/debug/micro_benchmark_controller.h
+++ b/cc/debug/micro_benchmark_controller.h
@@ -28,17 +28,22 @@ class CC_EXPORT MicroBenchmarkController {
void DidUpdateLayers();
- bool ScheduleRun(const std::string& micro_benchmark_name,
- scoped_ptr<base::Value> value,
- const MicroBenchmark::DoneCallback& callback);
+ // Returns the id of the benchmark on success, 0 otherwise.
+ int ScheduleRun(const std::string& micro_benchmark_name,
+ scoped_ptr<base::Value> value,
+ const MicroBenchmark::DoneCallback& callback);
+ // Returns true if the message was successfully delivered and handled.
+ bool SendMessage(int id, scoped_ptr<base::Value> value);
void ScheduleImplBenchmarks(LayerTreeHostImpl* host_impl);
private:
void CleanUpFinishedBenchmarks();
+ int GetNextIdAndIncrement();
LayerTreeHost* host_;
ScopedPtrVector<MicroBenchmark> benchmarks_;
+ static int next_id_;
scoped_refptr<base::MessageLoopProxy> main_controller_message_loop_;
DISALLOW_COPY_AND_ASSIGN(MicroBenchmarkController);

Powered by Google App Engine
This is Rietveld 408576698