Remove some code that is no longer necessary for the Java plugin on AIX. b=498148 r/sr=jst

This commit is contained in:
Josh Aas 2009-07-07 21:01:38 -04:00
Родитель ca37de3d5e
Коммит 8f211a8bc6
1 изменённых файлов: 1 добавлений и 100 удалений

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alex Musil
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -35,14 +36,6 @@
*
* ***** END LICENSE BLOCK ***** */
/*
nsPluginsDirUNIX.cpp
UNIX implementation of the nsPluginsDir/nsPluginsFile classes.
by Alex Musil
*/
#include "nsNPAPIPlugin.h"
#include "nsNPAPIPluginInstance.h"
#include "nsIMemory.h"
@ -57,11 +50,6 @@
#include "nsILocalFile.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#ifdef AIX
#include "nsPluginLogging.h"
#include "prprf.h"
#define LOG(args) PLUGIN_LOG(PLUGIN_LOG_NORMAL, args)
#endif
#define LOCAL_PLUGIN_DLL_SUFFIX ".so"
#if defined(__hpux)
@ -251,10 +239,6 @@ static void LoadExtraSharedLibs()
}
#endif //MOZ_WIDGET_GTK2
///////////////////////////////////////////////////////////////////////////
/* nsPluginsDir implementation */
PRBool nsPluginsDir::IsPluginFile(nsIFile* file)
@ -277,85 +261,17 @@ PRBool nsPluginsDir::IsPluginFile(nsIFile* file)
return PR_FALSE;
}
///////////////////////////////////////////////////////////////////////////
/* nsPluginFile implementation */
nsPluginFile::nsPluginFile(nsIFile* file)
: mPlugin(file)
{
// nada
}
nsPluginFile::~nsPluginFile()
{
// nada
}
#ifdef AIX
/**
* This code is necessary for Java 1.4.2 SR2 and later on AIX, as the
* loadquery() function is no longer used to determine the path to the
* installed JVM, so we need to manually set the LIBPATH variable to
* include the proper directories needed to run the Java plug-in.
*
* See Bug 297807 for more information.
*/
static char *javaLibPath = NULL;
static void SetJavaLibPath(const nsCString& pluginPath)
{
// If javaLibPath is non-NULL, that means we have already set the LIBPATH
// variable once this session, so we don't need to do it again.
if (javaLibPath)
return;
nsCAutoString javaDir, newLibPath;
PRInt32 pos = pluginPath.RFindChar('/');
if (pos == kNotFound || pos == 0)
return;
javaDir = Substring(pluginPath, 0, pos);
LOG(("AIX: Java dir is %s\n", javaDir.get()));
// Add jre/bin to new LIBPATH
newLibPath += javaDir;
// Check for existance of jre/bin/classic dir, and append it to
// LIBPATH if found
PRFileInfo info;
javaDir.AppendLiteral("/classic");
if (PR_GetFileInfo(javaDir.get(), &info) == PR_SUCCESS &&
info.type == PR_FILE_DIRECTORY)
{
newLibPath.Append(':');
newLibPath.Append(javaDir);
}
// Get the current LIBPATH, and append it to the new LIBPATH
const char *currentLibPath = PR_GetEnv("LIBPATH");
LOG(("AIX: current LIBPATH=%s\n", currentLibPath));
if (currentLibPath && *currentLibPath) {
newLibPath.Append(':');
newLibPath.Append(currentLibPath);
}
// Set the LIBPATH to include the path to the JRE directories.
// NOTE: We are leaking javaLibPath here, as it needs to remain in memory
// for PR_SetEnv to work properly.
javaLibPath = PR_smprintf("LIBPATH=%s", newLibPath.get());
if (javaLibPath) {
LOG(("AIX: new LIBPATH=%s\n", newLibPath.get()));
PR_SetEnv(javaLibPath);
}
}
#endif
/**
* Loads the plugin into memory using NSPR's shared-library loading
* mechanism. Handles platform differences in loading shared libraries.
*/
nsresult nsPluginFile::LoadPlugin(PRLibrary* &outLibrary)
{
PRLibSpec libSpec;
@ -371,21 +287,10 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary* &outLibrary)
if (NS_FAILED(rv))
return rv;
#ifdef AIX
nsCAutoString leafName;
rv = mPlugin->GetNativeLeafName(leafName);
if (NS_FAILED(rv))
return rv;
if (StringBeginsWith(leafName, NS_LITERAL_CSTRING("libjavaplugin_oji")))
SetJavaLibPath(path);
#endif
libSpec.value.pathname = path.get();
#if defined(MOZ_WIDGET_GTK2)
///////////////////////////////////////////////////////////
// Normally, Mozilla isn't linked against libXt and libXext
// since it's a Gtk/Gdk application. On the other hand,
// legacy plug-ins expect the libXt and libXext symbols
@ -424,9 +329,6 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary* &outLibrary)
return NS_OK;
}
/**
* Obtains all of the information currently available for this plugin.
*/
nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info)
{
info.fVersion = nsnull;
@ -477,7 +379,6 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info)
return NS_OK;
}
nsresult nsPluginFile::FreePluginInfo(nsPluginInfo& info)
{
if (info.fName != nsnull)