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

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

Issue 1350043004: Cleanup: Initialize Value from tools/gn by moving std::string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove Value(..., std::string&&) Created 5 years, 2 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/clang/empty_string/tests/test-original.cc ('k') | tools/gn/value.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 #ifndef TOOLS_GN_VALUE_H_ 5 #ifndef TOOLS_GN_VALUE_H_
6 #define TOOLS_GN_VALUE_H_ 6 #define TOOLS_GN_VALUE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <map> 9 #include <map>
10 10
(...skipping 14 matching lines...) Expand all
25 INTEGER, 25 INTEGER,
26 STRING, 26 STRING,
27 LIST, 27 LIST,
28 SCOPE, 28 SCOPE,
29 }; 29 };
30 30
31 Value(); 31 Value();
32 Value(const ParseNode* origin, Type t); 32 Value(const ParseNode* origin, Type t);
33 Value(const ParseNode* origin, bool bool_val); 33 Value(const ParseNode* origin, bool bool_val);
34 Value(const ParseNode* origin, int64_t int_val); 34 Value(const ParseNode* origin, int64_t int_val);
35 Value(const ParseNode* origin, std::string str_val); 35 Value(const ParseNode* origin, const std::string& str_val);
brettw 2015/09/24 20:15:31 I think without adding the && constructor, this wi
ki.stfu 2015/09/24 20:54:29 Probably yes. BTW, why we don't want to use a mova
36 Value(const ParseNode* origin, const char* str_val); 36 Value(const ParseNode* origin, const char* str_val);
37 // Values "shouldn't" have null scopes when type == Scope, so be sure to 37 // Values "shouldn't" have null scopes when type == Scope, so be sure to
38 // always set one. However, this is not asserted since there are some 38 // always set one. However, this is not asserted since there are some
39 // use-cases for creating values and immediately setting the scope on it. So 39 // use-cases for creating values and immediately setting the scope on it. So
40 // you can pass a null scope here if you promise to set it before any other 40 // you can pass a null scope here if you promise to set it before any other
41 // code gets it (code will generally assume the scope is not null). 41 // code gets it (code will generally assume the scope is not null).
42 Value(const ParseNode* origin, scoped_ptr<Scope> scope); 42 Value(const ParseNode* origin, scoped_ptr<Scope> scope);
43 43
44 Value(const Value& other); 44 Value(const Value& other);
45 ~Value(); 45 ~Value();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 std::string string_value_; 123 std::string string_value_;
124 bool boolean_value_; 124 bool boolean_value_;
125 int64_t int_value_; 125 int64_t int_value_;
126 std::vector<Value> list_value_; 126 std::vector<Value> list_value_;
127 scoped_ptr<Scope> scope_value_; 127 scoped_ptr<Scope> scope_value_;
128 128
129 const ParseNode* origin_; 129 const ParseNode* origin_;
130 }; 130 };
131 131
132 #endif // TOOLS_GN_VALUE_H_ 132 #endif // TOOLS_GN_VALUE_H_
OLDNEW
« no previous file with comments | « tools/clang/empty_string/tests/test-original.cc ('k') | tools/gn/value.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698