Fix missing .Pass() on returning scoped_ptr<SdchManager::DictionarySet>
[chromium-blink-merge.git] / cc / debug / rasterize_and_record_benchmark.h
blob8a23292bc73b04aeaf29c54ee89be655bb99df39
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
3 // found in the LICENSE file.
5 #ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_
6 #define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_
8 #include <map>
9 #include <utility>
10 #include <vector>
12 #include "base/memory/weak_ptr.h"
13 #include "base/time/time.h"
14 #include "cc/debug/micro_benchmark_controller.h"
15 #include "cc/resources/picture.h"
17 namespace base {
18 class DictionaryValue;
21 namespace cc {
23 class LayerTreeHost;
24 class Layer;
25 class RasterizeAndRecordBenchmark : public MicroBenchmark {
26 public:
27 explicit RasterizeAndRecordBenchmark(
28 scoped_ptr<base::Value> value,
29 const MicroBenchmark::DoneCallback& callback);
30 ~RasterizeAndRecordBenchmark() override;
32 // Implements MicroBenchmark interface.
33 void DidUpdateLayers(LayerTreeHost* host) override;
34 void RunOnLayer(PictureLayer* layer) override;
36 scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl(
37 scoped_refptr<base::MessageLoopProxy> origin_loop) override;
39 private:
40 void Run(Layer* layer);
42 void RecordRasterResults(scoped_ptr<base::Value> results);
44 struct RecordResults {
45 RecordResults();
46 ~RecordResults();
48 int pixels_recorded;
49 size_t bytes_used;
50 base::TimeDelta total_best_time[Picture::RECORDING_MODE_COUNT];
53 RecordResults record_results_;
54 int record_repeat_count_;
55 scoped_ptr<base::Value> settings_;
56 scoped_ptr<base::DictionaryValue> results_;
58 // The following is used in DCHECKs.
59 bool main_thread_benchmark_done_;
61 LayerTreeHost* host_;
63 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_;
66 } // namespace cc
68 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_