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

Unified Diff: tools/json_schema_compiler/feature_compiler.py

Issue 2202733003: [Extensions] Remove JSONFeatureProvider, SimpleFeature::Parse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lei's Created 4 years, 4 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 | « extensions/test/test_extensions_client.cc ('k') | tools/json_schema_compiler/feature_compiler_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/feature_compiler.py
diff --git a/tools/json_schema_compiler/feature_compiler.py b/tools/json_schema_compiler/feature_compiler.py
index d28880220ec5ccfe3adc560cc9174b4b49afb717..9b04a7965a5abc310b334cd6d00b861396fbf913 100644
--- a/tools/json_schema_compiler/feature_compiler.py
+++ b/tools/json_schema_compiler/feature_compiler.py
@@ -460,8 +460,17 @@ class FeatureCompiler(object):
sep = feature_name.rfind('.')
if sep is -1 or no_parent:
return None
+
parent_name = feature_name[:sep]
- if parent_name not in self._features:
+ while sep != -1 and parent_name not in self._features:
+ # This recursion allows for a feature to have a parent that isn't a direct
+ # ancestor. For instance, we could have feature 'alpha', and feature
+ # 'alpha.child.child', where 'alpha.child.child' inherits from 'alpha'.
+ # TODO(devlin): Is this useful? Or logical?
+ sep = feature_name.rfind('.', 0, sep)
+ parent_name = feature_name[:sep]
+
+ if sep == -1:
# TODO(devlin): It'd be kind of nice to be able to assert that the
# deduced parent name is in our features, but some dotted features don't
# have parents and also don't have noparent, e.g. system.cpu. We should
« no previous file with comments | « extensions/test/test_extensions_client.cc ('k') | tools/json_schema_compiler/feature_compiler_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698