Codegen support multiple interfaces in single webidl file & WebGPU single webidl (#30448)

* Codegen support multiple interfaces in single webidl file

* Merge GPU*.webidl into WebGPU.webidl

* Update gpu files to use WebGPUBinding module file
This commit is contained in:
Samson 2023-09-30 14:30:12 +02:00 committed by GitHub
parent ebd41d4101
commit ddc47aa56b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 1267 additions and 1428 deletions

View file

@ -364,6 +364,17 @@ class Descriptor(DescriptorProvider):
config.maxProtoChainLength = max(config.maxProtoChainLength,
len(self.prototypeChain))
def maybeGetSuperModule(self):
"""
Returns name of super module if self is part of it
"""
filename = getIdlFileName(self.interface)
# if interface name is not same as webidl file
# webidl is super module for interface
if filename.lower() != self.interface.identifier.name.lower() and not self.interface.isIteratorInterface():
return filename
return None
def binaryNameFor(self, name):
return self._binaryNames.get(name, name)
@ -459,9 +470,12 @@ def MakeNativeName(name):
return name[0].upper() + name[1:]
def getIdlFileName(object):
return os.path.basename(object.location.filename()).split('.webidl')[0]
def getModuleFromObject(object):
return ('crate::dom::bindings::codegen::Bindings::'
+ os.path.basename(object.location.filename()).split('.webidl')[0] + 'Binding')
return ('crate::dom::bindings::codegen::Bindings::' + getIdlFileName(object) + 'Binding')
def getTypesFromDescriptor(descriptor):