gecko-dev/tools/profiler/gecko
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
..
nsIProfiler.idl Bug 1288077: Forward declare arrays by including 'nsTArrayForwardDeclare.h', r=froydnj 2016-07-20 17:29:36 +02:00
nsIProfileSaveEvent.idl
nsProfiler.cpp Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa 2015-08-12 14:20:26 -04:00
nsProfiler.h Backed out changeset 8f489e406701 (bug 822135) for m(dt) failures CLOSED TREE 2015-10-02 16:07:43 -07:00
nsProfilerCIID.h
nsProfilerFactory.cpp
nsProfilerStartParams.cpp
nsProfilerStartParams.h
ProfileGatherer.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
Profiler.jsm
ProfilerIOInterposeObserver.cpp
ProfilerIOInterposeObserver.h
ProfilerTypes.ipdlh Bug 1103094 - Start profiling subprocesses if the parent process is already profiling. r=BenWa 2015-08-11 14:26:27 -04:00
SaveProfileTask.cpp
SaveProfileTask.h Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
ThreadResponsiveness.cpp Bug 1293117 (part 4) - Change many NS_IMETHODIMP occurrences to NS_IMETHOD. r=froydnj. 2016-08-08 10:54:47 +10:00
ThreadResponsiveness.h Bug 1270928 - part 3 - don't include nsAutoPtr.h in ThreadResponsiveness.h; r=BenWa 2016-05-09 10:04:50 -04:00