Skip to content

Conversation

@calvaris
Copy link
Member

This PR backports all changes regarding string management that took some time. It is necessary proper testing before merging.

https://bugs.webkit.org/show_bug.cgi?id=289788

Reviewed by Philippe Normand.

Other than the description, as a fly-by, made GstPadTemplate use a smart ptr.

* Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(_WebKitWebAudioSrcPrivate::_WebKitWebAudioSrcPrivate):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::webkitGstGhostPadFromStaticTemplate):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
* Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:
(webKitAudioSinkConfigure):
* Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp:
(videoEncoderConstructed):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcAddTrack):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=289896

Reviewed by Philippe Normand.

* Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::plugDeinterleave):
* Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::doCapsHaveType):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
* Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
(WebCore::ImageDecoderGStreamer::ImageDecoderGStreamer):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerIncomingTrackProcessor.cpp:
(WebCore::GStreamerIncomingTrackProcessor::configure):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=289942

Reviewed by Philippe Normand.

* Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp:
(WebCore::createGStreamerPeerConnectionBackend):
* Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
(webKitGLVideoSinkProbePlatform):
* Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp:
(WebCore::GStreamerAudioMixer::isAvailable):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::isGStreamerPluginAvailable):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
* Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
(webKitTextCombinerHandleCaps):
(webkitTextCombinerNew):
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp:
(WebCore::MediaRecorderPrivateBackend::containerProfile):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=289949

Reviewed by Philippe Normand.

For the same price I removed the makeGStreamerBin function, that is supposed to be dead code.

* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::maybeInsertNetSimForElement):
(WebCore::GStreamerMediaEndpoint::initializePipeline):
* Source/WebCore/platform/audio/gstreamer/AudioDecoderGStreamer.cpp:
(WebCore::GStreamerInternalAudioDecoder::GStreamerInternalAudioDecoder):
* Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
(WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
* Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::handleNewDeinterleavePad):
(WebCore::AudioFileReader::plugDeinterleave):
(WebCore::AudioFileReader::decodeAudioForBusCreation):
* Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
(WebCore::AudioSourceProviderGStreamer::configureAudioBin):
(WebCore::AudioSourceProviderGStreamer::setClient):
(WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
* Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcConstructed):
* Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
(webKitGLVideoSinkConstructed):
* Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp:
(WebCore::GStreamerAudioMixer::GStreamerAudioMixer):
(WebCore::GStreamerAudioMixer::registerProducer):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::createAutoAudioSink):
(WebCore::makeGStreamerElement):
(WebCore::makeGStreamerBin): Deleted.
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
* Source/WebCore/platform/graphics/gstreamer/GStreamerVideoFrameConverter.cpp:
(WebCore::GStreamerVideoFrameConverter::Pipeline::Pipeline):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSinkGL):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
* Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
(webKitTextCombinerHandleCaps):
* Source/WebCore/platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkConstructed):
* Source/WebCore/platform/graphics/gstreamer/VideoDecoderGStreamer.cpp:
(WebCore::GStreamerInternalVideoDecoder::GStreamerInternalVideoDecoder):
* Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:
(webKitAudioSinkConfigure):
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::createOptionalParserForFormat):
(WebCore::createOptionalEncoderForFormat):
(WebCore::AppendPipeline::Track::initializeElements):
* Source/WebCore/platform/gstreamer/GStreamerHolePunchQuirkFake.h:
* Source/WebCore/platform/gstreamer/GStreamerHolePunchQuirkRialto.cpp:
(WebCore::GStreamerHolePunchQuirkRialto::createHolePunchVideoSink):
* Source/WebCore/platform/gstreamer/GStreamerHolePunchQuirkWesteros.cpp:
(WebCore::GStreamerHolePunchQuirkWesteros::createHolePunchVideoSink):
* Source/WebCore/platform/gstreamer/GStreamerQuirkAmLogic.cpp:
(WebCore::GStreamerQuirkAmLogic::createWebAudioSink):
* Source/WebCore/platform/gstreamer/GStreamerQuirkRealtek.cpp:
(WebCore::GStreamerQuirkRealtek::createWebAudioSink):
* Source/WebCore/platform/gstreamer/GStreamerQuirkRialto.cpp:
(WebCore::GStreamerQuirkRialto::createAudioSink):
(WebCore::GStreamerQuirkRialto::createWebAudioSink):
* Source/WebCore/platform/gstreamer/PlatformSpeechSynthesizerGStreamer.cpp:
(WebCore::GstSpeechSynthesisWrapper::GstSpeechSynthesisWrapper):
* Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp:
(videoEncoderSetEncoder):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::createConverter):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioRTPPacketizer.cpp:
(WebCore::GStreamerAudioRTPPacketizer::create):
(WebCore::GStreamerAudioRTPPacketizer::GStreamerAudioRTPPacketizer):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::GStreamerCapturer):
(WebCore::GStreamerCapturer::setupPipeline):
(WebCore::GStreamerCapturer::makeElement):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.h:
* Source/WebCore/platform/mediastream/gstreamer/GStreamerIncomingTrackProcessor.cpp:
(WebCore::GStreamerIncomingTrackProcessor::incomingTrackProcessor):
(WebCore::GStreamerIncomingTrackProcessor::createParser):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMockDevice.cpp:
(webkitMockDeviceCreateElement):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::GStreamerVideoCapturer::GStreamerVideoCapturer):
(WebCore::GStreamerVideoCapturer::createConverter):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.h:
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoRTPPacketizer.cpp:
(WebCore::GStreamerVideoRTPPacketizer::GStreamerVideoRTPPacketizer):
* Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceGStreamer.cpp:
(WebCore::RealtimeOutgoingVideoSourceGStreamer::initializePreProcessor):
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerWebRTCVideoDecoder::makeElement):
(WebCore::GStreamerWebRTCVideoDecoder::CreateFilter):
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp:
(WebCore::LibWebRTCGStreamerVideoEncoder::makeElement):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
@calvaris calvaris requested a review from philn as a code owner December 19, 2025 15:13
calvaris and others added 18 commits December 19, 2025 16:16
https://bugs.webkit.org/show_bug.cgi?id=290035

Reviewed by Philippe Normand.

* Source/WebCore/Modules/mediastream/gstreamer/GStreamerIceTransportBackend.cpp:
(WebCore::GStreamerIceTransportBackend::iceTransportChanged):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::initializePipeline):
(WebCore::GStreamerMediaEndpoint::requestPad):
* Source/WebCore/platform/audio/gstreamer/AudioEncoderGStreamer.cpp:
(WebCore::GStreamerInternalAudioEncoder::initialize):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::configureAudioDecoderForHarnessing):
(WebCore::configureVideoDecoderForHarnessing):
(WebCore::configureMediaStreamVideoDecoder):
(WebCore::configureVideoRTPDepayloader):
(WebCore::gstObjectHasProperty):
(WebCore::gstElementMatchesFactoryAndHasProperty):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::configureVideoDecoder):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
* Source/WebCore/platform/gstreamer/GStreamerHolePunchQuirkBcmNexus.cpp:
(WebCore::GStreamerHolePunchQuirkBcmNexus::setHolePunchVideoRectangle):
* Source/WebCore/platform/gstreamer/GStreamerHolePunchQuirkRialto.cpp:
(WebCore::GStreamerHolePunchQuirkRialto::setHolePunchVideoRectangle):
* Source/WebCore/platform/gstreamer/GStreamerHolePunchQuirkWesteros.cpp:
(WebCore::GStreamerHolePunchQuirkWesteros::setHolePunchVideoRectangle):
* Source/WebCore/platform/gstreamer/GStreamerQuirkAmLogic.cpp:
(WebCore::GStreamerQuirkAmLogic::configureElement):
* Source/WebCore/platform/gstreamer/GStreamerQuirkBroadcom.cpp:
(WebCore::GStreamerQuirkBroadcom::configureElement):
* Source/WebCore/platform/gstreamer/GStreamerQuirkBroadcomBase.cpp:
(WebCore::GStreamerQuirkBroadcomBase::setupBufferingPercentageCorrection const):
* Source/WebCore/platform/gstreamer/GStreamerQuirkRealtek.cpp:
(WebCore::GStreamerQuirkRealtek::configureElement):
* Source/WebCore/platform/gstreamer/GStreamerQuirkWesteros.cpp:
(WebCore::GStreamerQuirkWesteros::configureElement):
* Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp:
(webkit_video_encoder_class_init):
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp:
(WebCore::MediaRecorderPrivateBackend::configureAudioEncoder):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioRTPPacketizer.cpp:
(WebCore::GStreamerAudioRTPPacketizer::create):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerIncomingTrackProcessor.cpp:
(WebCore::GStreamerIncomingTrackProcessor::mediaStreamIdFromPad):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoRTPPacketizer.cpp:
(WebCore::GStreamerVideoRTPPacketizer::create):
* Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.cpp:
(WebCore::RealtimeOutgoingMediaSourceGStreamer::initialize):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=290049

Reviewed by Philippe Normand.

* Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
(webKitGLVideoSinkChangeState):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::setGstElementGLContext):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
* Source/WebCore/platform/graphics/gstreamer/GStreamerVideoFrameConverter.cpp:
(WebCore::GStreamerVideoFrameConverter::Pipeline::run):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
…null terminated strings

https://bugs.webkit.org/show_bug.cgi?id=290306

Reviewed by Geoffrey Garen.

Created a new CStringView type to wrap a C String and be able to recover, without copies, the original string while
taking advantage of some other string niceties likes comparisons and the like. This class handles UTF8 strings only, so
if you need to compare or interface with any other WebKit strings, you have to convert to String.

