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

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

Issue 1544333002: Convert Pass()→std::move() in //tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/functions_unittest.cc ('k') | tools/gn/input_file_manager.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/input_conversion.h" 5 #include "tools/gn/input_conversion.h"
6 6
7 #include <utility>
8
7 #include "base/macros.h" 9 #include "base/macros.h"
8 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
9 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
10 #include "tools/gn/build_settings.h" 12 #include "tools/gn/build_settings.h"
11 #include "tools/gn/err.h" 13 #include "tools/gn/err.h"
12 #include "tools/gn/input_file.h" 14 #include "tools/gn/input_file.h"
13 #include "tools/gn/label.h" 15 #include "tools/gn/label.h"
14 #include "tools/gn/parse_tree.h" 16 #include "tools/gn/parse_tree.h"
15 #include "tools/gn/parser.h" 17 #include "tools/gn/parser.h"
16 #include "tools/gn/scheduler.h" 18 #include "tools/gn/scheduler.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 76
75 scoped_ptr<Scope> scope(new Scope(settings)); 77 scoped_ptr<Scope> scope(new Scope(settings));
76 Value result = parse_root->Execute(scope.get(), err); 78 Value result = parse_root->Execute(scope.get(), err);
77 if (err->has_error()) 79 if (err->has_error())
78 return Value(); 80 return Value();
79 81
80 // When we want the result as a scope, the result is actually the scope 82 // When we want the result as a scope, the result is actually the scope
81 // we made, rather than the result of running the block (which will be empty). 83 // we made, rather than the result of running the block (which will be empty).
82 if (what == PARSE_SCOPE) { 84 if (what == PARSE_SCOPE) {
83 DCHECK(result.type() == Value::NONE); 85 DCHECK(result.type() == Value::NONE);
84 result = Value(origin, scope.Pass()); 86 result = Value(origin, std::move(scope));
85 } 87 }
86 return result; 88 return result;
87 } 89 }
88 90
89 Value ParseList(const std::string& input, const ParseNode* origin, Err* err) { 91 Value ParseList(const std::string& input, const ParseNode* origin, Err* err) {
90 Value ret(origin, Value::LIST); 92 Value ret(origin, Value::LIST);
91 std::vector<std::string> as_lines = base::SplitString( 93 std::vector<std::string> as_lines = base::SplitString(
92 input, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 94 input, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
93 95
94 // Trim one empty line from the end since the last line might end in a 96 // Trim one empty line from the end since the last line might end in a
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 const ParseNode* origin, 204 const ParseNode* origin,
203 const Value& input_conversion_value, 205 const Value& input_conversion_value,
204 Err* err) { 206 Err* err) {
205 if (input_conversion_value.type() == Value::NONE) 207 if (input_conversion_value.type() == Value::NONE)
206 return Value(); // Allow null inputs to mean discard the result. 208 return Value(); // Allow null inputs to mean discard the result.
207 if (!input_conversion_value.VerifyTypeIs(Value::STRING, err)) 209 if (!input_conversion_value.VerifyTypeIs(Value::STRING, err))
208 return Value(); 210 return Value();
209 return DoConvertInputToValue(settings, input, origin, input_conversion_value, 211 return DoConvertInputToValue(settings, input, origin, input_conversion_value,
210 input_conversion_value.string_value(), err); 212 input_conversion_value.string_value(), err);
211 } 213 }
OLDNEW
« no previous file with comments | « tools/gn/functions_unittest.cc ('k') | tools/gn/input_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698