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

Unified Diff: tools/gn/scope.cc

Issue 1632573002: Support for excluding variable from forwarding via forward_variables_form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_shell
Patch Set: Fix error message about incorrect argument count 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 side-by-side diff with in-line comments
Download patch
« tools/gn/function_forward_variables_from.cc ('K') | « tools/gn/scope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/scope.cc
diff --git a/tools/gn/scope.cc b/tools/gn/scope.cc
index 2bf9dd467da7903b5ff4a874915d5f1481429fea..ee2b1fe4d2bda1e3dedc5fda63f1e9d630d7e2c4 100644
--- a/tools/gn/scope.cc
+++ b/tools/gn/scope.cc
@@ -25,6 +25,13 @@ bool IsPrivateVar(const base::StringPiece& name) {
} // namespace
+// Defaults to all false, which are the things least likely to cause errors.
+Scope::MergeOptions::MergeOptions()
+ : clobber_existing(false),
+ skip_private_vars(false),
+ mark_dest_used(false) {}
brettw 2016/01/25 20:44:41 Can you put the } on the following line like the o
sdefresne 2016/01/26 11:59:44 Done here an below.
+
+Scope::MergeOptions::~MergeOptions() {}
Scope::ProgrammaticProvider::~ProgrammaticProvider() {
scope_->RemoveProvider(this);
@@ -251,6 +258,11 @@ bool Scope::NonRecursiveMergeTo(Scope* dest,
for (const auto& pair : values_) {
if (options.skip_private_vars && IsPrivateVar(pair.first))
continue; // Skip this private var.
+ if (!options.excluded_values.empty() &&
brettw 2016/01/25 20:44:41 This loop is getting a bit out of control with pai
sdefresne 2016/01/26 11:59:44 Done.
+ options.excluded_values.find(pair.first.as_string()) !=
+ options.excluded_values.end()) {
+ continue; // Skip this excluded value.
+ }
const Value& new_value = pair.second.value;
if (!options.clobber_existing) {
« tools/gn/function_forward_variables_from.cc ('K') | « tools/gn/scope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698