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

Unified Diff: tools/json_schema_compiler/schema_util.py

Issue 12375006: Added UMA stats for extensions events on addListener. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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/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
« chrome/browser/extensions/event_router.cc ('K') | « tools/json_schema_compiler/model.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698