diff options
Diffstat (limited to 'plugin/icedteanp/IcedTeaScriptablePluginObject.h')
-rw-r--r-- | plugin/icedteanp/IcedTeaScriptablePluginObject.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/plugin/icedteanp/IcedTeaScriptablePluginObject.h b/plugin/icedteanp/IcedTeaScriptablePluginObject.h index 99e89c2..a02df53 100644 --- a/plugin/icedteanp/IcedTeaScriptablePluginObject.h +++ b/plugin/icedteanp/IcedTeaScriptablePluginObject.h @@ -145,20 +145,13 @@ class IcedTeaScriptableJavaObject: public NPObject private: NPP instance; bool is_object_array; - /* These may be empty if 'initialized' is false */ + /* These may be empty if 'is_applet_instance' is true + * and the object has not yet been used */ std::string class_id, instance_id; - bool initialized, initialization_failed; - - /* If we are uninitialized, make a Java request for the applet java class & instance ID for the plugin instance. - * Only objects representing an applet will begin uninitialized, to prevent blocking when the browser requests the object. - * Returns false on initialization error. */ - bool tryToInitializeIfApplet(); public: IcedTeaScriptableJavaObject(NPP instance) { this->instance = instance; - this->is_object_array = false; - this->initialized = false; - this->initialization_failed = false; + is_object_array = false; } static void deAllocate(NPObject *npobj) { delete (IcedTeaScriptableJavaObject*)npobj; @@ -173,12 +166,8 @@ public: return getClassID() + ":" + getInstanceID(); } static void invalidate(NPObject *npobj) { - IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*) npobj; - /* Nothing to do if we have not been initialized */ - if (!scriptable_object->initialized) { - return; - } IcedTeaPluginUtilities::removeInstanceID(npobj); + IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*) npobj; IcedTeaPluginUtilities::removeObjectMapping(scriptable_object->objectKey()); } static bool hasMethod(NPObject *npobj, NPIdentifier name_id); @@ -206,12 +195,15 @@ public: } static bool construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); - - static NPObjectRef get_scriptable_applet_object(NPP instance); - static NPObjectRef get_scriptable_java_object(NPP instance, + /* Creates and retains a scriptable java object (intended to be called asynch.) */ + static NPObject* get_scriptable_java_object(NPP instance, std::string class_id, std::string instance_id, bool isArray); }; +/* Creates and retains a scriptable java object (intended to be called asynch.) */ + +void _createAndRetainJavaObject(void* data); + #endif /* __ICEDTEASCRIPTABLEPLUGINOBJECT_H_ */ |