Added more detailed comments.
2006-06-06 Lillian Angel <[EMAIL PROTECTED]>
* native/plugin/gcjwebplugin.cc:
Fixed failure message and commenting.
(NP_Initialize): Added more comments.
Index: native/plugin/gcjwebplugin.cc
===================================================================
RCS file: /cvsroot/classpath/classpath/native/plugin/gcjwebplugin.cc,v
retrieving revision 1.3
diff -u -r1.3 gcjwebplugin.cc
--- native/plugin/gcjwebplugin.cc 5 Jun 2006 18:20:15 -0000 1.3
+++ native/plugin/gcjwebplugin.cc 6 Jun 2006 15:21:51 -0000
@@ -134,9 +134,10 @@
"The whitelist is a list of the URLs from which you trust" \
" applets.\n" \
"Your whitelist file is \"" WHITELIST_FILENAME "\"."
-#define FAILURE_MESSAGE \
- "This page wants to load an applet.\n" \
- "There is no appletviewer installed in \"" APPLETVIEWER_EXECUTABLE "\"." \
+#define FAILURE_MESSAGE \
+ "This page wants to load an applet.\n" \
+ "The appletviewer is missing or not installed properly in \"" \
+ APPLETVIEWER_EXECUTABLE "\"."
// Documentbase retrieval required definition.
static NS_DEFINE_IID (kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID);
@@ -144,7 +145,7 @@
// Browser function table.
static NPNetscapeFuncs browserFunctions;
-// Keeps track of initialization. NP_INITIALIZE should only be
+// Keeps track of initialization. NP_Initialize should only be
// called once.
bool initialized = false;
@@ -376,7 +377,7 @@
// appletviewer, create the IO channels and install the channel
// watch callbacks.
g_mutex_lock (data->appletviewer_mutex);
-
+
np_error = plugin_start_appletviewer (data);
// If the appletviewer is not installed, then a dialog box will
@@ -386,7 +387,7 @@
if (plugin_failed ())
goto cleanup_applet_failure;
}
-
+
// Create plugin-to-appletviewer channel. The default encoding for
// the file is UTF-8.
// data->out_to_appletviewer
@@ -1559,6 +1560,11 @@
// implement and initializes a local table with browser functions that
// we may wish to call. Called once, after browser startup and before
// the first plugin instance is created.
+// The field 'initialized' is set to true once this function has
+// finished. If 'initialized' is already true at the beginning of
+// this function, then it is evident that NP_Initialize has already
+// been called. There is no need to call this function more than twice and
+// this workaround avoids any duplicate calls.
NPError
NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable)
{