OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_RENDERING_BENCHMARK_H_ | 5 #ifndef CONTENT_RENDERER_RENDERING_BENCHMARK_H_ |
6 #define CONTENT_RENDERER_RENDERING_BENCHMARK_H_ | 6 #define CONTENT_RENDERER_RENDERING_BENCHMARK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 namespace WebKit { | 12 namespace WebKit { |
13 class WebViewBenchmarkSupport; | 13 class WebViewBenchmarkSupport; |
14 } | 14 } |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class RenderingBenchmarkResults; | 17 class RenderingBenchmarkResults; |
18 | 18 |
19 class RenderingBenchmark { | 19 class RenderingBenchmark { |
20 public: | 20 public: |
21 explicit RenderingBenchmark(const std::string& name); | 21 explicit RenderingBenchmark(const std::string& name); |
22 virtual ~RenderingBenchmark(); | 22 virtual ~RenderingBenchmark(); |
23 | 23 |
24 virtual void SetUp(WebKit::WebViewBenchmarkSupport* benchmarkSupport) {} | 24 virtual void SetUp(WebKit::WebViewBenchmarkSupport* benchmarkSupport) {} |
25 | 25 |
26 virtual void Run(RenderingBenchmarkResults* results, | 26 virtual double Run(WebKit::WebViewBenchmarkSupport* benchmarkSupport) = 0; |
27 WebKit::WebViewBenchmarkSupport* benchmarkSupport) = 0; | |
28 | 27 |
29 virtual void TearDown(WebKit::WebViewBenchmarkSupport* benchmarkSupport) {} | 28 virtual void TearDown(WebKit::WebViewBenchmarkSupport* benchmarkSupport) {} |
30 | 29 |
31 const std::string& name() { return name_; } | 30 const std::string& name() { return name_; } |
32 | 31 |
33 private: | 32 private: |
34 const std::string name_; | 33 const std::string name_; |
35 | 34 |
36 DISALLOW_COPY_AND_ASSIGN(RenderingBenchmark); | 35 DISALLOW_COPY_AND_ASSIGN(RenderingBenchmark); |
37 }; | 36 }; |
38 } // namespace content | 37 } // namespace content |
39 | 38 |
40 #endif // CONTENT_RENDERER_RENDERING_BENCHMARK_H_ | 39 #endif // CONTENT_RENDERER_RENDERING_BENCHMARK_H_ |
OLD | NEW |