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

Side by Side Diff: tools/gn/value.cc

Issue 2187523003: Allow creation and modification of scopes in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments 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 | « tools/gn/value.h ('k') | tools/gn/visibility_unittest.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "tools/gn/value.h" 5 #include "tools/gn/value.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 : type_(other.type_), 66 : type_(other.type_),
67 string_value_(other.string_value_), 67 string_value_(other.string_value_),
68 boolean_value_(other.boolean_value_), 68 boolean_value_(other.boolean_value_),
69 int_value_(other.int_value_), 69 int_value_(other.int_value_),
70 list_value_(other.list_value_), 70 list_value_(other.list_value_),
71 origin_(other.origin_) { 71 origin_(other.origin_) {
72 if (type() == SCOPE && other.scope_value_.get()) 72 if (type() == SCOPE && other.scope_value_.get())
73 scope_value_ = other.scope_value_->MakeClosure(); 73 scope_value_ = other.scope_value_->MakeClosure();
74 } 74 }
75 75
76 Value::Value(Value&& other) = default;
77
76 Value::~Value() { 78 Value::~Value() {
77 } 79 }
78 80
79 Value& Value::operator=(const Value& other) { 81 Value& Value::operator=(const Value& other) {
80 type_ = other.type_; 82 type_ = other.type_;
81 string_value_ = other.string_value_; 83 string_value_ = other.string_value_;
82 boolean_value_ = other.boolean_value_; 84 boolean_value_ = other.boolean_value_;
83 int_value_ = other.int_value_; 85 int_value_ = other.int_value_;
84 list_value_ = other.list_value_; 86 list_value_ = other.list_value_;
85 if (type() == SCOPE && other.scope_value_.get()) 87 if (type() == SCOPE && other.scope_value_.get())
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // iteration code. 214 // iteration code.
213 return false; 215 return false;
214 default: 216 default:
215 return false; 217 return false;
216 } 218 }
217 } 219 }
218 220
219 bool Value::operator!=(const Value& other) const { 221 bool Value::operator!=(const Value& other) const {
220 return !operator==(other); 222 return !operator==(other);
221 } 223 }
OLDNEW
« no previous file with comments | « tools/gn/value.h ('k') | tools/gn/visibility_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698