| OLD | NEW |
| 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') |
| OLD | NEW |