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

Unified Diff: tools/metrics/histograms/presubmit_scheme_histograms.py

Issue 2787573003: Remove DumpWithoutCrashing from ShouldAllowOpenURL. (Closed)
Patch Set: Address asvitkine's comments 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: tools/metrics/histograms/presubmit_scheme_histograms.py
diff --git a/tools/metrics/histograms/presubmit_scheme_histograms.py b/tools/metrics/histograms/presubmit_scheme_histograms.py
new file mode 100644
index 0000000000000000000000000000000000000000..4adccb98def363041970ae7740597614f880d256
--- /dev/null
+++ b/tools/metrics/histograms/presubmit_scheme_histograms.py
@@ -0,0 +1,31 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Check to see if the ShouldAllowOpenURLFailureScheme enum in histograms.xml
+needs to be updated. This can be called from a chromium PRESUBMIT.py to ensure
+updates to the enum in chrome_content_browser_client_extensions_part.cc also
+include the generated changes to histograms.xml.
+"""
+
+import update_histogram_enum
+
+def PrecheckShouldAllowOpenURLEnums(input_api, output_api):
+ source_file = 'chrome/browser/extensions/' \
+ 'chrome_content_browser_client_extensions_part.cc'
+
+ affected_files = (f.LocalPath() for f in input_api.AffectedFiles())
+ if source_file not in affected_files:
+ return []
+
+ if update_histogram_enum.HistogramNeedsUpdate(
+ histogram_enum_name='ShouldAllowOpenURLFailureScheme',
+ source_enum_path=source_file,
+ start_marker='^enum ShouldAllowOpenURLFailureScheme {',
+ end_marker='^SCHEME_LAST'):
+ return [output_api.PresubmitPromptWarning(
+ 'ShouldAllowOpenURLFailureScheme has been updated but histogram.xml '
+ 'does not appear to be updated.\nPlease run:\n'
+ ' python tools/metrics/histograms/'
+ 'update_should_allow_open_url_histograms.py\n')]
+ return []
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | tools/metrics/histograms/update_should_allow_open_url_histograms.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698