I used that on gstStructureGetString and Name and updated the rest of the code accordingly.

Tests: Tools/TestWebKitAPI/Tests/WTF/CStringView.cpp

* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/CMakeLists.txt:
* Source/WTF/wtf/text/CStringView.cpp: Added.
(WTF::CStringView::toString const):
(WTF::CStringView::dump const):
* Source/WTF/wtf/text/CStringView.h: Added.
(WTF::operator==):
(WTF::safePrintfType):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::requestPad):
(WebCore::GStreamerMediaEndpoint::connectIncomingTrack):
(WebCore::GStreamerMediaEndpoint::preprocessStats):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerRtpReceiverBackend.cpp:
(WebCore::GStreamerRtpReceiverBackend::getParameters):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp:
(WebCore::iceCandidateType):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerWebRTCUtils.cpp:
(WebCore::toRTCEncodingParameters):
(WebCore::toRTCRtpSendParameters):
(WebCore::payloadTypeForEncodingName):
(WebCore::capsFromRtpCapabilities):
(WebCore::capsFromSDPMedia):
(WebCore::extractMidAndRidFromRTPBuffer):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerWebRTCUtils.h:
* Source/WebCore/inspector/agents/page/PageHeapAgent.cpp:
(WebCore::PageHeapAgent::heapSnapshotBuilderOverrideClassName):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgent const):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::webkitGstGhostPadFromStaticTemplate):
(WebCore::capsMediaType):
(WebCore::doCapsHaveType):
(WebCore::gstStructureGet):
(WebCore::gstStructureGetString):
(WebCore::gstStructureGetName):
(WebCore::gstStructureGetArray):
(WebCore::gstStructureGetList):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const):
* Source/WebCore/platform/graphics/gstreamer/GStreamerVideoFrameConverter.cpp:
(WebCore::GStreamerVideoFrameConverter::convert):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
* Source/WebCore/platform/graphics/gstreamer/VideoEncoderGStreamer.cpp:
(WebCore::retrieveTemporalIndex):
* Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:
(webKitAudioSinkConfigure):
* Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(transformCaps):
(transformInPlace):
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::appsinkCapsChanged):
* Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
(WebCore::GStreamerMediaDescription::extractCodecName const):
* Source/WebCore/platform/gstreamer/GStreamerElementHarness.cpp:
(WebCore::MermaidBuilder::describeCaps):
* Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp:
(webkit_video_encoder_class_init):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioRTPPacketizer.cpp:
(WebCore::GStreamerAudioRTPPacketizer::create):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::captureDeviceFromGstDevice):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerIncomingTrackProcessor.cpp:
(WebCore::GStreamerIncomingTrackProcessor::configure):
(WebCore::GStreamerIncomingTrackProcessor::incomingTrackProcessor):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcAddTrack):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMockDeviceProvider.cpp:
(webkitGstMockDeviceProviderSwitchDefaultDevice):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::GStreamerVideoCapturer::reconfigure):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoRTPPacketizer.cpp:
(WebCore::GStreamerVideoRTPPacketizer::create):
* Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceGStreamer.cpp:
(WebCore::RealtimeOutgoingAudioSourceGStreamer::setInitialParameters):
* Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.cpp:
(WebCore::RealtimeOutgoingMediaSourceGStreamer::setParameters):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::getPacketizerForRid):
* Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.h:
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerWebRTCVideoDecoder::makeElement):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::operator<<):
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WTF/CStringView.cpp: Added.
(TestWebKitAPI::TEST(WTF, CStringViewNullAndEmpty)):
(TestWebKitAPI::TEST(WTF, CStringViewLength)):
(TestWebKitAPI::TEST(WTF, CStringViewFrom)):
(TestWebKitAPI::TEST(WTF, CStringViewEquality)):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=294724
rdar://153818709

Reviewed by Alex Christensen.

WebKit wishes to move from UChar to the C++ standard char16_t; they are
currently typedef'ed to be the same. This PR makes the textual substitutions
across JavaScriptCore. This is a simple search and replace for \bUChar\b with
no other changes, and it should have no functional effect.

This is one of a series of PRs for different parts of WebKit.

