Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 170c1fcf9e15e3b1b3bebc0a093da67dce72fe77
      
https://github.com/WebKit/WebKit/commit/170c1fcf9e15e3b1b3bebc0a093da67dce72fe77
  Author: Adrian Taylor <adrian_tay...@apple.com>
  Date:   2025-06-23 (Mon, 23 Jun 2025)

  Changed paths:
    M Source/WTF/wtf/Assertions.cpp
    M Source/WTF/wtf/DateMath.cpp
    M Source/WTF/wtf/DateMath.h
    M Source/WTF/wtf/FastFloat.cpp
    M Source/WTF/wtf/FastFloat.h
    M Source/WTF/wtf/FileSystem.cpp
    M Source/WTF/wtf/JSONValues.cpp
    M Source/WTF/wtf/SIMDHelpers.h
    M Source/WTF/wtf/URL.cpp
    M Source/WTF/wtf/URLHelpers.cpp
    M Source/WTF/wtf/URLParser.cpp
    M Source/WTF/wtf/URLParser.h
    M Source/WTF/wtf/persistence/PersistentCoders.cpp
    M Source/WTF/wtf/text/ASCIIFastPath.h
    M Source/WTF/wtf/text/AdaptiveStringSearcher.h
    M Source/WTF/wtf/text/AtomString.h
    M Source/WTF/wtf/text/AtomStringImpl.cpp
    M Source/WTF/wtf/text/AtomStringImpl.h
    M Source/WTF/wtf/text/Base64.cpp
    M Source/WTF/wtf/text/Base64.h
    M Source/WTF/wtf/text/CodePointIterator.h
    M Source/WTF/wtf/text/ExternalStringImpl.cpp
    M Source/WTF/wtf/text/ExternalStringImpl.h
    M Source/WTF/wtf/text/LChar.h
    M Source/WTF/wtf/text/MakeString.h
    M Source/WTF/wtf/text/NullTextBreakIterator.h
    M Source/WTF/wtf/text/ParsingUtilities.h
    M Source/WTF/wtf/text/StringBuilder.cpp
    M Source/WTF/wtf/text/StringBuilder.h
    M Source/WTF/wtf/text/StringCommon.cpp
    M Source/WTF/wtf/text/StringCommon.h
    M Source/WTF/wtf/text/StringConcatenate.h
    M Source/WTF/wtf/text/StringHash.h
    M Source/WTF/wtf/text/StringHasher.h
    M Source/WTF/wtf/text/StringHasherInlines.h
    M Source/WTF/wtf/text/StringImpl.cpp
    M Source/WTF/wtf/text/StringImpl.h
    M Source/WTF/wtf/text/StringView.cpp
    M Source/WTF/wtf/text/StringView.h
    M Source/WTF/wtf/text/SuperFastHash.h
    M Source/WTF/wtf/text/SymbolImpl.h
    M Source/WTF/wtf/text/TextBreakIterator.cpp
    M Source/WTF/wtf/text/TextBreakIterator.h
    M Source/WTF/wtf/text/UniquedStringImpl.h
    M Source/WTF/wtf/text/WTFString.cpp
    M Source/WTF/wtf/text/WTFString.h
    M Source/WTF/wtf/text/WYHash.h
    M Source/WTF/wtf/text/cf/AtomStringImplCF.cpp
    M Source/WTF/wtf/text/cf/StringCF.cpp
    M Source/WTF/wtf/text/cf/StringConcatenateCF.h
    M Source/WTF/wtf/text/cf/TextBreakIteratorCF.h
    M Source/WTF/wtf/text/cocoa/ContextualizedNSString.mm
    M Source/WTF/wtf/text/cocoa/StringViewCocoa.mm
    M Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp
    M Source/WTF/wtf/text/icu/TextBreakIteratorICU.h
    M Source/WTF/wtf/text/icu/UTextProvider.cpp
    M Source/WTF/wtf/text/icu/UTextProvider.h
    M Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp
    M Source/WTF/wtf/text/icu/UTextProviderLatin1.h
    M Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp
    M Source/WTF/wtf/text/icu/UTextProviderUTF16.h
    M Source/WTF/wtf/text/win/WCharStringExtras.h
    M Source/WTF/wtf/unicode/CharacterNames.h
    M Source/WTF/wtf/unicode/UTF8Conversion.cpp
    M Source/WTF/wtf/unicode/icu/ICUHelpers.h
    M Source/WTF/wtf/win/FileSystemWin.cpp
    M Source/WTF/wtf/win/LanguageWin.cpp

  Log Message:
  -----------
  WTF: Convert UChar to char16_t
