Bug 1496758 - Fix few compilation warnings in ipc code. r=handyman,Jamie
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 10 Oct 2018 04:31:35 +0000
changeset 496154 e8e4080d11009e7e05871301f252a593e913e497
parent 496153 fd465ab13d0f27061fd7590ae482c87a4d1f084e
child 496155 107392a74e8a7a8d39e66a9b176eb5060ff00924
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershandyman, Jamie
bugs1496758
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1496758 - Fix few compilation warnings in ipc code. r=handyman,Jamie Differential Revision: https://phabricator.services.mozilla.com/D7918
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginInstanceParent.h
dom/plugins/ipc/PluginModuleParent.cpp
ipc/mscom/Interceptor.cpp
ipc/mscom/MainThreadHandoff.cpp
ipc/mscom/MainThreadInvoker.cpp
ipc/mscom/ProxyStream.cpp
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -3509,17 +3509,16 @@ PluginInstanceChild::PaintRectWithAlphaE
                                                                surfaceAsImage);
         }
     }
 
     RefPtr<gfxImageSurface> whiteImage;
     RefPtr<gfxImageSurface> blackImage;
     gfxRect targetRect(rect.x, rect.y, rect.width, rect.height);
     IntSize targetSize(rect.width, rect.height);
-    gfxPoint deviceOffset = -targetRect.TopLeft();
 
     // We always use a temporary "white image"
     whiteImage = new gfxImageSurface(targetSize, SurfaceFormat::X8R8G8B8_UINT32);
     if (whiteImage->CairoStatus()) {
         return;
     }
 
 #ifdef XP_WIN
@@ -3544,16 +3543,17 @@ PluginInstanceChild::PaintRectWithAlphaE
     PaintRectToSurface(rect, aSurface, Color(0.f, 0.f, 0.f));
 
     // Don't copy the result, just extract a subimage so that we can
     // recover alpha directly into the target
     gfxImageSurface *image = static_cast<gfxImageSurface*>(aSurface);
     blackImage = image->GetSubimage(targetRect);
 
 #else
