Home | History | Annotate | Download | only in histograms
      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
      3 # found in the LICENSE file.
      4 
      5 """Updates ExtensionPermission2 enum in histograms.xml file with values read
      6 from permission_message.h.
      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   UpdateHistogramEnum(histogram_enum_name='ExtensionPermission2',
     23                       source_enum_path=os.path.join('..', '..', '..',
     24                                                     'extensions', 'common',
     25                                                     'permissions',
     26                                                     'permission_message.h'),
     27                       start_marker='^enum ID {',
     28                       end_marker='^kEnumBoundary')
     29