* Source/JavaScriptCore/API/JSStringRef.cpp:
(JSStringCreateWithCharacters):
(JSStringCreateWithUTF8CString):
(JSStringCreateWithCharactersNoCopy):
* Source/JavaScriptCore/API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
* Source/JavaScriptCore/API/JSValueRef.cpp:
(JSValueMakeFromJSONString):
* Source/JavaScriptCore/API/OpaqueJSString.cpp:
(OpaqueJSString::~OpaqueJSString):
(OpaqueJSString::characters):
* Source/JavaScriptCore/API/OpaqueJSString.h:
(OpaqueJSString::create):
(OpaqueJSString::OpaqueJSString):
* Source/JavaScriptCore/API/glib/JSCValue.cpp:
(jsc_value_new_from_json):
* Source/JavaScriptCore/API/tests/JSONParseTest.cpp:
(testJSONParse):
* Source/JavaScriptCore/KeywordLookupGenerator.py:
(Trie.printAsC):
* Source/JavaScriptCore/builtins/BuiltinNames.cpp:
(JSC::BuiltinNames::lookUpPrivateName const):
(JSC::BuiltinNames::lookUpWellKnownSymbol const):
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/bytecode/CodeBlockHash.cpp:
(JSC::CodeBlockHash::CodeBlockHash):
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* Source/JavaScriptCore/dfg/DFGLazyJSValue.cpp:
(JSC::DFG::equalToSingleCharacter):
* Source/JavaScriptCore/dfg/DFGLazyJSValue.h:
(JSC::DFG::LazyJSValue::singleCharacterString):
(JSC::DFG::LazyJSValue::character const):
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
* Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.h:
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringIndexOf):
* Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::escapeStringForRegularExpressionSource):
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::Interpreter::executeProgram):
* Source/JavaScriptCore/jsc.cpp:
(pathSeparator):
* Source/JavaScriptCore/parser/Lexer.cpp:
(JSC::isSingleCharacterIdentStart):
(JSC::cannotBeIdentStart):
(JSC::isSingleCharacterIdentPart):
(JSC::cannotBeIdentPartOrEscapeStart):
(JSC::Lexer<char16_t>::currentCodePoint const):
(JSC::Lexer<T>::append16):
(JSC::Lexer<T>::record16):
(JSC::Lexer<CharacterType>::recordUnicodeCodePoint):
(JSC::Lexer<char16_t>::parseIdentifier):
(JSC::characterRequiresParseStringSlowCase):
(JSC::Lexer<CharacterType>::parseCommentDirectiveValue):
(JSC::orCharacter<LChar>):
(JSC::orCharacter<char16_t>):
(JSC::Lexer<T>::scanRegExp):
(JSC::Lexer<T>::clear):
(JSC::Lexer<UChar>::currentCodePoint const): Deleted.
(JSC::Lexer<UChar>::parseIdentifier): Deleted.
(JSC::orCharacter<UChar>): Deleted.
* Source/JavaScriptCore/parser/Lexer.h:
(JSC::Lexer::append16):
(JSC::Lexer<char16_t>::isWhiteSpace):
(JSC::Lexer<char16_t>::isLineTerminator):
(JSC::Lexer<T>::convertUnicode):
(JSC::Lexer<LChar>::makeRightSizedIdentifier):
(JSC::Lexer<char16_t>::makeRightSizedIdentifier):
(JSC::Lexer<char16_t>::setCodeStart):
(JSC::Lexer<T>::makeIdentifierLCharFromUChar):
(JSC::Lexer<T>::makeLCharIdentifier):
(JSC::Lexer<UChar>::isWhiteSpace): Deleted.
(JSC::Lexer<UChar>::isLineTerminator): Deleted.
(JSC::Lexer<UChar>::makeRightSizedIdentifier): Deleted.
(JSC::Lexer<UChar>::setCodeStart): Deleted.
* Source/JavaScriptCore/parser/Parser.cpp:
* Source/JavaScriptCore/parser/Parser.h:
(JSC::parse):
(JSC::parseRootNode):
(JSC::parseFunctionForFunctionConstructor):
* Source/JavaScriptCore/parser/ParserArena.h:
(JSC::IdentifierArena::makeIdentifierLCharFromUChar):
* Source/JavaScriptCore/runtime/ArrayPrototype.cpp:
(JSC::sortBucketSort):
* Source/JavaScriptCore/runtime/CachedTypes.cpp:
(JSC::CachedUniquedStringImplBase::span16 const):
* Source/JavaScriptCore/runtime/ExceptionHelpers.cpp:
(JSC::functionCallBase):
* Source/JavaScriptCore/runtime/ISO8601.cpp:
(JSC::ISO8601::canBeTimeZone):
(JSC::ISO8601::parseTimeZoneAnnotation):
(JSC::ISO8601::parseTimeZone):
* Source/JavaScriptCore/runtime/Identifier.cpp:
(JSC::Identifier::add8):
* Source/JavaScriptCore/runtime/Identifier.h:
(JSC::Identifier::createLCharFromUChar):
(JSC::Identifier::canUseSingleCharacterString):
(JSC::Identifier::equal):
* Source/JavaScriptCore/runtime/IdentifierInlines.h:
(JSC::Identifier::Identifier):
(JSC::Identifier::fromString):
* Source/JavaScriptCore/runtime/IntlCache.cpp:
(JSC::IntlCache::getBestDateTimePattern):
(JSC::IntlCache::getFieldDisplayName):
* Source/JavaScriptCore/runtime/IntlCache.h:
* Source/JavaScriptCore/runtime/IntlCollator.cpp:
(JSC::IntlCollator::checkICULocaleInvariants):
* Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:
(JSC::canonicalizeTimeZoneName):
(JSC::IntlDateTimeFormat::hourCycleFromSymbol):
(JSC::IntlDateTimeFormat::hourCycleFromPattern):
(JSC::IntlDateTimeFormat::replaceHourCycleInSkeleton):
(JSC::IntlDateTimeFormat::replaceHourCycleInPattern):
(JSC::IntlDateTimeFormat::buildSkeleton):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::IntlDateTimeFormat::format const):
(JSC::IntlDateTimeFormat::formatToParts const):
(JSC::IntlDateTimeFormat::createDateIntervalFormatIfNecessary):
(JSC::IntlDateTimeFormat::formatRange):
(JSC::IntlDateTimeFormat::formatRangeToParts):
* Source/JavaScriptCore/runtime/IntlDateTimeFormat.h:
* Source/JavaScriptCore/runtime/IntlDisplayNames.cpp:
(JSC::IntlDisplayNames::of const):
* Source/JavaScriptCore/runtime/IntlDurationFormat.cpp:
(JSC::retrieveSeparator):
(JSC::collectElements):
(JSC::IntlDurationFormat::format const):
(JSC::IntlDurationFormat::formatToParts const):
* Source/JavaScriptCore/runtime/IntlListFormat.cpp:
(JSC::IntlListFormat::format const):
(JSC::IntlListFormat::formatToParts const):
* Source/JavaScriptCore/runtime/IntlLocale.cpp:
(JSC::IntlLocale::hourCycles):
* Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::format const):
(JSC::IntlNumberFormat::formatRange const):
(JSC::IntlNumberFormat::formatRangeToPartsInternal):
(JSC::IntlNumberFormat::formatToParts const):
* Source/JavaScriptCore/runtime/IntlObject.cpp:
(JSC::convertToUnicodeSingletonIndex):
(JSC::LanguageTagParser::parseExtensionsAndPUExtensions):
* Source/JavaScriptCore/runtime/IntlObjectInlines.h:
(JSC::canUseASCIIUCADUCETComparison):
(JSC::followedByNonLatinCharacter):
(JSC::ListFormatInput::stringPointers const):
* Source/JavaScriptCore/runtime/IntlPluralRules.cpp:
(JSC::IntlPluralRules::select const):
(JSC::IntlPluralRules::selectRange const):
* Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.cpp:
(JSC::IntlRelativeTimeFormat::formatInternal const):
(JSC::IntlRelativeTimeFormat::formatToParts const):
* Source/JavaScriptCore/runtime/IntlSegmentIterator.cpp:
(JSC::IntlSegmentIterator::create):
(JSC::IntlSegmentIterator::IntlSegmentIterator):
* Source/JavaScriptCore/runtime/IntlSegmentIterator.h:
* Source/JavaScriptCore/runtime/IntlSegmenter.cpp:
(JSC::IntlSegmenter::segment const):
* Source/JavaScriptCore/runtime/IntlSegments.cpp:
(JSC::IntlSegments::create):
(JSC::IntlSegments::IntlSegments):
* Source/JavaScriptCore/runtime/IntlSegments.h:
* Source/JavaScriptCore/runtime/JSDateMath.cpp:
(JSC::DateCache::timeZoneDisplayName):
(JSC::retrieveTimeZoneInformation):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.cpp:
(JSC::decodeHex):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h:
* Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:
(JSC::decode):
(JSC::parseFloat):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSImmutableButterfly.cpp:
(JSC::JSImmutableButterfly::createFromString):
* Source/JavaScriptCore/runtime/JSONAtomStringCache.h:
(JSC::JSONAtomStringCache::cacheSlot):
* Source/JavaScriptCore/runtime/JSONAtomStringCacheInlines.h:
(JSC::JSONAtomStringCache::makeIdentifier):
* Source/JavaScriptCore/runtime/JSONObject.cpp:
(JSC::stringCopyUpconvert):
(JSC::stringify):
(JSC::jsonParseSlow):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSONParse):
(JSC::JSONParseWithException):
* Source/JavaScriptCore/runtime/JSString.cpp:
(JSC:: const):
(JSC::JSRopeString::resolveRopeWithFunction const):
* Source/JavaScriptCore/runtime/JSString.h:
(JSC::jsSingleCharacterString):
* Source/JavaScriptCore/runtime/JSStringInlines.h:
(JSC::JSString::tryReplaceOneCharImpl):
(JSC::JSString::tryReplaceOneChar):
(JSC::jsAtomString):
(JSC::jsSubstringOfResolved):
* Source/JavaScriptCore/runtime/JSStringJoiner.cpp:
(JSC::appendStringToDataWithOneCharacterSeparatorRepeatedly):
(JSC::JSStringJoiner::joinImpl):
(JSC::JSOnlyStringsAndInt32sJoiner::joinImpl):
* Source/JavaScriptCore/runtime/LiteralParser.cpp:
(JSC::cannotBeIdentPartOrEscapeStart):
(JSC::setParserTokenString<char16_t>):
(JSC::isSafeStringCharacter):
(JSC::isSafeStringCharacterForIdentifier):
(JSC::setParserTokenString<UChar>): Deleted.
* Source/JavaScriptCore/runtime/LiteralParser.h:
(JSC::LiteralParserToken::string16 const):
* Source/JavaScriptCore/runtime/ParseInt.h:
(JSC::parseIntOverflow):
(JSC::isStrWhiteSpace):
* Source/JavaScriptCore/runtime/RegExp.cpp:
(JSC::RegExpFunctionalTestCollector::outputEscapedString):
(JSC::appendLineTerminatorEscape<char16_t>):
(JSC::appendLineTerminatorEscape<UChar>): Deleted.
* Source/JavaScriptCore/runtime/RegExpObjectInlines.h:
(JSC::advanceStringUnicode):
* Source/JavaScriptCore/runtime/StringConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::stringFromCharCode):
* Source/JavaScriptCore/runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::splitStringByOneCharacterImpl):
(JSC::isASCIIIdentifierStart):
(JSC::toLocaleCase):
(JSC::normalize):
(JSC::illFormedIndex):
* Source/JavaScriptCore/runtime/StringPrototypeInlines.h:
(JSC::jsSpliceSubstringsWithSeparators):
(JSC::jsSpliceSubstringsWithSeparator):
(JSC::jsSpliceSubstrings):
(JSC::replaceAllWithCacheUsingRegExpSearchThreeArguments):
(JSC::replaceAllWithCacheUsingRegExpSearch):
* Source/JavaScriptCore/testRegExp.cpp:
(scanString):
* Source/JavaScriptCore/tools/CharacterPropertyDataGenerator.cpp:
(JSC::LineBreakData::fill):
(JSC::LineBreakData::dump):
(JSC::LineBreakData::setPairValue):
* Source/JavaScriptCore/yarr/YarrInterpreter.cpp:
(JSC::Yarr::interpret):
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
(JSC::Yarr::SubjectSampler::frequency const):
(JSC::Yarr::SubjectSampler::add):
* Source/JavaScriptCore/yarr/YarrJIT.h:
* Source/JavaScriptCore/yarr/YarrParser.h:
(JSC::Yarr::requires):
(JSC::Yarr::Parser::tryConsume):
(JSC::Yarr::parse):
* Source/JavaScriptCore/yarr/YarrPattern.cpp:
(JSC::Yarr::CharacterClassConstructor::putRange):
(JSC::Yarr::YarrPatternConstructor::extractSpecificPattern):
* Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp:
(JSC::Yarr::SyntaxChecker::atomCharacterClassAtom):
(JSC::Yarr::SyntaxChecker::atomCharacterClassRange):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
rdar://161048219
https://bugs.webkit.org/show_bug.cgi?id=299254

Reviewed by Sam Weinig.

* Source/WTF/wtf/text/Latin1Character.h: Renamed from Source/WTF/wtf/text/LChar.h.

* Tools/Scripts/do-webcore-rename: Updated the script so it only skips our copy of
icu, not our icu directories. And updated the "things to rename" to rename LChar.

* <many files>:
Let the do-webcore-rename script do its thing!

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
…Character

https://bugs.webkit.org/show_bug.cgi?id=299671
rdar://161487282

Reviewed by Sam Weinig.

* Source/JavaScriptCore/heap/HeapSnapshotBuilder.cpp:
(JSC::edgeTypeToNumber): Deleted.
(JSC::HeapSnapshotBuilder::json): Remove call to edgeTypeToNumber function so we can
serialize the edge type enumeration as a number. It's not needed because serialization
done by StringBuilder::append already serializes enumerations as their underlying=
numeric values.

* Source/WTF/wtf/HexNumber.cpp:
(WTF::Internal::hexDigitsForMode): Moved this function out of the header since it's
only used in this file.
* Source/WTF/wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Deleted.

* Source/WebCore/Modules/url-pattern/URLPatternParser.cpp:
(WebCore::URLPatternUtilities::escapeRegexStringForCharacters): Use an array of
CharacterType rather than an array of char.
(WebCore::URLPatternUtilities::escapePatternStringForCharacters): Ditto.

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
rdar://161524685
https://bugs.webkit.org/show_bug.cgi?id=299706

Reviewed by Geoffrey Garen.

* Source/JavaScriptCore/API/JSScript.mm:
(+[JSScript scriptOfType:memoryMappedFromASCIIFile:withSourceURL:andBytecodeCache:inVirtualMachine:error:]):
Cast to Latin1Character.

* Source/JavaScriptCore/API/JSStringRefCF.cpp:
(JSStringCreateWithCFString): Cast to UInt8.
(JSStringCopyCFString): Ditto.

* Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::backendCommands const): Eliminate use of String::adopt.
It doesn't really work for vectors any more, and likely we should remove it to avoid
making a promise we can't keep. It doesn't work with byteCast, which is why we need
to do this here now.

* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.cpp:
(JSC::uint8ArrayPrototypeToHex): Cast to uint8_t.

* Source/JavaScriptCore/runtime/LiteralParser.cpp:
(JSC::reviverMode>::Lexer::lexString): Reduce mixing char with Latin1Character a bit.

* Source/WTF/wtf/URLParser.cpp:
(WTF::URLParser::appendNumberToASCIIBuffer): Cast to char.

* Source/WTF/wtf/cf/CFURLExtras.cpp:
(WTF::bytesAsString): Cast to UInt8.
(WTF::isSameOrigin): Cast to Latin1Character.

* Source/WTF/wtf/cf/URLCF.cpp:
(WTF::URL::createCFURL): Cast to UInt8.

* Source/WTF/wtf/cocoa/NSURLExtras.mm:
(WTF::userVisibleString): Cast to Latin1Character.
* Source/WTF/wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<String>::encodeForPersistence): Use asBytes.

* Source/WTF/wtf/text/StringBuilder.h:
(WTF::StringBuilder::operator[] const): Cast so the conditional operator
does not mix types.

* Source/WTF/wtf/text/WTFString.cpp:
(WTF::String::String): Cast to Latin1Character.
(WTF::String::ascii const): Cast so the conditional operator does not mix types.

* Source/WTF/wtf/text/cf/StringCF.cpp:
(WTF::String::String): Cast to UInt8.
* Source/WTF/wtf/text/cf/StringImplCF.cpp:
(WTF::StringImpl::createCFString): Ditto.
* Source/WTF/wtf/text/cf/StringViewCF.cpp:
(WTF::StringView::createCFString const): Ditto.
(WTF::StringView::createCFStringWithoutCopying const): Ditto.

* Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsKeyids): Cast to Latin1Character to pass to parseJSON and remove
the unnecessary copy into a temporary String.

* Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::handleLogMessage): Cast to uint8_t.
* Source/WebCore/Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp:
(WebCore::RTCRtpSFrameTransformer::computeSaltKey): Ditto.
(WebCore::createBaseSFrameKey): Ditto.
(WebCore::RTCRtpSFrameTransformer::computeAuthenticationKey): Ditto.
(WebCore::RTCRtpSFrameTransformer::computeEncryptionKey): Ditto.
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerDtlsTransportBackend.cpp:
(WebCore::GStreamerDtlsTransportBackendObserver::stateChanged): Ditto.
* Source/WebCore/Modules/push-api/PushMessageCrypto.cpp:
(WebCore::PushCrypto::decryptAES128GCMPayload): Ditto.
(WebCore::PushCrypto::decryptAESGCMPayload): Ditto.

* Source/WebCore/Modules/websockets/WebSocketHandshake.cpp:
(WebCore::trimInputSample): Cast to Latin1Character.
(WebCore::WebSocketHandshake::readStatusLine): Ditto.

* Source/WebCore/bindings/js/ScriptBufferSourceProvider.h: Cast to Latin1Character.
* Source/WebCore/bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readString): Ditto.

* Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretJumpTable):
Cast so the conditional operator does not mix types.
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret): Ditto.

* Source/WebCore/crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::unwrapKey): Cast to Latin1Character to pass to JSONParse and remove
the unnecessary copy into a temporary String.

* Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::replaceRichContentWithAttachments): Cast to Latin1Character.
* Source/WebCore/fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::stringResult): Ditto.
* Source/WebCore/html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate): Ditto.

* Source/WebCore/html/parser/HTMLEntityParser.cpp:
(WebCore::StringParsingBufferSource::currentCharacter const):
Cast so the conditional operator does not mix types.
* Source/WebCore/html/track/VTTScanner.h:
(WebCore::VTTScanner::currentChar const): Ditto.

* Source/WebCore/html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::fileFinished): Cast to uint8_t.

* Source/WebCore/loader/FTPDirectoryParser.cpp:
(WebCore::parseOneFTPLine): Cast to Latin1Character.

* Source/WebCore/loader/FormSubmission.cpp:
(WebCore::appendMailtoPostFormDataToURL): Cast to Latin1Character.
(WebCore::FormSubmission::create): Ditto.

* Source/WebCore/loader/TextResourceDecoder.cpp:
(WebCore::findXMLEncoding): Cast to uint8_t.
(WebCore::TextResourceDecoder::checkForCSSCharset): Cast to uint8_t and Latin1Character.
(WebCore::TextResourceDecoder::checkForHeadCharset): Ditto.

* Source/WebCore/loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script): Cast to Latin1Character.
(WebCore::CachedScript::codeBlockHashConcurrently): Ditto.

* Source/WebCore/platform/encryptedmedia/CDMUtilities.cpp:
(WebCore::CDMUtilities::parseJSONObject): Cast to Latin1Character to pass to parseJSON
and remove the unnecessary copy into a temporary String.
* Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::extractSinfData): Ditto.
(WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsMpts): Ditto.

* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::parseJSONValue): Cast to Latin1Character.
* Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::fontNameMapName): Ditto.

* Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::ParsedResponseMessage::ParsedResponseMessage): Cast to Latin1Character.
(WebCore::CDMInstanceSessionThunder::loadSession): Ditto.

* Source/WebCore/platform/gstreamer/GStreamerElementHarness.cpp:
(WebCore::MermaidBuilder::span const): Cast to uint8_t.

* Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::decodingWarning): Cast to char.
(WebCore::PNGImageDecoder::readChunks): Ditto.

* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.cpp:
(WebCore::MediaRecorderPrivateMock::fetchData): Cast to uint8_t.

* Source/WebCore/platform/network/curl/OpenSSLHelper.cpp:
(OpenSSL::BIO::getDataAsString const): Cast to Latin1Character.
(OpenSSL::toString): Ditto.
* Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp:
(WebCore::CertificateInfo::summary const): Ditto.

* Source/WebCore/platform/text/SegmentedString.h:
(WebCore::SegmentedString::Substring::currentCharacter const):
Cast so the conditional operator does not mix types.

* Source/WebCore/testing/MockCDMFactory.cpp:
(WebCore::MockCDM::sanitizeResponse const): Cast to Latin1Character.
(WebCore::MockCDMInstance::setServerCertificate): Ditto.
(WebCore::MockCDMInstanceSession::updateLicense): Ditto.

* Source/WebGPU/WebGPU/Pipeline.mm:
(WebKit::printToFileForPsoRepro): Cast to uint8_t.
* Source/WebKit/NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::dumpContentsToFile): Ditto.

* Source/WebKit/NetworkProcess/storage/CacheStorageManager.cpp:
(WebKit::readSizeFile): Cast to Latin1Character.

* Source/WebKit/Platform/IPC/DaemonCoders.h:
(WebKit::Daemon::Coder<WTF::String>::encode): Cast to uint8_t.

* Source/WebKit/Shared/API/c/cf/WKStringCF.mm:
(WKStringCopyCFString): Cast to UInt8.

* Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::SandboxExtensionImpl::SandboxExtensionImpl): Cast to Latin1Character.

* Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp:
(API::getContentRuleListSourceFromMappedFile): Cast to Latin1Character.

* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(dataFrom): Cast to uint8_t.

* Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::testIPCSharedMemory): Cast to Latin1Character.
* Source/WebKit/UIProcess/Extensions/WebExtensionDeclarativeNetRequestSQLiteStore.cpp:
(WebKit::WebExtensionDeclarativeNetRequestSQLiteStore::getKeysAndValuesFromRowIterator):
Ditto.

* Source/WebKit/UIProcess/Inspector/glib/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorClient::setBackendCommands): Cast to std::byte.

* Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm:
(WebKit::RemoteWebInspectorUIProxy::platformLoad): Cast to Latin1Character.
* Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
(WebKit::WebInspectorUIProxy::platformLoad): Ditto.
* Source/WebKit/UIProcess/wpe/WebPasteboardProxyWPE.cpp:
(WebKit::WebPasteboardProxy::readURLFromPasteboard): Ditto.
* Source/WebKit/WebProcess/Network/webrtc/RTCDataChannelRemoteManager.cpp:
(WebKit::RTCDataChannelRemoteManager::sendData): Ditto.

* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::registerLogClient): Cast to uint8_t.

* Tools/TestWebKitAPI/Tests/WTF/Base64.cpp:
(TestWebKitAPI::TEST(Base64, Encode)): Cast to uint8_t.
(TestWebKitAPI::TEST(Base64, EncodeOmitPadding)): Ditto.
(TestWebKitAPI::TEST(Base64, EncodeURL)): Ditto.
(TestWebKitAPI::TEST(Base64, EncodeURLOmitPadding)): Ditto.
* Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::createTestFile): Ditto.
(TestWebKitAPI::TEST_F(FileSystemTest, openExistingFileTruncate)): Ditto.
(TestWebKitAPI::TEST_F(FileSystemTest, openExistingFileReadWrite)): Ditto.
(TestWebKitAPI::TEST_F(FileSystemTest, deleteEmptyDirectoryContainingDSStoreFile)): Ditto.
(TestWebKitAPI::TEST_F(FileSystemTest, deleteEmptyDirectoryOnNonEmptyDirectory)): Ditto.
(TestWebKitAPI::TEST_F(FileSystemTest, moveDirectory)): Ditto.
(TestWebKitAPI::runGetFileModificationTimeTest): Ditto.
(TestWebKitAPI::TEST_F(FileSystemTest, readEntireFile)): Ditto.

* Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST(WTF, ExternalStringImplCreate8bit)): Use char and cast to Latin1Character.
(TestWebKitAPI::TEST(WTF, ExternalStringAtom)): Ditto.

* Tools/TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::TEST(WTF, StringViewEqualIgnoringASCIICaseWithLatin1Characters)):
Use byteCast instead of reinterpret_cast.

* Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
(TestWebKitAPI::dataAsString): Pass a character instead of an int.

* Tools/TestWebKitAPI/Tests/WebCore/PushMessageCrypto.cpp:
(TestWebKitAPI::mustBase64URLDecode): Use ASCIILiteral.
(TestWebKitAPI::stringView): Added.
(TestWebKitAPI::TEST(PushMessageCrypto, AES128GCMPayloadWithMinimalPadding)): Use stringView.
(TestWebKitAPI::TEST(PushMessageCrypto, AES128GCMPayloadWithPadding)): Ditto.
(TestWebKitAPI::TEST(PushMessageCrypto, AESGCMPayloadWithMinimalPadding)): Ditto.
(TestWebKitAPI::TEST(PushMessageCrypto, AESGCMPayloadWithPadding)): Ditto.

* Tools/TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp:
(TestWebKitAPI::TEST_F(FragmentedSharedBufferTest, createWithContentsOfExistingFile)):
Cast to Latin1Character.
(TestWebKitAPI::TEST_F(FragmentedSharedBufferTest, read)): Ditto.
(TestWebKitAPI::TEST_F(SharedBufferChunkReaderTest, includeSeparator)): Use uint8_t.
(TestWebKitAPI::TEST_F(SharedBufferChunkReaderTest, peekData)): Cast to Latin1Character.

* Tools/TestWebKitAPI/Tests/WebCore/SharedBufferTest.cpp:
(TestWebKitAPI::FragmentedSharedBufferTest::SetUp): Cast to uint8_t.
* Tools/TestWebKitAPI/Tests/WebCore/curl/CurlMultipartHandleTests.cpp:
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, SimpleMessage)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, NoHeader)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, NoBody)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, TransportPadding)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, NoEndOfBoundary)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, NoEndOfBoundaryAfterCompleted)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, NoCloseDelimiter)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, NoCloseDelimiterAfterCompleted)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, CloseDelimiter)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, CloseDelimiterAfterCompleted)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, DivideFirstDelimiter)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, DivideSecondDelimiter)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, DivideLastDelimiter)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, DivideCloseDelimiter)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, DivideTransportPadding)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, DivideHeader)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, DivideBody)): Ditto.
(TestWebKitAPI::Curl::TEST(CurlMultipartHandleTests, CompleteWhileHeaderProcessing)): Ditto.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm:
(-[IndexedDBOpenPanelUIDelegate webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]): Ditto.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::WebPushDTestWebView::injectPushMessage): Cast to Latin1Character.

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=301739
rdar://163764627

Reviewed by Sam Weinig.

* Source/WTF/wtf/Logger.h:
(WTF::LogArgument::toString): Added overload that takes std::span<const char8_t>.

* Source/WTF/wtf/PrintStream.cpp:
(WTF::printInternal): Added overload that takes std::span<const char8_t>.
* Source/WTF/wtf/PrintStream.h: Ditto.

* Source/WTF/wtf/text/StringImpl.cpp:
(WTF::StringImpl::create): Added overload that takes std::span<const char8_t>.
* Source/WTF/wtf/text/StringImpl.h: Ditto.

* Source/WTF/wtf/text/WTFString.cpp:
(WTF::String::String): Added overload that takes std::span<const char8_t>.
(WTF::fromUTF8Impl): Deleted.
(WTF::String::fromUTF8): Changed to call the constructor.
(WTF::String::fromUTF8ReplacingInvalidSequences): Moved code here from the
fromUTF8Impl function.
(WTF::String::fromUTF8WithLatin1Fallback): Call the constructor rather than
the fromUTF8 function.

* Source/WTF/wtf/text/WTFString.h: Added constructor that takes

std::span<const char8_t>.
Canonical link: https://commits.webkit.org/302417@main

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
…nd add some helpers for spans to StringCommon

https://bugs.webkit.org/show_bug.cgi?id=299946

Reviewed by Darin Adler.

Improved several comparisons, like starts, ends, contains, find, both case and aware and not. Also some more useful
conversions and parsing. For this, some more tweaks and templating was needed as many string management methods consider
Latin1Character only and CStringView handles char8_t.

Fly-by: fix return value of isEmpty to be bool instead of size_t and renamed length into lengthInBytes.

GStreamer code using CStringView already was adapted to this.

Tests: Tools/TestWebKitAPI/Tests/WTF/CString.cpp
       Tools/TestWebKitAPI/Tests/WTF/CStringView.cpp
       Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp
       Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp
* Source/WTF/wtf/StdLibExtras.h:
(WTF::find):
(WTF::contains):
(WTF::ByteCastTraits<T>::cast):
(WTF::ByteCastTraits<T::cast):
(WTF::byteCast):
* Source/WTF/wtf/text/ASCIILiteral.h:
(WTF::StringLiterals::operator_spanChar8):
* Source/WTF/wtf/text/CString.cpp:
(WTF::convertASCIICase):
(WTF::convertToASCIILowercase):
(WTF::convertToASCIIUppercase):
* Source/WTF/wtf/text/CString.h:
* Source/WTF/wtf/text/CStringView.cpp:
(WTF::CStringView::dump const):
(WTF::CStringView::toString const): Deleted.
* Source/WTF/wtf/text/CStringView.h:
(WTF::operator==):
* Source/WTF/wtf/text/ParsingUtilities.h:
(WTF::requires):
* Source/WTF/wtf/text/StringCommon.h:
(WTF::unsafeSpanChar8):
(WTF::equal):
(WTF::requires):
(WTF::equalIgnoringASCIICase):
(WTF::findIgnoringASCIICase):
(WTF::containsIgnoringASCIICase):
(WTF::find):
(WTF::contains):
(WTF::reverseFind):
(WTF::equalLettersIgnoringASCIICaseWithLength):
(WTF::startsWith):
(WTF::endsWith):
(WTF::endsWithLettersIgnoringASCIICaseCommon):
(WTF::endsWithLettersIgnoringASCIICase):
(WTF::startsWithLettersIgnoringASCIICaseCommon):
(WTF::startsWithLettersIgnoringASCIICase):
* Source/WTF/wtf/text/StringToIntegerConversion.h:
(WTF::parseInteger):
(WTF::parseIntegerAllowingTrailingJunk):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::requestPad):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerRtpReceiverBackend.cpp:
(WebCore::GStreamerRtpReceiverBackend::getParameters):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerRtpTransceiverBackend.cpp:
(WebCore::GStreamerRtpTransceiverBackend::setCodecPreferences):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp:
(WebCore::RTCStatsReport::Stats::Stats):
(WebCore::RTCStatsReport::RtpStreamStats::RtpStreamStats):
(WebCore::RTCStatsReport::CodecStats::CodecStats):
(WebCore::RTCStatsReport::RemoteInboundRtpStreamStats::RemoteInboundRtpStreamStats):
(WebCore::RTCStatsReport::RemoteOutboundRtpStreamStats::RemoteOutboundRtpStreamStats):
(WebCore::RTCStatsReport::InboundRtpStreamStats::InboundRtpStreamStats):
(WebCore::RTCStatsReport::OutboundRtpStreamStats::OutboundRtpStreamStats):
(WebCore::RTCStatsReport::TransportStats::TransportStats):
(WebCore::RTCStatsReport::IceCandidateStats::IceCandidateStats):
(WebCore::RTCStatsReport::IceCandidatePairStats::IceCandidatePairStats):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerWebRTCUtils.cpp:
(WebCore::toRTCEncodingParameters):
(WebCore::toRTCCodecParameters):
(WebCore::toRTCRtpSendParameters):
(WebCore::capsFromRtpCapabilities):
(WebCore::capsFromSDPMedia):
(WebCore::extractMidAndRidFromRTPBuffer):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::doCapsHaveType):
* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::fillVideoRtpCapabilities):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
* Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(transformInPlace):
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* Source/WebCore/platform/gstreamer/GStreamerElementHarness.cpp:
(WebCore::MermaidBuilder::describeCaps):
* Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp:
(annexBStreamFormatCapsFieldValue):
(videoEncoderSetEncoder):
(webkit_video_encoder_class_init):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioRTPPacketizer.cpp:
(WebCore::GStreamerAudioRTPPacketizer::create):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::captureDeviceFromGstDevice):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerIncomingTrackProcessor.cpp:
(WebCore::GStreamerIncomingTrackProcessor::configure):
(WebCore::GStreamerIncomingTrackProcessor::incomingTrackProcessor):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMockDeviceProvider.cpp:
(webkitGstMockDeviceProviderSwitchDefaultDevice):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerRTPPacketizer.cpp:
(WebCore::GStreamerRTPPacketizer::rtpStreamId const):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::GStreamerVideoCapturer::reconfigure):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoRTPPacketizer.cpp:
(WebCore::GStreamerVideoRTPPacketizer::create):
* Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceGStreamer.cpp:
(WebCore::RealtimeOutgoingAudioSourceGStreamer::setInitialParameters):
* Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.cpp:
(WebCore::RealtimeOutgoingMediaSourceGStreamer::setParameters):
* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, CStringNullStringConstructor)):
(TEST(WTF, CStringEmptyEmptyConstructor)):
(TEST(WTF, CStringViewASCIICaseConversions)):
* Tools/TestWebKitAPI/Tests/WTF/CStringView.cpp:
(TestWebKitAPI::TEST(WTF, CStringViewSize)):
(TestWebKitAPI::TEST(WTF, CStringViewFrom)):
(TestWebKitAPI::TEST(WTF, CStringViewEquality)):
(TestWebKitAPI::TEST(WTF, CStringViewLength)): Deleted.
* Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
(TestWebKitAPI::TEST(StringBuilderTest, Append)):
* Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp:
(TestWebKitAPI::TEST(WTF_StringCommon, Equal)):
(TestWebKitAPI::TEST(WTF_StringCommon, EqualIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, StartsWith)):
(TestWebKitAPI::TEST(WTF_StringCommon, EndsWith)):
(TestWebKitAPI::TEST(WTF_StringCommon, Find)):
(TestWebKitAPI::TEST(WTF_StringCommon, ReverseFind)):
(TestWebKitAPI::TEST(WTF_StringCommon, Contains)):
(TestWebKitAPI::TEST(WTF_StringCommon, StartsWithLettersIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, EndsWithLettersIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, FindIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, ContainsIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, CharactersAreAllASCII)):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
… safety

