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

Side by Side Diff: tools/metrics/histograms/update_extension_permission.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, 6 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
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Updates ExtensionPermission2 and ExtensionPermission3 enums in histograms.xml 5 """Updates ExtensionPermission2 and ExtensionPermission3 enums in histograms.xml
6 file with values read from permission_message.h and api_permission.h, 6 file with values read from permission_message.h and api_permission.h,
7 respectively. 7 respectively.
8 8
9 If the file was pretty-printed, the updated version is pretty-printed too. 9 If the file was pretty-printed, the updated version is pretty-printed too.
10 """ 10 """
11 11
12 import os 12 import os
13 import sys 13 import sys
14 14
15 from update_histogram_enum import UpdateHistogramEnum 15 from update_histogram_enum import UpdateHistogramEnum
16 16
17 if __name__ == '__main__': 17 if __name__ == '__main__':
18 if len(sys.argv) > 1: 18 if len(sys.argv) > 1:
19 print >>sys.stderr, 'No arguments expected!' 19 print >>sys.stderr, 'No arguments expected!'
20 sys.stderr.write(__doc__) 20 sys.stderr.write(__doc__)
21 sys.exit(1) 21 sys.exit(1)
22 22
23 header_file = 'extensions/common/permissions/permission_message.h'
23 UpdateHistogramEnum(histogram_enum_name='ExtensionPermission2', 24 UpdateHistogramEnum(histogram_enum_name='ExtensionPermission2',
24 source_enum_path=os.path.join('..', '..', '..', 25 source_enum_path=header_file,
25 'extensions', 'common',
26 'permissions',
27 'permission_message.h'),
28 start_marker='^enum ID {', 26 start_marker='^enum ID {',
29 end_marker='^kEnumBoundary') 27 end_marker='^kEnumBoundary')
30 28
29 header_file = 'extensions/common/permissions/api_permission.h'
31 UpdateHistogramEnum(histogram_enum_name='ExtensionPermission3', 30 UpdateHistogramEnum(histogram_enum_name='ExtensionPermission3',
32 source_enum_path=os.path.join('..', '..', '..', 31 source_enum_path=header_file,
33 'extensions', 'common',
34 'permissions',
35 'api_permission.h'),
36 start_marker='^enum ID {', 32 start_marker='^enum ID {',
37 end_marker='^kEnumBoundary') 33 end_marker='^kEnumBoundary')
OLDNEW
« no previous file with comments | « tools/metrics/histograms/update_extension_functions.py ('k') | tools/metrics/histograms/update_histogram_enum.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698