summaryrefslogtreecommitdiffstats
path: root/dom/plugins/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'dom/plugins/ipc')
-rw-r--r--dom/plugins/ipc/PluginInstanceChild.cpp13
-rw-r--r--dom/plugins/ipc/PluginMessageUtils.cpp6
-rw-r--r--dom/plugins/ipc/PluginModuleChild.cpp6
-rw-r--r--dom/plugins/ipc/PluginModuleChild.h2
4 files changed, 15 insertions, 12 deletions
diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp
index af9db9103..3f2cdbc13 100644
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -310,9 +310,10 @@ PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
switch (aValue) {
case NPNVWindowNPObject:
if (!(actor = mCachedWindowActor)) {
+ result = NPERR_GENERIC_ERROR;
PPluginScriptableObjectChild* actorProtocol;
- CallNPN_GetValue_NPNVWindowNPObject(&actorProtocol, &result);
- if (result == NPERR_NO_ERROR) {
+ if (CallNPN_GetValue_NPNVWindowNPObject(&actorProtocol, &result) &&
+ result == NPERR_NO_ERROR) {
actor = mCachedWindowActor =
static_cast<PluginScriptableObjectChild*>(actorProtocol);
NS_ASSERTION(actor, "Null actor!");
@@ -324,10 +325,10 @@ PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
case NPNVPluginElementNPObject:
if (!(actor = mCachedElementActor)) {
+ result = NPERR_GENERIC_ERROR;
PPluginScriptableObjectChild* actorProtocol;
- CallNPN_GetValue_NPNVPluginElementNPObject(&actorProtocol,
- &result);
- if (result == NPERR_NO_ERROR) {
+ if (CallNPN_GetValue_NPNVPluginElementNPObject(&actorProtocol, &result) &&
+ result == NPERR_NO_ERROR) {
actor = mCachedElementActor =
static_cast<PluginScriptableObjectChild*>(actorProtocol);
NS_ASSERTION(actor, "Null actor!");
@@ -338,6 +339,7 @@ PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
break;
default:
+ result = NPERR_GENERIC_ERROR;
NS_NOTREACHED("Don't know what to do with this value type!");
}
@@ -434,6 +436,7 @@ PluginInstanceChild::NPN_GetValue(NPNVariable aVar,
case NPNVWindowNPObject: // Intentional fall-through
case NPNVPluginElementNPObject: {
NPObject* object;
+ *((NPObject**)aValue) = nullptr;
NPError result = InternalGetNPObjectForValue(aVar, &object);
if (result == NPERR_NO_ERROR) {
*((NPObject**)aValue) = object;
diff --git a/dom/plugins/ipc/PluginMessageUtils.cpp b/dom/plugins/ipc/PluginMessageUtils.cpp
index 47653fe6e..5b1d1667f 100644
--- a/dom/plugins/ipc/PluginMessageUtils.cpp
+++ b/dom/plugins/ipc/PluginMessageUtils.cpp
@@ -82,7 +82,7 @@ MediateRace(const MessageChannel::MessageInfo& parent,
}
}
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_SOLARIS)
static string
ReplaceAll(const string& haystack, const string& needle, const string& with)
{
@@ -101,7 +101,7 @@ ReplaceAll(const string& haystack, const string& needle, const string& with)
string
MungePluginDsoPath(const string& path)
{
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_SOLARIS)
// https://bugzilla.mozilla.org/show_bug.cgi?id=519601
return ReplaceAll(path, "netscape", "netsc@pe");
#else
@@ -112,7 +112,7 @@ MungePluginDsoPath(const string& path)
string
UnmungePluginDsoPath(const string& munged)
{
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_SOLARIS)
return ReplaceAll(munged, "netsc@pe", "netscape");
#else
return munged;
diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp
index cbf6e509f..f943dfc42 100644
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -286,7 +286,7 @@ PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
// TODO: use PluginPRLibrary here
-#if defined(OS_LINUX) || defined(OS_BSD)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
mShutdownFunc =
(NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
@@ -1821,7 +1821,7 @@ PluginModuleChild::AnswerNP_GetEntryPoints(NPError* _retval)
AssertPluginThread();
MOZ_ASSERT(mIsChrome);
-#if defined(OS_LINUX) || defined(OS_BSD)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
return true;
#elif defined(OS_WIN) || defined(OS_MACOSX)
*_retval = mGetEntryPointsFunc(&mFunctions);
@@ -1866,7 +1866,7 @@ PluginModuleChild::DoNP_Initialize(const PluginSettings& aSettings)
#endif
NPError result;
-#if defined(OS_LINUX) || defined(OS_BSD)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
result = mInitializeFunc(&sBrowserFuncs, &mFunctions);
#elif defined(OS_WIN) || defined(OS_MACOSX)
result = mInitializeFunc(&sBrowserFuncs);
diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h
index 681743582..5e4fa7d20 100644
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -258,7 +258,7 @@ private:
// we get this from the plugin
NP_PLUGINSHUTDOWN mShutdownFunc;
-#if defined(OS_LINUX) || defined(OS_BSD)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
NP_PLUGINUNIXINIT mInitializeFunc;
#elif defined(OS_WIN) || defined(OS_MACOSX)
NP_PLUGININIT mInitializeFunc;