diff options
author | treib <treib@chromium.org> | 2015-05-07 16:15:36 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-07 23:16:11 +0000 |
commit | 2e0517f9e7eaf7901a00d8e475c4cf37c534f9e9 (patch) | |
tree | 5e6b1f3101f54be042dffe0409812d2eb6147af4 /extensions/common/PRESUBMIT.py | |
parent | 5924d3efed5a4408b13a56e18b5d6ebd42b9045c (diff) | |
download | chromium_src-2e0517f9e7eaf7901a00d8e475c4cf37c534f9e9.zip chromium_src-2e0517f9e7eaf7901a00d8e475c4cf37c534f9e9.tar.gz chromium_src-2e0517f9e7eaf7901a00d8e475c4cf37c534f9e9.tar.bz2 |
Extensions: Switch to new permission message system, part V
Add new UMA histograms for APIPermission::ID (which will eventually replace PermissionMessage::ID)
TBRing a mechanical change in app_launcher_handler.cc
TBR=estade
BUG=398257
Review URL: https://codereview.chromium.org/1094873002
Cr-Commit-Position: refs/heads/master@{#328874}
Diffstat (limited to 'extensions/common/PRESUBMIT.py')
-rw-r--r-- | extensions/common/PRESUBMIT.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/extensions/common/PRESUBMIT.py b/extensions/common/PRESUBMIT.py new file mode 100644 index 0000000..cbfb2b6 --- /dev/null +++ b/extensions/common/PRESUBMIT.py @@ -0,0 +1,35 @@ +# Copyright 2015 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. + +"""Chromium presubmit script for src/extensions/common. + +See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts +for more details on the presubmit API built into depot_tools. +""" + +import sys + +def _CreateAPIPermissionIDChecker(input_api, output_api): + original_sys_path = sys.path + + try: + sys.path.append(input_api.os_path.join( + input_api.PresubmitLocalPath(), '..', '..', 'tools', + 'strict_enum_value_checker')) + from strict_enum_value_checker import StrictEnumValueChecker + finally: + sys.path = original_sys_path + + return StrictEnumValueChecker(input_api, output_api, + start_marker=' enum ID {', end_marker=' // Last entry:', + path='extensions/common/api_permission.h') + +def CheckChangeOnUpload(input_api, output_api): + results = [] + results += _CreateAPIPermissionIDChecker(input_api, output_api).Run() + results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) + return results + +def CheckChangeOnCommit(input_api, output_api): + return _CreateAPIPermissionIDChecker(input_api, output_api).Run() |