gecko-dev/dom/presentation/provider
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
..
BuiltinProviders.manifest Bug 1228266 - rename TCPPresentationServer to PresentationControlService. r=junior. 2016-05-20 14:53:30 +08:00
ControllerStateMachine.jsm Bug 1153134 - Part 2, support TLS control server. r=junior. 2016-07-26 10:59:52 +08:00
DeviceProviderHelpers.cpp Bug 1228526 - Part 1, support device filtering by requested presentation URL. r=smaug 2016-08-26 10:59:27 +08:00
DeviceProviderHelpers.h Bug 1228526 - Part 1, support device filtering by requested presentation URL. r=smaug 2016-08-26 10:59:27 +08:00
DisplayDeviceProvider.cpp Bug 1228526 - Part 1, support device filtering by requested presentation URL. r=smaug 2016-08-26 10:59:27 +08:00
DisplayDeviceProvider.h Bug 1153134 - Part 3, retry startServer after timeout. r=junior. 2016-08-02 10:48:22 +08:00
LegacyMDNSDeviceProvider.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
LegacyMDNSDeviceProvider.h Bug 1272197 - Part 3, backward compatibility for connecting TV 2.5 devices. r=junior 2016-07-04 18:27:09 +08:00
LegacyPresentationControlService.js Bug 1197690 - Part1: Support reconnect command, r=junior 2016-08-02 19:10:00 +02:00
LegacyProviders.manifest Bug 1272197 - Part 3, backward compatibility for connecting TV 2.5 devices. r=junior 2016-07-04 18:27:09 +08:00
moz.build Bug 1228526 - Part 1, support device filtering by requested presentation URL. r=smaug 2016-08-26 10:59:27 +08:00
MulticastDNSDeviceProvider.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
MulticastDNSDeviceProvider.h Bug 1153134 - Part 3, retry startServer after timeout. r=junior. 2016-08-02 10:48:22 +08:00
nsTCPDeviceInfo.h Bug 1153134 - Part 1, establish TLS socket to encrypted control server. r=junior. 2016-07-18 18:45:07 +08:00
PresentationControlService.js Bug 1153134 - Part 2, support TLS control server. r=junior. 2016-07-26 10:59:52 +08:00
PresentationDeviceProviderModule.cpp Bug 1272197 - Part 3, backward compatibility for connecting TV 2.5 devices. r=junior 2016-07-04 18:27:09 +08:00
ReceiverStateMachine.jsm Bug 1153134 - Part 2, support TLS control server. r=junior. 2016-07-26 10:59:52 +08:00
StateMachineHelper.jsm Bug 1197690 - Part1: Support reconnect command, r=junior 2016-08-02 19:10:00 +02:00