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

Unified Diff: tools/gn/template.h

Issue 2148093002: GN: Use the correct defaults for templates invoked via target(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: tools/gn/template.h
diff --git a/tools/gn/template.h b/tools/gn/template.h
index a79d82f368ba3414a6b36c1f8b02a1f46612f02d..da5a1a458e8b8b84273740d933f59c617c7ab568 100644
--- a/tools/gn/template.h
+++ b/tools/gn/template.h
@@ -33,9 +33,12 @@ class Template : public base::RefCountedThreadSafe<Template> {
Template(std::unique_ptr<Scope> closure, const FunctionCallNode* def);
// Invoke the template. The values correspond to the state of the code
- // invoking the template.
+ // invoking the template. The template name needs to be supplied since the
+ // template object itself doesn't know what name the calling code is using
+ // to refer to it (this is used to set defaults).
Value Invoke(Scope* scope,
const FunctionCallNode* invocation,
+ const std::string& template_name,
const std::vector<Value>& args,
BlockNode* block,
Err* err) const;

Powered by Google App Engine
This is Rietveld 408576698