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

Side by Side Diff: ppapi/generators/idl_gen_wrapper.py

Issue 305233002: PPAPI: Make "no_interface_string" APIs have no PNaCl wrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/generators/idl_gen_pnacl.py ('k') | ppapi/generators/test_gen_pnacl/test_interfaces.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Base class for generating wrapper functions for PPAPI methods. 5 """Base class for generating wrapper functions for PPAPI methods.
6 """ 6 """
7 7
8 from datetime import datetime 8 from datetime import datetime
9 import os 9 import os
10 import sys 10 import sys
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 out.Write(' ' + ',\n '.join(methods) + '\n') 342 out.Write(' ' + ',\n '.join(methods) + '\n')
343 out.Write('};\n\n') 343 out.Write('};\n\n')
344 344
345 345
346 def GetWrapperInfoName(self, iface): 346 def GetWrapperInfoName(self, iface):
347 return '%s_WrapperInfo_%s' % (self.wrapper_prefix, iface.struct_name) 347 return '%s_WrapperInfo_%s' % (self.wrapper_prefix, iface.struct_name)
348 348
349 349
350 def GenerateWrapperInfoAndCollection(self, iface_releases, out): 350 def GenerateWrapperInfoAndCollection(self, iface_releases, out):
351 for iface in iface_releases: 351 for iface in iface_releases:
352 iface_macro = "NULL" 352 iface_macro = self.cgen.GetInterfaceMacro(iface.node, iface.version)
353 if not iface.node.GetProperty("no_interface_string"):
354 iface_macro = self.cgen.GetInterfaceMacro(iface.node, iface.version)
355 if iface.needs_wrapping: 353 if iface.needs_wrapping:
356 wrap_iface = '(const void *) &%s_Wrappers_%s' % (self.wrapper_prefix, 354 wrap_iface = '(const void *) &%s_Wrappers_%s' % (self.wrapper_prefix,
357 iface.struct_name) 355 iface.struct_name)
358 out.Write("""static struct %s %s = { 356 out.Write("""static struct %s %s = {
359 .iface_macro = %s, 357 .iface_macro = %s,
360 .wrapped_iface = %s, 358 .wrapped_iface = %s,
361 .real_iface = NULL 359 .real_iface = NULL
362 };\n\n""" % (self.GetWrapperMetadataName(), 360 };\n\n""" % (self.GetWrapperMetadataName(),
363 self.GetWrapperInfoName(iface), 361 self.GetWrapperInfoName(iface),
364 iface_macro, 362 iface_macro,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 self.GenerateWrapperInterfaces(iface_releases, out) 429 self.GenerateWrapperInterfaces(iface_releases, out)
432 430
433 # Generate a table of the wrapped interface structs that can be looked up. 431 # Generate a table of the wrapped interface structs that can be looked up.
434 self.GenerateWrapperInfoAndCollection(iface_releases, out) 432 self.GenerateWrapperInfoAndCollection(iface_releases, out)
435 433
436 # Write out the IDL-invariant functions. 434 # Write out the IDL-invariant functions.
437 self.GenerateFixedFunctions(out) 435 self.GenerateFixedFunctions(out)
438 436
439 out.Close() 437 out.Close()
440 return 0 438 return 0
OLDNEW
« no previous file with comments | « ppapi/generators/idl_gen_pnacl.py ('k') | ppapi/generators/test_gen_pnacl/test_interfaces.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698