gecko-dev/ipc/mscom
Nicholas Nethercote 34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
..
COMApartmentRegion.h Bug 1277075: Add MainThreadRuntime class to mscom glue, enabling safe initialization of COM security and exception handlers; r=jimm 2016-07-20 11:10:46 -06:00
COMPtrHolder.h Bug 1298840 - declare dependent type with typename in ParamTraits<COMPtrHolder<Interface, _IID>>; r=aklotz 2016-08-29 21:47:03 -04:00
DispatchForwarder.cpp Bug 1293486: Add tearoff IDispatch handler to mscom interceptor; r=jimm 2016-08-12 12:12:48 -06:00
DispatchForwarder.h Bug 1298462 - tidy ipc/mscom/ files to avoid warnings from clang-cl; r=aklotz 2016-08-26 14:26:29 -04:00
DynamicallyLinkedFunctionPtr.h Bug 1287002: Add DynamicallyLinkedFunctionPtr helper class to mscom glue; r=jimm 2016-06-03 12:56:24 -06:00
EnsureMTA.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
EnsureMTA.h Bug 1298882 - ensure mozilla/mscom/Utils.h is included with uniform casing; r=aklotz 2016-08-29 21:55:37 -04:00
Interceptor.cpp Bug 1298412: Fix Interceptor construction to use Move semantics for STAUniquePtr instead of pass-by-reference; r=jimm 2016-08-26 10:03:17 -06:00
Interceptor.h Bug 1298412: Fix Interceptor construction to use Move semantics for STAUniquePtr instead of pass-by-reference; r=jimm 2016-08-26 10:03:17 -06:00
InterceptorLog.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
InterceptorLog.h Bug 1287875: Adds a logging facility for intercepted COM traffic; r=jimm 2016-07-14 17:11:33 -06:00
MainThreadHandoff.cpp Bug 1298412: Fix Interceptor construction to use Move semantics for STAUniquePtr instead of pass-by-reference; r=jimm 2016-08-26 10:03:17 -06:00
MainThreadHandoff.h Bug 1298462 - tidy ipc/mscom/ files to avoid warnings from clang-cl; r=aklotz 2016-08-26 14:26:29 -04:00
MainThreadInvoker.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
MainThreadInvoker.h Bug 1263224: Adds MainThreadInvoker class for posting Asynchronous Procedure Calls to the main thread; r=jimm 2016-07-19 13:35:36 -06:00
MainThreadRuntime.cpp Bug 1277075: Add MainThreadRuntime class to mscom glue, enabling safe initialization of COM security and exception handlers; r=jimm 2016-07-20 11:10:46 -06:00
MainThreadRuntime.h Bug 1277075: Add MainThreadRuntime class to mscom glue, enabling safe initialization of COM security and exception handlers; r=jimm 2016-07-20 11:10:46 -06:00
ProxyStream.cpp Bug 1298882 - ensure mozilla/mscom/Utils.h is included with uniform casing; r=aklotz 2016-08-29 21:55:37 -04:00
ProxyStream.h Bug 1261107: Adds code to marshal a Microsoft COM object and transfer its serialized proxy across IPDL; r=billm,jimm 2016-07-27 11:44:29 -06:00
Ptr.h Bug 1263224: Smart pointers for passing COM interface pointers around in other apartments; r=jimm 2016-07-19 13:13:31 -06:00
Registration.cpp Bug 1286986: Add glue to enable process-local registration of COM proxies at runtime; r=jimm 2016-07-27 11:45:08 -06:00
Registration.h Bug 1286986: Add glue to enable process-local registration of COM proxies at runtime; r=jimm 2016-07-27 11:45:08 -06:00
Utils.cpp Bug 1261107: Add IsCurrentThreadMTA() to ipc/mscom/Utils; r=jimm 2016-07-18 13:47:34 -06:00
Utils.h Bug 1261107: Add IsCurrentThreadMTA() to ipc/mscom/Utils; r=jimm 2016-07-18 13:47:34 -06:00
WeakRef.cpp Bug 1263224: Add support for thread-safe weak references for COM-based objects; r=jimm 2016-07-19 13:36:55 -06:00
WeakRef.h Bug 1263224: Add support for thread-safe weak references for COM-based objects; r=jimm 2016-07-19 13:36:55 -06:00
moz.build Bug 1293486: Add tearoff IDispatch handler to mscom interceptor; r=jimm 2016-08-12 12:12:48 -06:00