mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 865785 part 1. Go back to passing a JSContext* to the constructors for JS-implemented interfaces. r=mccr8
This commit is contained in:
parent
01dccf283c
commit
4061685759
@ -4051,9 +4051,11 @@ def isResultAlreadyAddRefed(descriptor, extendedAttributes):
|
||||
# Default to already_AddRefed on the main thread, raw pointer in workers
|
||||
return not descriptor.workers and not 'resultNotAddRefed' in extendedAttributes
|
||||
|
||||
def needCx(returnType, arguments, extendedAttributes, descriptorProvider):
|
||||
return (typeNeedsCx(returnType, descriptorProvider, True) or
|
||||
any(typeNeedsCx(a.type, descriptorProvider) for a in arguments) or
|
||||
def needCx(returnType, arguments, extendedAttributes, descriptorProvider,
|
||||
considerTypes):
|
||||
return (considerTypes and
|
||||
(typeNeedsCx(returnType, descriptorProvider, True) or
|
||||
any(typeNeedsCx(a.type, descriptorProvider) for a in arguments)) or
|
||||
'implicitJSContext' in extendedAttributes)
|
||||
|
||||
class CGCallGenerator(CGThing):
|
||||
@ -4294,9 +4296,11 @@ if (global.Failed()) {
|
||||
""" % globalObjectType))
|
||||
argsPre.append("global")
|
||||
|
||||
needsCx = (not descriptor.interface.isJSImplemented() and
|
||||
needCx(returnType, arguments, self.extendedAttributes,
|
||||
descriptor))
|
||||
# For JS-implemented interfaces we do not want to base the
|
||||
# needsCx decision on the types involved, just on our extended
|
||||
# attributes.
|
||||
needsCx = needCx(returnType, arguments, self.extendedAttributes,
|
||||
descriptor, not descriptor.interface.isJSImplemented())
|
||||
if needsCx and not (static and descriptor.workers):
|
||||
argsPre.append("cx")
|
||||
|
||||
@ -7967,7 +7971,11 @@ class CGNativeMember(ClassMethod):
|
||||
jsObjectsArePtr=False, variadicIsSequence=False):
|
||||
"""
|
||||
If jsObjectsArePtr is true, typed arrays and "object" will be
|
||||
passed as JSObject*
|
||||
passed as JSObject*.
|
||||
|
||||
If passCxAsNeeded is false, we don't automatically pass in a
|
||||
JSContext* based on the return and argument types. We can
|
||||
still pass it based on 'implicitJSContext' annotations.
|
||||
"""
|
||||
self.descriptor = descriptor
|
||||
self.member = member
|
||||
@ -8144,9 +8152,8 @@ class CGNativeMember(ClassMethod):
|
||||
assert self.member.isIdentifierLess()
|
||||
args.insert(0, Argument("JS::Value", "aThisVal"))
|
||||
# And jscontext bits.
|
||||
if (self.passCxAsNeeded and
|
||||
needCx(returnType, argList, self.extendedAttrs,
|
||||
self.descriptor)):
|
||||
if needCx(returnType, argList, self.extendedAttrs,
|
||||
self.descriptor, self.passCxAsNeeded):
|
||||
args.insert(0, Argument("JSContext*", "cx"))
|
||||
# And if we're static, a global
|
||||
if self.member.isStatic():
|
||||
|
Loading…
Reference in New Issue
Block a user