зеркало из https://github.com/mozilla/gecko-dev.git
Bug 764456 part 1. Flag consequential interfaces in the WebIDL data model. r=khuey
This commit is contained in:
Родитель
4214241dca
Коммит
73dde405dc
|
@ -1564,11 +1564,11 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
elif descriptor.workers:
|
||||
templateBody += "${declName} = &${val}.toObject();"
|
||||
else:
|
||||
# External interface. We always have a holder for these,
|
||||
# because we don't actually know whether we have to addref
|
||||
# when unwrapping or not. So we just pass an
|
||||
# getter_AddRefs(nsRefPtr) to XPConnect and if we'll need
|
||||
# a release it'll put a non-null pointer in there.
|
||||
# Either external, or new-binding non-castable. We always have a
|
||||
# holder for these, because we don't actually know whether we have
|
||||
# to addref when unwrapping or not. So we just pass an
|
||||
# getter_AddRefs(nsRefPtr) to XPConnect and if we'll need a release
|
||||
# it'll put a non-null pointer in there.
|
||||
if forceOwningType:
|
||||
# Don't return a holderType in this case; our declName
|
||||
# will just own stuff.
|
||||
|
|
|
@ -351,6 +351,9 @@ class IDLExternalInterface(IDLObjectWithIdentifier):
|
|||
def isInterface(self):
|
||||
return True
|
||||
|
||||
def isConsequential(self):
|
||||
return False
|
||||
|
||||
def addExtendedAttributes(self, attrs):
|
||||
assert len(attrs) == 0
|
||||
|
||||
|
@ -368,6 +371,7 @@ class IDLInterface(IDLObjectWithScope):
|
|||
self._finished = False
|
||||
self.members = list(members) # clone the list
|
||||
self.implementedInterfaces = set()
|
||||
self._consequential = False
|
||||
|
||||
IDLObjectWithScope.__init__(self, location, parentScope, name)
|
||||
|
||||
|
@ -459,6 +463,8 @@ class IDLInterface(IDLObjectWithScope):
|
|||
for iface in sorted(self.getConsequentialInterfaces(),
|
||||
cmp=cmp,
|
||||
key=lambda x: x.identifier.name):
|
||||
# Flag the interface as being someone's consequential interface
|
||||
iface.setConsequential()
|
||||
additionalMembers = iface.originalMembers;
|
||||
for additionalMember in additionalMembers:
|
||||
for member in self.members:
|
||||
|
@ -507,6 +513,12 @@ class IDLInterface(IDLObjectWithScope):
|
|||
def isExternal(self):
|
||||
return False
|
||||
|
||||
def setConsequential(self):
|
||||
self._consequential = True
|
||||
|
||||
def isConsequential(self):
|
||||
return self._consequential
|
||||
|
||||
def setCallback(self, value):
|
||||
self._callback = value
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче