gecko-dev/dom/xbl
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
..
builtin Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
crashtests Bug 1268050 - Skip dom/xbl/crashtests/336744-1.html on Android, for frequent failures 2016-04-28 10:49:40 -06:00
test
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
nsBindingManager.cpp Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
nsBindingManager.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
nsXBLBinding.cpp Bug 1292662 - Style XBL anonymous content after binding explicit children to insertion points. r=heycam 2016-08-25 21:36:46 -07:00
nsXBLBinding.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
nsXBLContentSink.cpp
nsXBLContentSink.h
nsXBLDocumentInfo.cpp Bug 1286084 - Remove warning that startup cache is null. r=enn 2016-07-26 14:31:03 -07:00
nsXBLDocumentInfo.h
nsXBLEventHandler.cpp Bug 1154183 part.1 Move shortcut/access key candidate list creators from nsContentUtils to WidgetKeyboardEvent r=smaug 2016-03-18 11:22:37 +09:00
nsXBLEventHandler.h
nsXBLMaybeCompiled.h Bug 1297244 - Assert on the type given as a parameter to Heap. r=terrence 2016-08-24 14:21:42 -07:00
nsXBLProtoImpl.cpp Bug 1275315 part 2. Use the new Realm getters in binding code. r=peterv 2016-07-09 00:19:52 -04:00
nsXBLProtoImpl.h
nsXBLProtoImplField.cpp Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
nsXBLProtoImplField.h
nsXBLProtoImplMember.h
nsXBLProtoImplMethod.cpp Bug 1275698. Get rid of nsScriptSecurityManager::ScriptAllowed and replace it with xpc::Scriptability::Get(obj).Allowed() for better performance and less indirection. r=khuey 2016-05-27 20:26:56 -04:00
nsXBLProtoImplMethod.h
nsXBLProtoImplProperty.cpp
nsXBLProtoImplProperty.h
nsXBLPrototypeBinding.cpp Bug 1173199 - Create preference to disable MathML. r=heycam, r=huseby, r=smaug 2016-06-28 15:24:48 +01:00
nsXBLPrototypeBinding.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
nsXBLPrototypeHandler.cpp Bug 1297993 - Include the ID of the offending <key> element in the key conflict message. r=masayuki 2016-08-31 12:53:24 -04:00
nsXBLPrototypeHandler.h Bug 1154183 part.7 Don't dispatch preceding keydown events of reserved keypress events on content in the default event group r=smaug 2016-03-22 15:05:25 +09:00
nsXBLPrototypeResources.cpp Bug 1247182 - Add an nsCSSRuleProcessor constructor that takes ownership of the given sheet array. r=birtles 2016-04-14 16:02:44 +10:00
nsXBLPrototypeResources.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
nsXBLResourceLoader.cpp Bug 1206961 - Use channel->AsyncOpen2() for imageLoader; Remove security checks from callsites (r=bz) 2016-04-27 19:41:13 +02:00
nsXBLResourceLoader.h Bug 1244074 - Part 4: Use StyleSheetHandle instead of concrete style sheet class in most places. r=dholbert 2016-02-24 18:01:12 +11:00
nsXBLSerialize.cpp
nsXBLSerialize.h
nsXBLService.cpp Bug 1297961 (part 1) - Introduce nsURI::GetSpecOrDefault(). r=hurley. 2016-08-26 16:02:31 +10:00
nsXBLService.h
nsXBLWindowKeyHandler.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
nsXBLWindowKeyHandler.h Bug 1257759 part.8 nsXBLWindowKeyHandler should handle eKeyDownOnPlugin and eKeyUpOnPlugin events only with reserved shortcut key handlers r=smaug 2016-04-23 02:12:54 +09:00
XBLChildrenElement.cpp Bug 1260871 - Remove do_GetAtom() and rename NS_NewAtom() as NS_Atomize(). r=erahm. 2016-03-29 10:09:43 +11:00
XBLChildrenElement.h