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

Unified Diff: tools/gn/substitution_type.h

Issue 2627703002: Validate GN substitutions in args and rsp files. (Closed)
Patch Set: Format Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/ninja_action_target_writer.cc ('k') | tools/gn/substitution_type.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/substitution_type.h
diff --git a/tools/gn/substitution_type.h b/tools/gn/substitution_type.h
index 74ab507a56e4b937b986e6dcf9a58acff2d3e0b2..df7f8b7abcf00954ec0c97c63365fcf01e605a93 100644
--- a/tools/gn/substitution_type.h
+++ b/tools/gn/substitution_type.h
@@ -118,6 +118,8 @@ bool SubstitutionIsInBundleDir(SubstitutionType type);
// Returns true if the given substitution is valid for the named purpose.
bool IsValidBundleDataSubstitution(SubstitutionType type);
bool IsValidSourceSubstitution(SubstitutionType type);
+bool IsValidScriptArgsSubstitution(SubstitutionType type);
+
// Both compiler and linker tools.
bool IsValidToolSubstitution(SubstitutionType type);
bool IsValidCompilerSubstitution(SubstitutionType type);
@@ -128,10 +130,12 @@ bool IsValidALinkSubstitution(SubstitutionType type);
bool IsValidCopySubstitution(SubstitutionType type);
bool IsValidCompileXCassetsSubstitution(SubstitutionType type);
-// Like the "IsValid..." version above but checks a list of types and sets a
-// an error blaming the given source if the test fails.
-bool EnsureValidSourcesSubstitutions(
+// Validates that each substitution type in the vector passes the given
+// is_valid_subst predicate. Returns true on success. On failure, fills in the
+// error object with an appropriate message and returns false.
+bool EnsureValidSubstitutions(
const std::vector<SubstitutionType>& types,
+ bool (*is_valid_subst)(SubstitutionType),
const ParseNode* origin,
Err* err);
« no previous file with comments | « tools/gn/ninja_action_target_writer.cc ('k') | tools/gn/substitution_type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698