rdar://165305546
https://bugs.webkit.org/show_bug.cgi?id=303027

Reviewed by Sam Weinig.

Eliminated other members of the unsafeSpan function family, leaving only
unsafeSpan and unsafeSpanIncludingNullTerminator.

Eliminated some functions that take null-terminated strings, such as
String::createFromCString. Changed callers to safe interfaces that pass
lengths and sizes instead or to call unsafeSpan.

Redid the UTF-8 span literal operator so we can use it in constant expressions.
Syntax is now u8""_span instead of ""_spanChar8.

Simplified test code that was unnecessarily using null-terminated strings
to instead use ASCIILiteral or similar. Also used toNSData in test code
rather than toNSDataNoCopy; the "no copy" optimization is unnecessary for tests.

* Source/JavaScriptCore/API/JSStringRef.cpp:
(JSStringCreateWithUTF8CString): Use unsafeSpan. Use conversion from UTF-8
built into the String class. Take advantage of null handling built into the
function so we don't need a special case for the null pointer.

* Source/JavaScriptCore/API/JSValue.mm:
(createStructHandlerMap): Use unsafeSpan.

* Source/JavaScriptCore/runtime/Identifier.h: Removed overloads of
the == operator and the equal function that take null-terminated strings.

(JSC::Identifier::equal):
* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::OptionsHelper::Option::dump const): Use unsafeSpan.

* Source/JavaScriptCore/wasm/WasmParser.h:
(JSC::Wasm::ParserBase::consumeUTF8String): Use byteCast.

* Source/WTF/wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fromStdFileSystemPath): Use unsafeSpan.

* Source/WTF/wtf/text/ASCIILiteral.h: Added u8""_span. Removed ""_spanChar8.

* Source/WTF/wtf/text/StringCommon.h:
Deleted the unsafeSpan overload that takes const Latin1Character*.
(WTF::unsafeSpan8): Deleted.
(WTF::unsafeSpanChar8): Deleted.
(WTF::unsafeSpan8IncludingNullTerminator): Deleted.

* Source/WTF/wtf/text/StringConcatenate.h: Deleted the StringTypeAdapter
that takes const Latin1Character*.

* Source/WTF/wtf/text/StringImpl.h: Use unsafeSpan.
(WTF::StringImpl::createFromCString): Deleted.

* Source/WTF/wtf/text/StringView.h: Use unsafeSpan.
Replaced the equal function that takes const Latin1Character* with one
that takes span<const Latin1Character>.

* Source/WTF/wtf/text/WTFString.cpp:
(WTF::String::String): Use unsafeSpan.

* Source/WTF/wtf/text/WTFString.h: Use unsafeSpan.
Some updates to the fromUTF8 family of functions, clarifying deprecation.

* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::initialize): Use unsafeSpan.

* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::initializeEGLDisplay): Use unsafeSpan.
(WebCore::GraphicsContextGLCocoa::platformInitializeContext): Ditto.

* Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::familyName const): Use unsafeSpan.

* Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Use unsafeSpan.
(WebCore::TrackPrivateBaseGStreamer::setPad): Ditto.
(WebCore::TrackPrivateBaseGStreamer::getLanguageCode): Ditto.
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfStreamChanged): Ditto.
(WebCore::TrackPrivateBaseGStreamer::updateTrackIDFromTags): Ditto.

* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::recycleTrackForPad): Use unsafeSpan.
(WebCore::serializeLowercase): Moved this function up in the file, changed it
to return ASCIILiteral, and made it a non-member function so it can be internal
to the file rather than in the header.
(WebCore::AppendPipeline::Track::emplaceOptionalElementsForFormat): Use
serializeLowercase.

* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h:
Removed now-unused streamTypeToStringLower.

* Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_load_plain_text): Use unsafeSpan.

* Source/WebKit/UIProcess/gtk/SystemSettingsManagerProxyGtk.cpp:
(WebKit::SystemSettingsManagerProxy::updateFontProperties): Use unsafeSpan.

* Source/WebKit/WebProcess/GPU/media/RemoteVideoCodecFactory.cpp:
(WebKit::RemoteVideoCodecFactory::createEncoder): Use byteCast.

* Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
(WebKit::GObjectEventListener::GObjectEventListener): Store event type as
m_eventType AtomString instead of m_domEventName CString, previously we converted
it to an AtomString any time it is used. Also, used the term event type from
the DOM rather than coining a different name for the same concept.
(WebKit::GObjectEventListener::gobjectDestroyed): Use m_eventType.

* Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.h:
(WebKit::GObjectEventListener::addEventListener): Use m_eventType instead of
converting to AtomString.
(WebKit::GObjectEventListener::removeEventListener): Ditto.

* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityFocusedUIElement): Use unsafeSpanIncludingNullTerminator.

* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, CStringViewASCIICaseConversions)): Use u8""_span.

* Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
(TestWebKitAPI::TEST(StringBuilderTest, Append)): Use u8""_span.

* Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp:
(TestWebKitAPI::TEST(WTF_StringCommon, Equal)): Use u8""_span.
(TestWebKitAPI::TEST(WTF_StringCommon, EqualIgnoringASCIICase)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, StartsWith)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, EndsWith)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, Find)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, ReverseFind)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, Contains)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, StartsWithLettersIgnoringASCIICase)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, EndsWithLettersIgnoringASCIICase)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, FindIgnoringASCIICase)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, ContainsIgnoringASCIICase)): Ditto.
(TestWebKitAPI::TEST(WTF_StringCommon, CharactersAreAllASCII)): Ditto.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegatePlugIn.mm:
(-[BundleEditingDelegatePlugIn _webProcessPlugInBrowserContextController:pasteboardDataForRange:]):
Use [NSData dataUsingEncoding:].

* Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONScheme initWithBytes:]): Use ASCIILiteral.
(-[PSONScheme addMappingFromURLString:toData:]): Ditto.
(-[PSONScheme webView:startURLSchemeTask:]): Ditto.
((ProcessSwap, HistoryNavigationToFragmentURL)): Ditto.
((ProcessSwap, PolicyCancelAfterServerRedirect)): Ditto.
((ProcessSwap, SameOriginSystemPreview)): Ditto.
((ProcessSwap, SessionStorage)): Ditto.
((ProcessSwap, ReuseSuspendedProcessEvenIfPageCacheFails)): Ditto.
((ProcessSwap, HistoryItemIDConfusion)): Ditto.
((ProcessSwap, MainFramesOnly)): Ditto.
((ProcessSwap, MediaTypeAfterSwap)): Ditto.
((ProcessSwap, NavigateCrossSiteBeforePageLoadEnd)): Ditto.
((ProcessSwap, PageShowHide)): Ditto.
((ProcessSwap, LoadUnload)): Ditto.
((ProcessSwap, SameOriginBlobNavigation)): Ditto.
((ProcessSwap, NavigateToDataURLThenBack)): Ditto.
((ProcessSwap, SwapOnFormSubmission)): Ditto.
((ProcessSwap, OpenerLinkAfterAPIControlledProcessSwappingOfOpener)): Ditto.
((ProcessSwap, NavigateCrossOriginWithOpener)): Ditto.
((ProcessSwap, ContentBlockingAfterProcessSwap)): Ditto.
((ProcessSwap, ContentExtensionBlocksMainLoadThenReloadWithoutExtensions)): Ditto.
((ProcessSwap, GetUserMediaCaptureState)): Ditto.
((ProcessSwap, PassMinimumDeviceWidthOnNewWebView)): Ditto.
((ProcessSwap, ResizeWebViewDuringCrossSiteProvisionalNavigation)): Ditto.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
(-[ServiceWorkerSchemeHandler webView:startURLSchemeTask:]): Use unsafeSpan.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
(mainBytesData): Added.
(TEST(URLSchemeHandler, Basic)): Use ASCIILiteral.
(TEST(URLSchemeHandler, BasicWithHTTPS)): Ditto.
(TEST(URLSchemeHandler, BasicWithAsyncPolicyDelegate)): Ditto.
(TEST(URLSchemeHandler, NoMIMEType)): Ditto.
(-[SyncScheme webView:startURLSchemeTask:]): Ditto.
(-[SyncErrorScheme webView:startURLSchemeTask:]): Ditto.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[DataMappingSchemeHandler addMappingFromURLString:toData:]): Use ASCIILiteral.
((WebpagePreferences, WebsitePoliciesCustomUserAgent)): Ditto.

