Bug 1404035 Address unused result warnings in dom/ipc/ draft
authorTom Ritter <tom@mozilla.com>
Thu, 28 Sep 2017 12:46:37 -0500
changeset 677750 368d91c2a32a2fad3f9da4a93332c17e96dd4322
parent 677749 963f1096692d3dd4335f1c5f232cbac405b513e2
child 677751 24cf25d0f7126b99573e04d91c0ba24fc3137757
push id83797
push userbmo:tom@mozilla.com
push dateTue, 10 Oct 2017 18:10:48 +0000
bugs1404035
milestone58.0a1
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
dom/ipc/ContentChild.cpp
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginUtilsWin.cpp
--- 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;
 };