From 02816bb7c8176b072c1cce4df9e5932eee581ad2 Mon Sep 17 00:00:00 2001 From: "edburns%acm.org" Date: Sat, 22 Dec 2007 01:40:58 +0000 Subject: [PATCH] A src/nsIPluglet.idl M classes/org/mozilla/pluglet/Registry.java M dist/build.xml M examples/simple/src/main/java/simple/SimplePluglet.java M examples/simple/src/main/web/index.html M mozilla/Makefile.in M mozilla/nppluglet.cpp M mozilla/nppluglet.h M mozilla/nsScriptablePeer.cpp M netbeans/nbproject/build-impl.xml M netbeans/nbproject/genfiles.properties M netbeans/nbproject/project.properties M netbeans/nbproject/project.xml M src/Makefile.in M src/Pluglet.cpp M src/Pluglet.h M src/PlugletEngine.cpp M src/PlugletFactory.cpp M src/Registry.cpp M src/Registry.h R mozilla/nsIPluglet.idl - At this point, I can call from JavaScript and locate an arbitratily named method on the Pluglet instance that conforms to the signature of returning String, and taking 0 or more Strings as arguments. git-svn-id: svn://10.0.0.236/trunk@242001 18797224-902f-48f8-a5cc-f745e15eee43 --- .../classes/org/mozilla/pluglet/Registry.java | 62 ++++++++++++++++ mozilla/java/plugins/dist/build.xml | 4 +- .../src/main/java/simple/SimplePluglet.java | 5 ++ .../examples/simple/src/main/web/index.html | 4 +- mozilla/java/plugins/mozilla/Makefile.in | 2 - mozilla/java/plugins/mozilla/nppluglet.cpp | 10 +++ mozilla/java/plugins/mozilla/nppluglet.h | 1 + .../java/plugins/mozilla/nsScriptablePeer.cpp | 18 +---- .../plugins/netbeans/nbproject/build-impl.xml | 55 ++++---------- .../netbeans/nbproject/genfiles.properties | 6 +- .../netbeans/nbproject/project.properties | 7 +- .../plugins/netbeans/nbproject/project.xml | 2 +- mozilla/java/plugins/src/Makefile.in | 9 ++- mozilla/java/plugins/src/Pluglet.cpp | 33 ++++++++- mozilla/java/plugins/src/Pluglet.h | 4 +- mozilla/java/plugins/src/PlugletEngine.cpp | 2 +- mozilla/java/plugins/src/PlugletFactory.cpp | 2 +- mozilla/java/plugins/src/Registry.cpp | 74 +++++++++++++++++++ mozilla/java/plugins/src/Registry.h | 3 + .../plugins/{mozilla => src}/nsIPluglet.idl | 1 - 20 files changed, 226 insertions(+), 78 deletions(-) rename mozilla/java/plugins/{mozilla => src}/nsIPluglet.idl (97%) diff --git a/mozilla/java/plugins/classes/org/mozilla/pluglet/Registry.java b/mozilla/java/plugins/classes/org/mozilla/pluglet/Registry.java index 4db0f818ca8..ac80db0a3c3 100644 --- a/mozilla/java/plugins/classes/org/mozilla/pluglet/Registry.java +++ b/mozilla/java/plugins/classes/org/mozilla/pluglet/Registry.java @@ -20,6 +20,7 @@ */ package org.mozilla.pluglet; +import java.lang.reflect.Method; import java.util.*; public class Registry { @@ -46,5 +47,66 @@ public class Registry { table.remove(key); } } + + public static String findMatchingPlugletMethod(Pluglet pluglet, + String methodName, int numStringArgs) { + String result = null; + Class plugletClass = pluglet.getClass(); + Method [] methods = plugletClass.getMethods(); + boolean foundMatch = false; + Method matchingMethod = null; + // For each of the methods on the Pluglet + for (Method cur : methods) { + if (foundMatch) { + break; + } + // See if the name of the method matches the name we + // are looking for. + if (cur.getName().equals(methodName)) { + // If so, does it return String? + if (String.class == cur.getReturnType()) { + // If so, do the number of arguments match? + Class [] paramTypes = cur.getParameterTypes(); + if (numStringArgs == paramTypes.length) { + foundMatch = true; + matchingMethod = cur; + // If so, are all the arguments of type String? + for (Class curClass : paramTypes) { + if (String.class != curClass) { + // If not, this method is not a match. + foundMatch = false; + matchingMethod = null; + break; + } + } + } + // No, the number of arguments do not match, not a match + else { + foundMatch = false; + } + } + // No, it does not return String, not a match. + else { + foundMatch = false; + } + } + // No, the name does not match, not a match + else { + foundMatch = false; + } + } + + if (foundMatch) { + StringBuilder signature = new StringBuilder(); + signature.append('('); + for (int i = 0; i < numStringArgs; i++) { + signature.append("Ljava/lang/String;"); + } + signature.append(")Ljava/lang/String;"); + result = signature.toString(); + } + + return result; + } } diff --git a/mozilla/java/plugins/dist/build.xml b/mozilla/java/plugins/dist/build.xml index 45f7f929b0c..ec30b1a9c75 100644 --- a/mozilla/java/plugins/dist/build.xml +++ b/mozilla/java/plugins/dist/build.xml @@ -269,15 +269,13 @@ - - + diff --git a/mozilla/java/plugins/examples/simple/src/main/java/simple/SimplePluglet.java b/mozilla/java/plugins/examples/simple/src/main/java/simple/SimplePluglet.java index 8ec79234787..c5105f95102 100755 --- a/mozilla/java/plugins/examples/simple/src/main/java/simple/SimplePluglet.java +++ b/mozilla/java/plugins/examples/simple/src/main/java/simple/SimplePluglet.java @@ -192,6 +192,11 @@ class SimplePlugletInstance implements Pluglet { protected void finalize() { org.mozilla.util.DebugPluglet.print("--SimplePlugletInstance.finalize()\n"); } + + public String calledFromJavaScript1(String arg1, String arg2) { + org.mozilla.util.DebugPluglet.print("calledFromJavaScript1\n"); + return "hard coded result"; + } } class TestStreamListener implements PlugletStreamListener { diff --git a/mozilla/java/plugins/examples/simple/src/main/web/index.html b/mozilla/java/plugins/examples/simple/src/main/web/index.html index b8c3b2bdc6e..e7ffbefc626 100755 --- a/mozilla/java/plugins/examples/simple/src/main/web/index.html +++ b/mozilla/java/plugins/examples/simple/src/main/web/index.html @@ -10,14 +10,14 @@ var embed = document.embeds[0]; function callPluglet() { var strs2 = { - value : ["double","me","please"] + value : ["double","me"] }; var strslen2 = { value : strs2.value.length }; - embed.callPlugletMethod("methodName", strslen2, strs2); + embed.callPlugletMethod("calledFromJavaScript1", strslen2, strs2); } diff --git a/mozilla/java/plugins/mozilla/Makefile.in b/mozilla/java/plugins/mozilla/Makefile.in index 90645dc1450..3810239ec0a 100644 --- a/mozilla/java/plugins/mozilla/Makefile.in +++ b/mozilla/java/plugins/mozilla/Makefile.in @@ -60,8 +60,6 @@ CPPSRCS = nsScriptablePeer.cpp \ npAPInsIInputStreamShim.cpp \ $(NULL) -XPIDLSRCS = nsIPluglet.idl - SHARED_LIBRARY_LIBS = $(PLUGIN_SDK_OBJDIR)/samples/common/$(LIB_PREFIX)plugingate_s.$(LIB_SUFFIX) ../src/$(LIB_PREFIX)pluglet.$(LIB_SUFFIX) $(XPCOM_LIBS) $(NSPR_LIBS) ifeq ($(OS_ARCH),WINNT) diff --git a/mozilla/java/plugins/mozilla/nppluglet.cpp b/mozilla/java/plugins/mozilla/nppluglet.cpp index f8eae0ec25d..f2f27f2d009 100644 --- a/mozilla/java/plugins/mozilla/nppluglet.cpp +++ b/mozilla/java/plugins/mozilla/nppluglet.cpp @@ -376,6 +376,16 @@ NS_IMETHODIMP nsPluginInstance::HasPlugletForMimeType(const char *aMimeType, return rv; } +NS_IMETHODIMP nsPluginInstance::CallPlugletMethod(const char *methodName, PRUint32 *inArgc, + char ***inArgv) +{ + nsresult rv = NS_OK; + nsCOMPtr pluglet = do_QueryInterface(mPluglet); + if (pluglet) { + rv = pluglet->CallPlugletMethod(methodName, inArgc, inArgv); + } + return rv; +} nsresult nsPluginInstance::CopyNPWindowToNsPluginWindow(NPWindow *aWindow, nsPluginWindow *pluginWindow) diff --git a/mozilla/java/plugins/mozilla/nppluglet.h b/mozilla/java/plugins/mozilla/nppluglet.h index 5360a7edbab..17dd9ed52f7 100644 --- a/mozilla/java/plugins/mozilla/nppluglet.h +++ b/mozilla/java/plugins/mozilla/nppluglet.h @@ -72,6 +72,7 @@ public: // locals NS_IMETHOD HasPlugletForMimeType(const char *aMimeType, PRBool *outResult); + NS_IMETHOD CallPlugletMethod(const char *methodName, PRUint32 *inArgc, char ***inArgv); nsScriptablePeer* getScriptablePeer(); diff --git a/mozilla/java/plugins/mozilla/nsScriptablePeer.cpp b/mozilla/java/plugins/mozilla/nsScriptablePeer.cpp index 5de7a104f40..a259981a1ab 100644 --- a/mozilla/java/plugins/mozilla/nsScriptablePeer.cpp +++ b/mozilla/java/plugins/mozilla/nsScriptablePeer.cpp @@ -122,23 +122,13 @@ void nsScriptablePeer::SetInstance(nsPluginInstance* plugin) // return NS_OK; //} -NS_IMETHODIMP nsScriptablePeer::HasPlugletForMimeType(const char *aMimeType, PRBool *isSupported) -{ - nsresult rv = NS_ERROR_FAILURE; - if (mPlugin) { - rv = mPlugin->HasPlugletForMimeType(aMimeType, isSupported); - } - return rv; - -} - NS_IMETHODIMP nsScriptablePeer::CallPlugletMethod(const char *methodName, PRUint32 *inArgc, char ***inArgv) { - nsresult rv = NS_OK; - PR_LOG(log, PR_LOG_DEBUG, - ("nppluglet CallPlugletMethod: methodName: %s\n", methodName)); - *inArgc = 0; + nsresult rv = NS_ERROR_FAILURE; + if (mPlugin) { + rv = mPlugin->CallPlugletMethod(methodName, inArgc, inArgv); + } return rv; } diff --git a/mozilla/java/plugins/netbeans/nbproject/build-impl.xml b/mozilla/java/plugins/netbeans/nbproject/build-impl.xml index 3f886f147d4..dae59304f2f 100755 --- a/mozilla/java/plugins/netbeans/nbproject/build-impl.xml +++ b/mozilla/java/plugins/netbeans/nbproject/build-impl.xml @@ -44,36 +44,6 @@ is divided into following sections: - - - - - - - - - - - - - - - - - - - - - - - - - - Must set platform.home - Must set platform.bootcp - Must set platform.java - Must set platform.javac - Platform is not correctly set up @@ -95,6 +65,7 @@ is divided into following sections: + @@ -125,6 +96,7 @@ is divided into following sections: + Must set src.classes.dir Must set src.EmptyMainClass.dir Must set src.java.dir Must set src.java2.dir @@ -148,13 +120,13 @@ is divided into following sections: - + - + @@ -168,7 +140,7 @@ is divided into following sections: - + @@ -194,9 +166,6 @@ is divided into following sections: - - - @@ -215,7 +184,7 @@ is divided into following sections: - + @@ -238,7 +207,7 @@ is divided into following sections: - + @@ -276,6 +245,7 @@ is divided into following sections: + @@ -335,7 +305,7 @@ is divided into following sections: - ${platform.java} -cp "${run.classpath.with.dist.jar}" ${main.class} + java -cp "${run.classpath.with.dist.jar}" ${main.class} @@ -360,7 +330,7 @@ is divided into following sections: To run this application from the command line without Ant, try: - ${platform.java} -jar "${dist.jar.resolved}" + java -jar "${dist.jar.resolved}" @@ -423,18 +393,21 @@ is divided into following sections: --> - + + + + diff --git a/mozilla/java/plugins/netbeans/nbproject/genfiles.properties b/mozilla/java/plugins/netbeans/nbproject/genfiles.properties index ae114ba4d0a..6779221e338 100755 --- a/mozilla/java/plugins/netbeans/nbproject/genfiles.properties +++ b/mozilla/java/plugins/netbeans/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=4cc13411 build.xml.stylesheet.CRC32=240b97a2 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=c09404ce -nbproject/build-impl.xml.script.CRC32=d63e7ed7 -nbproject/build-impl.xml.stylesheet.CRC32=20b9345e +nbproject/build-impl.xml.data.CRC32=ea24ec3b +nbproject/build-impl.xml.script.CRC32=dd66d43e +nbproject/build-impl.xml.stylesheet.CRC32=65d7ca21 diff --git a/mozilla/java/plugins/netbeans/nbproject/project.properties b/mozilla/java/plugins/netbeans/nbproject/project.properties index ba8acad7dc2..1d7e9e0ac6e 100755 --- a/mozilla/java/plugins/netbeans/nbproject/project.properties +++ b/mozilla/java/plugins/netbeans/nbproject/project.properties @@ -20,10 +20,10 @@ file.reference.examples-EmptyMainClass=../examples/EmptyMainClass file.reference.main-java=../examples/simple/src/main/java file.reference.main-java-1=../examples/jmf-player/src/main/java file.reference.main-java-2=../examples/jmfplayer/src/main/java +file.reference.plugins-classes=../classes jar.compress=false javac.classpath=\ - ${libs.JMF.classpath}:\ - ${file.reference.pluglet-1_1_a2.jar} + ${libs.JMF.classpath} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -47,7 +47,7 @@ javadoc.windowtitle= main.class=EmptyMainClass manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF -platform.active=Java_HotSpot_TM__Client_VM_1.5.0_11-b03 +platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} @@ -58,6 +58,7 @@ run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} +src.classes.dir=${file.reference.plugins-classes} src.EmptyMainClass.dir=${file.reference.examples-EmptyMainClass} src.java.dir=${file.reference.main-java} src.java2.dir=${file.reference.main-java-2} diff --git a/mozilla/java/plugins/netbeans/nbproject/project.xml b/mozilla/java/plugins/netbeans/nbproject/project.xml index 4950959195f..75795b0e7be 100755 --- a/mozilla/java/plugins/netbeans/nbproject/project.xml +++ b/mozilla/java/plugins/netbeans/nbproject/project.xml @@ -5,8 +5,8 @@ pluglet 1.6.5 - + diff --git a/mozilla/java/plugins/src/Makefile.in b/mozilla/java/plugins/src/Makefile.in index 840cc51ac2c..b0508998130 100644 --- a/mozilla/java/plugins/src/Makefile.in +++ b/mozilla/java/plugins/src/Makefile.in @@ -34,17 +34,17 @@ IS_COMPONENT = 1 ifeq ($(OS_ARCH),Linux) INCLUDES := -I$(MOZ_JDKHOME)/include -I$(MOZ_JDKHOME)/include/linux $(INCLUDES) \ - -I$(DEPTH)/widget/src/gtk -I../src_share + -I$(DEPTH)/widget/src/gtk else ifeq ($(OS_ARCH),WINNT) INCLUDES := -I$(MOZ_JDKHOME)/include -I$(MOZ_JDKHOME)/include/win32 $(INCLUDES) \ - -I../src_share -I. + -I -I. else ifeq ($(OS_ARCH),Darwin) -INCLUDES := -I$(MOZ_JDKHOME)/include $(INCLUDES) -I../src_share -I. +INCLUDES := -I$(MOZ_JDKHOME)/include $(INCLUDES) -I. else INCLUDES := -I$(MOZ_JDKHOME)/include -I$(MOZ_JDKHOME)/include/solaris $(INCLUDES) \ - -I$(DEPTH)/widget/src/gtk -I../src_share + -I$(DEPTH)/widget/src/gtk endif endif endif @@ -81,6 +81,7 @@ endif endif XPIDLSRCS = \ + nsIPluglet.idl \ iPlugletEngine.idl \ iPlugletManager.idl \ $(NULL) diff --git a/mozilla/java/plugins/src/Pluglet.cpp b/mozilla/java/plugins/src/Pluglet.cpp index 729d4f4d4e8..33072c1b417 100644 --- a/mozilla/java/plugins/src/Pluglet.cpp +++ b/mozilla/java/plugins/src/Pluglet.cpp @@ -40,7 +40,10 @@ jmethodID Pluglet::printMID = NULL; static NS_DEFINE_IID(kIPluginInstanceIID, NS_IPLUGININSTANCE_IID); -NS_IMPL_ISUPPORTS1(Pluglet,nsIPluginInstance); +NS_IMPL_ISUPPORTS2(Pluglet, + nsIPluginInstance, + nsIPluglet) + Pluglet::Pluglet(jobject object) : peer(nsnull) { nsresult rv; @@ -299,6 +302,34 @@ NS_METHOD Pluglet::Print(nsPluginPrint* platformPrint) { return NS_OK; } +NS_IMETHODIMP Pluglet::CallPlugletMethod(const char *methodName, PRUint32 *inArgc, + char ***inArgv) +{ + nsresult rv = NS_OK; + + if (NULL != methodName && 0 < strlen(methodName) && NULL != inArgc && NULL != inArgv) { + PR_LOG(PlugletLog::log, PR_LOG_DEBUG, + ("Pluglet::CallPlugletMethod: methodName: %s\n", methodName)); + + jmethodID plugletMethodMID = Registry::GetMethodIDForPlugletMethod(jthis, methodName, + (jint) *inArgc); + if (NULL != plugletMethodMID) { + PR_LOG(PlugletLog::log, PR_LOG_DEBUG, + ("Pluglet::CallPlugletMethod: found match for methodName: %s\n", methodName)); + } + else { + PR_LOG(PlugletLog::log, PR_LOG_DEBUG, + ("Pluglet::CallPlugletMethod: no match for methodName: %s\n", methodName)); + } + } + else { + PR_LOG(PlugletLog::log, PR_LOG_DEBUG, + ("Pluglet::CallPlugletMethod: invalid arguments\n")); + + } + + return NS_OK; +} diff --git a/mozilla/java/plugins/src/Pluglet.h b/mozilla/java/plugins/src/Pluglet.h index bfc8f7336c0..01c1055d26a 100644 --- a/mozilla/java/plugins/src/Pluglet.h +++ b/mozilla/java/plugins/src/Pluglet.h @@ -23,10 +23,11 @@ #include "nsplugin.h" #include "jni.h" #include "PlugletView.h" +#include "nsIPluglet.h" class iPlugletEngine; -class Pluglet : public nsIPluginInstance { +class Pluglet : public nsIPluginInstance, public nsIPluglet { public: NS_IMETHOD HandleEvent(nsPluginEvent* event, PRBool* handled); NS_IMETHOD Initialize(nsIPluginInstancePeer* peer); @@ -38,6 +39,7 @@ class Pluglet : public nsIPluginInstance { NS_IMETHOD SetWindow(nsPluginWindow* window); NS_IMETHOD Print(nsPluginPrint* platformPrint); NS_IMETHOD GetValue(nsPluginInstanceVariable variable, void *value); + NS_DECL_NSIPLUGLET NS_DECL_ISUPPORTS Pluglet(jobject object); diff --git a/mozilla/java/plugins/src/PlugletEngine.cpp b/mozilla/java/plugins/src/PlugletEngine.cpp index d8a9e8cf358..9bc1d56cb81 100644 --- a/mozilla/java/plugins/src/PlugletEngine.cpp +++ b/mozilla/java/plugins/src/PlugletEngine.cpp @@ -202,7 +202,7 @@ void PlugletEngine::StartJVM() { options[3].optionString=""; //-Djava.compiler=NONE"; vm_args.version = JNI_VERSION_1_4; vm_args.options = options; - vm_args.nOptions = 1; // EDBURNS: Change to 3 for debugging + vm_args.nOptions = 1; // EDBURNS: Change to 3 for debugging, 1 for non-debuging vm_args.ignoreUnrecognized = JNI_FALSE; /* Create the Java VM */ PR_LOG(PlugletLog::log, PR_LOG_DEBUG, diff --git a/mozilla/java/plugins/src/PlugletFactory.cpp b/mozilla/java/plugins/src/PlugletFactory.cpp index e2819f8c18b..f3a27f8143e 100644 --- a/mozilla/java/plugins/src/PlugletFactory.cpp +++ b/mozilla/java/plugins/src/PlugletFactory.cpp @@ -62,7 +62,7 @@ nsresult PlugletFactory::CreatePluginInstance(const char* aPluginMIMEType, void if (!obj) { return NS_ERROR_FAILURE; } - nsISupports * instance = new Pluglet(obj); + Pluglet * instance = new Pluglet(obj); NS_ADDREF(instance); *aResult = instance; return NS_OK; diff --git a/mozilla/java/plugins/src/Registry.cpp b/mozilla/java/plugins/src/Registry.cpp index 25701463741..2222e18b8ea 100644 --- a/mozilla/java/plugins/src/Registry.cpp +++ b/mozilla/java/plugins/src/Registry.cpp @@ -28,6 +28,7 @@ jclass Registry::clazz = NULL; jmethodID Registry::setPeerMID = NULL; jmethodID Registry::removeMID = NULL; +jmethodID Registry::findMatchingPlugletMethodMID = NULL; void Registry::SetPeer(jobject key, jlong peer) { if (!clazz) { @@ -81,6 +82,71 @@ void Registry::Remove(jobject key) { } } +jmethodID Registry::GetMethodIDForPlugletMethod(jobject plugletInstance, const char *methodName, + jint numStringArgs) +{ + jmethodID result = NULL; + + if (!clazz) { // it is impossible + Initialize(); + if(!clazz) { + return result; + } + } + + if (NULL == methodName || 0 == strlen(methodName)) { + return result; + } + nsresult rv = NS_ERROR_FAILURE; + nsCOMPtr plugletEngine = + do_GetService(PLUGLETENGINE_ContractID, &rv);; + if (NS_FAILED(rv)) { + return result; + } + JNIEnv *env = nsnull; + rv = plugletEngine->GetJNIEnv(&env); + if (NS_FAILED(rv)) { + return result; + } + + env->ExceptionClear(); + + jstring methodNameJstr = env->NewStringUTF(methodName); + jstring methodSignatureJstr; + methodSignatureJstr = (jstring) + env->CallStaticObjectMethod(clazz, findMatchingPlugletMethodMID, + plugletInstance, methodNameJstr, numStringArgs); + if (env->ExceptionOccurred()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + return result; + } + + if (NULL != methodSignatureJstr) { + jboolean isCopy; + const char *signature = env->GetStringUTFChars(methodSignatureJstr, &isCopy); + + if (NULL != signature) { + jclass plugletClass = env->GetObjectClass(plugletInstance); + result = env->GetMethodID(plugletClass, methodName, signature); + if (isCopy == JNI_TRUE) { + env->ReleaseStringUTFChars(methodSignatureJstr, signature); + } + } + env->DeleteLocalRef(methodSignatureJstr); + } + + env->DeleteLocalRef(methodNameJstr); + + if (env->ExceptionOccurred()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } + + return result; +} + + void Registry::Initialize() { nsresult rv = NS_ERROR_FAILURE; nsCOMPtr plugletEngine = @@ -114,6 +180,14 @@ void Registry::Initialize() { clazz = NULL; return; } + findMatchingPlugletMethodMID = env->GetStaticMethodID(clazz,"findMatchingPlugletMethod","(Lorg/mozilla/pluglet/Pluglet;Ljava/lang/String;I)Ljava/lang/String;"); + if (!findMatchingPlugletMethodMID) { + env->ExceptionDescribe(); + clazz = NULL; + return; + } + + } diff --git a/mozilla/java/plugins/src/Registry.h b/mozilla/java/plugins/src/Registry.h index 40c6f26a804..8503091847a 100644 --- a/mozilla/java/plugins/src/Registry.h +++ b/mozilla/java/plugins/src/Registry.h @@ -25,11 +25,14 @@ class Registry { public: static void SetPeer(jobject key, jlong peer); static void Remove(jobject key); + static jmethodID GetMethodIDForPlugletMethod(jobject plugletInstance, const char *methodName, + jint numStringArgs); private: static void Initialize(); static jclass clazz; static jmethodID setPeerMID; static jmethodID removeMID; + static jmethodID findMatchingPlugletMethodMID; }; #endif /* __Registry_h__ */ diff --git a/mozilla/java/plugins/mozilla/nsIPluglet.idl b/mozilla/java/plugins/src/nsIPluglet.idl similarity index 97% rename from mozilla/java/plugins/mozilla/nsIPluglet.idl rename to mozilla/java/plugins/src/nsIPluglet.idl index 9515e74dbd6..56b19c0b111 100755 --- a/mozilla/java/plugins/mozilla/nsIPluglet.idl +++ b/mozilla/java/plugins/src/nsIPluglet.idl @@ -40,7 +40,6 @@ [scriptable, uuid(482e1890-1fe5-11d5-9cf8-0060b0fbd8ac)] interface nsIPluglet : nsISupports { - boolean hasPlugletForMimeType(in string aMimeType); void callPlugletMethod(in string methodName, inout PRUint32 inArgc, [array, size_is(inArgc)] inout string inArgv);