summaryrefslogtreecommitdiffstats
path: root/ppapi/generators/idl_thunk.py
diff options
context:
space:
mode:
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 17:43:49 +0000
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 17:43:49 +0000
commitfa8543dea596ab76cced0a2d3a26891b90585d4b (patch)
treeb0f58095386083b1229404e0b883956c1538bd24 /ppapi/generators/idl_thunk.py
parent53b090e53be0403ef4498f9c8c2481969d8ac573 (diff)
downloadchromium_src-fa8543dea596ab76cced0a2d3a26891b90585d4b.zip
chromium_src-fa8543dea596ab76cced0a2d3a26891b90585d4b.tar.gz
chromium_src-fa8543dea596ab76cced0a2d3a26891b90585d4b.tar.bz2
Pepper: Fix thunk function names with versions.
Thunk files previously had buggy code when dealing with multiple versions of a function. It's easiest to explain with the example Yuzhu gave: The IDL file has three versions defined: label Chrome { M19 = 0.2, M25 = 0.3, M29 = 0.4 }; And the interface has: int32_t Open(...) [version=0.4] int32_t Open(...) The generated thunk defines Open_0_2() and Open(). But the v0.3 interface structure use Open_0_3() which isn't defined. This change makes the v0.3 interface above use Open_0_2, as intended. BUG=239984 Review URL: https://chromiumcodereview.appspot.com/14927016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generators/idl_thunk.py')
-rwxr-xr-xppapi/generators/idl_thunk.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/ppapi/generators/idl_thunk.py b/ppapi/generators/idl_thunk.py
index 9121cb0..1bb0de0 100755
--- a/ppapi/generators/idl_thunk.py
+++ b/ppapi/generators/idl_thunk.py
@@ -536,10 +536,11 @@ class TGen(GeneratorByFile):
for child in members:
rtype, name, arrays, args = cgen.GetComponents(
child, build, 'return')
- if not _IsNewestMember(child, members, releases):
- version = node.GetVersion(build).replace('.', '_')
- name += '_' + version
if child.InReleases([build]):
+ if not _IsNewestMember(child, members, releases):
+ version = child.GetVersion(
+ child.first_release[build]).replace('.', '_')
+ name += '_' + version
generated_functions.append(name)
out.Write(',\n'.join([' &%s' % f for f in generated_functions]))
out.Write('\n};\n\n')
@@ -574,11 +575,11 @@ def Main(args):
idldir = os.path.join(idldir, 'test_thunk', '*.idl')
filenames = glob.glob(idldir)
ast = ParseFiles(filenames)
- if tgen.GenerateRange(ast, ['M13', 'M14'], {}):
- print "Golden file for M13-M14 failed."
+ if tgen.GenerateRange(ast, ['M13', 'M14', 'M15'], {}):
+ print "Golden file for M13-M15 failed."
failed = 1
else:
- print "Golden file for M13-M14 passed."
+ print "Golden file for M13-M15 passed."
return failed