Use STL instead of WTF::get_if, WTF::Monostate, WTF::visit, and WTF::holds_alternative
https://bugs.webkit.org/show_bug.cgi?id=231582
Patch by Alex Christensen <[email protected]> on 2021-10-12
Reviewed by Darin Adler.
Source/JavaScriptCore:
(JSC::AssemblyHelpers::branchIfValue):
(JSC_DEFINE_HOST_FUNCTION):
(JSC::Lexer<T>::lexWithoutClearingLineTerminator):
- parser/VariableEnvironment.h:
(JSC::CompactTDZEnvironment::toTDZEnvironment const):
(JSC::CacheUpdate::isGlobal const):
(JSC::CachedCompactTDZEnvironment::encode):
- wasm/WasmLLIntGenerator.cpp:
(JSC::Wasm::LLIntGenerator::ControlType::isLoop):
(JSC::Wasm::LLIntGenerator::ControlType::isTopLevel):
(JSC::Wasm::LLIntGenerator::ControlType::isBlock):
(JSC::Wasm::LLIntGenerator::ControlType::isIf):
(JSC::Wasm::LLIntGenerator::ControlType::isTry):
(JSC::Wasm::LLIntGenerator::ControlType::isAnyCatch):
(JSC::Wasm::LLIntGenerator::ControlType::isCatch):
(JSC::Wasm::LLIntGenerator::ControlType::targetLabelForBranch const):
(JSC::Wasm::LLIntGenerator::ControlType::branchTargetArity const):
(JSC::Wasm::LLIntGenerator::ControlType::branchTargetType const):
(JSC::Wasm::LLIntGenerator::addElse):
(JSC::Wasm::LLIntGenerator::addCatchToUnreachable):
(JSC::Wasm::LLIntGenerator::addCatchAllToUnreachable):
(JSC::Wasm::LLIntGenerator::addRethrow):
(JSC::Wasm::LLIntGenerator::addEndToUnreachable):
Source/WebCore:
- Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::handlesIdentifier):
- Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::invokeCompletionHandler):
(WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
- Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::requestFromInfo):
- Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isBlob const):
(WebCore::FetchBody::isFormData const):
(WebCore::FetchBody::isArrayBuffer const):
(WebCore::FetchBody::isArrayBufferView const):
(WebCore::FetchBody::isURLSearchParams const):
(WebCore::FetchBody::isText const):
- Modules/fetch/FetchHeaders.cpp:
(WebCore::fillHeaderMap):
- Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::create):
- Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::continuePrimaryKey):
- Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::transaction):
- Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::isIDBKeyPathValid):
(WebCore::isolatedCopy):
(WebCore::loggingString):
- Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
- Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::requestedIndexRecordType const):
- Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializeIDBKeyPath):
- Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::displayNameForTrack):
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
- Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTransceiver):
(WebCore::certificateTypeFromAlgorithmIdentifier):
- Modules/mediastream/RTCRtpSFrameTransform.cpp:
(WebCore::RTCRtpSFrameTransform::setEncryptionKey):
- Modules/speech/SpeechRecognitionUpdate.cpp:
(WebCore::SpeechRecognitionUpdate::create):
- Modules/speech/SpeechRecognitionUpdate.h:
- Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::WebXRWebGLLayer::create):
- animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::updateTiming):
- animation/KeyframeEffect.cpp:
(WebCore::processIterableKeyframes):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffect::create):
- bindings/js/BufferSource.h:
(WebCore::BufferSource::data const):
(WebCore::BufferSource::length const):
- bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::canInjectIDBKeyIntoScriptValue):
(WebCore::createKeyPathArray):
(WebCore::deserializeIDBValueWithKeyInjection):
(WebCore::normalizeCryptoAlgorithmParameters):
- css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::createEmpty):
(WebCore::CSSCustomPropertyValue::equals const):
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
- css/CSSCustomPropertyValue.h:
- css/StyleRule.h:
- css/typedom/CSSUnparsedValue.cpp:
(WebCore::CSSUnparsedValue::serialize const):
(WebCore::DocumentMarker::description const):
(WebCore::Element::scrollIntoView):
(WebCore::Element::animate):
(WebCore::EventTarget::addEventListenerForBindings):
(WebCore::EventTarget::removeEventListenerForBindings):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):
- html/URLSearchParams.cpp:
(WebCore::URLSearchParams::create):
- html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyle::isEquivalentColor const):
(WebCore::CanvasStyle::isEquivalent const):
- html/canvas/CanvasStyle.h:
(WebCore::CanvasStyle::isValid const):
(WebCore::CanvasStyle::isCurrentColor const):
(WebCore::CanvasStyle::canvasGradient const):
(WebCore::CanvasStyle::canvasPattern const):
- html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::InspectorScopedShaderProgramHighlight::saveBlendValue):
(WebCore::InspectorScopedShaderProgramHighlight::hasBufferBinding):
(WebCore::InspectorScopedShaderProgramHighlight::hasFramebufferParameterAttachment):
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::getTexImageSourceSize):
(WebCore::WebGLRenderingContextBase::texImageSourceHelper):
(WebCore::VTTCue::setLine):
(WebCore::VTTCue::setPosition):
- inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::canvasContext const):
(WebCore::InspectorCanvas::canvasElement const):
(WebCore::InspectorCanvas::scriptExecutionContext const):
(WebCore::InspectorCanvas::resolveContext const):
(WebCore:: const):
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::indexForData):
- inspector/InspectorCanvas.h:
- inspector/InspectorShaderProgram.cpp:
(WebCore::InspectorShaderProgram::program const):
(WebCore::InspectorShaderProgram::requestShaderSource):
(WebCore::InspectorShaderProgram::updateShader):
(WebCore::InspectorShaderProgram::buildObjectForShaderProgram):
- inspector/InspectorShaderProgram.h:
- inspector/agents/InspectorIndexedDBAgent.cpp:
(WebCore::Inspector::keyPathFromIDBKeyPath):
- layout/integration/InlineIteratorBox.h:
(WebCore::InlineIterator::Box::legacyInlineBox const):
(WebCore::InlineIterator::Box::inlineBox const):
- platform/PasteboardCustomData.cpp:
(WebCore::copyPlatformData):
(WebCore::PasteboardCustomData::readBuffer const):
(WebCore::PasteboardCustomData::readString const):
(WebCore::PasteboardCustomData::forEachPlatformString const):
(WebCore::PasteboardCustomData::forEachPlatformStringOrBuffer const):
- platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::takeData):
(WebCore::SharedBuffer::DataSegment::data const):
(WebCore::SharedBuffer::DataSegment::containsMappedFileData const):
(WebCore::SharedBuffer::DataSegment::size const):
- platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::createCFData const):
(WebCore::SharedBuffer::hintMemoryNotNeededSoon const):
- platform/generic/KeyedDecoderGeneric.cpp:
(WebCore::KeyedDecoderGeneric::getPointerFromDictionaryStack):
- platform/graphics/DecodingOptions.h:
(WebCore::DecodingOptions::has const):
- platform/graphics/FontCascadeFonts.cpp:
(WebCore::realizeNextFallback):
- platform/graphics/InlinePathData.h:
- platform/graphics/Path.h:
(WebCore::Path::hasInlineData const):
- platform/graphics/cg/PathCG.cpp:
(WebCore::Path::createCGPath const):
(WebCore::Path::ensurePlatformPath):
(WebCore::Path::Path):
(WebCore::Path::transform):
(WebCore::Path::clear):
- platform/graphics/displaylists/DisplayListItemBuffer.cpp:
(WebCore::DisplayList::safeCopy):
- platform/graphics/displaylists/DisplayListItemType.cpp:
(WebCore::DisplayList::paddedSizeOfTypeAndItemInBytes):
(WebCore::DisplayList::displayListItemType):
- platform/graphics/displaylists/DisplayListResourceHeap.h:
(WebCore::DisplayList::ResourceHeap::deleteAllFonts):
(WebCore::DisplayList::ResourceHeap::get const):
(WebCore::DisplayList::ResourceHeap::remove):
- platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp:
(WebCore::CDMProxyClearKey::cencSetDecryptionKey):
- platform/graphics/gstreamer/eme/CDMProxyThunder.cpp:
(WebCore::CDMProxyThunder::getDecryptionSession const):
- platform/ios/PlatformPasteboardIOS.mm:
(WebCore::createItemProviderRegistrationList):
- platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::write):
(WebCore::createPasteboardItem):
- platform/mock/MockMediaDevice.h:
(WebCore::MockMediaDevice::isMicrophone const):
(WebCore::MockMediaDevice::isSpeaker const):
(WebCore::MockMediaDevice::isCamera const):
(WebCore::MockMediaDevice::isDisplay const):
- platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::mockDisplayType const):
- platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::mockCamera const):
(WebCore::MockRealtimeVideoSource::mockDisplay const):
(WebCore::IPAddress::isIPv4 const):
(WebCore::IPAddress::isIPv6 const):
- platform/network/FormData.cpp:
(WebCore::FormData::imageOrMediaFilesCount const):
(WebCore::FormData::appendData):
(WebCore::FormData::appendMultiPartKeyValuePairItems):
(WebCore::FormData::appendNonMultiPartKeyValuePairItems):
(WebCore::FormData::flatten const):
(WebCore::FormData::containsBlobElement const):
(WebCore::FormData::prepareForUpload):
(WebCore::FormData::asSharedBuffer const):
(WebCore::FormData::asBlobURL const):
- platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::hasUpload const):
- platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::setHTTPBody):
- platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableSSLForHost):
- platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::clearCACertInfo):
- platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
- platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageBody const):
- platform/network/soup/WebKitFormDataInputStream.cpp:
(webkitFormDataInputStreamNew):
- platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeCustomData):
- platform/xr/PlatformXR.h:
(PlatformXR::Device::FrameData::View::encode const):
- rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::setChildrenInline):
(WebCore::RenderBlockFlow::deleteLines):
(WebCore::RenderBlockFlow::invalidateLineLayoutPath):
- rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::hasLineLayout const):
(WebCore::RenderBlockFlow::hasLegacyLineLayout const):
(WebCore::RenderBlockFlow::hasModernLineLayout const):
(WebCore::Style::Builder::applyCustomProperty):
(WebCore::Style::Builder::applyProperty):
- workers/service/ServiceWorkerJobData.cpp:
(WebCore::ServiceWorkerJobData::serviceWorkerPageIdentifier const):
- workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::queueTaskToPostMessage):
- workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::cancelJobsFromServiceWorker):
Source/WebKit:
- NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
- NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
- NetworkProcess/cache/NetworkCacheDataCurl.cpp:
(WebKit::NetworkCache::Data::Data):
- Platform/IPC/ArgumentCoders.h:
(IPC::ArgumentCoder<std::monostate>::encode):
(IPC::ArgumentCoder<std::monostate>::decode):
(IPC::ArgumentCoder<Monostate>::encode): Deleted.
(IPC::ArgumentCoder<Monostate>::decode): Deleted.
- Platform/IPC/FormDataReference.h:
(IPC::FormDataReference::encode const):
- Platform/IPC/MessageReceiveQueueMap.cpp:
(IPC::MessageReceiveQueueMap::get const):
- Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::sendOutputMessage):
- Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PasteboardCustomData::Entry>::encode):
(IPC::ArgumentCoder<IDBKeyPath>::encode):
(IPC::ArgumentCoder<ServiceWorkerOrClientData>::encode):
(IPC::ArgumentCoder<ServiceWorkerOrClientIdentifier>::encode):
- Shared/WebPreferencesStore.cpp:
(WebKit::valueForKey):
- UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::isValidBackgroundActivity):
(WebKit::ProcessThrottler::isValidForegroundActivity):
(WebKit::ProcessThrottler::TimedActivity::updateTimer):
- UIProcess/WebAuthentication/Authenticator.cpp:
(WebKit::Authenticator::handleRequest):
- UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::WebCore::getRpId):
(WebKit::WebCore::getUserName):
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::invokePendingCompletionHandler):
- UIProcess/WebAuthentication/WebAuthenticationRequestData.cpp:
(WebKit::getClientDataType):
(WebKit::getUserVerificationRequirement):
- UIProcess/gtk/WebPasteboardProxyGtk.cpp:
(WebKit::WebPasteboardProxy::writeCustomData):
- WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
(WebKit::ImageBufferShareableBitmapBackend::create):
- WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
- WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp:
(WebKit::ImageBufferShareableIOSurfaceBackend::create):
- WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp:
(WebKit::ImageBufferShareableMappedIOSurfaceBackend::create):
- WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
- WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::executePendingEditorCommands):
- WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
(WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection):
Source/WTF:
(WTF::switchOn):
(): Deleted.
(WTF::visit): Deleted.
(WTF::get_if): Deleted.
Tools:
- TestWebKitAPI/Tests/WTF/Variant.cpp:
(TestWebKitAPI::TEST):
- TestWebKitAPI/Tests/WebKitCocoa/PrivateClickMeasurement.mm:
(addValuesToTable):