diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-17 16:01:32 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-17 16:01:32 +0000 |
commit | 8c311f064c0ad5a70049f771bd15677bf7c9b098 (patch) | |
tree | 2a2727243475ff72eec47736e2567db064bba953 /ppapi/PRESUBMIT.py | |
parent | d68206fcca8a719e5152a09c6e9d235cdbcdeec3 (diff) | |
download | chromium_src-8c311f064c0ad5a70049f771bd15677bf7c9b098.zip chromium_src-8c311f064c0ad5a70049f771bd15677bf7c9b098.tar.gz chromium_src-8c311f064c0ad5a70049f771bd15677bf7c9b098.tar.bz2 |
Add support for generating thunk source from IDL.
This introduces a few new IDL attributes:
generate_thunk - Enables thunk generation for an IDL file.
create_func - Overrides the guessed create function name.
on_failure - Overrides the default return value on failure.
report_errors - Allows error reporting to be disabled.
By using these attributes, we can generate _thunk.cc files for many IDL
files.
I'll send CLs for moving the thunks separately, as I found it tiring to
review them all in a big lump. I have PPB_Widget_Dev here as an example.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11417010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/PRESUBMIT.py')
-rw-r--r-- | ppapi/PRESUBMIT.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ppapi/PRESUBMIT.py b/ppapi/PRESUBMIT.py index b350003..5fbb135 100644 --- a/ppapi/PRESUBMIT.py +++ b/ppapi/PRESUBMIT.py @@ -157,13 +157,24 @@ def CheckChange(input_api, output_api): missing = [] for filename in idl_files: if filename not in set(h_files): - missing.append(' ppapi/c/%s.idl' % filename) + missing.append('ppapi/api/%s.idl' % filename) + + # An IDL change that includes [generate_thunk] doesn't need to have + # an update to the corresponding .h file. + new_thunk_files = [] + for filename in missing: + lines = input_api.RightHandSideLines(lambda f: f.LocalPath() == filename) + for line in lines: + if line[2].strip() == '[generate_thunk]': + new_thunk_files.append(filename) + for filename in new_thunk_files: + missing.remove(filename) if missing: results.append( output_api.PresubmitPromptWarning( 'Missing PPAPI header, no change or skipped generation?', - long_text='\n'.join(missing))) + long_text='\n '.join(missing))) missing_dev = [] missing_stable = [] |