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/input_conversion.cc

Issue 229423002: Improve public header file checking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include static cast for 64 bit Created 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/header_checker_unittest.cc ('k') | tools/gn/input_file_manager.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) 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 "base/strings/string_split.h" 7 #include "base/strings/string_split.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "tools/gn/build_settings.h" 9 #include "tools/gn/build_settings.h"
10 #include "tools/gn/err.h" 10 #include "tools/gn/err.h"
(...skipping 19 matching lines...) Expand all
30 const std::string& input, 30 const std::string& input,
31 ValueOrScope what, 31 ValueOrScope what,
32 const ParseNode* origin, 32 const ParseNode* origin,
33 Err* err) { 33 Err* err) {
34 // The memory for these will be kept around by the input file manager 34 // The memory for these will be kept around by the input file manager
35 // so the origin parse nodes for the values will be preserved. 35 // so the origin parse nodes for the values will be preserved.
36 InputFile* input_file; 36 InputFile* input_file;
37 std::vector<Token>* tokens; 37 std::vector<Token>* tokens;
38 scoped_ptr<ParseNode>* parse_root_ptr; 38 scoped_ptr<ParseNode>* parse_root_ptr;
39 g_scheduler->input_file_manager()->AddDynamicInput( 39 g_scheduler->input_file_manager()->AddDynamicInput(
40 &input_file, &tokens, &parse_root_ptr); 40 SourceFile(), &input_file, &tokens, &parse_root_ptr);
41 41
42 input_file->SetContents(input); 42 input_file->SetContents(input);
43 if (origin) { 43 if (origin) {
44 // This description will be the blame for any error messages caused by 44 // This description will be the blame for any error messages caused by
45 // script parsing or if a value is blamed. It will say 45 // script parsing or if a value is blamed. It will say
46 // "Error at <...>:line:char" so here we try to make a string for <...> 46 // "Error at <...>:line:char" so here we try to make a string for <...>
47 // that reads well in this context. 47 // that reads well in this context.
48 input_file->set_friendly_name( 48 input_file->set_friendly_name(
49 "dynamically parsed input that " + 49 "dynamically parsed input that " +
50 origin->GetRange().begin().Describe(true) + 50 origin->GetRange().begin().Describe(true) +
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 const ParseNode* origin, 208 const ParseNode* origin,
209 const Value& input_conversion_value, 209 const Value& input_conversion_value,
210 Err* err) { 210 Err* err) {
211 if (input_conversion_value.type() == Value::NONE) 211 if (input_conversion_value.type() == Value::NONE)
212 return Value(); // Allow null inputs to mean discard the result. 212 return Value(); // Allow null inputs to mean discard the result.
213 if (!input_conversion_value.VerifyTypeIs(Value::STRING, err)) 213 if (!input_conversion_value.VerifyTypeIs(Value::STRING, err))
214 return Value(); 214 return Value();
215 return DoConvertInputToValue(settings, input, origin, input_conversion_value, 215 return DoConvertInputToValue(settings, input, origin, input_conversion_value,
216 input_conversion_value.string_value(), err); 216 input_conversion_value.string_value(), err);
217 } 217 }
OLDNEW
« no previous file with comments | « tools/gn/header_checker_unittest.cc ('k') | tools/gn/input_file_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698