mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Bug 1096328 - Remove nativeOwnership from Bindings.conf, change a python check for a refcounted type to a static_assert. r=bz.
--HG-- extra : rebase_source : 3b9396921576b07ae3e6403ecb562502d75e5f16
This commit is contained in:
parent
cff93906c9
commit
6bf82f2628
@ -4681,12 +4681,6 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
||||
isMember or
|
||||
isCallbackReturnValue)
|
||||
|
||||
if forceOwningType and descriptor.nativeOwnership == 'owned':
|
||||
raise TypeError("Interface %s has 'owned' nativeOwnership, so we "
|
||||
"don't know how to keep it alive in %s" %
|
||||
(descriptor.interface.identifier.name,
|
||||
sourceDescription))
|
||||
|
||||
typeName = descriptor.nativeType
|
||||
typePtr = typeName + "*"
|
||||
|
||||
@ -4710,6 +4704,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
||||
declType = "NonNull<" + typeName + ">"
|
||||
|
||||
templateBody = ""
|
||||
if forceOwningType:
|
||||
templateBody += 'static_assert(IsRefcounted<%s>::value, "We can only store refcounted classes.");' % typeName
|
||||
if not descriptor.skipGen and not descriptor.interface.isConsequential() and not descriptor.interface.isExternal():
|
||||
if failureCode is not None:
|
||||
templateBody += str(CastableObjectUnwrapper(
|
||||
|
Loading…
x
Reference in New Issue
Block a user