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

Unified Diff: third_party/WebKit/public/platform/PRESUBMIT.py

Issue 2894063002: Expose UseCounter::Feature enum out of blink as WebFeature (Closed)
Patch Set: Rebase update Created 3 years, 7 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/public/platform/PRESUBMIT.py
diff --git a/third_party/WebKit/public/platform/PRESUBMIT.py b/third_party/WebKit/public/platform/PRESUBMIT.py
new file mode 100644
index 0000000000000000000000000000000000000000..47110974a0b47ccb0214b1fe12bb7578da98bdd6
--- /dev/null
+++ b/third_party/WebKit/public/platform/PRESUBMIT.py
@@ -0,0 +1,56 @@
+# 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.
+
+"""Blink frame presubmit script
+
+See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
+for more details about the presubmit API built into gcl.
+"""
+
+
+def _RunUmaHistogramChecks(input_api, output_api): # pylint: disable=C0103
+ import sys
+
+ original_sys_path = sys.path
+ try:
+ sys.path = sys.path + [input_api.os_path.join(
+ input_api.PresubmitLocalPath(), '..', '..', '..', '..',
+ 'tools', 'metrics', 'histograms')]
+ import update_histogram_enum # pylint: disable=F0401
+ finally:
+ sys.path = original_sys_path
+
+ source_path = ''
+ for f in input_api.AffectedFiles():
+ if f.LocalPath().endswith('UseCounterFeature.def'):
+ source_path = f.LocalPath()
+ break
+ else:
+ return []
+
+ start_marker = '^'
+ end_marker = '^kNumberOfFeatures'
+ presubmit_error = update_histogram_enum.CheckPresubmitErrors(
+ histogram_enum_name='FeatureObserver',
+ update_script_name='update_use_counter_feature_enum.py',
+ source_enum_path=source_path,
+ start_marker=start_marker,
+ end_marker=end_marker,
+ strip_k_prefix=True)
+ if presubmit_error:
+ return [output_api.PresubmitPromptWarning(presubmit_error,
+ items=[source_path])]
+ return []
+
+
+def CheckChangeOnUpload(input_api, output_api): # pylint: disable=C0103
+ results = []
+ results.extend(_RunUmaHistogramChecks(input_api, output_api))
+ return results
+
+
+def CheckChangeOnCommit(input_api, output_api): # pylint: disable=C0103
+ results = []
+ results.extend(_RunUmaHistogramChecks(input_api, output_api))
+ return results
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | third_party/WebKit/public/platform/UseCounterFeature.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698