+    gfxPoint deviceOffset = -targetRect.TopLeft();
     // Paint onto white background
     whiteImage->SetDeviceOffset(deviceOffset);
     PaintRectToSurface(rect, whiteImage, Color(1.f, 1.f, 1.f));
 
     if (useSurfaceSubimageForBlack) {
         gfxImageSurface *surface = static_cast<gfxImageSurface*>(aSurface);
         blackImage = surface->GetSubimage(targetRect);
     } else {
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -119,17 +119,16 @@ PluginInstanceParent::PluginInstancePare
     , mDrawingModel(kDefaultDrawingModel)
     , mLastRecordedDrawingModel(-1)
     , mFrameID(0)
 #if defined(OS_WIN)
     , mPluginHWND(nullptr)
     , mChildPluginHWND(nullptr)
     , mChildPluginsParentHWND(nullptr)
     , mPluginWndProc(nullptr)
-    , mNestedEventState(false)
 #endif // defined(XP_WIN)
 #if defined(XP_MACOSX)
     , mShWidth(0)
     , mShHeight(0)
     , mShColorSpace(nullptr)
 #endif
 {
 #if defined(OS_WIN)
--- a/dom/plugins/ipc/PluginInstanceParent.h
+++ b/dom/plugins/ipc/PluginInstanceParent.h
@@ -397,17 +397,16 @@ private:
     nsIntRect          mPluginPort;
     nsIntRect          mSharedSize;
     HWND               mPluginHWND;
     // This is used for the normal child plugin HWND for windowed plugins and,
     // if needed, also the child popup surrogate HWND for windowless plugins.
     HWND               mChildPluginHWND;
     HWND               mChildPluginsParentHWND;
     WNDPROC            mPluginWndProc;
-    bool               mNestedEventState;
 #endif // defined(XP_WIN)
 #if defined(MOZ_WIDGET_COCOA)
 private:
     Shmem                  mShSurface;
     uint16_t               mShWidth;
     uint16_t               mShHeight;
     CGColorSpaceRef        mShColorSpace;
     RefPtr<MacIOSurface> mIOSurface;
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -490,17 +490,17 @@ PluginModuleChromeParent::LoadModule(con
     if (NS_FAILED(rv)) {
         parent->mShutdown = true;
         return nullptr;
     }
 
     parent->mBrokerParent =
       FunctionBrokerParent::Create(std::move(brokerParentEnd));
     if (parent->mBrokerParent) {
-      parent->SendInitPluginFunctionBroker(std::move(brokerChildEnd));
+      Unused << parent->SendInitPluginFunctionBroker(std::move(brokerChildEnd));
     }
 #endif
     return parent.forget();
 }
 
 static const char* gCallbackPrefs[] = {
     kChildTimeoutPref,
     kParentTimeoutPref,
--- a/ipc/mscom/Interceptor.cpp
+++ b/ipc/mscom/Interceptor.cpp
@@ -14,17 +14,17 @@
 #include "mozilla/mscom/InterceptorLog.h"
 #include "mozilla/mscom/MainThreadInvoker.h"
 #include "mozilla/mscom/Objref.h"
 #include "mozilla/mscom/Registration.h"
 #include "mozilla/mscom/Utils.h"
 #include "mozilla/ThreadLocal.h"
 #include "MainThreadUtils.h"
 #include "mozilla/Assertions.h"
-#include "mozilla/DebugOnly.h"
+#include "mozilla/Unused.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsExceptionHandler.h"
 #include "nsPrintfCString.h"
 #include "nsRefPtrHashtable.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 
@@ -272,16 +272,17 @@ Interceptor::Interceptor(IInterceptorSin
   : WeakReferenceSupport(WeakReferenceSupport::Flags::eDestroyOnMainThread)
   , mEventSink(aSink)
   , mInterceptorMapMutex("mozilla::mscom::Interceptor::mInterceptorMapMutex")
   , mStdMarshalMutex("mozilla::mscom::Interceptor::mStdMarshalMutex")
   , mStdMarshal(nullptr)
 {
   static const bool kHasTls = tlsCreatingStdMarshal.init();
   MOZ_ASSERT(kHasTls);
+  Unused << kHasTls;
 
   MOZ_ASSERT(aSink);
   RefPtr<IWeakReference> weakRef;
   if (SUCCEEDED(GetWeakReference(getter_AddRefs(weakRef)))) {
     aSink->SetInterceptor(weakRef);
   }
 }
 
--- a/ipc/mscom/MainThreadHandoff.cpp
+++ b/ipc/mscom/MainThreadHandoff.cpp
@@ -11,16 +11,17 @@
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Move.h"
 #include "mozilla/mscom/AgileReference.h"
 #include "mozilla/mscom/InterceptorLog.h"
 #include "mozilla/mscom/Registration.h"
 #include "mozilla/mscom/Utils.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/ThreadLocal.h"
+#include "mozilla/Unused.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 
 using mozilla::DebugOnly;
 using mozilla::mscom::AgileReference;
 
 namespace {
 
@@ -161,16 +162,17 @@ class MOZ_RAII SavedCallFrame final
 public:
   explicit SavedCallFrame(mozilla::NotNull<ICallFrame*> aFrame)
     : mCallFrame(aFrame)
   {
     static const bool sIsInit = tlsFrame.init();
     MOZ_ASSERT(sIsInit);
     MOZ_ASSERT(!tlsFrame.get());
     tlsFrame.set(this);
+    Unused << sIsInit;
   }
 
   ~SavedCallFrame()
   {
     MOZ_ASSERT(tlsFrame.get());
     tlsFrame.set(nullptr);
   }
 
--- a/ipc/mscom/MainThreadInvoker.cpp
+++ b/ipc/mscom/MainThreadInvoker.cpp
@@ -6,20 +6,20 @@
 
 #include "mozilla/mscom/MainThreadInvoker.h"
 
 #include "GeckoProfiler.h"
 #include "MainThreadUtils.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/BackgroundHangMonitor.h"
 #include "mozilla/ClearOnShutdown.h"
-#include "mozilla/DebugOnly.h"
 #include "mozilla/mscom/SpinEvent.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/SystemGroup.h"
+#include "mozilla/Unused.h"
 #include "private/prpriv.h" // For PR_GetThreadID
 #include <winternl.h> // For NTSTATUS and NTAPI
 
 namespace {
 
 typedef NTSTATUS (NTAPI* NtTestAlertPtr)(VOID);
 
 /**
@@ -33,16 +33,17 @@ class SyncRunnable : public mozilla::Run
 {
 public:
   explicit SyncRunnable(already_AddRefed<nsIRunnable> aRunnable)
     : mozilla::Runnable("MainThreadInvoker")
     , mRunnable(aRunnable)
   {
     static const bool gotStatics = InitStatics();
     MOZ_ASSERT(gotStatics);
+    Unused << gotStatics;
   }
 
   ~SyncRunnable() = default;
 
   NS_IMETHOD Run() override
   {
     if (mHasRun) {
       // The APC already ran, so we have nothing to do.
@@ -126,16 +127,17 @@ MainThreadInvoker::InitStatics()
 
   return !!sMainThread;
 }
 
 MainThreadInvoker::MainThreadInvoker()
 {
   static const bool gotStatics = InitStatics();
   MOZ_ASSERT(gotStatics);
+  Unused << gotStatics;
 }
 
 bool
 MainThreadInvoker::Invoke(already_AddRefed<nsIRunnable>&& aRunnable)
 {
   nsCOMPtr<nsIRunnable> runnable(std::move(aRunnable));
   if (!runnable) {
     return false;
--- a/ipc/mscom/ProxyStream.cpp
+++ b/ipc/mscom/ProxyStream.cpp
@@ -291,17 +291,17 @@ ProxyStream::ProxyStream(REFIID aIID, IU
 
   HRESULT createStreamResult = S_OK;
   HRESULT marshalResult = S_OK;
   HRESULT statResult = S_OK;
   HRESULT getHGlobalResult = S_OK;
 
   nsAutoString manifestPath;
 
-  auto marshalFn = [this, &aIID, aObject, mshlFlags, &stream, &streamSize,
+  auto marshalFn = [&aIID, aObject, mshlFlags, &stream, &streamSize,
                     &hglobal, &createStreamResult, &marshalResult, &statResult,
                     &getHGlobalResult, aEnv, &manifestPath]() -> void
   {
     if (aEnv) {
       bool pushOk = aEnv->Push();
       MOZ_DIAGNOSTIC_ASSERT(pushOk);
       if (!pushOk) {
         return;