diff options
author | Deepak Bhole <[email protected]> | 2011-03-03 17:56:00 -0500 |
---|---|---|
committer | Deepak Bhole <[email protected]> | 2011-03-03 17:56:00 -0500 |
commit | eb116d00b1dfee2df7b1dc6191d388a4b0f4b846 (patch) | |
tree | 8d4dfe429378999a33b9404e1db6a571bb44c891 /plugin/icedteanp/IcedTeaNPPlugin.cc | |
parent | 42b3fd0a3fcfa1fc5113f7c23215a600ee408ea8 (diff) |
Send initialization information to Java side via a new function (also takes
care of webkit/chromium breakage with a 0x0 sized plugin)
Diffstat (limited to 'plugin/icedteanp/IcedTeaNPPlugin.cc')
-rw-r--r-- | plugin/icedteanp/IcedTeaNPPlugin.cc | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc index 1cd15bb..49feb6b 100644 --- a/plugin/icedteanp/IcedTeaNPPlugin.cc +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc @@ -220,6 +220,9 @@ NPError get_proxy_info(const char* siteAddr, char** proxy, uint32_t* len); void consume_message(gchar* message); void start_jvm_if_needed(); static void appletviewer_monitor(GPid pid, gint status, gpointer data); +void plugin_send_initialization_message(char* instance, gulong handle, + int width, int height, + char* url); // Global instance counter. // Mutex to protect plugin_instance_counter. @@ -768,18 +771,9 @@ ITNP_SetWindow (NPP instance, NPWindow* window) data->window_height = window->height; // Now we have everything. Send this data to the Java side - - gchar* instance_msg = g_strdup_printf ("instance %s handle %ld width %d height %d %s", - data->instance_id, - (gulong) data->window_handle, - data->window_width, - data->window_height, - data->applet_tag); - - plugin_send_message_to_appletviewer (instance_msg); - - g_free(instance_msg); - instance_msg = NULL; + plugin_send_initialization_message( + data->instance_id, (gulong) data->window_handle, + data->window_width, data->window_height, data->applet_tag); g_mutex_unlock (data->appletviewer_mutex); @@ -1834,6 +1828,25 @@ plugin_send_message_to_appletviewer (gchar const* message) PLUGIN_DEBUG ("plugin_send_message_to_appletviewer return\n"); } +/* + * Sends the initialization message (handle/size/url) to the plugin + */ +void +plugin_send_initialization_message(char* instance, gulong handle, + int width, int height, char* url) +{ + PLUGIN_DEBUG ("plugin_send_initialization_message\n"); + + gchar *window_message = g_strdup_printf ("instance %s handle %ld width %d height %d %s", + instance, handle, width, height, url); + plugin_send_message_to_appletviewer (window_message); + g_free (window_message); + window_message = NULL; + + PLUGIN_DEBUG ("plugin_send_initialization_message return\n"); +} + + // Stop the appletviewer process. When this is called the // appletviewer can be in any of three states: running, crashed or // hung. If the appletviewer is running then sending it "shutdown" @@ -2414,11 +2427,7 @@ get_scriptable_object(NPP instance) // a 0 handle if (!data->window_handle) { - data->window_handle = 0; - gchar *window_message = g_strdup_printf ("instance %s handle %d", - id_str, 0); - plugin_send_message_to_appletviewer (window_message); - g_free (window_message); + plugin_send_initialization_message(data->instance_id, 0, 0, 0, data->applet_tag); } java_result = java_request.getAppletObjectInstance(id_str); |