Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop Vector::append(T*, size_t) and use Vector::append(std::span<cons…
…t T>) instead https://bugs.webkit.org/show_bug.cgi?id=271118 Reviewed by Darin Adler and Brent Fulgham. Drop Vector::append(T*, size_t) and use Vector::append(std::span<const T>) instead. This is part of an effort to use std::span more in the codebase, for better security. * Source/JavaScriptCore/API/ObjcRuntimeExtras.h: (forEachProtocolImplementingProtocol): * Source/JavaScriptCore/assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::JumpList::append): * Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.cpp: (JSC::ObjectPropertyConditionSet::mergedWith const): * Source/JavaScriptCore/jsc.cpp: (runWithOptions): * Source/JavaScriptCore/parser/Lexer.cpp: (JSC::Lexer<CharacterType>::parseIdentifierSlowCase): (JSC::Lexer<T>::parseTemplateLiteral): * Source/JavaScriptCore/parser/Lexer.h: (JSC::Lexer::append16): * Source/JavaScriptCore/runtime/IntlLocale.cpp: (JSC::LocaleIDBuilder::overrideLanguageScriptRegion): * Source/JavaScriptCore/runtime/IntlObject.cpp: (JSC::canonicalizeUnicodeExtensionsAfterICULocaleCanonicalization): (JSC::addScriptlessLocaleIfNeeded): * Source/JavaScriptCore/runtime/StringPrototype.cpp: (JSC::illFormedIndex): (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/tools/JSDollarVM.cpp: * Source/JavaScriptCore/wasm/WasmBBQPlan.h: * Source/JavaScriptCore/wasm/WasmEntryPlan.cpp: (JSC::Wasm::EntryPlan::parseAndValidateModule): * Source/JavaScriptCore/wasm/WasmEntryPlan.h: * Source/JavaScriptCore/wasm/WasmIPIntPlan.cpp: (JSC::Wasm::IPIntPlan::IPIntPlan): * Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp: (JSC::Wasm::LLIntPlan::LLIntPlan): * Source/JavaScriptCore/wasm/WasmStreamingCompiler.h: * Source/JavaScriptCore/wasm/WasmStreamingParser.cpp: (JSC::Wasm::StreamingParser::consume): (JSC::Wasm::StreamingParser::consumeVarUInt32): (JSC::Wasm::StreamingParser::addBytes): (JSC::Wasm::StreamingParser::finalize): * Source/JavaScriptCore/wasm/WasmStreamingParser.h: (JSC::Wasm::StreamingParser::addBytes): * Source/WTF/wtf/StreamBuffer.h: (WTF::StreamBuffer::append): * Source/WTF/wtf/TrailingArray.h: (WTF::TrailingArray::span const): * Source/WTF/wtf/URL.cpp: (WTF::appendEncodedHostname): * Source/WTF/wtf/URLParser.cpp: (WTF::URLParser::appendToASCIIBuffer): (WTF::URLParser::utf8PercentEncode): (WTF::URLParser::utf8QueryEncode): (WTF::URLParser::copyASCIIStringUntil): (WTF::URLParser::syntaxViolation): (WTF::URLParser::parse): (WTF::URLParser::appendNumberToASCIIBuffer): (WTF::URLParser::serializeIPv6): (WTF::URLParser::domainToASCII): (WTF::URLParser::parseHostAndPort): * Source/WTF/wtf/URLParser.h: (WTF::URLParser::appendToASCIIBuffer): Deleted. * Source/WTF/wtf/Vector.h: (WTF::Vector::subspan const): (WTF::Vector::tryAppend): (WTF::Vector::append): (WTF::Vector::appendList): (WTF::Malloc>::append): (WTF::Malloc>::appendVector): * Source/WTF/wtf/cf/VectorCF.h: * Source/WTF/wtf/cocoa/FileSystemCocoa.mm: (WTF::FileSystemImpl::openTemporaryFile): * Source/WTF/wtf/text/AtomString.h: * Source/WTF/wtf/text/SuperFastHash.h: (WTF::SuperFastHash::addCharacters): (WTF::SuperFastHash::computeHash): * Source/WTF/wtf/text/WTFString.cpp: (WTF::String::charactersWithoutNullTermination const): * Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp: (WebCore::writeLittleEndian): (WebCore::encodeKey): (WebCore::decodeKey): * Source/WebCore/Modules/mediastream/SFrameUtils.cpp: (WebCore::toRbsp): (WebCore::computeVP8PrefixBuffer): * Source/WebCore/Modules/mediastream/STUNMessageParsing.cpp: (WebCore::WebRTC::getSTUNOrTURNMessageLengths): (WebCore::WebRTC::extractSTUNOrTURNMessages): * Source/WebCore/Modules/mediastream/STUNMessageParsing.h: * Source/WebCore/Modules/webauthn/cbor/CBORReader.cpp: (cbor::CBORReader::readBytes): * Source/WebCore/Modules/webauthn/cbor/CBORWriter.cpp: (cbor::CBORWriter::encodeCBOR): * Source/WebCore/Modules/webauthn/fido/FidoHidPacket.cpp: (fido::FidoHidInitPacket::getSerializedData const): (fido::FidoHidContinuationPacket::getSerializedData const): * Source/WebCore/Modules/webauthn/fido/FidoParsingUtils.cpp: (fido::getInitPacketData): (fido::getContinuationPacketData): * Source/WebCore/Modules/webauthn/fido/U2fCommandConstructor.cpp: (fido::WebCore::constructU2fSignCommand): * Source/WebCore/Modules/websockets/WebSocketFrame.cpp: (WebCore::WebSocketFrame::makeFrameData): * Source/WebCore/Modules/websockets/WebSocketHandshake.cpp: (WebCore::WebSocketHandshake::readHTTPHeaders): * Source/WebCore/PAL/pal/text/TextCodecCJK.cpp: (PAL::appendDecimal): * Source/WebCore/PAL/pal/text/TextCodecICU.cpp: (PAL::TextCodecICU::encode const): * Source/WebCore/PAL/pal/text/TextCodecLatin1.cpp: (PAL::encodeComplexWindowsLatin1): * Source/WebCore/PAL/pal/text/TextCodecUserDefined.cpp: (PAL::encodeComplexUserDefined): * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsPressAction const): * Source/WebCore/bindings/js/JSDOMGlobalObject.cpp: (WebCore::handleResponseOnStreamingAction): * Source/WebCore/bindings/js/SerializedScriptValue.cpp: (WebCore::writeLittleEndian): (WebCore::writeLittleEndian<uint8_t>): (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::dumpImageBitmap): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneSerializer::write): (WebCore::CloneDeserializer::read): * Source/WebCore/crypto/SubtleCrypto.cpp: (WebCore::SubtleCrypto::wrapKey): * Source/WebCore/crypto/cocoa/CryptoAlgorithmECDSAMac.cpp: (WebCore::signECDSA): (WebCore::verifyECDSA): * Source/WebCore/crypto/cocoa/CryptoKeyECMac.cpp: (WebCore::CryptoKeyEC::platformExportSpki const): (WebCore::CryptoKeyEC::platformImportPkcs8): (WebCore::CryptoKeyEC::platformExportPkcs8 const): * Source/WebCore/crypto/cocoa/CryptoKeyOKPCocoa.cpp: (WebCore::CryptoKeyOKP::exportSpki const): (WebCore::CryptoKeyOKP::exportPkcs8 const): * Source/WebCore/crypto/cocoa/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::exportSpki const): (WebCore::CryptoKeyRSA::exportPkcs8 const): * Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: * Source/WebCore/crypto/parameters/CryptoAlgorithmAesCtrParams.h: * Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h: * Source/WebCore/crypto/parameters/CryptoAlgorithmHkdfParams.h: * Source/WebCore/crypto/parameters/CryptoAlgorithmPbkdf2Params.h: * Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: (WebCore::CryptoAlgorithmRsaKeyGenParams::publicExponentVector const): * Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h: * Source/WebCore/dom/DatasetDOMStringMap.cpp: (WebCore::convertPropertyNameToAttributeName): * Source/WebCore/fileapi/BlobBuilder.cpp: (WebCore::BlobBuilder::append): * Source/WebCore/history/HistoryItem.cpp: (WebCore::HistoryItem::showTreeWithIndent const): * Source/WebCore/html/parser/HTMLToken.h: (WebCore::HTMLToken::appendToComment): * Source/WebCore/loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::decode): * Source/WebCore/page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): * Source/WebCore/page/PageConsoleClient.cpp: (WebCore::PageConsoleClient::addMessage): (WebCore::PageConsoleClient::messageWithTypeAndLevel): * Source/WebCore/platform/SharedBuffer.cpp: (WebCore::combineSegmentsData): (WebCore::FragmentedSharedBuffer::getContiguousData const): (WebCore::FragmentedSharedBuffer::read const): * Source/WebCore/platform/SharedStringHash.cpp: (WebCore::findSlashDotDotSlash): (WebCore::findSlashSlash): (WebCore::findSlashDotSlash): (WebCore::containsColonSlashSlash): (WebCore::cleanSlashDotDotSlashes): (WebCore::mergeDoubleSlashes): (WebCore::cleanSlashDotSlashes): (WebCore::cleanPath): (WebCore::needsTrailingSlash): (WebCore::computeSharedStringHashInline): (WebCore::computeSharedStringHash): (WebCore::computeVisitedLinkHash): * Source/WebCore/platform/SharedStringHash.h: * Source/WebCore/platform/audio/MultiChannelResampler.cpp: (WebCore::MultiChannelResampler::provideInputForChannel): * Source/WebCore/platform/audio/SincResampler.cpp: (WebCore::SincResampler::processBuffer): (WebCore::SincResampler::process): * Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp: (WebCore::encode): (WebCore::encodeToVector): * Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::WebMParser::AudioTrackData::consumeFrameData): * Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h: * Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm: (WebCore::cookieFromVorbisCodecPrivate): (WebCore::createVorbisAudioInfo): * Source/WebCore/platform/network/FormData.cpp: (WebCore::FormData::flatten const): * Source/WebCore/platform/network/FormDataBuilder.cpp: (WebCore::FormDataBuilder::append): * Source/WebCore/platform/network/HTTPParsers.cpp: (WebCore::parseHTTPHeader): (WebCore::parseHTTPRequestBody): * Source/WebCore/platform/network/HTTPParsers.h: * Source/WebCore/platform/network/SynchronousLoaderClient.cpp: (WebCore::SynchronousLoaderClient::didReceiveData): * Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp: (WebCore::CurlMultipartHandle::parseHeadersIfPossible): * Source/WebCore/platform/text/QuotedPrintable.cpp: (WebCore::quotedPrintableEncode): * Source/WebCore/rendering/svg/SVGTextChunk.cpp: (WebCore::SVGTextChunk::SVGTextChunk): * Source/WebCore/svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): * Source/WebCore/testing/MockContentFilter.cpp: (WebCore::MockContentFilter::maybeDetermineStatus): * Source/WebCore/xml/parser/XMLDocumentParser.h: * Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::PendingCallbacks::appendCharactersCallback): (WebCore::XMLDocumentParser::characters): (WebCore::charactersHandler): * Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp: (WebKit::sendReplyToSynchronousRequest): * Source/WebKit/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: (WebKit::LibWebRTCSocketClient::sendTo): * Source/WebKit/NetworkProcess/webrtc/LibWebRTCSocketClient.h: * Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::sendToSocket): * Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.h: * Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h: * Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: (WebKit::NetworkRTCTCPSocketCocoa::createMessageBuffer): (WebKit::NetworkRTCTCPSocketCocoa::sendTo): * Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: * Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: (WebKit::NetworkRTCUDPSocketCocoa::sendTo): (WebKit::NetworkRTCUDPSocketCocoaConnections::sendTo): * Source/WebKit/Shared/API/APIData.h: (API::Data::data const): (API::Data::bytes const): (API::Data::dataReference const): Deleted. * Source/WebKit/Shared/API/APIData.serialization.in: * Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm: (-[WKRemoteObjectDecoder decodeBytesForKey:returnedLength:]): * Source/WebKit/Shared/API/c/WKData.cpp: (WKDataGetBytes): * Source/WebKit/Shared/APIWebArchive.mm: (API::WebArchive::WebArchive): * Source/WebKit/Shared/APIWebArchiveResource.mm: (API::WebArchiveResource::WebArchiveResource): * Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtension::createHandleForTemporaryFile): * Source/WebKit/Shared/Cocoa/WKNSData.mm: (-[WKNSData bytes]): * Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm: (WebKit::fileContents): (WebKit::compileAndCacheSandboxProfile): * Source/WebKit/UIProcess/API/C/WKNotificationManager.cpp: (WKNotificationManagerProviderDidClickNotification_b): * Source/WebKit/UIProcess/API/C/WKPage.cpp: (WKPageLoadData): (WKPageLoadDataWithUserData): (restoreFromSessionState): * Source/WebKit/UIProcess/API/C/WKSessionStateRef.cpp: (WKSessionStateCreateFromData): * Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon): (WebKit::WebPageProxy::getWebCryptoMasterKey): * Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resumeDownload): * Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataDecoder::operator>>): * Source/WebKit/UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): * Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): * Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::createUnarchiver): * Source/WebKit/WebProcess/Plugins/PDF/PDFIncrementalLoader.mm: (WebKit::ByteRangeRequest::addData): (WebKit::PDFPluginStreamLoaderClient::didReceiveData): * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::completeTextManipulation): * Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleClient.h: * Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleImpl.cpp: (WebCore::removeTerminationCharacters): (WebCore::cookieDataForHandshake): (WebCore::SocketStreamHandleImpl::platformSendHandshake): * Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleImplCFNet.cpp: (WebCore::SocketStreamHandleImpl::readStreamCallback): * Source/WebKitLegacy/WebCoreSupport/WebCryptoClient.mm: (WebCryptoClient::wrapCryptoKey const): (WebCryptoClient::unwrapCryptoKey const): * Source/WebKitLegacy/WebCoreSupport/WebSocketChannel.cpp: (WebCore::WebSocketChannel::didReceiveSocketStreamData): (WebCore::WebSocketChannel::appendToBuffer): * Source/WebKitLegacy/WebCoreSupport/WebSocketChannel.h: * Source/WebKitLegacy/mac/WebCoreSupport/WebVisitedLinkStore.mm: (WebVisitedLinkStore::addVisitedLink): * Tools/DumpRenderTree/PixelDumpSupport.cpp: (convertChecksumToPNGComment): * Tools/TestWebKitAPI/Tests/WebCore/ASN1Utilities.cpp: * Tools/TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp: (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/Tests/WebCore/CtapResponseTest.cpp: (TestWebKitAPI::getTestAttestedCredentialDataBytes): (TestWebKitAPI::getTestAttestationObjectBytes): (TestWebKitAPI::getTestCorruptedSignResponse): (TestWebKitAPI::getTestU2fRegisterResponse): (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm: (TestWebKitAPI::testVideoBytes): (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: (respondToRangeRequests): * Tools/TestWebKitAPI/cocoa/HTTPServer.mm: (TestWebKitAPI::vectorFromData): (TestWebKitAPI::appendUTF8ToVector): (TestWebKitAPI::H2::Connection::receive const): * Tools/WebKitTestRunner/PixelDumpSupport.cpp: (convertChecksumToPNGComment): Canonical link: https://commits.webkit.org/276319@main
- Loading branch information