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

Unified Diff: tools/json_schema_compiler/cpp_util.py

Issue 23594008: Initial code generation for features. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 7 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
Index: tools/json_schema_compiler/cpp_util.py
diff --git a/tools/json_schema_compiler/cpp_util.py b/tools/json_schema_compiler/cpp_util.py
index 2de42293fba9c4b444978f64292ced4153f986e5..1a347c71eb74f21b08f3f7f8b2a26cc832ce4d68 100644
--- a/tools/json_schema_compiler/cpp_util.py
+++ b/tools/json_schema_compiler/cpp_util.py
@@ -24,6 +24,10 @@ GENERATED_BUNDLE_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITIONS IN
// %s
// DO NOT EDIT.
"""
+GENERATED_FEATURE_MESSAGE = """// GENERATED FROM THE FEATURE DEFINITIONS IN
+// %s
+// DO NOT EDIT.
+"""
def Classname(s):
"""Translates a namespace name or function name into something more
@@ -111,3 +115,10 @@ def CloseNamespace(namespace):
for component in reversed(namespace.split('::')):
c.Append('} // namespace %s' % component)
return c
+
+def RemoveFeatureDuplicates(feature_list):
+ """Return a "set" of features where any feature with the same name is tossed.
not at google - send to devlin 2013/09/12 16:20:43 this method returns a list not a set.
dhnishi (use Chromium) 2013/09/13 17:36:42 Done.
+ """
+ feature_set = set()
+ return [feature for feature in feature_list if feature.name not in
+ feature_set and not feature_set.add(feature.name)]

Powered by Google App Engine
This is Rietveld 408576698