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

Unified Diff: third_party/WebKit/Source/core/frame/PRESUBMIT.py

Issue 2797043002: Add a presubmit checker for duplicated enum values in UseCounter::Feature (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
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 589861be7649c971a0fcaa37eb7149f56e8d8e74..a8eee457211feb54c0a3f1cebfbcbd5e4bc93e6a 100644
--- a/third_party/WebKit/Source/core/frame/PRESUBMIT.py
+++ b/third_party/WebKit/Source/core/frame/PRESUBMIT.py
@@ -74,11 +74,17 @@ def _RunUmaHistogramChecks(input_api, output_api):
START_MARKER = '^enum Feature : uint32_t {'
END_MARKER = '^NumberOfFeatures'
- if update_histogram_enum.HistogramNeedsUpdate(
- histogram_enum_name='FeatureObserver',
- source_enum_path=source_path,
- start_marker=START_MARKER,
- end_marker=END_MARKER):
+ 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)
+ if duplicated_values is not None:
+ 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 '
« no previous file with comments | « no previous file | tools/metrics/histograms/update_histogram_enum.py » ('j') | tools/metrics/histograms/update_histogram_enum.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698