Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a506af486d6b9133df03391980faf0629c7f47a8
      
https://github.com/WebKit/WebKit/commit/a506af486d6b9133df03391980faf0629c7f47a8
  Author: Chris Dumez <[email protected]>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    M Source/JavaScriptCore/jit/ExecutableAllocator.cpp
    M Source/JavaScriptCore/jit/GdbJIT.cpp
    M Source/JavaScriptCore/jsc.cpp
    M Source/JavaScriptCore/testRegExp.cpp
    M Source/WTF/WTF.xcodeproj/project.pbxproj
    M Source/WTF/wtf/CMakeLists.txt
    M Source/WTF/wtf/darwin/LibraryPathDiagnostics.mm
    M Source/WTF/wtf/playstation/FileSystemPlayStation.cpp
    M Source/WTF/wtf/posix/FileSystemPOSIX.cpp
    A Source/WTF/wtf/posix/POSIXExtras.h
    M Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
    M Source/WebCore/platform/graphics/gbm/GBMDevice.cpp
    M Source/WebCore/platform/graphics/vulkan/VulkanTypes.cpp
    M Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm
    M Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm
    M Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm
    M Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp
    M Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp
    M Source/WebKit/WPEPlatform/wpe/wayland/WPEWaylandSHMPool.cpp
    M Tools/Scripts/webkitpy/style/checkers/cpp.py
    M Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
    M Tools/TestWebKitAPI/Tests/WTF/glib/FilePathWatcher.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm

  Log Message:
  -----------
  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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to