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

Unified Diff: ppapi/PRESUBMIT.py

Issue 141523010: Pepper: Log in UMA when an interface is used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again Created 6 years, 10 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
« no previous file with comments | « content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc ('k') | ppapi/proxy/interface_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/PRESUBMIT.py
diff --git a/ppapi/PRESUBMIT.py b/ppapi/PRESUBMIT.py
index 12df7a7540d17873b8515b49df1744cc110370a7..44efb2feb7445e170db494e02c3a9bfaf5bc805b 100644
--- a/ppapi/PRESUBMIT.py
+++ b/ppapi/PRESUBMIT.py
@@ -146,6 +146,38 @@ def CheckUpdatedNaClSDK(input_api, output_api):
'PPAPI Interface modified without updating NaCl SDK.',
output_api)
+# Verify that changes to ppapi/thunk/interfaces_* files have a corresponding
+# change to tools/metrics/histograms/histograms.xml for UMA tracking.
+def CheckHistogramXml(input_api, output_api):
+ # We can't use input_api.LocalPaths() here because we need to know about
+ # changes outside of ppapi/. See tools/depot_tools/presubmit_support.py for
+ # details on input_api.
+ files = input_api.change.AffectedFiles()
+
+ INTERFACE_FILES = ('ppapi/thunk/interfaces_legacy.h',
+ 'ppapi/thunk/interfaces_ppb_private_flash.h',
+ 'ppapi/thunk/interfaces_ppb_private.h',
+ 'ppapi/thunk/interfaces_ppb_private_no_permissions.h',
+ 'ppapi/thunk/interfaces_ppb_public_dev_channel.h',
+ 'ppapi/thunk/interfaces_ppb_public_dev.h',
+ 'ppapi/thunk/interfaces_ppb_public_stable.h')
+ HISTOGRAM_XML_FILE = 'tools/metrics/histograms/histograms.xml'
+ interface_changes = []
+ has_histogram_xml_change = False
+ for filename in files:
+ path = filename.LocalPath()
+ if path in INTERFACE_FILES:
+ interface_changes.append(path)
+ if path == HISTOGRAM_XML_FILE:
+ has_histogram_xml_change = True
+
+ if interface_changes and not has_histogram_xml_change:
+ return [output_api.PresubmitPromptWarning(
+ 'Missing change to tools/metrics/histograms/histograms.xml.\n' +
+ 'Run pepper_hash_for_uma to make get values for new interfaces.\n' +
+ 'Interface changes:\n' + '\n'.join(interface_changes))]
+ return []
+
def CheckChange(input_api, output_api):
results = []
@@ -157,6 +189,8 @@ def CheckChange(input_api, output_api):
results.extend(CheckUpdatedNaClSDK(input_api, output_api))
+ results.extend(CheckHistogramXml(input_api, output_api))
+
# Verify all modified *.idl have a matching *.h
files = input_api.LocalPaths()
h_files = []
« no previous file with comments | « content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc ('k') | ppapi/proxy/interface_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698