зеркало из https://github.com/mozilla/gecko-dev.git
Bug 983264. Include callback headers in UnionTypes.h when a callback is used in a union. r=mccr8
This commit is contained in:
Родитель
0b309b77ef
Коммит
54faddbaf7
|
@ -912,8 +912,14 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
|
|||
typeDesc = p.getDescriptor(f.inner.identifier.name)
|
||||
except NoSuchDescriptorError:
|
||||
continue
|
||||
declarations.add((typeDesc.nativeType, False))
|
||||
implheaders.add(typeDesc.headerFile)
|
||||
if typeDesc.interface.isCallback():
|
||||
# Callback interfaces always use strong refs, so
|
||||
# we need to include the right header to be able
|
||||
# to Release() in our inlined code.
|
||||
headers.add(typeDesc.headerFile)
|
||||
else:
|
||||
declarations.add((typeDesc.nativeType, False))
|
||||
implheaders.add(typeDesc.headerFile)
|
||||
elif f.isDictionary():
|
||||
# For a dictionary, we need to see its declaration in
|
||||
# UnionTypes.h so we have its sizeof and know how big to
|
||||
|
@ -926,6 +932,11 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
|
|||
# Need to see the actual definition of the enum,
|
||||
# unfortunately.
|
||||
headers.add(CGHeaders.getDeclarationFilename(f.inner))
|
||||
elif f.isCallback():
|
||||
# Callbacks always use strong refs, so we need to include
|
||||
# the right header to be able to Release() in our inlined
|
||||
# code.
|
||||
headers.add(CGHeaders.getDeclarationFilename(f))
|
||||
|
||||
map(addInfoForType, getAllTypes(descriptors, dictionaries, callbacks))
|
||||
|
||||
|
|
|
@ -524,6 +524,7 @@ public:
|
|||
void PassUnion12(const EventInitOrLong& arg);
|
||||
void PassUnion13(JSContext*, const ObjectOrLongOrNull& arg);
|
||||
void PassUnion14(JSContext*, const ObjectOrLongOrNull& arg);
|
||||
void PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg);
|
||||
#endif
|
||||
void PassNullableUnion(JSContext*, const Nullable<ObjectOrLong>&);
|
||||
void PassOptionalUnion(JSContext*, const Optional<ObjectOrLong>&);
|
||||
|
|
|
@ -475,6 +475,7 @@ interface TestInterface {
|
|||
void passUnion12(optional (EventInit or long) arg = 5);
|
||||
void passUnion13(optional (object or long?) arg = null);
|
||||
void passUnion14(optional (object or long?) arg = 5);
|
||||
void passUnionWithCallback((EventHandler or long) arg);
|
||||
#endif
|
||||
void passUnionWithNullable((object? or long) arg);
|
||||
void passNullableUnion((object or long)? arg);
|
||||
|
|
|
@ -368,6 +368,7 @@ interface TestExampleInterface {
|
|||
void passUnion12(optional (EventInit or long) arg = 5);
|
||||
void passUnion13(optional (object or long?) arg = null);
|
||||
void passUnion14(optional (object or long?) arg = 5);
|
||||
void passUnionWithCallback((EventHandler or long) arg);
|
||||
#endif
|
||||
void passUnionWithNullable((object? or long) arg);
|
||||
void passNullableUnion((object or long)? arg);
|
||||
|
|
|
@ -389,6 +389,7 @@ interface TestJSImplInterface {
|
|||
void passUnion12(optional (EventInit or long) arg = 5);
|
||||
void passUnion13(optional (object or long?) arg = null);
|
||||
void passUnion14(optional (object or long?) arg = 5);
|
||||
void passUnionWithCallback((EventHandler or long) arg);
|
||||
#endif
|
||||
void passUnionWithNullable((object? or long) arg);
|
||||
void passNullableUnion((object or long)? arg);
|
||||
|
|
Загрузка…
Ссылка в новой задаче