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

Unified Diff: tools/gn/scope.h

Issue 2148993002: Allow multiple set_default calls in GN. (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
« no previous file with comments | « tools/gn/function_set_defaults.cc ('k') | tools/gn/scope.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/scope.h
diff --git a/tools/gn/scope.h b/tools/gn/scope.h
index e9bd1397cc9b81c76454e44e7c2e6f4eceb3cd78..685f8404d5fce71682580e713513b0155b651d68 100644
--- a/tools/gn/scope.h
+++ b/tools/gn/scope.h
@@ -229,8 +229,7 @@ class Scope {
// change, we don't have to copy its values).
std::unique_ptr<Scope> MakeClosure() const;
- // Makes an empty scope with the given name. Returns NULL if the name is
- // already set.
+ // Makes an empty scope with the given name. Overwrites any existing one.
Scope* MakeTargetDefaults(const std::string& target_type);
// Gets the scope associated with the given target name, or null if it hasn't
@@ -311,9 +310,16 @@ class Scope {
Value value;
};
+ typedef base::hash_map<base::StringPiece, Record, base::StringPieceHash>
+ RecordMap;
+
void AddProvider(ProgrammaticProvider* p);
void RemoveProvider(ProgrammaticProvider* p);
+ // Returns true if the two RecordMaps contain the same values (the origins
+ // of the values may be different).
+ static bool RecordMapValuesEqual(const RecordMap& a, const RecordMap& b);
+
// Scopes can have no containing scope (both null), a mutable containing
// scope, or a const containing scope. The reason is that when we're doing
// a new target, we want to refer to the base_config scope which will be read
@@ -329,8 +335,6 @@ class Scope {
// for more.
unsigned mode_flags_;
- typedef base::hash_map<base::StringPiece, Record, base::StringPieceHash>
- RecordMap;
RecordMap values_;
// Note that this can't use string pieces since the names are constructed from
« no previous file with comments | « tools/gn/function_set_defaults.cc ('k') | tools/gn/scope.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698