Bug 960694. Support writing out classes with JS implementations of classinfo. r=bsmedberg

--HG--
extra : rebase_source : 6eb91d99f710b366fc2ffab5defea0969834633f
This commit is contained in:
Johnny Stenback 2014-01-24 13:47:50 -08:00
parent f9b09db3f5
commit 72bc953afd

View File

@ -261,9 +261,21 @@ nsBinaryOutputStream::WriteCompoundObject(nsISupports* aObject,
return NS_ERROR_NOT_AVAILABLE;
nsCID cid;
classInfo->GetClassIDNoAlloc(&cid);
nsresult rv = classInfo->GetClassIDNoAlloc(&cid);
if (NS_SUCCEEDED(rv)) {
rv = WriteID(cid);
} else {
nsCID *cidptr = nullptr;
rv = classInfo->GetClassID(&cidptr);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = WriteID(*cidptr);
NS_Free(cidptr);
}
nsresult rv = WriteID(cid);
if (NS_WARN_IF(NS_FAILED(rv)))
return rv;