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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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/micro_benchmark_impl.h ('k') | cc/debug/picture_debug_util.cc » ('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_impl.h" 5 #include "cc/debug/micro_benchmark_impl.h"
6 6
7 #include <memory>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/location.h" 11 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
12 #include "base/values.h" 13 #include "base/values.h"
13 14
14 namespace cc { 15 namespace cc {
15 16
16 namespace { 17 namespace {
17 18
18 void RunCallback(const MicroBenchmarkImpl::DoneCallback& callback, 19 void RunCallback(const MicroBenchmarkImpl::DoneCallback& callback,
19 scoped_ptr<base::Value> result) { 20 std::unique_ptr<base::Value> result) {
20 callback.Run(std::move(result)); 21 callback.Run(std::move(result));
21 } 22 }
22 23
23 } 24 }
24 25
25 MicroBenchmarkImpl::MicroBenchmarkImpl( 26 MicroBenchmarkImpl::MicroBenchmarkImpl(
26 const DoneCallback& callback, 27 const DoneCallback& callback,
27 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner) 28 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner)
28 : callback_(callback), 29 : callback_(callback),
29 is_done_(false), 30 is_done_(false),
30 origin_task_runner_(origin_task_runner) { 31 origin_task_runner_(origin_task_runner) {
31 } 32 }
32 33
33 MicroBenchmarkImpl::~MicroBenchmarkImpl() {} 34 MicroBenchmarkImpl::~MicroBenchmarkImpl() {}
34 35
35 bool MicroBenchmarkImpl::IsDone() const { 36 bool MicroBenchmarkImpl::IsDone() const {
36 return is_done_; 37 return is_done_;
37 } 38 }
38 39
39 void MicroBenchmarkImpl::DidCompleteCommit(LayerTreeHostImpl* host) {} 40 void MicroBenchmarkImpl::DidCompleteCommit(LayerTreeHostImpl* host) {}
40 41
41 void MicroBenchmarkImpl::NotifyDone(scoped_ptr<base::Value> result) { 42 void MicroBenchmarkImpl::NotifyDone(std::unique_ptr<base::Value> result) {
42 origin_task_runner_->PostTask( 43 origin_task_runner_->PostTask(
43 FROM_HERE, base::Bind(RunCallback, callback_, base::Passed(&result))); 44 FROM_HERE, base::Bind(RunCallback, callback_, base::Passed(&result)));
44 is_done_ = true; 45 is_done_ = true;
45 } 46 }
46 47
47 void MicroBenchmarkImpl::RunOnLayer(LayerImpl* layer) {} 48 void MicroBenchmarkImpl::RunOnLayer(LayerImpl* layer) {}
48 49
49 void MicroBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {} 50 void MicroBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {}
50 51
51 } // namespace cc 52 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/micro_benchmark_impl.h ('k') | cc/debug/picture_debug_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698