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

Unified Diff: tools/metrics/histograms/update_use_counter_feature_enum.py

Issue 276663002: Script to populate the XML for the CSS property UseCounter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update-css-histogram
Patch Set: made update_use_counter_css.py executable Created 6 years, 7 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/metrics/histograms/update_use_counter_css.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/update_use_counter_feature_enum.py
diff --git a/tools/metrics/histograms/update_use_counter_feature_enum.py b/tools/metrics/histograms/update_use_counter_feature_enum.py
index ad4de167adddf8bbae33b253109d69118d599a7d..09ec6d75efaadd77df88a5a8f38f4f2bb8d03b3e 100755
--- a/tools/metrics/histograms/update_use_counter_feature_enum.py
+++ b/tools/metrics/histograms/update_use_counter_feature_enum.py
@@ -17,11 +17,8 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
from update_histogram_enum import ReadHistogramValues
from update_histogram_enum import UpdateHistogramEnum
-USE_COUNTER_HEADER_PATH = \
- '../../../third_party/WebKit/Source/core/frame/UseCounter.h'
-
-def print_enum_for_dashboard(enum_dict):
+def PrintEnumForDashboard(enum_dict):
"""Prints enum_items formatted for use in uma.py of Chromium dashboard."""
for key in sorted(enum_dict.iterkeys()):
print ' %d: \'%s\',' % (key, enum_dict[key])
@@ -36,16 +33,19 @@ if __name__ == '__main__':
'https://github.com/GoogleChrome/chromium-dashboard')
options, args = parser.parse_args()
+ source_path = os.path.join(
+ '..', '..', '..',
+ 'third_party', 'WebKit', 'Source', 'core', 'frame', 'UseCounter.h')
+
START_MARKER = '^enum Feature {'
END_MARKER = '^NumberOfFeatures'
if options.dashboard:
- enum_dict = ReadHistogramValues(
- USE_COUNTER_HEADER_PATH, START_MARKER, END_MARKER)
- print_enum_for_dashboard(enum_dict)
+ enum_dict = ReadHistogramValues(source_path, START_MARKER, END_MARKER)
+ PrintEnumForDashboard(enum_dict)
else:
UpdateHistogramEnum(
histogram_enum_name='FeatureObserver',
- source_enum_path=USE_COUNTER_HEADER_PATH,
+ source_enum_path=source_path,
start_marker=START_MARKER,
end_marker=END_MARKER)
« no previous file with comments | « tools/metrics/histograms/update_use_counter_css.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698