* Tools/TestWebKitAPI/Tests/mac/WebViewIconLoading.mm:
(mainResourceData): Use ASCIILiteral.
(imageFromData): Ditto.
(TestWebKitAPI::TEST(WebKitLegacy, IconLoadingDelegateDefaultFirst)): Ditto.
(TestWebKitAPI::TEST(WebKitLegacy, IconLoadingDelegateCustomFirst)): Ditto.

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
…ngle character

https://bugs.webkit.org/show_bug.cgi?id=303428

Reviewed by Darin Adler.

isEmpty was accounting for a null terminator in the CStringBuffer length but it is not like that.

Test: Tools/TestWebKitAPI/Tests/WTF/CString.cpp
* Source/WTF/wtf/text/CString.h:
* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, CStringEmptyRegularConstructor)):
(TEST(WTF, CStringOnyByte)):

Canonical link: https://commits.webkit.org/303840@main
https://bugs.webkit.org/show_bug.cgi?id=302925

Reviewed by Darin Adler.

There were several cases where we were not handling properly certain cases when inspecting spans for data and some
codepaths that had different behaviors. Fixed them and improved test coverage. reverseFind lost the starting offset that
was not used anywhere and for coherence with the find counterpart.

Test: Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp
* Source/WTF/wtf/StdLibExtras.h:
(WTF::find):
* Source/WTF/wtf/text/StringCommon.h:
(WTF::findIgnoringASCIICase):
(WTF::reverseFindInner):
(WTF::reverseFind):
* Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp:
(TestWebKitAPI::TEST(WTF_StringCommon, Equal)):
(TestWebKitAPI::TEST(WTF_StringCommon, EqualIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, StartsWith)):
(TestWebKitAPI::TEST(WTF_StringCommon, EndsWith)):
(TestWebKitAPI::TEST(WTF_StringCommon, Find)):
(TestWebKitAPI::TEST(WTF_StringCommon, ReverseFind)):
(TestWebKitAPI::TEST(WTF_StringCommon, Contains)):
(TestWebKitAPI::TEST(WTF_StringCommon, StartsWithLettersIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, EndsWithLettersIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, FindIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, ContainsIgnoringASCIICase)):
(TestWebKitAPI::TEST(WTF_StringCommon, CharactersAreAllASCII)):

Canonical link: https://commits.webkit.org/303965@main
…mprovements

https://bugs.webkit.org/show_bug.cgi?id=299443

Reviewed by Philippe Normand.

We are increasing the use of CStringView, also assuming that all input is UTF8 and that it might need to be converted in
order to interact with other WebKit classes.

Test: Covered by existing tests.

* Source/WTF/wtf/glib/GSpanExtras.cpp:
(WTF::gFileGetContents):
(WTF::gKeyFileGetKeys):
* Source/WTF/wtf/glib/GSpanExtras.h:
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerDataChannelHandler.cpp:
(WebCore::GStreamerDataChannelHandler::GStreamerDataChannelHandler):
(WebCore::GStreamerDataChannelHandler::onMessageString):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerDataChannelHandler.h:
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::maybeInsertNetSimForElement):
(WebCore::fetchDescription):
(WebCore::getMediaStreamIdsFromSDPMedia):
(WebCore::GStreamerMediaEndpoint::linkOutgoingSources):
(WebCore::GStreamerMediaEndpoint::doSetRemoteDescription):
(WebCore::GStreamerMediaEndpoint::processSDPMessage):
(WebCore::GStreamerMediaEndpoint::isIceGatheringComplete):
(WebCore::GStreamerMediaEndpoint::initiate):
(WebCore::GStreamerMediaEndpoint::trackIdFromSDPMedia):
(WebCore::GStreamerMediaEndpoint::connectPad):
(WebCore::GStreamerMediaEndpoint::canTrickleIceCandidates const):
(WebCore::GStreamerMediaEndpoint::completeSDPAnswer):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h:
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerRtpTransceiverBackend.cpp:
(WebCore::GStreamerRtpTransceiverBackend::setCodecPreferences):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerWebRTCUtils.cpp:
(WebCore::x509Serialize):
(WebCore::privateKeySerialize):
(WebCore::sdpMediaHasAttributeKey):
(WebCore::getDirectionFromSDPMedia):
(WebCore::capsFromSDPMedia):
(WebCore::setSsrcAudioLevelVadOn):
(WebCore::SDPStringBuilder::appendConnection):
(WebCore::SDPStringBuilder::appendMedia):
(WebCore::SDPStringBuilder::SDPStringBuilder):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerWebRTCUtils.h:
* Source/WebCore/platform/audio/gstreamer/AudioEncoderGStreamer.cpp:
(WebCore::GStreamerInternalAudioEncoder::initialize):
* Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::handleMessage):
* Source/WebCore/platform/audio/gstreamer/PlatformRawAudioDataGStreamer.cpp:
(WebCore::layoutToString):
(WebCore::PlatformRawAudioData::copyTo):
* Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
(initializeDMABufAvailability):
* Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp:
(WebCore::GStreamerAudioMixer::registerProducer):
(WebCore::GStreamerAudioMixer::configureSourcePeriodTime):
* Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.h:
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::getStreamIdFromPad):
(WebCore::getStreamIdFromStream):
(WebCore::parseStreamId):
(WebCore::extractGStreamerOptionsFromCommandLine):
(WebCore::ensureGStreamerInitialized):
(WebCore::registerWebKitGStreamerElements):
(WebCore::deinitializeGStreamer):
(WebCore::getGstPlayFlag):
(WebCore::makeGStreamerElement):
(WebCore::gstStructureValueToJSON):
(WebCore::gstStructureToJSON):
(WebCore::gstElementMatchesFactoryAndHasProperty):
(WebCore::gstIdToString):
(WebCore::buildDMABufCaps):
(WebCore::requestGLContext):
(WebCore::setGstElementGLContext):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:
* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::ElementFactories::elementFactoryTypeToString):
(WebCore::GStreamerRegistryScanner::ElementFactories::hasElementForCaps const):
(WebCore::GStreamerRegistryScanner::initializeDecoders):
(WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const):
(WebCore::probeRtpExtensions):
(WebCore::GStreamerRegistryScanner::isRtpHeaderExtensionSupported):
* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.h:
* Source/WebCore/platform/graphics/gstreamer/GStreamerSinksWorkarounds.cpp:
(WebCore::getWorkAroundModeFromEnvironment):
(WebCore::BaseSinkPositionFlushWorkaroundProbe::checkIsNeeded):
(WebCore::AppSinkFlushCapsWorkaroundProbe::checkIsNeeded):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::elementIdChanged const):
(WebCore::MediaPlayerPrivateGStreamer::handleNeedContextMessage):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::configureParsebin):
(WebCore::MediaPlayerPrivateGStreamer::configureElement):
(WebCore::MediaPlayerPrivateGStreamer::configureDownloadBuffer):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSinkGL):
(WebCore::MediaPlayerPrivateGStreamer::parseInitDataFromProtectionMessage):
(WebCore::MediaPlayerPrivateGStreamer::handleProtectionEvent):
* Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::dump const):
* Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::getLanguageCode):
(WebCore::TrackPrivateBaseGStreamer::getTag):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
* Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.cpp:
(WebCore::VideoFrameGStreamer::createFromPixelBuffer):
(WebCore::VideoFrameGStreamer::convert):
* Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:
(webKitAudioSinkConfigure):
* Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcSetExtraHeader):
(webKitWebSrcMakeRequest):
(convertPlaybinURI):
(webKitWebSrcSetUri):
* Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
* Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::sessionLoadFailureFromThunder):
(WebCore::toString):
(WebCore::CDMInstanceSessionThunder::keyUpdatedCallback):
(WebCore::CDMInstanceSessionThunder::loadSession):
* Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
(WebCore::GStreamerEMEUtilities::isClearKeyUUID):
(WebCore::GStreamerEMEUtilities::isWidevineUUID):
(WebCore::GStreamerEMEUtilities::isPlayReadyUUID):
(WebCore::GStreamerEMEUtilities::isUnspecifiedUUID):
(WebCore::GStreamerEMEUtilities::keySystemToUuid):
(WebCore::GStreamerEMEUtilities::uuidToKeySystem):
* Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(transformCaps):
* Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
* Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:
(createSinkPadTemplateCaps):
(protectionSystemId):
* Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderParser.cpp:
(createThunderParseSinkPadTemplateCaps):
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::serialize):
(WebCore::AppendPipeline::didReceiveInitializationSegment):
(WebCore::AppendPipeline::Track::initializeElements):
(WebCore::appendPipelinePadProbeDebugInformation):
(WebCore::AppendPipeline::streamTypeToString): Deleted.
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h:
* Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(dumpReadyState):
(WebCore::MediaPlayerPrivateGStreamerMSE::readyStateFromMediaSourceChanged):
(WebCore::MediaPlayerPrivateGStreamerMSE::propagateReadyStateToPlayer):
* Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
(WebCore::MediaSourcePrivateGStreamer::markEndOfStream):
* Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(streamTypeToString):
(webKitMediaSrcEmitStreams):
* Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.cpp:
(WebCore::GStreamerCodecUtilities::parseH264ProfileAndLevel):
(WebCore::h264CapsFromCodecString):
(WebCore::GStreamerCodecUtilities::parseHEVCProfile):
(WebCore::h265CapsFromCodecString):
(WebCore::av1CapsFromCodecString):
(): Deleted.
* Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.h:
* Source/WebCore/platform/gstreamer/GStreamerElementHarness.cpp:
(WebCore::MermaidBuilder::dumpElement):
(WebCore::MermaidBuilder::describeCaps):
(WebCore::GStreamerElementHarness::dumpGraph):
* Source/WebCore/platform/gstreamer/GStreamerQuirkBroadcom.cpp:
(WebCore::GStreamerQuirkBroadcom::configureElement):
* Source/WebCore/platform/gstreamer/GStreamerQuirkBroadcomBase.cpp:
(WebCore::GStreamerQuirkBroadcomBase::correctBufferingPercentage const):
(WebCore::GStreamerQuirkBroadcomBase::setupBufferingPercentageCorrection const):
* Source/WebCore/platform/gstreamer/GStreamerQuirkRialto.cpp:
(WebCore::GStreamerQuirkRialto::GStreamerQuirkRialto):
(WebCore::GStreamerQuirkRialto::configureElement):
* Source/WebCore/platform/gstreamer/GStreamerQuirkWesteros.cpp:
(WebCore::GStreamerQuirkWesteros::configureElement):
* Source/WebCore/platform/gstreamer/GStreamerQuirks.cpp:
(WebCore::GStreamerQuirksManager::GStreamerQuirksManager):
* Source/WebCore/platform/gstreamer/WebKitFliteSourceGStreamer.cpp:
(fliteVoice):
(webKitFliteSrcSetUtterance):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::captureDeviceFromGstDevice):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.h:
* Source/WebCore/platform/mediastream/gstreamer/GStreamerIncomingTrackProcessor.cpp:
(WebCore::GStreamerIncomingTrackProcessor::mediaStreamIdFromPad):
(WebCore::GStreamerIncomingTrackProcessor::retrieveMediaStreamAndTrackIdFromSDP):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMockDevice.cpp:
(webkitMockDeviceCreate):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerRTPPacketizer.cpp:
(WebCore::GStreamerRTPPacketizer::ensureMidExtension):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::getMaxIntValueFromStructure):
(WebCore::getMaxFractionValueFromStructure):
(WebCore::GStreamerVideoCapturer::reconfigure):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.h:
* Source/WebCore/platform/mediastream/gstreamer/GStreamerWebRTCLogSink.cpp:
(WebCore::GStreamerWebRTCLogSink::start):
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerWebRTCVideoDecoder::GstDecoderFactory):
(WebCore::VP8Decoder::Create):
* Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_apply_from_key_file):
* Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.cpp:
(TestWebKitAPI::TEST_F(GStreamerTest, hevcProfileParsing)):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
…amer code

