Bug 1404035 Address unused result warnings in dom/ipc/
In come cases, we can fail the IPC message, but in one we can't really do anything.
MozReview-Commit-ID: 4vdKIRUOJNN
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -3057,19 +3057,21 @@ ContentChild::GetBrowserOrId(TabChild* a
mozilla::ipc::IPCResult
ContentChild::RecvUpdateWindow(const uintptr_t& aChildId)
{
#if defined(XP_WIN)
NS_ASSERTION(aChildId, "Expected child hwnd value for remote plugin instance.");
mozilla::plugins::PluginInstanceParent* parentInstance =
mozilla::plugins::PluginInstanceParent::LookupPluginInstanceByID(aChildId);
if (parentInstance) {
- // sync! update call to the plugin instance that forces the
- // plugin to paint its child window.
- parentInstance->CallUpdateWindow();
+ // sync! update call to the plugin instance that forces the
+ // plugin to paint its child window.
+ if(!parentInstance->CallUpdateWindow()) {
+ return IPC_FAIL_NO_REASON(this);
+ }
}
return IPC_OK();
#else
MOZ_ASSERT(false, "ContentChild::RecvUpdateWindow calls unexpected on this platform.");
return IPC_FAIL_NO_REASON(this);
#endif
}
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -535,17 +535,17 @@ PluginModuleChromeParent::OnProcessLaunc
}
#endif
#if defined(XP_WIN) && defined(_X86_)
// Protected mode only applies to Windows and only to x86.
if (!mIsBlocklisted && mIsFlashPlugin &&
(Preferences::GetBool("dom.ipc.plugins.flash.disable-protected-mode", false) ||
mSandboxLevel >= 2)) {
- SendDisableFlashProtectedMode();
+ Unused << SendDisableFlashProtectedMode();
}
#endif
#ifdef MOZ_GECKO_PROFILER
Unused << SendInitProfiler(ProfilerParent::CreateForProcess(OtherPid()));
#endif
}
@@ -2430,17 +2430,20 @@ PluginModuleParent::NPP_NewInternal(NPMI
#ifdef XP_WIN
bool supportsAsyncRender =
Preferences::GetBool("dom.ipc.plugins.asyncdrawing.enabled", false);
bool supportsForceDirect =
Preferences::GetBool("dom.ipc.plugins.forcedirect.enabled", false);
if (supportsAsyncRender) {
// Prefs indicates we want async plugin rendering, make sure
// the flash module has support.
- CallModuleSupportsAsyncRender(&supportsAsyncRender);
+ if(!CallModuleSupportsAsyncRender(&supportsAsyncRender)) {
+ *error = NPERR_GENERIC_ERROR;
+ return NS_ERROR_FAILURE;
+ }
}
#ifdef _WIN64
// For 64-bit builds force windowless if the flash library doesn't support
// async rendering regardless of sandbox level.
if (!supportsAsyncRender) {
#else
// For 32-bit builds force windowless if the flash library doesn't support
// async rendering and the sandbox level is 2 or greater.
--- a/dom/plugins/ipc/PluginUtilsWin.cpp
+++ b/dom/plugins/ipc/PluginUtilsWin.cpp
@@ -30,17 +30,19 @@ public:
NS_IMETHOD Run() override
{
StaticMutexAutoLock lock(sMutex);
PLUGIN_LOG_DEBUG(("Notifying %d plugins of audio device change.",
mAudioNotificationSet->Count()));
for (auto iter = mAudioNotificationSet->ConstIter(); !iter.Done(); iter.Next()) {
PluginModuleParent* pluginModule = iter.Get()->GetKey();
- pluginModule->SendNPP_SetValue_NPNVaudioDeviceChangeDetails(mChangeDetails);
+ if(!pluginModule->SendNPP_SetValue_NPNVaudioDeviceChangeDetails(mChangeDetails)) {
+ return NS_ERROR_FAILURE;
+ }
}
return NS_OK;
}
protected:
NPAudioDeviceChangeDetailsIPC mChangeDetails;
const PluginModuleSet* mAudioNotificationSet;
};