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

Unified Diff: tools/gn/visibility.cc

Issue 552843005: Convert GN visibility to be a list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/variables.cc ('k') | tools/gn/visibility_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/visibility.cc
diff --git a/tools/gn/visibility.cc b/tools/gn/visibility.cc
index c9dbb874897d5ab2f280c06842edb47b26f802e9..0dbad167cf0c6b38b607977176148b4b37df7da5 100644
--- a/tools/gn/visibility.cc
+++ b/tools/gn/visibility.cc
@@ -25,16 +25,10 @@ bool Visibility::Set(const SourceDir& current_dir,
Err* err) {
patterns_.clear();
- // Allow a single string to be passed in to make the common case (just one
- // pattern) easier to specify.
- if (value.type() == Value::STRING) {
- patterns_.push_back(LabelPattern::GetPattern(current_dir, value, err));
- return !err->has_error();
- }
-
- // If it's not a string, it should be a list of strings.
- if (!value.VerifyTypeIs(Value::LIST, err))
+ if (!value.VerifyTypeIs(Value::LIST, err)) {
+ CHECK(err->has_error());
return false;
+ }
const std::vector<Value>& list = value.list_value();
for (size_t i = 0; i < list.size(); i++) {
« no previous file with comments | « tools/gn/variables.cc ('k') | tools/gn/visibility_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698