haikuwebkit/Source/WTF/wtf/mac
Chris Dumez 1e6093992f Restore pre-r276879 behavior for FileSystem::deleteFile() and FileSystem::deleteEmptyDirectory()
https://bugs.webkit.org/show_bug.cgi?id=225289

Reviewed by Darin Adler.

Source/JavaScriptCore:

Fix build.

* Configurations/JavaScriptCore.xcconfig:

Source/WTF:

Restore pre-r276879 behavior for FileSystem::deleteFile() and FileSystem::deleteEmptyDirectory() to
reduce the risk of regressions. In particular, calling FileSystem::deleteFile() on an empty directory
now fails and calling FileSystem::deleteEmptyDirectory() on a non-directory now fails.

I have also gotten rid of the macOS-specific implementation of deleteEmptyDirectory() and merged the
needed behavior (Dealing with .DS_Store files) to the generic function.

* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
* wtf/mac/FileSystemMac.mm:
(WTF::FileSystem::deleteEmptyDirectory): Deleted.

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::TEST_F):


Canonical link: https://commits.webkit.org/237251@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-03 17:23:25 +00:00
..
FileSystemMac.mm Restore pre-r276879 behavior for FileSystem::deleteFile() and FileSystem::deleteEmptyDirectory() 2021-05-03 17:23:25 +00:00
MachExceptions.defs
SchedulePairMac.mm