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

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

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
« no previous file with comments | « cc/debug/micro_benchmark.h ('k') | cc/debug/micro_benchmark_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "cc/debug/micro_benchmark.h" 5 #include "cc/debug/micro_benchmark.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/values.h" 11 #include "base/values.h"
12 #include "cc/debug/micro_benchmark_impl.h"
10 13
11 namespace cc { 14 namespace cc {
12 15
13 MicroBenchmark::MicroBenchmark(const DoneCallback& callback) 16 MicroBenchmark::MicroBenchmark(const DoneCallback& callback)
14 : callback_(callback), is_done_(false) {} 17 : callback_(callback),
18 is_done_(false),
19 processed_for_benchmark_impl_(false) {}
15 20
16 MicroBenchmark::~MicroBenchmark() {} 21 MicroBenchmark::~MicroBenchmark() {}
17 22
18 bool MicroBenchmark::IsDone() const { 23 bool MicroBenchmark::IsDone() const {
19 return is_done_; 24 return is_done_;
20 } 25 }
21 26
22 void MicroBenchmark::DidUpdateLayers(LayerTreeHost* host) {} 27 void MicroBenchmark::DidUpdateLayers(LayerTreeHost* host) {}
23 28
24 void MicroBenchmark::NotifyDone(scoped_ptr<base::Value> result) { 29 void MicroBenchmark::NotifyDone(scoped_ptr<base::Value> result) {
25 callback_.Run(result.Pass()); 30 callback_.Run(result.Pass());
26 is_done_ = true; 31 is_done_ = true;
27 } 32 }
28 33
29 void MicroBenchmark::RunOnLayer(Layer* layer) {} 34 void MicroBenchmark::RunOnLayer(Layer* layer) {}
30 35
31 void MicroBenchmark::RunOnLayer(PictureLayer* layer) {} 36 void MicroBenchmark::RunOnLayer(PictureLayer* layer) {}
32 37
38 bool MicroBenchmark::ProcessedForBenchmarkImpl() const {
39 return processed_for_benchmark_impl_;
40 }
41
42 scoped_ptr<MicroBenchmarkImpl> MicroBenchmark::GetBenchmarkImpl(
43 scoped_refptr<base::MessageLoopProxy> origin_loop) {
44 DCHECK(!processed_for_benchmark_impl_);
45 processed_for_benchmark_impl_ = true;
enne (OOO) 2013/11/12 20:27:54 Ok, sure.
46 return CreateBenchmarkImpl(origin_loop);
47 }
48
49 scoped_ptr<MicroBenchmarkImpl> MicroBenchmark::CreateBenchmarkImpl(
50 scoped_refptr<base::MessageLoopProxy> origin_loop) {
51 return make_scoped_ptr<MicroBenchmarkImpl>(NULL);
52 }
53
33 } // namespace cc 54 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/micro_benchmark.h ('k') | cc/debug/micro_benchmark_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698