Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8217890851167c3b788be2bedf3d38a087c4e220
https://github.com/WebKit/WebKit/commit/8217890851167c3b788be2bedf3d38a087c4e220
Author: Chris Dumez <[email protected]>
Date: 2026-09-16 (Wed, 16 Sep 2026)
Changed paths:
M Source/JavaScriptCore/tools/FunctionOverrides.cpp
M Source/WTF/wtf/Logger.cpp
M Source/WTF/wtf/Logger.h
M Source/WTF/wtf/SHA1.cpp
M Source/WTF/wtf/SHA1.h
M Source/WTF/wtf/cocoa/FileSystemCocoa.mm
M Source/WTF/wtf/persistence/PersistentCoders.cpp
M Source/WTF/wtf/persistence/PersistentCoders.h
M Source/WTF/wtf/text/Base64.h
M Source/WTF/wtf/text/WTFString.cpp
M Source/WTF/wtf/unicode/icu/CollatorICU.cpp
M Source/WebCore/Modules/webauthn/WebAuthenticationUtils.cpp
M Source/WebCore/Modules/webauthn/fido/Pin.cpp
M Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
M Source/WebCore/PAL/pal/crypto/CryptoDigest.h
M Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm
M Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
M Source/WebCore/platform/sql/SQLiteFileSystem.cpp
M Source/WebCore/storage/StorageUtilities.cpp
M Source/WebCore/workers/service/server/SWScriptStorage.cpp
M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp
M Tools/TestWebKitAPI/Helpers/cocoa/NetworkConnection.mm
M Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp
M Tools/TestWebKitAPI/Tests/WebCore/CryptoDigest.cpp
Log Message:
-----------
Reduce use of untyped CString
https://bugs.webkit.org/show_bug.cgi?id=324322
Reviewed by Mike Wyrzykowski.
CString does not record the encoding of its bytes, so callers keep having to
re-establish it with byteCast<> at every use. Move APIs that already know their
encoding over to UTF8CString / Latin1CString / ASCIICString, and drop the
CString
overloads that only existed to paper over the gap: SHA1::addBytes(const
CString&)
and Persistence::Coder<CString> are removed, and Logger::osLog(),
base64EncodeToStringReturnNullIfOverflow(), CollatorICU and
createTemporaryZipArchive() now use the typed strings.
Add CryptoDigest::addBytes(std::span<const std::byte>), mirroring SHA1, so
hashing
a string is std::as_bytes(string.span()) rather than byteCast<uint8_t>(...).
This
removes the cast from seven call sites, leaving one in the CryptoDigest
forwarder.
copyShortASCIIString() no longer over-allocates by a byte: it asked for
length + 1 and so returned a string whose length() included the null terminator.
CStringBuffer already reserves room for the terminator.
* Source/JavaScriptCore/tools/FunctionOverrides.cpp:
(JSC::parseClause):
* Source/WTF/wtf/Logger.cpp:
(WTF::Logger::osLog):
* Source/WTF/wtf/Logger.h:
* Source/WTF/wtf/SHA1.cpp:
(WTF::SHA1::addUTF8Bytes):
* Source/WTF/wtf/SHA1.h:
* Source/WTF/wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::createTemporaryZipArchive):
* Source/WTF/wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<CString>::encodeForPersistence): Deleted.
(WTF::Persistence::Coder<CString>::decodeForPersistence): Deleted.
* Source/WTF/wtf/persistence/PersistentCoders.h:
* Source/WTF/wtf/text/Base64.h:
(WTF::base64EncodeToStringReturnNullIfOverflow):
* Source/WTF/wtf/text/WTFString.cpp:
(asciiDebug):
* Source/WTF/wtf/unicode/icu/CollatorICU.cpp:
(WTF::copyShortASCIIString):
(WTF::copyDefaultLocale):
(WTF::resolveDefaultLocale):
* Source/WebCore/Modules/webauthn/WebAuthenticationUtils.cpp:
(WebCore::produceRpIdHash):
* Source/WebCore/Modules/webauthn/fido/Pin.cpp:
(fido::pin::TokenRequest::tryCreate):
* Source/WebCore/Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::getExpectedWebSocketAccept):
* Source/WebCore/PAL/pal/crypto/CryptoDigest.h:
(PAL::Crypto::CryptoDigest::addBytes):
* Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::showText):
* Source/WebCore/platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::drawNumber):
* Source/WebCore/platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::computeHashForFileName):
* Source/WebCore/storage/StorageUtilities.cpp:
(WebCore::StorageUtilities::encodeSecurityOriginForFileName):
* Source/WebCore/workers/service/server/SWScriptStorage.cpp:
(WebCore::SWScriptStorage::sha2Hash const):
* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:
(WebKit::encode):
* Tools/TestWebKitAPI/Helpers/cocoa/NetworkConnection.mm:
(TestWebKitAPI::Connection::webSocketHandshake):
* Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp:
(TestWebKitAPI::expectSHA1):
* Tools/TestWebKitAPI/Tests/WebCore/CryptoDigest.cpp:
(TestWebKitAPI::expect):
Canonical link: https://commits.webkit.org/321289@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications