зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1602308: Allow MOZ_PLUGIN_PATH to prepend search paths for Flash r=Gijs,froydnj
MOZ_PLUGIN_PATH is a ':'-separated list of folders (';' on Windows) that we search for when launching Flash -- the only supported browser plugin. Differential Revision: https://phabricator.services.mozilla.com/D68601 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
7f7aa73508
Коммит
c3c148c25d
|
@ -26,6 +26,7 @@
|
|||
#include "prio.h"
|
||||
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsPluginDirServiceProvider.h"
|
||||
|
@ -922,6 +923,33 @@ nsresult PluginFinder::DeterminePluginDirs() {
|
|||
NS_GET_IID(nsISimpleEnumerator),
|
||||
getter_AddRefs(dirEnum)));
|
||||
|
||||
// Add any paths from MOZ_PLUGIN_PATH first.
|
||||
#if defined(XP_WIN) || defined(XP_LINUX)
|
||||
# ifdef XP_WIN
|
||||
# define PATH_SEPARATOR ';'
|
||||
# else
|
||||
# define PATH_SEPARATOR ':'
|
||||
# endif
|
||||
const char* pathsenv = PR_GetEnv("MOZ_PLUGIN_PATH");
|
||||
if (pathsenv) {
|
||||
const nsDependentCString pathsStr(pathsenv);
|
||||
nsCCharSeparatedTokenizer paths(pathsStr, PATH_SEPARATOR);
|
||||
while (paths.hasMoreTokens()) {
|
||||
auto pathStr = paths.nextToken();
|
||||
nsCOMPtr<nsIFile> pathFile;
|
||||
rv = NS_NewNativeLocalFile(pathStr, true, getter_AddRefs(pathFile));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool exists;
|
||||
if (pathFile && NS_SUCCEEDED(pathFile->Exists(&exists)) && exists) {
|
||||
mPluginDirs.AppendElement(pathFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // defined(XP_WIN) || defined(XP_LINUX)
|
||||
|
||||
bool hasMore = false;
|
||||
while (NS_SUCCEEDED(dirEnum->HasMoreElements(&hasMore)) && hasMore) {
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
|
|
Загрузка…
Ссылка в новой задаче