Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 99452a3d81d4bd7e2a9d591baab5a5876830ade4
https://github.com/WebKit/WebKit/commit/99452a3d81d4bd7e2a9d591baab5a5876830ade4
Author: Chris Dumez <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M Source/JavaScriptCore/assembler/LinkBuffer.cpp
M Source/JavaScriptCore/b3/B3AbstractHeap.cpp
M Source/JavaScriptCore/b3/B3AbstractHeap.h
M Source/JavaScriptCore/heap/MarkedBlock.cpp
M Source/JavaScriptCore/jsc.cpp
M Source/JavaScriptCore/tools/JSDollarVM.cpp
M Source/WTF/wtf/Forward.h
M Source/WTF/wtf/NumberOfCores.cpp
M Source/WTF/wtf/cf/FileSystemCF.cpp
M Source/WTF/wtf/cocoa/CrashReporter.cpp
M Source/WTF/wtf/cocoa/CrashReporter.h
M Source/WTF/wtf/darwin/OSLogPrintStream.h
M Source/WTF/wtf/darwin/OSLogPrintStream.mm
M Source/WTF/wtf/text/CString.h
M Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm
M Source/WebKit/Platform/cocoa/WKCrashReporter.h
M Source/WebKit/Platform/cocoa/WKCrashReporter.mm
M Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm
M
Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm
M Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm
M Source/WebKit/WPEPlatform/wpe/WPESettings.cpp
M Tools/DumpRenderTree/mac/DumpRenderTree.mm
M Tools/TestWebKitAPI/Tests/WTF/CString.cpp
M Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm
Log Message:
-----------
Make CString::newUninitialized() reachable only through CStringWithEncoding
https://bugs.webkit.org/show_bug.cgi?id=324692
Reviewed by Mike Wyrzykowski.
newUninitialized() hands out a mutable buffer, so there is no point at which
the encoding of the bytes written into it can be established. It becomes
protected, which leaves CStringWithEncoding as the only way to allocate one.
The four callers outside WTF name an encoding: the GSettings key path in
WPESettings is UTF-8, and the cached sandbox builtin, the B3 heap index names
and the LinkBuffer thunk label are ASCII. SandboxInfo::header and
setAndSerializeSandboxParameters() follow the builtin, as they already held
what String::ascii() returns and only the declared type erased it.
setCrashLogMessage() takes a UTF8CString&&, which is what every caller already
holds and which says that the message is retained for the lifetime of the
process. logAndSetCrashLogMessage() is typed the same way and logs through
SAFE_WTFLOGALWAYS, since WTFLogAlways is raw varargs. Ten call sites stop
reaching for legacyCStringPointer(), and MarkedBlock logs its message before
moving it.
numberOfProcessorCores() reads its environment variable through a CStringView,
as the other getenv() call sites do, which also drops a copy, and the
OSLogPrintStream scratch buffer becomes a UTF8CString.
* Source/JavaScriptCore/assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::finalizeCodeWithDisassemblyImpl):
* Source/JavaScriptCore/b3/B3AbstractHeap.cpp:
(JSC::B3::IndexedAbstractHeap::initialize):
* Source/JavaScriptCore/b3/B3AbstractHeap.h:
* Source/JavaScriptCore/heap/MarkedBlock.cpp:
(JSC::crashDueToGarbageCollectorClientDanglingReference_CheckRootsAndBarriers):
(JSC::MarkedBlock::analyzeInvalidHandleAndCrash):
* Source/JavaScriptCore/jsc.cpp:
(main):
* Source/JavaScriptCore/tools/JSDollarVM.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/WTF/wtf/NumberOfCores.cpp:
(WTF::numberOfProcessorCores):
* Source/WTF/wtf/cf/FileSystemCF.cpp:
(WTF::FileSystem::fileSystemRepresentation):
* Source/WTF/wtf/cocoa/CrashReporter.cpp:
(WTF::setCrashLogMessage):
* Source/WTF/wtf/cocoa/CrashReporter.h:
* Source/WTF/wtf/darwin/OSLogPrintStream.h:
* Source/WTF/wtf/darwin/OSLogPrintStream.mm:
(WTF::OSLogPrintStream::vprintf):
* Source/WTF/wtf/text/CString.h:
* Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm:
(IPC::Connection::sendMessage):
(IPC::readFromMachPort):
* Source/WebKit/Platform/cocoa/WKCrashReporter.h:
* Source/WebKit/Platform/cocoa/WKCrashReporter.mm:
(WebKit::logAndSetCrashLogMessage):
* Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm:
(WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
* Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::checkFrameworkVersion):
* Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::SandboxInfo::SandboxInfo):
(WebKit::setAndSerializeSandboxParameters):
(WebKit::tryApplyCachedSandbox):
* Source/WebKit/WPEPlatform/wpe/WPESettings.cpp:
(makeKeyPath):
(wpe_settings_load_from_keyfile):
* Tools/DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, ASCIICStringUninitializedConstructor)):
(TEST(WTF, CStringUninitializedConstructor)): Deleted.
* Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm:
(WTR::setCrashReportApplicationSpecificInformationToURL):
Canonical link: https://commits.webkit.org/321560@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications