Make GeckoEmbed functions more Java-like. Don't reflect NS_NewArray. Provide generic impl of QI.
git-svn-id: svn://10.0.0.236/trunk@163854 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -70,6 +70,17 @@ public final class XPCOM {
|
||||
|
||||
/* Utility functions */
|
||||
|
||||
// Generic QueryInterface implementation
|
||||
public static nsISupports queryInterface(nsISupports aObject, String aIID)
|
||||
{
|
||||
Class[] interfaces = aObject.getClass().getInterfaces();
|
||||
for (int i = 0; i < interfaces.length; i++ ) {
|
||||
if (aIID.equals(XPCOM.getInterfaceIID(interfaces[i])))
|
||||
return aObject;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Given an interface, this will construct the name of the IID field (such as
|
||||
// NS_ISUPPORTS_IID) and return its value.
|
||||
public static String getInterfaceIID(Class aInterface)
|
||||
|
||||
Reference in New Issue
Block a user