mojo/public/tools/bindings/generators/mojom_cpp_generator.py
def _IsFullHeaderRequiredForImport(self, imported_module):
    """Determines whether a given import module requires a full header include,
    or if the forward header is sufficient."""

    # Type-mapped kinds may not have forward declarations, and nested kinds
    # cannot be forward declared.
    if any(kind.module == imported_module and (
        (self._IsTypemappedKind(kind) and not self.
         _GetTypemappedForwardDeclaration(kind)) or kind.parent_kind != None)
           for kind in self.module.imported_kinds.values()):
      return True

    # For most kinds, whether or not a full definition is needed depends on how
    # the kind is used.
    for kind in self.module.structs + self.module.unions:
      for field in kind.fields:

        # Peel array kinds.
        kind = field.kind
        while mojom.IsArrayKind(kind):
          kind = kind.kind

        if kind.module == imported_module:
          # Need full def for struct/union fields, even when not inlined.
          if mojom.IsStructKind(kind) or mojom.IsUnionKind(kind):
            return True

    for kind in self.module.kinds.values():
      if mojom.IsMapKind(kind):
        if kind.key_kind.module == imported_module:
          # Map keys need the full definition.
          return True
        if self.for_blink and kind.value_kind.module == imported_module:
          # For Blink, map values need the full definition for tracing.
          return True

    for constant in self.module.constants:
      # Constants referencing enums need the full definition.
      if mojom.IsEnumKind(
          constant.kind) and constant.value.module == imported_module:
        return True

    return False
Determines whether a given import module requires a full header include,
    or if the forward header is sufficient.
Determines whether a given import module requires a full header include,
or if the forward header is sufficient.
Determines whether a given import module requires a full header include or if the forward header is sufficient .
def _IsFullHeaderRequiredForImport(self, imported_module):
    if any(kind.module == imported_module and (
        (self._IsTypemappedKind(kind) and not self.
         _GetTypemappedForwardDeclaration(kind)) or kind.parent_kind != None)
           for kind in self.module.imported_kinds.values()):
      return True
    for kind in self.module.structs + self.module.unions:
      for field in kind.fields:
        kind = field.kind
        while mojom.IsArrayKind(kind):
          kind = kind.kind
        if kind.module == imported_module:
          if mojom.IsStructKind(kind) or mojom.IsUnionKind(kind):
            return True
    for kind in self.module.kinds.values():
      if mojom.IsMapKind(kind):
        if kind.key_kind.module == imported_module:
          return True
        if self.for_blink and kind.value_kind.module == imported_module:
          return True
    for constant in self.module.constants:
      if mojom.IsEnumKind(
          constant.kind) and constant.value.module == imported_module:
        return True
    return False
def _IsFullHeaderRequiredForImport ( self , imported_module ) : if any ( kind . module == imported_module and ( ( self . _IsTypemappedKind ( kind ) and not self . _GetTypemappedForwardDeclaration ( kind ) ) or kind . parent_kind != None ) for kind in self . module . imported_kinds . values ( ) ) : return True for kind in self . module . structs + self . module . unions : for field in kind . fields : kind = field . kind while mojom . IsArrayKind ( kind ) : kind = kind . kind if kind . module == imported_module : if mojom . IsStructKind ( kind ) or mojom . IsUnionKind ( kind ) : return True for kind in self . module . kinds . values ( ) : if mojom . IsMapKind ( kind ) : if kind . key_kind . module == imported_module : return True if self . for_blink and kind . value_kind . module == imported_module : return True for constant in self . module . constants : if mojom . IsEnumKind ( constant . kind ) and constant . value . module == imported_module : return True return False
Determines whether a given import module requires a full header include,
or if the forward header is sufficient.
Determines whether a given import module requires a full header include or if the forward header is sufficient .
"""Determines whether a given import module requires a full header include,
    or if the forward header is sufficient.""" # Type-mapped kinds may not have forward declarations, and nested kinds # cannot be forward declared. # For most kinds, whether or not a full definition is needed depends on how # the kind is used. # Peel array kinds. # Need full def for struct/union fields, even when not inlined. # Map keys need the full definition. # For Blink, map values need the full definition for tracing. # Constants referencing enums need the full definition.
self
imported_module