Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ce646f1f8523b64188d1fb68520a44e43c035906
https://github.com/WebKit/WebKit/commit/ce646f1f8523b64188d1fb68520a44e43c035906
Author: Chris Dumez <[email protected]>
Date: 2026-09-13 (Sun, 13 Sep 2026)
Changed paths:
M Source/JavaScriptCore/API/JSRemoteInspector.cpp
M Source/JavaScriptCore/inspector/InjectedScriptManager.cpp
M Source/JavaScriptCore/inspector/InjectedScriptModule.cpp
M Source/JavaScriptCore/runtime/ConsoleClient.cpp
M Source/WTF/wtf/Assertions.cpp
M Source/WTF/wtf/StdLibExtras.h
M Source/WTF/wtf/TimingScope.cpp
M Source/WTF/wtf/cocoa/FileSystemCocoa.mm
M Source/WTF/wtf/cocoa/ResourceUsageCocoa.cpp
M Source/WebCore/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations
M Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations
M Source/WebCore/bindings/js/GarbageCollectionController.cpp
M Source/WebCore/history/BackForwardCache.cpp
M Source/WebCore/inspector/InspectorFrontendHost.cpp
M Source/WebCore/layout/Verification.cpp
M Source/WebCore/layout/integration/grid/LayoutIntegrationGridCoverage.cpp
M Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp
M Source/WebCore/loader/cache/MemoryCache.cpp
M Source/WebCore/page/ViewportConfiguration.cpp
M Source/WebCore/page/cocoa/PageCocoa.mm
M Source/WebCore/page/scrolling/ScrollingStateTree.cpp
M Source/WebCore/platform/android/SharedMemoryAndroid.cpp
M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm
M Source/WebCore/platform/glib/FileMonitorGLib.cpp
M Source/WebCore/platform/graphics/GraphicsLayer.cpp
M Source/WebCore/platform/graphics/gbm/GBMDevice.cpp
M Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
M Source/WebCore/platform/graphics/win/FontCacheWin.cpp
M Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.mm
M Source/WebCore/platform/unix/SharedMemoryUnix.cpp
M Source/WebCore/rendering/RenderLayer.cpp
M Source/WebCore/rendering/RenderObject.cpp
M Source/WebCore/testing/Internals.cpp
M Source/WebGPU/WebGPU/Pipeline.mm
M Source/WebKit/NetworkProcess/NetworkSession.cpp
M Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp
M Source/WebKit/Platform/IPC/cocoa/DaemonConnectionCocoa.mm
M Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp
M
Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp
M Source/WebKit/Platform/glib/ModuleGlib.cpp
M Source/WebKit/Shared/AuxiliaryProcess.cpp
M Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm
M Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm
M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
M
Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
M Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm
M Source/WebKit/Shared/unix/BreakpadExceptionHandler.cpp
M Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
M Source/WebKit/UIProcess/Cocoa/MediaPermissionUtilities.mm
M Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm
M Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
M
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.cpp
M Tools/TestWebKitAPI/Helpers/GraphicsTestUtilities.cpp
M Tools/TestWebKitAPI/Tests/WGSL/TestWGSLAPI.cpp
M Tools/TestWebKitAPI/Tests/WTF/URL.cpp
M Tools/TestWebKitAPI/Tests/WebCore/FloatQuadTests.cpp
M Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp
M Tools/TestWebKitAPI/Tests/WebCore/RegionTests.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
M Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.cpp
M Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.cpp
Log Message:
-----------
Use SAFE_WTFLOGALWAYS instead of WTFLogAlways at call sites that reach for a
raw const char*
https://bugs.webkit.org/show_bug.cgi?id=324090
Reviewed by Darin Adler and Mike Wyrzykowski.
SAFE_WTFLOGALWAYS routes every argument through WTF::safeNSStringPrintfType(),
which rejects char* while accepting the null-terminated string types that know
their own length (CString, CStringView, ASCIILiteral, GMallocString) and passing
Objective-C objects through untouched for %@. It was introduced with the sandbox
logging in AuxiliaryProcessMac.mm and had not been applied anywhere else, so the
rest of the tree kept calling WTFLogAlways() with an escape-hatch pointer.
Convert the call sites that were only reaching for const char* in order to
satisfy printf:
- String::utf8().legacyCStringPointer() becomes String::utf8(). This is the
bulk of the change and removes 60 uses of the accessor that CString.h
documents as an escape hatch for printf-style formatting.
- ASCIILiteral::characters() and CStringView::utf8() become the string itself.
- safeStrerror(errno).data() and CString::data() become the CString.
- char* string literals used as %s arguments become ASCIILiteral ("empty"_s).
- [x UTF8String] with %s becomes the object with %@, which also stops a nil
NSString from handing printf a null pointer.
Where the pointer genuinely comes from outside WTF -- GError::message,
g_module_error(), xpc_connection_copy_invalidation_reason() and the sandbox
parameter values -- wrap it in CStringView::unsafeFromUTF8() so the unchecked
conversion is named at the call site rather than implied, matching what
compileAndApplySandboxSlowCase() already does for sandbox_init's error buffer.
SiteIsolation.mm's indentation() helper built a manually null-terminated
Vector<char> purely to produce a %s argument; it returns an ASCIICString now.
ALWAYS_LOG_WITH_STREAM() and WTF_ALWAYS_LOG() in Assertions.h are left alone:
SAFE_WTFLOGALWAYS lives in StdLibExtras.h, which includes Assertions.h, so the
macro is not available there.
WTFLogAlways() call sites whose only arguments are Objective-C objects for %@
are unchanged -- there is no char* for the macro to reject, so converting them
would be churn.
No change in behavior.
* Source/JavaScriptCore/API/JSRemoteInspector.cpp:
(defaultStateForRemoteInspectionEnabledByDefault):
* Source/JavaScriptCore/inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::injectedScriptFor):
* Source/JavaScriptCore/inspector/InjectedScriptModule.cpp:
(Inspector::InjectedScriptModule::ensureInjected):
* Source/JavaScriptCore/runtime/ConsoleClient.cpp:
(JSC::ConsoleClient::printConsoleMessage):
(JSC::ConsoleClient::printConsoleMessageWithArguments):
* Source/WTF/wtf/Assertions.cpp:
* Source/WTF/wtf/TimingScope.cpp:
(WTF::TimingScope::scopeDidEnd):
* Source/WTF/wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
* Source/WTF/wtf/cocoa/ResourceUsageCocoa.cpp:
(WTF::logFootprintComparison):
* Source/WebCore/bindings/js/GarbageCollectionController.cpp:
(WebCore::GarbageCollectionController::dumpHeapForVM):
* Source/WebCore/history/BackForwardCache.cpp:
(WebCore::BackForwardCache::dump const):
* Source/WebCore/inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::unbufferedLog):
* Source/WebCore/layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
* Source/WebCore/layout/integration/grid/LayoutIntegrationGridCoverage.cpp:
(WebCore::LayoutIntegration::printLegacyGridReasons):
* Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::showLayoutTree):
* Source/WebCore/loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::dumpLRULists const):
* Source/WebCore/page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::dump const):
* Source/WebCore/page/cocoa/PageCocoa.mm:
(WebCore::Page::platformInitialize):
* Source/WebCore/page/scrolling/ScrollingStateTree.cpp:
(showScrollingStateTree):
* Source/WebCore/platform/android/SharedMemoryAndroid.cpp:
(WebCore::SharedMemory::allocate):
* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::clearNowPlayingInfo):
(WebCore::MediaSessionManagerCocoa::setNowPlayingInfo):
* Source/WebCore/platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::FileMonitor):
* Source/WebCore/platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* Source/WebCore/platform/graphics/gbm/GBMDevice.cpp:
(WebCore::GBMDevice::create):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::makeGStreamerElement):
* Source/WebCore/platform/graphics/win/FontCacheWin.cpp:
(WebCore::getLinkedFonts):
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.mm:
(WebCore::VideoPresentationInterfaceIOS::enterFullscreenHandler):
(WebCore::VideoPresentationInterfaceIOS::exitFullscreenHandler):
(WebCore::VideoPresentationInterfaceIOS::cleanupFullscreen):
* Source/WebCore/platform/unix/SharedMemoryUnix.cpp:
(WebCore::SharedMemory::allocate):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::showPaintOrderTree):
(WebCore::showLayerPositionTree):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::showRenderTreeForThis const):
(WebCore::RenderObject::showSubtreeForThis const):
(WebCore::RenderObject::showLineTreeForThis const):
(WebCore::printPaintOrderTreeForLiveDocuments):
(WebCore::printRenderTreeForLiveDocuments):
(WebCore::printLayerTreeForLiveDocuments):
(WebCore::printAccessibilityTreeForLiveDocuments):
(WebCore::printGraphicsLayerTreeForLiveDocuments):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::log):
* Source/WebGPU/WebGPU/Pipeline.mm:
* Source/WebKit/NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setPrivateClickMeasurementAppBundleIDForTesting):
* Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::add):
* Source/WebKit/Platform/IPC/cocoa/DaemonConnectionCocoa.mm:
(WebKit::Daemon::ConnectionToMachService<Traits>::initializeConnectionIfNeeded
const):
* Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::readyReadHandler):
(IPC::Connection::sendOutputMessage):
*
Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp:
(WebKit::ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel):
* Source/WebKit/Platform/glib/ModuleGlib.cpp:
(WebKit::Module::load):
* Source/WebKit/Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
* Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm:
(WebKit::hasProhibitedUsageStrings):
* Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::SandboxExtension::createReadOnlyHandlesForFiles):
(WebKit::SandboxExtension::createHandleForTemporaryFile):
(WebKit::SandboxExtension::createHandleForGenericExtension):
(WebKit::SandboxExtension::createHandleForMachLookup):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::dump const):
*
Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::dump const):
* Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::compileAndApplySandboxSlowCase):
* Source/WebKit/Shared/unix/BreakpadExceptionHandler.cpp:
(WebKit::installBreakpadExceptionHandler):
* Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp:
(WebKit::WebKitProtocolHandler::handleGPU):
* Source/WebKit/UIProcess/Cocoa/MediaPermissionUtilities.mm:
(WebKit::checkSandboxRequirementForType):
* Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm:
(-[WKPreferenceObserver init]):
* Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp:
(WebKit::IconCache::removeUnusedIcons):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logScrollingEvent):
* Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:
(WebKit::pathToPDFOnDisk):
(WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::RenderTargetEGLImage::create):
* Tools/TestWebKitAPI/Helpers/GraphicsTestUtilities.cpp:
(TestWebKitAPI::imageBufferPixelIs):
* Tools/TestWebKitAPI/Tests/WGSL/TestWGSLAPI.cpp:
(TestWGSLAPI::logCompilationError):
* Tools/TestWebKitAPI/Tests/WTF/URL.cpp:
(TestWebKitAPI::TEST_F(WTF_URL, URLRemoveQueryParameters)):
* Tools/TestWebKitAPI/Tests/WebCore/FloatQuadTests.cpp:
(TestWebKitAPI::checkIsEmpty):
* Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp:
(TestWebKitAPI::TEST_F(LoggingTest, DISABLED_TestRELEASE_LOG_WITH_LEVEL_IF)):
* Tools/TestWebKitAPI/Tests/WebCore/RegionTests.cpp:
(TestWebKitAPI::TEST(RegionTests, FuzzOperationsIsValidShape)):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::indentation):
(TestWebKitAPI::printTree):
* Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.cpp:
(WTR::UIScriptControllerGtk::sendEventStream):
* Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.cpp:
(WTR::UIScriptControllerWPE::sendEventStream):
Canonical link: https://commits.webkit.org/321031@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications