parameters: (dependency_interface, dependency_interface_basename)
docstring: Transfer extended attributes from dependency interface onto members.
  
      Merging consists of storing certain interface-level data in extended
      attributes of the *members* (because there is no separate dependency
      interface post-merging).
  
      The data storing consists of:
      * applying certain extended attributes from the dependency interface
        to its members
      * storing the C++ class of the implementation in an internal
        extended attribute of each member, [PartialInterfaceImplementedAs]
  
      No return: modifies dependency_interface in place.
docstring_summary: Transfer extended attributes from dependency interface onto members.
docstring_tokens: Transfer extended attributes from dependency interface onto members .
function: def transfer_extended_attributes(dependency_interface, dependency_interface_basename):
      """Transfer extended attributes from dependency interface onto members.
  
      Merging consists of storing certain interface-level data in extended
      attributes of the *members* (because there is no separate dependency
      interface post-merging).
  
      The data storing consists of:
      * applying certain extended attributes from the dependency interface
        to its members
      * storing the C++ class of the implementation in an internal
        extended attribute of each member, [PartialInterfaceImplementedAs]
  
      No return: modifies dependency_interface in place.
      """
      merged_extended_attributes = dict(
          (key, value)
          for key, value in dependency_interface.extended_attributes.iteritems()
          if key in DEPENDENCY_EXTENDED_ATTRIBUTES)
  
      # A partial interface's members are implemented as static member functions
      # in a separate C++ class. This class name is stored in
      # [PartialInterfaceImplementedAs] which defaults to the basename of
      # dependency IDL file.
      # This class name can be overridden by [ImplementedAs] on the partial
      # interface definition.
      #
      # Note that implemented interfaces do *not* need [ImplementedAs], since
      # they are implemented on the C++ object |impl| itself, just like members of
      # the main interface definition, so the bindings do not need to know in
      # which class implemented interfaces are implemented.
      #
      # Currently [LegacyTreatAsPartialInterface] can be used to have partial
      # interface behavior on implemented interfaces, but this is being removed
      # as legacy cruft:
      # FIXME: Remove [LegacyTreatAsPartialInterface]
      # http://crbug.com/360435
      #
      # Note that [ImplementedAs] is used with different meanings on interfaces
      # and members:
      # for Blink class name and function name (or constant name), respectively.
      # Thus we do not want to copy this from the interface to the member, but
      # instead extract it and handle it separately.
      if (dependency_interface.is_partial or
          'LegacyTreatAsPartialInterface' in dependency_interface.extended_attributes):
          merged_extended_attributes['PartialInterfaceImplementedAs'] = (
              dependency_interface.extended_attributes.get(
                  'ImplementedAs', dependency_interface_basename))
  
      def update_attributes(attributes, extras):
          for key, value in extras.items():
              if key not in attributes:
                  attributes[key] = value
  
      for attribute in dependency_interface.attributes:
          update_attributes(attribute.extended_attributes, merged_extended_attributes)
      for constant in dependency_interface.constants:
          update_attributes(constant.extended_attributes, merged_extended_attributes)
      for operation in dependency_interface.operations:
          update_attributes(operation.extended_attributes, merged_extended_attributes)
function_tokens: def transfer_extended_attributes ( dependency_interface , dependency_interface_basename ) : merged_extended_attributes = dict ( ( key , value ) for key , value in dependency_interface . extended_attributes . iteritems ( ) if key in DEPENDENCY_EXTENDED_ATTRIBUTES ) # A partial interface's members are implemented as static member functions # in a separate C++ class. This class name is stored in # [PartialInterfaceImplementedAs] which defaults to the basename of # dependency IDL file. # This class name can be overridden by [ImplementedAs] on the partial # interface definition. # # Note that implemented interfaces do *not* need [ImplementedAs], since # they are implemented on the C++ object |impl| itself, just like members of # the main interface definition, so the bindings do not need to know in # which class implemented interfaces are implemented. # # Currently [LegacyTreatAsPartialInterface] can be used to have partial # interface behavior on implemented interfaces, but this is being removed # as legacy cruft: # FIXME: Remove [LegacyTreatAsPartialInterface] # http://crbug.com/360435 # # Note that [ImplementedAs] is used with different meanings on interfaces # and members: # for Blink class name and function name (or constant name), respectively. # Thus we do not want to copy this from the interface to the member, but # instead extract it and handle it separately. if ( dependency_interface . is_partial or 'LegacyTreatAsPartialInterface' in dependency_interface . extended_attributes ) : merged_extended_attributes [ 'PartialInterfaceImplementedAs' ] = ( dependency_interface . extended_attributes . get ( 'ImplementedAs' , dependency_interface_basename ) ) def update_attributes ( attributes , extras ) : for key , value in extras . items ( ) : if key not in attributes : attributes [ key ] = value for attribute in dependency_interface . attributes : update_attributes ( attribute . extended_attributes , merged_extended_attributes ) for constant in dependency_interface . constants : update_attributes ( constant . extended_attributes , merged_extended_attributes ) for operation in dependency_interface . operations : update_attributes ( operation . extended_attributes , merged_extended_attributes )