https://bugs.webkit.org/show_bug.cgi?id=303909

Reviewed by Adrian Perez de Castro.

When interfacing with Glib APIs there was no way to wrap an owned malloced char* so GMallocString was created. It can
adopt C strings in several ways, providing then easy ways to interface with the WebKit strings the same way CStringView
does and also preserving the original null terminated C string without performing any copy.

I applied this to the GStreamer code.

Tests: Tools/TestWebKitAPI/Tests/WTF/CStringView.cpp
       Tools/TestWebKitAPI/Tests/WTF/glib/GMallocString.cpp
       Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.cpp
       Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GstElementHarness.cpp
* Source/WTF/wtf/PlatformGTK.cmake:
* Source/WTF/wtf/PlatformWPE.cmake:
* Source/WTF/wtf/glib/GMallocString.cpp: Added.
* Source/WTF/wtf/glib/GMallocString.h: Added.
(WTF::operator==):
(WTF::safePrintfType):
(WTF::toCStringView):
* Source/WTF/wtf/glib/GSpanExtras.h:
(WTF::dupGMallocSpan):
(WTF::adoptGMallocString): Deleted.
* Source/WTF/wtf/text/CStringView.h:
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerDataChannelHandler.cpp:
(WebCore::GStreamerDataChannelHandler::checkState):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerDtlsTransportBackend.cpp:
(WebCore::GStreamerDtlsTransportBackendObserver::stateChanged):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerIceAgent.cpp:
(webkitGstWebRTCIceAgentLocalCandidateGatheredForStream):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerIceTransportBackend.cpp:
(WebCore::GStreamerIceTransportBackend::registerClient):
(WebCore::GStreamerIceTransportBackend::stateChanged const):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::initializePipeline):
(WebCore::fetchDescription):
(WebCore::fetchSignalingState):
(WebCore::toGStreamerMediaEndpointTransceiverState):
(WebCore::transceiverStatesFromWebRTCBin):
(WebCore::GStreamerMediaEndpoint::linkOutgoingSources):
(WebCore::GStreamerMediaEndpoint::setDescription):
(WebCore::GStreamerMediaEndpoint::processSDPMessage):
(WebCore::GStreamerMediaEndpoint::createTransceiverBackends):
(WebCore::GStreamerMediaEndpoint::onIceGatheringChange):
(WebCore::GStreamerMediaEndpoint::collectTransceivers):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerRtpTransceiverBackend.cpp:
(WebCore::GStreamerRtpTransceiverBackend::setDirection):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerWebRTCUtils.cpp:
(WebCore::setSsrcAudioLevelVadOn):
* Source/WebCore/platform/audio/gstreamer/AudioEncoderGStreamer.cpp:
(WebCore::GStreamerInternalAudioEncoder::initialize):
* Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::updateConfigurationFromCaps):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::getStreamIdFromPad):
(WebCore::registerActivePipeline):
(WebCore::unregisterPipeline):
(WebCore::videoColorSpaceFromInfo):
* Source/WebCore/platform/graphics/gstreamer/GStreamerSinksWorkarounds.cpp:
(WebCore::BaseSinkPositionFlushWorkaroundProbe::checkIsNeeded):
(WebCore::AppSinkFlushCapsWorkaroundProbe::checkIsNeeded):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::elementIdChanged const):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::updateBufferingStatus):
(WebCore::MediaPlayerPrivateGStreamer::configureParsebin):
(WebCore::MediaPlayerPrivateGStreamer::configureElement):
(WebCore::MediaPlayerPrivateGStreamer::configureDownloadBuffer):
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
(WebCore::MediaPlayerPrivateGStreamer::setupCodecProbe):
(WebCore::MediaPlayerPrivateGStreamer::configureVideoDecoder):
(WebCore::MediaPlayerPrivateGStreamer::getVideoOrientation):
(WebCore::MediaPlayerPrivateGStreamer::audioOutputDeviceChanged):
* Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::updateConfigurationFromCaps):
* Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcSetProperty):
(webKitWebSrcGetProperty):
(webKitWebSrcSetExtraHeader):
(webKitWebSrcMakeRequest):
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::didReceiveInitializationSegment):
* Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
(WebCore::GStreamerMediaDescription::extractCodecName const):
* Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcLoop):
(webKitMediaSrcGetUri):
(webKitMediaSrcSetUri):
* Source/WebCore/platform/gstreamer/GStreamerElementHarness.cpp:
(WebCore::MermaidBuilder::describeCaps):
(WebCore::GStreamerElementHarness::dumpGraph):
* Source/WebCore/platform/mediastream/gstreamer/DesktopPortal.cpp:
(WebCore::DesktopPortal::waitResponseSignal):
(WebCore::DesktopPortalScreenCast::createScreencastSession):
(WebCore::DesktopPortalScreenCast::ScreencastSession::openPipewireRemote):
* Source/WebCore/platform/mediastream/gstreamer/DesktopPortal.h:
(WebCore::DesktopPortal::waitResponseSignal):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::sortDevices):
(WebCore::GStreamerCaptureDeviceManager::captureDeviceFromGstDevice):
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp:
(WebCore::GStreamerDisplayCaptureDeviceManager::createDisplayCaptureSource):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerIncomingTrackProcessor.cpp:
(WebCore::GStreamerIncomingTrackProcessor::mediaStreamIdFromPad):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcAddTrack):
* Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.cpp:
(WebCore::RealtimeOutgoingMediaSourceGStreamer::checkMid):
* Tools/TestWebKitAPI/PlatformGTK.cmake:
* Tools/TestWebKitAPI/PlatformWPE.cmake:
* Tools/TestWebKitAPI/Tests/WTF/CStringView.cpp:
(TestWebKitAPI::TEST(WTF, CStringViewFrom)):
* Tools/TestWebKitAPI/Tests/WTF/glib/GMallocString.cpp: Added.
(TestWebKitAPI::TEST(WTF_GMallocString, NullAndEmpty)):
(TestWebKitAPI::TEST(WTF_GMallocString, Move)):
(TestWebKitAPI::TEST(WTF_GMallocString, Length)):
(TestWebKitAPI::TEST(WTF_GMallocString, Equality)):
(TestWebKitAPI::TEST(WTF_GMallocString, CStringView)):
(TestWebKitAPI::TEST(WTF_GMallocString, LeakUTF8)):
(TestWebKitAPI::TEST(WTF_GMallocString, ToCStringView)):
* Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.cpp:
(TestWebKitAPI::TEST_F(GStreamerTest, capsFromCodecString)):
* Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GstElementHarness.cpp:
(TestWebKitAPI::TEST_F(GStreamerTest, harnessParseMP4)):
(TestWebKitAPI::TEST_F(GStreamerTest, harnessDecodeMP4Video)):

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

Signed-off-by: Xabier Rodriguez Calvar <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=304059

Reviewed by Adrian Perez de Castro.

Remove spurious LIFTETIME_BOUND annotation and un-needed includes.

* Source/WTF/wtf/glib/GMallocString.cpp:
(WTF::GMallocString::dump const):
(): Deleted.

Canonical link: https://commits.webkit.org/304353@main
…wrong WARN_UNUSED_RETURN

https://bugs.webkit.org/show_bug.cgi?id=304063

Reviewed by Xabier Rodriguez-Calvar.

Update the macro position, like 304354@main did.

* Source/WTF/wtf/glib/GMallocString.h:

Canonical link: https://commits.webkit.org/304358@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants