You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a506af4
Browse filesBrowse the repository at this point in the historyBrowse files
Add C++ wrappers for POSIX functions that take UTF-8 paths
https://bugs.webkit.org/show_bug.cgi?id=325773
Reviewed by Mike Wyrzykowski.
Code that passed a UTF8CString to a POSIX file function had to unwrap it with legacyCStringPointer().
Add wtf/posix/POSIXExtras.h with wrappers that take a UTF8CStringView and keep the C return types:
posixOpen(), posixAccess(), posixMkdir(), posixUnlink(), posixRename(), posixChmod(), posixSymlink(),
posixStat(), posixLstat(), posixStatvfs(), posixOpendir() and posixRealpath(), plus posixChflags() on
Darwin, posixStatx() on Linux, and posixDlopen(), posixShmOpen() and posixShmUnlink() everywhere but
PlayStation. posixFopen() is available on every platform, including Windows, and takes an ASCIILiteral
mode.
Use the wrappers at the call sites in Source/ and Tools/, removing 38 calls to legacyCStringPointer().
Add a runtime/posix_string_wrappers style check that flags calls to the wrapped functions that pass
legacyCStringPointer() directly as an argument, and suggests the wrapper instead. It shares its
implementation with runtime/glib_string_wrappers. Both checks now treat a call qualified with a leading
'::' as a call to the global function.
* Source/JavaScriptCore/jit/ExecutableAllocator.cpp:
* Source/JavaScriptCore/jit/GdbJIT.cpp:
* Source/JavaScriptCore/jsc.cpp:
* Source/JavaScriptCore/testRegExp.cpp:
* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/CMakeLists.txt:
* Source/WTF/wtf/darwin/LibraryPathDiagnostics.mm:
* Source/WTF/wtf/playstation/FileSystemPlayStation.cpp:
* Source/WTF/wtf/posix/FileSystemPOSIX.cpp:
* Source/WTF/wtf/posix/POSIXExtras.h: Added.
* Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp:
* Source/WebCore/platform/graphics/gbm/GBMDevice.cpp:
* Source/WebCore/platform/graphics/vulkan/VulkanTypes.cpp:
* Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
* Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm:
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm:
* Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp:
* Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp:
* Source/WebKit/WPEPlatform/wpe/wayland/WPEWaylandSHMPool.cpp:
* Tools/Scripts/webkitpy/style/checkers/cpp.py:
(_enclosing_function_call):
(_check_string_wrappers):
(check_glib_string_wrappers):
(check_posix_string_wrappers):
(check_style):
* Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_posix_string_wrappers):
* Tools/TestWebKitAPI/Tests/WTF/glib/FilePathWatcher.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm:
Canonical link: https://commits.webkit.org/322333@main
0 commit comments