Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / tools / metrics / histograms / update_extension_histograms.py
blobca3e12dbbe560148c7d753fdd5603d9ccb1b536f
1 # Copyright 2013 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.
5 """Updates the ExtensionEvents and ExtensionFunctions enums in histograms.xml
6 with values read from extension_event_histogram_value.h and
7 extension_function_histogram_value.h.
9 If the file was pretty-printed, the updated version is pretty-printed too.
10 """
12 import os
13 import sys
15 from update_histogram_enum import UpdateHistogramEnum
17 if __name__ == '__main__':
18 if len(sys.argv) > 1:
19 print >>sys.stderr, 'No arguments expected!'
20 sys.stderr.write(__doc__)
21 sys.exit(1)
23 histograms = (
24 ('ExtensionEvents',
25 'extensions/browser/extension_event_histogram_value.h'),
26 ('ExtensionFunctions',
27 'extensions/browser/extension_function_histogram_value.h'))
28 for enum_name, source_header in histograms:
29 UpdateHistogramEnum(histogram_enum_name=enum_name,
30 source_enum_path=source_header,
31 start_marker='^enum HistogramValue {',
32 end_marker='^ENUM_BOUNDARY')