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

Side by Side Diff: cc/base/region.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/base/region.h ('k') | cc/blink/scrollbar_impl.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/region.h" 5 #include "cc/base/region.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/trace_event/trace_event_argument.h" 9 #include "base/trace_event/trace_event_argument.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 std::string result; 114 std::string result;
115 for (Iterator it(*this); it.has_rect(); it.next()) { 115 for (Iterator it(*this); it.has_rect(); it.next()) {
116 if (!result.empty()) 116 if (!result.empty())
117 result += " | "; 117 result += " | ";
118 result += it.rect().ToString(); 118 result += it.rect().ToString();
119 } 119 }
120 return result; 120 return result;
121 } 121 }
122 122
123 scoped_ptr<base::Value> Region::AsValue() const { 123 std::unique_ptr<base::Value> Region::AsValue() const {
124 scoped_ptr<base::ListValue> result(new base::ListValue()); 124 std::unique_ptr<base::ListValue> result(new base::ListValue());
125 for (Iterator it(*this); it.has_rect(); it.next()) { 125 for (Iterator it(*this); it.has_rect(); it.next()) {
126 gfx::Rect rect(it.rect()); 126 gfx::Rect rect(it.rect());
127 result->AppendInteger(rect.x()); 127 result->AppendInteger(rect.x());
128 result->AppendInteger(rect.y()); 128 result->AppendInteger(rect.y());
129 result->AppendInteger(rect.width()); 129 result->AppendInteger(rect.width());
130 result->AppendInteger(rect.height()); 130 result->AppendInteger(rect.height());
131 } 131 }
132 return std::move(result); 132 return std::move(result);
133 } 133 }
134 134
(...skipping 11 matching lines...) Expand all
146 } 146 }
147 147
148 Region::Iterator::Iterator(const Region& region) 148 Region::Iterator::Iterator(const Region& region)
149 : it_(region.skregion_) { 149 : it_(region.skregion_) {
150 } 150 }
151 151
152 Region::Iterator::~Iterator() { 152 Region::Iterator::~Iterator() {
153 } 153 }
154 154
155 } // namespace cc 155 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/region.h ('k') | cc/blink/scrollbar_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698