gecko-dev/dom/filesystem
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
..
compat Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
tests Bug 1284742 - Replace profile directory traversal with a generated directory tree in dom/filesystem/test/test_basic.html. r=mystor 2016-08-02 15:48:13 -04:00
CreateDirectoryTask.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
CreateDirectoryTask.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
CreateFileTask.cpp Bug 1258490 - Implement file.webkitrelativepath, r=smaug 2016-05-13 13:11:38 +02:00
CreateFileTask.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
DeviceStorageFileSystem.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
DeviceStorageFileSystem.h Bug 1263992 - patch 2 - Support the creation of directories from FileSystemTasks, r=smaug 2016-04-18 03:32:59 -04:00
Directory.cpp Bug 1265767 - Subset of Blink FileSystem API - patch 6 - getFile and getDirectory, r=smaug 2016-06-07 00:55:17 +02:00
Directory.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
FileSystemBase.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
FileSystemBase.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
FileSystemPermissionRequest.cpp Bug 1263311: Part 3 - s/nsCancelableRunnable/CancelableRunnable/g. r=froydnj 2016-04-11 11:40:06 -07:00
FileSystemPermissionRequest.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
FileSystemRequestParent.cpp Bug 1288736 - Add some missing rv.SuppressException(), r=smaug 2016-07-22 16:50:10 +02:00
FileSystemRequestParent.h Bug 1258221 - patch 2 - Port FileSystem API and DeviceStorage API to PBackground, r=smaug 2016-04-09 19:17:02 +01:00
FileSystemTaskBase.cpp Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
FileSystemTaskBase.h Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
FileSystemUtils.cpp Bug 1265767 - Subset of Blink FileSystem API - patch 6 - getFile and getDirectory, r=smaug 2016-06-07 00:55:17 +02:00
FileSystemUtils.h Bug 1265767 - Subset of Blink FileSystem API - patch 6 - getFile and getDirectory, r=smaug 2016-06-07 00:55:17 +02:00
GetDirectoryListingTask.cpp Bug 1274959 - Support symlinks in Directory API - part 1 - Directory.getFilesAndDirectories, r=smaug 2016-07-23 10:34:43 +02:00
GetDirectoryListingTask.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
GetFileOrDirectoryTask.cpp Bug 1258490 - Implement file.webkitrelativepath, r=smaug 2016-05-13 13:11:38 +02:00
GetFileOrDirectoryTask.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
GetFilesHelper.cpp Bug 1274959 - Support symlinks in Directory API - part 3 - no loops with symlink in Directory.getFiles(), r=smaug 2016-07-23 10:35:26 +02:00
GetFilesHelper.h Bug 1274959 - Support symlinks in Directory API - part 3 - no loops with symlink in Directory.getFiles(), r=smaug 2016-07-23 10:35:26 +02:00
GetFilesTask.cpp Bug 1274959 - Support symlinks in Directory API - part 2 - Unify GetFilesHelper and GetFilesTaskParent, r=smaug 2016-07-23 10:35:06 +02:00
GetFilesTask.h Bug 1274959 - Support symlinks in Directory API - part 2 - Unify GetFilesHelper and GetFilesTaskParent, r=smaug 2016-07-23 10:35:06 +02:00
OSFileSystem.cpp Bug 1263992 - patch 1 - Remove DirectoryType enum, r=smaug 2016-04-18 03:32:30 -04:00
OSFileSystem.h Bug 1265767 - Subset of Blink FileSystem API - patch 6 - getFile and getDirectory, r=smaug 2016-06-07 00:55:17 +02:00
PFileSystemParams.ipdlh Bug 1258490 - Implement file.webkitrelativepath, r=smaug 2016-05-13 13:11:38 +02:00
PFileSystemRequest.ipdl Bug 1258490 - Implement file.webkitrelativepath, r=smaug 2016-05-13 13:11:38 +02:00
RemoveTask.cpp Bug 1258694 - Implement Directory::GetFiles(), r=smaug 2016-04-13 07:15:56 -04:00
RemoveTask.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00