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

Unified Diff: chrome/browser/PRESUBMIT.py

Issue 344883002: Collect UMA statistics on which chrome://flags lead to chrome restart on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Presubmit hook added. Created 6 years, 5 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: chrome/browser/PRESUBMIT.py
diff --git a/chrome/browser/PRESUBMIT.py b/chrome/browser/PRESUBMIT.py
index a485728b350aa88c98b2728adc8330d729bca405..114b9c8c5152705be6b8bad295102fb0373bc80a 100644
--- a/chrome/browser/PRESUBMIT.py
+++ b/chrome/browser/PRESUBMIT.py
@@ -20,6 +20,22 @@ def CheckChangeOnUpload(input_api, output_api):
def CheckChangeOnCommit(input_api, output_api):
return _CommonChecks(input_api, output_api)
+# chrome/browser/about_flags_switches_histogram_ids.h
+def _CreateAboutFlagsSwitchesHistogramIdsChecker(input_api, output_api):
+ import sys
+ original_sys_path = sys.path
+
+ try:
+ sys.path.append(input_api.os_path.join(
+ input_api.PresubmitLocalPath(), '..', '..', 'tools',
+ 'about_flags_switches_histogram_ids_checker'))
+ from about_flags_switches_histogram_ids_checker \
+ import AboutFlagsSwitchesHistogramIDsChecker
+ finally:
+ sys.path = original_sys_path
+
+ return AboutFlagsSwitchesHistogramIDsChecker(input_api, output_api,
+ path='chrome/browser/about_flags_switches_histogram_ids.h')
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
@@ -66,4 +82,10 @@ def _CommonChecks(input_api, output_api):
finally:
sys.path = old_path
+ affected_files = (f.AbsoluteLocalPath() for f in input_api.AffectedFiles())
+ if path.join(cwd, 'about_flags_switches_histogram_ids.h') in affected_files :
+ input_api.logging.info("Running AboutFlagsSwitchesHistogramIdsChecker.")
+ results += _CreateAboutFlagsSwitchesHistogramIdsChecker(input_api,
+ output_api).Run()
+
return results

Powered by Google App Engine
This is Rietveld 408576698