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

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

Issue 2216203002: Refactor MutatorHostClient from LayerTreeHost to LayerTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on another LTH refactor CL. Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « cc/debug/unittest_only_benchmark.h ('k') | cc/layers/layer.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/unittest_only_benchmark.h" 5 #include "cc/debug/unittest_only_benchmark.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 15 matching lines...) Expand all
26 return; 26 return;
27 27
28 if (settings->HasKey("run_benchmark_impl")) 28 if (settings->HasKey("run_benchmark_impl"))
29 settings->GetBoolean("run_benchmark_impl", &create_impl_benchmark_); 29 settings->GetBoolean("run_benchmark_impl", &create_impl_benchmark_);
30 } 30 }
31 31
32 UnittestOnlyBenchmark::~UnittestOnlyBenchmark() { 32 UnittestOnlyBenchmark::~UnittestOnlyBenchmark() {
33 weak_ptr_factory_.InvalidateWeakPtrs(); 33 weak_ptr_factory_.InvalidateWeakPtrs();
34 } 34 }
35 35
36 void UnittestOnlyBenchmark::DidUpdateLayers(LayerTreeHost* host) { 36 void UnittestOnlyBenchmark::DidUpdateLayers(LayerTree* layer_tree) {
37 NotifyDone(nullptr); 37 NotifyDone(nullptr);
38 } 38 }
39 39
40 bool UnittestOnlyBenchmark::ProcessMessage(std::unique_ptr<base::Value> value) { 40 bool UnittestOnlyBenchmark::ProcessMessage(std::unique_ptr<base::Value> value) {
41 base::DictionaryValue* message = nullptr; 41 base::DictionaryValue* message = nullptr;
42 value->GetAsDictionary(&message); 42 value->GetAsDictionary(&message);
43 bool can_handle; 43 bool can_handle;
44 if (message->HasKey("can_handle")) { 44 if (message->HasKey("can_handle")) {
45 message->GetBoolean("can_handle", &can_handle); 45 message->GetBoolean("can_handle", &can_handle);
46 if (can_handle) 46 if (can_handle)
(...skipping 12 matching lines...) Expand all
59 if (!create_impl_benchmark_) 59 if (!create_impl_benchmark_)
60 return base::WrapUnique<MicroBenchmarkImpl>(nullptr); 60 return base::WrapUnique<MicroBenchmarkImpl>(nullptr);
61 61
62 return base::WrapUnique(new UnittestOnlyBenchmarkImpl( 62 return base::WrapUnique(new UnittestOnlyBenchmarkImpl(
63 origin_task_runner, nullptr, 63 origin_task_runner, nullptr,
64 base::Bind(&UnittestOnlyBenchmark::RecordImplResults, 64 base::Bind(&UnittestOnlyBenchmark::RecordImplResults,
65 weak_ptr_factory_.GetWeakPtr()))); 65 weak_ptr_factory_.GetWeakPtr())));
66 } 66 }
67 67
68 } // namespace cc 68 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/unittest_only_benchmark.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698