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

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

Issue 67563002: cc: Plumbing for impl thread micro benchmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
OLDNEW
(Empty)
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.
4
5 #include "cc/debug/micro_benchmark_impl.h"
6
7 #include "base/bind.h"
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h"
11 #include "base/values.h"
12
13 namespace cc {
14
15 namespace {
16
17 void RunCallback(const MicroBenchmarkImpl::DoneCallback& callback,
enne (OOO) 2013/11/12 01:09:36 Do you expect other MicroBenchmarkImpl to do somet
vmpstr 2013/11/12 17:51:38 I'm not sure I understand what you mean... You mea
enne (OOO) 2013/11/12 19:22:56 Ah, fair enough.
18 scoped_ptr<base::Value> result) {
19 callback.Run(result.Pass());
20 }
21
22 }
23
24 MicroBenchmarkImpl::MicroBenchmarkImpl(
25 const DoneCallback& callback,
26 scoped_refptr<base::MessageLoopProxy> origin_loop)
enne (OOO) 2013/11/12 01:09:36 What about making MicroBenchmarkImpl provide a vir
vmpstr 2013/11/12 17:51:38 I do like the NotifyDone style thing, since it mak
27 : callback_(callback), is_done_(false), origin_loop_(origin_loop) {}
28
29 MicroBenchmarkImpl::~MicroBenchmarkImpl() {}
30
31 bool MicroBenchmarkImpl::IsDone() const {
32 return is_done_;
33 }
34
35 void MicroBenchmarkImpl::DidCompleteCommit(LayerTreeHostImpl* host) {}
36
37 void MicroBenchmarkImpl::NotifyDone(scoped_ptr<base::Value> result) {
38 origin_loop_->PostTask(
39 FROM_HERE,
40 base::Bind(RunCallback, callback_, base::Passed(&result)));
41 is_done_ = true;
42 }
43
44 void MicroBenchmarkImpl::RunOnLayer(LayerImpl* layer) {}
45
46 void MicroBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {}
47
48 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698