https://bugs.webkit.org/show_bug.cgi?id=294722
rdar://153817245

Reviewed by Alex Christensen.

This converts from UChar to char16_t across the WTF subproject. This was
performed using a simple textual find-and-replace for \bUChar\b.
This has no functional impact since UChar is a typedef to char16_t.

In addition to the functional replacement, one single comment was
updated to reflect the fact that we get char16_t from C++ rather than
ICU.

Similar PRs will be raised to convert other parts of the WebKit source code.

The goals are twofold:
* Switch to the C++ standard char16_t, because that makes WebKit code more
  standard. We have already done similarly by switching from UChar32 to
  char32_t.
* Unblock use of clang modules. Clang modules compile headers in standalone
  AST contexts, and did not previously work for WTF due to its dependency
  on setting the definition of UCHAR_TYPE for the ICU headers it includes.
  Although this is strictly a problem in the modularization of ICU, it's
  pretty hard to fix there, so if we can cease to rely on UChar then this
  unblocks us rather more quickly. Clang modules is a pre-requisite for
  use of Swift/C++ interop tools.

* Source/WTF/wtf/Assertions.cpp:
* Source/WTF/wtf/DateMath.cpp:
(WTF::WTF_REQUIRES_LOCK):
(WTF::validateTimeZone):
(WTF::getTimeZoneOverride):
* Source/WTF/wtf/DateMath.h:
* Source/WTF/wtf/FastFloat.cpp:
(WTF::parseDouble):
(WTF::parseHexDouble):
* Source/WTF/wtf/FastFloat.h:
* Source/WTF/wtf/FileSystem.cpp:
(WTF::FileSystemImpl::shouldEscapeUChar):
(WTF::FileSystemImpl::encodeForFileName):
(WTF::FileSystemImpl::decodeFromFilename):
(WTF::FileSystemImpl::isAncestor):
* Source/WTF/wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::parseJSON):
* Source/WTF/wtf/SIMDHelpers.h:
* Source/WTF/wtf/URL.cpp:
(WTF::shouldTrimFromURL):
(WTF::appendEncodedHostname):
(WTF::forwardSlashHashOrQuestionMark):
(WTF::slashHashOrQuestionMark):
(WTF::URL::setHost):
(WTF::URL::setHostAndPort):
(WTF::percentEncodeCharacters):
(WTF::escapePathWithoutCopying):
* Source/WTF/wtf/URLHelpers.cpp:
(WTF::URLHelpers::isLookalikeSequence):
(WTF::URLHelpers::allCharactersInAllowedIDNScriptList):
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
(WTF::URLHelpers::isRussianDomainNameCharacter):
(WTF::URLHelpers::allCharactersAllowedByTLDRules):
(WTF::URLHelpers::mapHostName):
(WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
(WTF::URLHelpers::applyHostNameFunctionToURLString):
(WTF::URLHelpers::escapeUnsafeCharacters):
* Source/WTF/wtf/URLParser.cpp:
(WTF::appendCodePoint):
(WTF::isForbiddenHostCodePoint):
(WTF::URLParser::isInUserInfoEncodeSet):
(WTF::URLParser::isSpecialCharacterForFragmentDirective):
(WTF::URLParser::encodeNonUTF8Query):
(WTF::URLParser::isLocalhost):
(WTF::URLParser::parsedDataView):
(WTF::URLParser::parse):
(WTF::URLParser::domainToASCII):
(WTF::URLParser::subdomainStartsWithXNDashDash):
(WTF::dnsNameEndsInNumber):
* Source/WTF/wtf/URLParser.h:
* Source/WTF/wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<String>::decodeForPersistence):
* Source/WTF/wtf/text/ASCIIFastPath.h:
* Source/WTF/wtf/text/AdaptiveStringSearcher.h:
(WTF::AdaptiveStringSearcherBase::exceedsOneByte):
* Source/WTF/wtf/text/AtomString.h:
(WTF::operator==):
(WTF::AtomString::AtomString):
(WTF::makeStringByReplacingAll):
* Source/WTF/wtf/text/AtomStringImpl.cpp:
(WTF::HashedUTF8CharactersTranslator::translate):
(WTF::AtomStringImpl::add):
(WTF::addStatic):
(WTF::AtomStringImpl::lookUp):
* Source/WTF/wtf/text/AtomStringImpl.h:
* Source/WTF/wtf/text/Base64.cpp:
(WTF::base64Encode):
(WTF::base64DecodeToString):
(WTF::fromBase64SlowImpl):
* Source/WTF/wtf/text/Base64.h:
(WTF::base64Encode):
* Source/WTF/wtf/text/CodePointIterator.h:
(WTF::CodePointIterator<char16_t>::operator const):
(WTF::CodePointIterator<char16_t>::operator):
(WTF::CodePointIterator<UChar>::operator const): Deleted.
(WTF::CodePointIterator<UChar>::operator): Deleted.
* Source/WTF/wtf/text/ExternalStringImpl.cpp:
(WTF::ExternalStringImpl::create):
(WTF::ExternalStringImpl::ExternalStringImpl):
* Source/WTF/wtf/text/ExternalStringImpl.h:
* Source/WTF/wtf/text/LChar.h:
* Source/WTF/wtf/text/MakeString.h:
(WTF::tryMakeStringImplFromAdaptersInternal):
(WTF::tryMakeAtomStringFromAdapters):
* Source/WTF/wtf/text/NullTextBreakIterator.h:
(WTF::NullTextBreakIterator::setText):
* Source/WTF/wtf/text/ParsingUtilities.h:
(WTF::characterPredicate):
(WTF::requires):
* Source/WTF/wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::shrink):
(WTF::StringBuilder::reallocateBuffer):
(WTF::StringBuilder::reserveCapacity):
(WTF::StringBuilder::extendBufferForAppendingWithUpconvert):
(WTF::StringBuilder::append):
* Source/WTF/wtf/text/StringBuilder.h:
(WTF::StringBuilder::operator StringView const):
(WTF::StringBuilder::append):
(WTF::StringBuilder::operator[] const):
* Source/WTF/wtf/text/StringCommon.cpp:
(WTF::find16NonASCIIAlignedImpl):
* Source/WTF/wtf/text/StringCommon.h:
(WTF::span):
(WTF::unsafeSpan):
(WTF::equal):
(WTF::find16NonASCII):
(WTF::find):
(WTF::copyElements):
* Source/WTF/wtf/text/StringConcatenate.h:
* Source/WTF/wtf/text/StringHash.h:
(WTF::ASCIICaseInsensitiveHash::FoldCase::convert):
* Source/WTF/wtf/text/StringHasher.h:
(WTF::StringHasher::DefaultConverter::convert):
* Source/WTF/wtf/text/StringHasherInlines.h:
(WTF::StringHasher::addCharacter):
(WTF::StringHasher::hashWithTop8BitsMasked):
* Source/WTF/wtf/text/StringImpl.cpp:
(WTF::StringImpl::createWithoutCopyingNonEmpty):
(WTF::StringImpl::createUninitialized):
(WTF::StringImpl::reallocate):
(WTF::StringImpl::tryReallocate):
(WTF::StringImpl::create):
(WTF::StringImpl::createStaticStringImpl):
(WTF::StringImpl::create8BitIfPossible):
(WTF::StringImpl::convertToLowercaseWithoutLocale):
(WTF::StringImpl::convertToUppercaseWithoutLocaleStartingAtFailingIndex8Bit):
(WTF::StringImpl::convertToUppercaseWithoutLocaleUpconvert):
(WTF::needsTurkishCasingRules):
(WTF::StringImpl::convertToLowercaseWithLocale):
(WTF::StringImpl::convertToUppercaseWithLocale):
(WTF::StringImpl::foldCase):
(WTF::StringImpl::simplifyWhiteSpace):
(WTF::StringImpl::reverseFind):
(WTF::StringImpl::startsWith const):
(WTF::StringImpl::endsWith const):
(WTF::StringImpl::replace):
(WTF::equal):
(WTF::StringImpl::adopt):
(WTF::StringImpl::utf8ForCharacters):
(WTF::StringImpl::utf8ForCharactersIntoBuffer):
(WTF::equalIgnoringNullity):
* Source/WTF/wtf/text/StringImpl.h:
(WTF::StringImpl::createWithoutCopying):
(WTF::StringImpl::copyCharacters):
(WTF::StringImpl::operator[] const):
(WTF::StringImpl::replace):
(WTF::StringImpl::constructInternal<char16_t>):
(WTF::StringImpl::span<char16_t> const):
(WTF::reverseFind):
(WTF::StringImpl::find):
(WTF::equalIgnoringNullity):
(WTF::isUnicodeWhitespace):
(WTF::deprecatedIsSpaceOrNewline):
(WTF::deprecatedIsNotSpaceOrNewline):
(WTF::StringImplShape::StringImplShape):
(WTF::StringImpl::containsOnlyLatin1 const):
(WTF::containsOnly):
(WTF::isSpecialCharacter const):
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::createSubstringSharingImpl):
(WTF::StringImpl::at const):
(WTF::StringImpl::requiresCopy const):
(WTF::StringImpl::createByReplacingInCharacters):
(WTF::StringImpl::tryGetUTF8ForCharacters):
(WTF::StringImpl::constructInternal<UChar>): Deleted.
(WTF::StringImpl::span<UChar> const): Deleted.
* Source/WTF/wtf/text/StringView.cpp:
(WTF::StringView::startsWith const):
(WTF::StringView::endsWith const):
(WTF::getCharactersWithASCIICaseInternal):
(WTF::StringView::getCharactersWithASCIICase const):
(WTF::normalizedNFC):
(WTF::makeStringByReplacingAll):
(WTF::makeStringBySimplifyingNewLinesSlowCase):
* Source/WTF/wtf/text/StringView.h:
(WTF::StringView::initialize):
(WTF::StringView::StringView):
(WTF::StringView::span16 const):
(WTF::StringView::span<char16_t> const):
(WTF::StringView::characterAt const):
(WTF::StringView::operator[] const):
(WTF::StringView::contains const):
(WTF:: const):
(WTF::isSpecialCharacter const):
(WTF::StringView::find const):
(WTF::StringView::reverseFind const):
(WTF::StringView::CodePoints::Iterator::operator++):
(WTF::StringView::CodePoints::Iterator::operator* const):
(WTF::StringView::CodeUnits::Iterator::operator* const):
(WTF::StringView::split const):
(WTF::StringView::splitAllowingEmptyEntries const):
(WTF::StringView::SplitResult::SplitResult):
(WTF::StringView::trim const):
(WTF::findCommon):
(WTF::makeStringByReplacingAll):
(WTF::StringView::span<UChar> const): Deleted.
* Source/WTF/wtf/text/SuperFastHash.h:
(WTF::SuperFastHash::addCharactersAssumingAligned):
(WTF::SuperFastHash::addCharacter):
(WTF::SuperFastHash::addCharacters):
(WTF::SuperFastHash::addCharactersAssumingAlignedImpl):
(WTF::SuperFastHash::addCharacterImpl):
(WTF::SuperFastHash::hashWithTop8BitsMaskedImpl):
(WTF::SuperFastHash::processPendingCharacterImpl):
* Source/WTF/wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::SymbolImpl):
* Source/WTF/wtf/text/TextBreakIterator.cpp:
(WTF::TextBreakIterator::mapModeToBackingIterator):
(WTF::TextBreakIterator::TextBreakIterator):
* Source/WTF/wtf/text/TextBreakIterator.h:
(WTF::TextBreakIterator::setText):
(WTF::TextBreakIteratorCache::take):
(WTF::CachedTextBreakIterator::CachedTextBreakIterator):
(WTF::CachedLineBreakIteratorFactory::PriorContext::lastCharacter const):
(WTF::CachedLineBreakIteratorFactory::PriorContext::secondToLastCharacter 
const):
(WTF::CachedLineBreakIteratorFactory::PriorContext::set):
(WTF::CachedLineBreakIteratorFactory::PriorContext::update):
(WTF::CachedLineBreakIteratorFactory::PriorContext::characters const):
* Source/WTF/wtf/text/UniquedStringImpl.h:
(WTF::UniquedStringImpl::UniquedStringImpl):
* Source/WTF/wtf/text/WTFString.cpp:
(WTF::String::String):
(WTF::String::substringSharingImpl const):
(WTF::String::charactersWithoutNullTermination const):
(WTF::String::charactersWithNullTermination const):
(WTF::String::splitInternal const):
(WTF::String::split const):
(WTF::String::splitAllowingEmptyEntries const):
(WTF::String::make8Bit):
(WTF::String::convertTo16Bit):
(WTF::fromUTF8Impl):
(WTF::String::fromCodePoint):
(WTF::charactersToDouble):
(WTF::charactersToFloat):
(asciiDebug):
* Source/WTF/wtf/text/WTFString.h:
(WTF::equalIgnoringNullity):
(WTF::String::span<char16_t> const):
(WTF::String::characterAt const):
(WTF::makeStringByReplacingAll):
(WTF::StringLiterals::operator_str):
(WTF::String::span<UChar> const): Deleted.
* Source/WTF/wtf/text/WYHash.h:
* Source/WTF/wtf/text/cf/AtomStringImplCF.cpp:
(WTF::AtomStringImpl::add):
* Source/WTF/wtf/text/cf/StringCF.cpp:
(WTF::String::String):
* Source/WTF/wtf/text/cf/StringConcatenateCF.h:
(WTF::StringTypeAdapter<CFStringRef>::writeTo<char16_t> const):
(WTF::StringTypeAdapter<CFStringRef>::writeTo<UChar> const): Deleted.
* Source/WTF/wtf/text/cf/TextBreakIteratorCF.h:
(WTF::TextBreakIteratorCF::setText):
* Source/WTF/wtf/text/cocoa/ContextualizedNSString.mm:
(-[WTFContextualizedNSString getCharacters:range:]):
* Source/WTF/wtf/text/cocoa/StringViewCocoa.mm:
(WTF::StringView::createNSString const):
(WTF::StringView::createNSStringWithoutCopying const):
* Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp:
(WTF::TextBreakIterator::mapModeToBackingIterator):
(WTF::TextBreakIterator::TextBreakIterator):
* Source/WTF/wtf/text/icu/TextBreakIteratorICU.h:
(WTF::TextBreakIteratorICU::TextBreakIteratorICU):
(WTF::TextBreakIteratorICU::setText):
* Source/WTF/wtf/text/icu/UTextProvider.cpp:
(WTF::uTextCloneImpl):
* Source/WTF/wtf/text/icu/UTextProvider.h:
(WTF::initializeContextAwareUTextProvider):
* Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp:
(WTF::chunkSpan):
(WTF::uTextLatin1Clone):
(WTF::uTextLatin1Extract):
(WTF::openLatin1UTextProvider):
(WTF::textLatin1ContextAwareMoveInPrimaryContext):
(WTF::textLatin1ContextAwareSwitchToPrimaryContext):
(WTF::textLatin1ContextAwareSwitchToPriorContext):
(WTF::uTextLatin1ContextAwareExtract):
(WTF::openLatin1ContextAwareUTextProvider):
* Source/WTF/wtf/text/icu/UTextProviderLatin1.h:
* Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp:
(WTF::textUTF16ContextAwareSwitchToPrimaryContext):
(WTF::textUTF16ContextAwareSwitchToPriorContext):
(WTF::uTextUTF16ContextAwareExtract):
(WTF::openUTF16ContextAwareUTextProvider):
* Source/WTF/wtf/text/icu/UTextProviderUTF16.h:
* Source/WTF/wtf/text/win/WCharStringExtras.h:
(WTF::ucharFrom):
(WTF::wcharFrom):
* Source/WTF/wtf/unicode/CharacterNames.h:
* Source/WTF/wtf/unicode/UTF8Conversion.cpp:
(WTF::Unicode::equal):
* Source/WTF/wtf/unicode/icu/ICUHelpers.h:
* Source/WTF/wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::storageDirectory):
* Source/WTF/wtf/win/LanguageWin.cpp:
(WTF::localeInfo):

Canonical link: https://commits.webkit.org/296518@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to