Commit 67ac9858 authored by Yoav Weiss's avatar Yoav Weiss Committed by Commit Bot

Fix histogram generation to match presubmit checks

Bug: 1060079
Change-Id: If115a07824df9de2ab5af91e91ca9e91bf8c4f1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095590Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Yoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748872}
parent 610028a3
......@@ -31,7 +31,9 @@ if __name__ == '__main__':
}
for header_file, histogram_name in histograms.items():
UpdateHistogramEnum(histogram_enum_name=histogram_name,
source_enum_path=header_file,
start_marker='^enum (class )?BadMessageReason {',
end_marker='^BAD_MESSAGE_MAX')
UpdateHistogramEnum(
histogram_enum_name=histogram_name,
source_enum_path=header_file,
start_marker='^enum (class )?BadMessageReason {',
end_marker='^BAD_MESSAGE_MAX',
calling_script=os.path.basename(__file__))
......@@ -28,7 +28,9 @@ if __name__ == '__main__':
('ExtensionFunctions',
'extensions/browser/extension_function_histogram_value.h'))
for enum_name, source_header in histograms:
UpdateHistogramEnum(histogram_enum_name=enum_name,
source_enum_path=source_header,
start_marker='^enum HistogramValue {',
end_marker='^ENUM_BOUNDARY')
UpdateHistogramEnum(
histogram_enum_name=enum_name,
source_enum_path=source_header,
start_marker='^enum HistogramValue {',
end_marker='^ENUM_BOUNDARY',
calling_script=os.path.basename(__file__))
......@@ -22,7 +22,9 @@ if __name__ == '__main__':
sys.exit(1)
header_file = 'extensions/common/permissions/api_permission.h'
UpdateHistogramEnum(histogram_enum_name='ExtensionPermission3',
source_enum_path=header_file,
start_marker='^enum ID {',
end_marker='^kEnumBoundary')
UpdateHistogramEnum(
histogram_enum_name='ExtensionPermission3',
source_enum_path=header_file,
start_marker='^enum ID {',
end_marker='^kEnumBoundary',
calling_script=os.path.basename(__file__))
......@@ -24,8 +24,10 @@ if __name__ == '__main__':
source_file = 'third_party/blink/public/mojom/feature_policy/' \
'feature_policy_feature.mojom'
UpdateHistogramEnum(histogram_enum_name='FeaturePolicyFeature',
source_enum_path=source_file,
start_marker='^enum FeaturePolicyFeature {',
end_marker='^};',
strip_k_prefix=True)
UpdateHistogramEnum(
histogram_enum_name='FeaturePolicyFeature',
source_enum_path=source_file,
start_marker='^enum FeaturePolicyFeature {',
end_marker='^};',
strip_k_prefix=True,
calling_script=os.path.basename(__file__))
......@@ -309,8 +309,12 @@ def UpdateHistogramFromDict(histogram_enum_name, source_enum_values,
Log('Done.')
def UpdateHistogramEnum(histogram_enum_name, source_enum_path,
start_marker, end_marker, strip_k_prefix = False):
def UpdateHistogramEnum(histogram_enum_name,
source_enum_path,
start_marker,
end_marker,
strip_k_prefix=False,
calling_script=None):
"""Reads a C++ enum from a .h file and updates histograms.xml to match.
Args:
......@@ -328,7 +332,7 @@ def UpdateHistogramEnum(histogram_enum_name, source_enum_path,
start_marker, end_marker, strip_k_prefix)
UpdateHistogramFromDict(histogram_enum_name, source_enum_values,
source_enum_path, None)
source_enum_path, calling_script)
def UpdateHistogramEnumFromXML(histogram_enum_name, source_enum_path,
......
......@@ -28,4 +28,5 @@ if __name__ == '__main__':
source_enum_path=source_file,
start_marker='^enum class WebSchedulerTrackedFeature {',
end_marker='^kMaxValue',
strip_k_prefix=True)
strip_k_prefix=True,
calling_script=os.path.basename(__file__))
......@@ -49,4 +49,5 @@ if __name__ == '__main__':
source_enum_path=source_path,
start_marker=START_MARKER,
end_marker=END_MARKER,
strip_k_prefix=True)
strip_k_prefix=True,
calling_script=os.path.basename(__file__))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment