Index: tools/json_schema_compiler/schema_util.py |
diff --git a/tools/json_schema_compiler/schema_util.py b/tools/json_schema_compiler/schema_util.py |
index 7ce399e8ed31e0a0a75a76d82176a39a9a00e6a1..be3d0df6a525645969472e202e65e8a46087e297 100644 |
--- a/tools/json_schema_compiler/schema_util.py |
+++ b/tools/json_schema_compiler/schema_util.py |
@@ -23,6 +23,16 @@ def SplitNamespace(ref): |
return tuple(ref.rsplit('.', 1)) |
return (None, ref) |
+def JsEventNameToHistogramValue(namespace_name, event_name): |
+ """Transform a fully qualified event name like foo.bar.baz into FOO_BAR_BAZ |
+ |
+ Format based on |
+ chrome/browser/extensions/extension_event_histogram_value.h . |
+ |
+ DOES NOT strip any leading 'experimental' prefix.""" |
+ full_name = namespace_name + "." + event_name |
+ return full_name.upper().replace(".", "_") |
+ |
def JsFunctionNameToClassName(namespace_name, function_name): |
"""Transform a fully qualified function name like foo.bar.baz into FooBarBaz |