| Index: third_party/WebKit/Source/core/frame/PRESUBMIT.py
|
| diff --git a/third_party/WebKit/Source/core/frame/PRESUBMIT.py b/third_party/WebKit/Source/core/frame/PRESUBMIT.py
|
| index ec96ed48c28a962f47e9236a9d20c60028f324c5..c7fd89422e7cf4ceef1586f0977f7208fc68a091 100644
|
| --- a/third_party/WebKit/Source/core/frame/PRESUBMIT.py
|
| +++ b/third_party/WebKit/Source/core/frame/PRESUBMIT.py
|
| @@ -74,22 +74,24 @@ def _RunUmaHistogramChecks(input_api, output_api):
|
|
|
| start_marker = '^enum Feature : uint32_t {'
|
| end_marker = '^kNumberOfFeatures'
|
| - should_update_histogram, duplicated_values = update_histogram_enum.HistogramNeedsUpdate(
|
| - histogram_enum_name='FeatureObserver',
|
| - source_enum_path=source_path,
|
| - start_marker=start_marker,
|
| - end_marker=end_marker,
|
| - strip_k_prefix=True)
|
| - if duplicated_values:
|
| + try:
|
| + if update_histogram_enum.HistogramNeedsUpdate(
|
| + histogram_enum_name='FeatureObserver',
|
| + source_enum_path=source_path,
|
| + start_marker=start_marker,
|
| + end_marker=end_marker,
|
| + strip_k_prefix=True):
|
| + return [output_api.PresubmitPromptWarning(
|
| + 'UseCounter::Feature has been updated and the UMA mapping needs'
|
| + 'to be regenerated. Please run '
|
| + 'update_use_counter_feature_enum.py in '
|
| + 'src/tools/metrics/histograms/ to update the mapping.',
|
| + items=[source_path])]
|
| + except update_histogram_enum.DuplicatedValue as duplicated_value:
|
| return [output_api.PresubmitPromptWarning(
|
| 'UseCounter::Feature has been updated and there exists duplicated '
|
| - 'values between (%s) and (%s)' % duplicated_values,
|
| - items=[source_path])]
|
| - if should_update_histogram:
|
| - return [output_api.PresubmitPromptWarning(
|
| - 'UseCounter::Feature has been updated and the UMA mapping needs to '
|
| - 'be regenerated. Please run update_use_counter_feature_enum.py in '
|
| - 'src/tools/metrics/histograms/ to update the mapping.',
|
| + 'values between (%s) and (%s)' % (duplicated_value.first_label,
|
| + duplicated_value.second_label),
|
| items=[source_path])]
|
|
|
| return []
|
|
|