ppapi/generators/idl_thunk.py
def DefineMember(filenode, node, member, release, include_version, meta):
  """Returns a definition for a member function of an interface.

  Args:
    filenode - IDLNode for the file
    node - IDLNode for the interface
    member - IDLNode for the member function
    release - release to generate
    include_version - include the version in emitted function name.
    meta - ThunkMetadata for header hints
  Returns:
    A string with the member definition.
  """
  cgen = CGen()
  rtype, name, arrays, args = cgen.GetComponents(member, release, 'return')
  log_body = '\"%s::%s()\";' % (node.GetName(),
                                cgen.GetStructName(member, release,
                                                   include_version))
  if len(log_body) > 69:  # Prevent lines over 80 characters.
    body = 'VLOG(4) <<\n'
    body += '    %s\n' % log_body
  else:
    body = 'VLOG(4) << %s\n' % log_body

  if _IsTypeCheck(node, member, args):
    body += '%s\n' % _MakeEnterLine(filenode, node, member, args[0], False,
                                    None, meta)
    body += 'return PP_FromBool(enter.succeeded());'
  elif member.GetName() == 'Create' or member.GetName() == 'CreateTrusted':
    body += _MakeCreateMemberBody(node, member, args)
  else:
    body += _MakeNormalMemberBody(filenode, release, node, member, rtype, args,
                                  include_version, meta)

  signature = cgen.GetSignature(member, release, 'return', func_as_ptr=False,
                                include_version=include_version)
  return '%s\n%s\n}' % (cgen.Indent('%s {' % signature, tabs=0),
                        cgen.Indent(body, tabs=1))
Returns a definition for a member function of an interface.

  Args:
    filenode - IDLNode for the file
    node - IDLNode for the interface
    member - IDLNode for the member function
    release - release to generate
    include_version - include the version in emitted function name.
    meta - ThunkMetadata for header hints
  Returns:
    A string with the member definition.
  
Returns a definition for a member function of an interface.
Returns a definition for a member function of an interface .
def DefineMember(filenode, node, member, release, include_version, meta):
  cgen = CGen()
  rtype, name, arrays, args = cgen.GetComponents(member, release, 'return')
  log_body = '\"%s::%s()\";' % (node.GetName(),
                                cgen.GetStructName(member, release,
                                                   include_version))
  if len(log_body) > 69:  
    body = 'VLOG(4) <<\n'
    body += '    %s\n' % log_body
  else:
    body = 'VLOG(4) << %s\n' % log_body
  if _IsTypeCheck(node, member, args):
    body += '%s\n' % _MakeEnterLine(filenode, node, member, args[0], False,
                                    None, meta)
    body += 'return PP_FromBool(enter.succeeded());'
  elif member.GetName() == 'Create' or member.GetName() == 'CreateTrusted':
    body += _MakeCreateMemberBody(node, member, args)
  else:
    body += _MakeNormalMemberBody(filenode, release, node, member, rtype, args,
                                  include_version, meta)
  signature = cgen.GetSignature(member, release, 'return', func_as_ptr=False,
                                include_version=include_version)
  return '%s\n%s\n}' % (cgen.Indent('%s {' % signature, tabs=0),
                        cgen.Indent(body, tabs=1))
def DefineMember ( filenode , node , member , release , include_version , meta ) : cgen = CGen ( ) rtype , name , arrays , args = cgen . GetComponents ( member , release , 'return' ) log_body = '\"%s::%s()\";' % ( node . GetName ( ) , cgen . GetStructName ( member , release , include_version ) ) if len ( log_body ) > 69 : body = 'VLOG(4) <<\n' body += '    %s\n' % log_body else : body = 'VLOG(4) << %s\n' % log_body if _IsTypeCheck ( node , member , args ) : body += '%s\n' % _MakeEnterLine ( filenode , node , member , args [ 0 ] , False , None , meta ) body += 'return PP_FromBool(enter.succeeded());' elif member . GetName ( ) == 'Create' or member . GetName ( ) == 'CreateTrusted' : body += _MakeCreateMemberBody ( node , member , args ) else : body += _MakeNormalMemberBody ( filenode , release , node , member , rtype , args , include_version , meta ) signature = cgen . GetSignature ( member , release , 'return' , func_as_ptr = False , include_version = include_version ) return '%s\n%s\n}' % ( cgen . Indent ( '%s {' % signature , tabs = 0 ) , cgen . Indent ( body , tabs = 1 ) )
Returns a definition for a member function of an interface.
Returns a definition for a member function of an interface .
"""Returns a definition for a member function of an interface.

  Args:
    filenode - IDLNode for the file
    node - IDLNode for the interface
    member - IDLNode for the member function
    release - release to generate
    include_version - include the version in emitted function name.
    meta - ThunkMetadata for header hints
  Returns:
    A string with the member definition.
  """ # Prevent lines over 80 characters.
filenode
node
member
release
include_version
meta