mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 829252 part 3. When wrapping things with an nsISupports in XPCWrappedJS for WebIDL callback interfaces, use the aggregated version. r=peterv
This commit is contained in:
parent
27b4736d69
commit
fe29b143cd
@ -1923,10 +1923,18 @@ if (!ccx.IsValid()) {
|
||||
${codeOnFailure}
|
||||
}
|
||||
|
||||
nsISupports* supp = nullptr;
|
||||
if (XPCConvert::GetISupportsFromJSObject(${source}, &supp)) {
|
||||
nsCOMPtr<nsIXPConnectWrappedNative> xpcwn = do_QueryInterface(supp);
|
||||
if (xpcwn) {
|
||||
supp = xpcwn->Native();
|
||||
}
|
||||
}
|
||||
|
||||
const nsIID& iid = NS_GET_IID(${nativeType});
|
||||
nsRefPtr<nsXPCWrappedJS> wrappedJS;
|
||||
rv = nsXPCWrappedJS::GetNewOrUsed(ccx, ${source}, iid,
|
||||
NULL, getter_AddRefs(wrappedJS));
|
||||
supp, getter_AddRefs(wrappedJS));
|
||||
if (NS_FAILED(rv) || !wrappedJS) {
|
||||
${codeOnFailure}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user