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

Side by Side Diff: cc/test/fake_painted_scrollbar_layer.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/test/fake_painted_scrollbar_layer.h ('k') | cc/test/fake_picture_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/test/fake_painted_scrollbar_layer.h" 5 #include "cc/test/fake_painted_scrollbar_layer.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/memory/ptr_util.h"
8 #include "cc/test/fake_scrollbar.h" 9 #include "cc/test/fake_scrollbar.h"
9 10
10 namespace cc { 11 namespace cc {
11 12
12 scoped_refptr<FakePaintedScrollbarLayer> FakePaintedScrollbarLayer::Create( 13 scoped_refptr<FakePaintedScrollbarLayer> FakePaintedScrollbarLayer::Create(
13 bool paint_during_update, 14 bool paint_during_update,
14 bool has_thumb, 15 bool has_thumb,
15 int scrolling_layer_id) { 16 int scrolling_layer_id) {
16 FakeScrollbar* fake_scrollbar = new FakeScrollbar( 17 FakeScrollbar* fake_scrollbar = new FakeScrollbar(
17 paint_during_update, has_thumb, false); 18 paint_during_update, has_thumb, false);
18 return make_scoped_refptr( 19 return make_scoped_refptr(
19 new FakePaintedScrollbarLayer(fake_scrollbar, scrolling_layer_id)); 20 new FakePaintedScrollbarLayer(fake_scrollbar, scrolling_layer_id));
20 } 21 }
21 22
22 FakePaintedScrollbarLayer::FakePaintedScrollbarLayer( 23 FakePaintedScrollbarLayer::FakePaintedScrollbarLayer(
23 FakeScrollbar* fake_scrollbar, 24 FakeScrollbar* fake_scrollbar,
24 int scrolling_layer_id) 25 int scrolling_layer_id)
25 : PaintedScrollbarLayer(scoped_ptr<Scrollbar>(fake_scrollbar), 26 : PaintedScrollbarLayer(std::unique_ptr<Scrollbar>(fake_scrollbar),
26 scrolling_layer_id), 27 scrolling_layer_id),
27 update_count_(0), 28 update_count_(0),
28 push_properties_count_(0), 29 push_properties_count_(0),
29 fake_scrollbar_(fake_scrollbar) { 30 fake_scrollbar_(fake_scrollbar) {
30 SetBounds(gfx::Size(1, 1)); 31 SetBounds(gfx::Size(1, 1));
31 SetIsDrawable(true); 32 SetIsDrawable(true);
32 } 33 }
33 34
34 FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {} 35 FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {}
35 36
36 bool FakePaintedScrollbarLayer::Update() { 37 bool FakePaintedScrollbarLayer::Update() {
37 bool updated = PaintedScrollbarLayer::Update(); 38 bool updated = PaintedScrollbarLayer::Update();
38 ++update_count_; 39 ++update_count_;
39 return updated; 40 return updated;
40 } 41 }
41 42
42 void FakePaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { 43 void FakePaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) {
43 PaintedScrollbarLayer::PushPropertiesTo(layer); 44 PaintedScrollbarLayer::PushPropertiesTo(layer);
44 ++push_properties_count_; 45 ++push_properties_count_;
45 } 46 }
46 47
47 scoped_ptr<base::AutoReset<bool>> 48 std::unique_ptr<base::AutoReset<bool>>
48 FakePaintedScrollbarLayer::IgnoreSetNeedsCommit() { 49 FakePaintedScrollbarLayer::IgnoreSetNeedsCommit() {
49 return make_scoped_ptr( 50 return base::WrapUnique(
50 new base::AutoReset<bool>(&ignore_set_needs_commit_, true)); 51 new base::AutoReset<bool>(&ignore_set_needs_commit_, true));
51 } 52 }
52 53
53 } // namespace cc 54 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_painted_scrollbar_layer.h ('k') | cc/test/fake_picture_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698