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

Side by Side 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: Split off the extensions permission weirdness. 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Updates the various BadMessage enums in histograms.xml file with values read
6 from the corresponding bad_message.h files.
7
8 If the file was pretty-printed, the updated version is pretty-printed too.
9 """
10
11 import os
12 import sys
13
14 from update_histogram_enum import UpdateHistogramEnum
15
16 if __name__ == '__main__':
17 if len(sys.argv) > 1:
18 print >>sys.stderr, 'No arguments expected!'
19 sys.stderr.write(__doc__)
20 sys.exit(1)
21
22 histograms = {
23 'chrome/browser/bad_message.h': 'BadMessageReasonChrome',
24 'content/browser/bad_message.h': 'BadMessageReasonContent',
25 'components/nacl/browser/bad_message.h': 'BadMessageReasonNaCl',
26 'extensions/browser/bad_message.h': 'BadMessageReasonExtensions',
27 }
28
29 for header_file, histogram_name in histograms.items():
30 UpdateHistogramEnum(histogram_enum_name=histogram_name,
31 source_enum_path=header_file,
32 start_marker='^enum BadMessageReason {',
33 end_marker='^BAD_MESSAGE_MAX')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698