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

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

Issue 1143323006: Histograms.xml python script housekeeping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bad_message
Patch Set: Fix imports (sadface) Created 5 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/print_style.py ('k') | tools/metrics/histograms/update_editor_commands.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/update_bad_message_reasons.py
diff --git a/tools/metrics/histograms/update_bad_message_reasons.py b/tools/metrics/histograms/update_bad_message_reasons.py
new file mode 100644
index 0000000000000000000000000000000000000000..eaf761f6a29d21c709d381335aa2f229e67c937e
--- /dev/null
+++ b/tools/metrics/histograms/update_bad_message_reasons.py
@@ -0,0 +1,32 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Updates the various BadMessage enums in histograms.xml file with values read
+from the corresponding bad_message.h files.
+
+If the file was pretty-printed, the updated version is pretty-printed too.
+"""
+
+import sys
+
+from update_histogram_enum import UpdateHistogramEnum
+
+if __name__ == '__main__':
+ if len(sys.argv) > 1:
+ print >>sys.stderr, 'No arguments expected!'
+ sys.stderr.write(__doc__)
+ sys.exit(1)
+
+ histograms = {
+ 'chrome/browser/bad_message.h': 'BadMessageReasonChrome',
+ 'content/browser/bad_message.h': 'BadMessageReasonContent',
+ 'components/nacl/browser/bad_message.h': 'BadMessageReasonNaCl',
+ 'extensions/browser/bad_message.h': 'BadMessageReasonExtensions',
+ }
+
+ for header_file, histogram_name in histograms.items():
+ UpdateHistogramEnum(histogram_enum_name=histogram_name,
+ source_enum_path=header_file,
+ start_marker='^enum BadMessageReason {',
+ end_marker='^BAD_MESSAGE_MAX')
« no previous file with comments | « tools/metrics/histograms/print_style.py ('k') | tools/metrics/histograms/update_editor_commands.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698