WebKit Bugzilla
Attachment 357561 Details for
Bug 192808
: Use Ref<> as much as possible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192808-20181218210052.patch (text/plain), 396.74 KB, created by
Yusuke Suzuki
on 2018-12-18 04:00:53 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-12-18 04:00:53 PST
Size:
396.74 KB
patch
obsolete
>Subversion Revision: 239328 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 3865cdb38b541916d12d7880c57d89e27eb526b2..59ede76aab954817a957c5ff9095ce91123186a9 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,42 @@ >+2018-12-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use Ref<> as much as possible >+ https://bugs.webkit.org/show_bug.cgi?id=192808 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * API/JSTypedArray.cpp: >+ (JSObjectMakeTypedArrayWithBytesNoCopy): >+ * dfg/DFGDesiredWatchpoints.cpp: >+ (JSC::DFG::ArrayBufferViewWatchpointAdaptor::add): >+ * heap/Heap.cpp: >+ (JSC::Heap::Heap): >+ (JSC::Heap::sweeper): >+ * heap/Heap.h: >+ * heap/IsoCellSet.cpp: >+ (JSC::IsoCellSet::parallelNotEmptyMarkedBlockSource): >+ * heap/IsoCellSet.h: >+ * heap/IsoCellSetInlines.h: >+ (JSC::IsoCellSet::forEachMarkedCellInParallel): >+ * heap/Subspace.cpp: >+ (JSC::Subspace::parallelDirectorySource): >+ (JSC::Subspace::parallelNotEmptyMarkedBlockSource): >+ * heap/Subspace.h: >+ * heap/SubspaceInlines.h: >+ (JSC::Subspace::forEachMarkedCellInParallel): >+ * jsc.cpp: >+ (functionDollarAgentReceiveBroadcast): >+ * runtime/ArrayBuffer.cpp: >+ (JSC::ArrayBuffer::slice const): >+ (JSC::ArrayBuffer::sliceImpl const): >+ * runtime/ArrayBuffer.h: >+ * runtime/ArrayBufferNeuteringWatchpoint.cpp: >+ (JSC::ArrayBufferNeuteringWatchpoint::ArrayBufferNeuteringWatchpoint): >+ (JSC::ArrayBufferNeuteringWatchpoint::fireAll): >+ * runtime/ArrayBufferNeuteringWatchpoint.h: >+ * runtime/JSArrayBufferPrototype.cpp: >+ (JSC::arrayBufferProtoFuncSlice): >+ > 2018-12-17 Mark Lam <mark.lam@apple.com> > > Array unshift/shift should not race against the AI in the compiler thread. >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b5a5d7182d07afbb11c00f16271dea98c32a4d46..5a23e42c6c6f694eea22107ce37b748aac1ce3cf 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,397 @@ >+2018-12-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use Ref<> as much as possible >+ https://bugs.webkit.org/show_bug.cgi?id=192808 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Modules/encryptedmedia/NavigatorEME.cpp: >+ (WebCore::NavigatorEME::requestMediaKeySystemAccess): >+ * Modules/fetch/FetchBody.cpp: >+ (WebCore::FetchBody::bodyAsFormData const): >+ * Modules/fetch/FetchBody.h: >+ * Modules/geolocation/Geolocation.cpp: >+ (WebCore::Geolocation::getCurrentPosition): >+ (WebCore::Geolocation::watchPosition): >+ * Modules/indexeddb/IDBDatabase.cpp: >+ (WebCore::IDBDatabase::objectStoreNames const): >+ * Modules/indexeddb/IDBDatabase.h: >+ * Modules/indexeddb/IDBObjectStore.cpp: >+ (WebCore::IDBObjectStore::indexNames const): >+ * Modules/indexeddb/IDBObjectStore.h: >+ * Modules/indexeddb/IDBTransaction.cpp: >+ (WebCore::IDBTransaction::scheduleOperation): >+ * Modules/indexeddb/IDBTransaction.h: >+ * Modules/indexeddb/client/TransactionOperation.h: >+ (WebCore::IDBClient::createTransactionOperation): >+ * Modules/mediastream/MediaDevices.cpp: >+ (WebCore::MediaDevices::getUserMedia const): >+ (WebCore::MediaDevices::getDisplayMedia const): >+ * Modules/mediastream/UserMediaRequest.cpp: >+ (WebCore::UserMediaRequest::create): >+ * Modules/mediastream/UserMediaRequest.h: >+ * Modules/webaudio/AudioParam.cpp: >+ (WebCore::AudioParam::calculateFinalValues): >+ * Modules/webaudio/ScriptProcessorNode.cpp: >+ (WebCore::ScriptProcessorNode::initialize): >+ * Modules/webdatabase/SQLStatement.cpp: >+ (WebCore::SQLStatement::execute): >+ * Modules/webgpu/WebGPU.cpp: >+ (WebCore::WebGPU::requestAdapter const): >+ * Modules/webgpu/WebGPUAdapter.cpp: >+ (WebCore::WebGPUAdapter::create): >+ * Modules/webgpu/WebGPUAdapter.h: >+ * Modules/webgpu/WebGPUBuffer.cpp: >+ (WebCore::WebGPUBuffer::create): >+ * Modules/webgpu/WebGPUBuffer.h: >+ * Modules/webgpu/WebGPUCommandBuffer.cpp: >+ (WebCore::WebGPUCommandBuffer::create): >+ (WebCore::WebGPUCommandBuffer::beginRenderPass): >+ * Modules/webgpu/WebGPUCommandBuffer.h: >+ * Modules/webgpu/WebGPUDevice.cpp: >+ (WebCore::WebGPUDevice::create): >+ (WebCore::WebGPUDevice::createBuffer const): >+ (WebCore::WebGPUDevice::createShaderModule const): >+ (WebCore::WebGPUDevice::createRenderPipeline const): >+ (WebCore::WebGPUDevice::createCommandBuffer const): >+ * Modules/webgpu/WebGPURenderPassEncoder.cpp: >+ (WebCore::WebGPURenderPassEncoder::create): >+ * Modules/webgpu/WebGPURenderPassEncoder.h: >+ * Modules/webgpu/WebGPURenderPipeline.cpp: >+ (WebCore::WebGPURenderPipeline::create): >+ * Modules/webgpu/WebGPURenderPipeline.h: >+ * Modules/webgpu/WebGPUShaderModule.cpp: >+ (WebCore::WebGPUShaderModule::create): >+ * Modules/webgpu/WebGPUShaderModule.h: >+ * Modules/webgpu/WebGPUTexture.cpp: >+ (WebCore::WebGPUTexture::createDefaultTextureView): >+ * Modules/webgpu/WebGPUTextureView.cpp: >+ (WebCore::WebGPUTextureView::create): >+ * Modules/webgpu/WebGPUTextureView.h: >+ * accessibility/AXObjectCache.cpp: >+ (WebCore::AXObjectCache::rangeMatchesTextNearRange): >+ * accessibility/atk/AXObjectCacheAtk.cpp: >+ (WebCore::AXObjectCache::nodeTextChangePlatformNotification): >+ * accessibility/atk/WebKitAccessibleHyperlink.cpp: >+ (webkitAccessibleHyperlinkGetStartIndex): >+ (webkitAccessibleHyperlinkGetEndIndex): >+ * accessibility/atk/WebKitAccessibleInterfaceText.cpp: >+ (getSelectionOffsetsForObject): >+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: >+ (-[WebAccessibilityObjectWrapper _convertToNSRange:]): >+ * bindings/js/JSDOMGlobalObjectTask.cpp: >+ * bindings/js/JSDOMWindowBase.cpp: >+ (WebCore::JSDOMWindowBase::queueTaskToEventLoop): >+ * bindings/js/JSWorkerGlobalScopeBase.cpp: >+ (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop): >+ * bindings/js/ScriptControllerMac.mm: >+ (WebCore::ScriptController::createScriptInstanceForWidget): >+ * bindings/js/SerializedScriptValue.cpp: >+ (WebCore::CloneDeserializer::readTerminal): >+ (WebCore::SerializedScriptValue::create): >+ * bridge/objc/objc_instance.h: >+ * bridge/objc/objc_instance.mm: >+ (ObjcInstance::create): >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::ComputedStyleExtractor::currentColorOrValidColor const): >+ (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties): >+ (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand): >+ (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): >+ * css/CSSComputedStyleDeclaration.h: >+ * css/CSSFontFaceSource.cpp: >+ (WebCore::CSSFontFaceSource::load): >+ * css/CSSStyleSheet.cpp: >+ (WebCore::CSSStyleSheet::rules): >+ * css/FontFace.cpp: >+ (WebCore::FontFace::unicodeRange const): >+ (WebCore::FontFace::featureSettings const): >+ * css/InspectorCSSOMWrappers.cpp: >+ (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents): >+ * css/SVGCSSComputedStyleDeclaration.cpp: >+ (WebCore::strokeDashArrayToCSSValueList): >+ (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const): >+ * css/StyleResolver.cpp: >+ (WebCore::StyleResolver::createFilterOperations): >+ * css/StyleRule.cpp: >+ (WebCore::StyleRuleBase::createCSSOMWrapper const): >+ * css/StyleRule.h: >+ * dom/ChildListMutationScope.cpp: >+ (WebCore::ChildListMutationAccumulator::getOrCreate): >+ * dom/ChildListMutationScope.h: >+ * dom/DocumentMarkerController.cpp: >+ (WebCore::updateRenderedRectsForMarker): >+ * dom/InlineStyleSheetOwner.cpp: >+ (WebCore::InlineStyleSheetOwner::createSheet): >+ * dom/PointerEvent.h: >+ * dom/UserGestureIndicator.h: >+ (WebCore::UserGestureToken::create): >+ * editing/AlternativeTextController.cpp: >+ (WebCore::AlternativeTextController::applyAlternativeTextToRange): >+ (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): >+ (WebCore::AlternativeTextController::respondToUnappliedEditing): >+ (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): >+ (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): >+ * editing/ApplyStyleCommand.cpp: >+ (WebCore::ApplyStyleCommand::applyBlockStyle): >+ (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): >+ * editing/CompositeEditCommand.cpp: >+ (WebCore::CompositeEditCommand::targetRanges const): >+ (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): >+ (WebCore::CompositeEditCommand::moveParagraphs): >+ * editing/DeleteSelectionCommand.cpp: >+ (WebCore::DeleteSelectionCommand::mergeParagraphs): >+ * editing/Editing.cpp: >+ (WebCore::visiblePositionForIndexUsingCharacterIterator): >+ * editing/EditingStyle.cpp: >+ (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode): >+ (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const): >+ (WebCore::EditingStyle::prepareToApplyAt): >+ (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement): >+ (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): >+ (WebCore::EditingStyle::removeStyleFromRulesAndContext): >+ (WebCore::extractPropertiesNotIn): >+ * editing/Editor.cpp: >+ (WebCore::Editor::setBaseWritingDirection): >+ (WebCore::Editor::setComposition): >+ * editing/EditorCommand.cpp: >+ (WebCore::executeApplyParagraphStyle): >+ (WebCore::executeMakeTextWritingDirectionLeftToRight): >+ (WebCore::executeMakeTextWritingDirectionNatural): >+ (WebCore::executeMakeTextWritingDirectionRightToLeft): >+ * editing/FormatBlockCommand.cpp: >+ (WebCore::FormatBlockCommand::formatRange): >+ * editing/RemoveFormatCommand.cpp: >+ (WebCore::RemoveFormatCommand::doApply): >+ * editing/ReplaceRangeWithTextCommand.cpp: >+ (WebCore::ReplaceRangeWithTextCommand::targetRanges const): >+ * editing/ReplaceSelectionCommand.cpp: >+ (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): >+ (WebCore::handleStyleSpansBeforeInsertion): >+ (WebCore::ReplaceSelectionCommand::handleStyleSpans): >+ * editing/SpellingCorrectionCommand.cpp: >+ (WebCore::SpellingCorrectionCommand::targetRanges const): >+ * editing/TextCheckingHelper.cpp: >+ (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): >+ * editing/TypingCommand.cpp: >+ (WebCore::TypingCommand::insertText): >+ (WebCore::TypingCommand::willAddTypingToOpenCommand): >+ * editing/VisibleUnits.cpp: >+ (WebCore::distanceBetweenPositions): >+ * editing/cocoa/EditorCocoa.mm: >+ (WebCore::Editor::selectionInWebArchiveFormat): >+ * editing/ios/DictationCommandIOS.cpp: >+ (WebCore::DictationCommandIOS::doApply): >+ * editing/ios/EditorIOS.mm: >+ (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection): >+ (WebCore::Editor::removeUnchangeableStyles): >+ (WebCore::Editor::writeImageToPasteboard): >+ * editing/mac/EditorMac.mm: >+ (WebCore::Editor::replaceNodeFromPasteboard): >+ (WebCore::Editor::imageInWebArchiveFormat): >+ * editing/markup.cpp: >+ (WebCore::styleFromMatchedRulesAndInlineDecl): >+ (WebCore::createFragmentForTransformToFragment): >+ * fileapi/FileReaderLoader.cpp: >+ (WebCore::FileReaderLoader::didFinishLoading): >+ * html/FTPDirectoryDocument.cpp: >+ (WebCore::createTemplateDocumentData): >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::scheduleEvent): >+ (WebCore::HTMLMediaElement::createMediaControls): >+ * html/HTMLTableElement.cpp: >+ (WebCore::HTMLTableElement::createSharedCellStyle): >+ * html/HTMLTableElement.h: >+ * html/URLUtils.h: >+ (WebCore::URLUtils<T>::origin const): >+ * html/parser/HTMLConstructionSite.cpp: >+ (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): >+ * html/shadow/TextControlInnerElements.cpp: >+ (WebCore::TextControlInnerElement::resolveCustomStyle): >+ * html/track/WebVTTParser.cpp: >+ (WebCore::WebVTTParser::createNewCue): >+ * inspector/DOMPatchSupport.cpp: >+ * inspector/InspectorCanvas.cpp: >+ (WebCore::InspectorCanvas::buildInitialState): >+ (WebCore::InspectorCanvas::buildAction): >+ * inspector/InspectorFrontendClientLocal.cpp: >+ (WebCore::InspectorFrontendClientLocal::openInNewTab): >+ * inspector/InspectorStyleSheet.cpp: >+ (WebCore::asCSSRuleList): >+ (WebCore::InspectorStyle::styleWithProperties const): >+ (WebCore::InspectorStyleSheet::ensureSourceData): >+ * inspector/agents/InspectorCanvasAgent.cpp: >+ (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext): >+ * inspector/agents/InspectorIndexedDBAgent.cpp: >+ (WebCore::Inspector::keyPathFromIDBKeyPath): >+ * inspector/agents/InspectorPageAgent.cpp: >+ (WebCore::InspectorPageAgent::archive): >+ * loader/EmptyClients.cpp: >+ (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace): >+ (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace): >+ (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace): >+ (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace): >+ * loader/FrameLoader.cpp: >+ (WebCore::FrameLoader::loadURL): >+ (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions): >+ (WebCore::FrameLoader::loadDifferentDocumentItem): >+ * loader/WorkerThreadableLoader.cpp: >+ (WebCore::WorkerThreadableLoader::loadResourceSynchronously): >+ * loader/archive/mhtml/MHTMLParser.cpp: >+ (WebCore::MHTMLParser::addResourceToArchive): >+ (WebCore::MHTMLParser::parseNextPart): >+ * loader/cache/MemoryCache.cpp: >+ (WebCore::MemoryCache::addImageToCache): >+ (WebCore::MemoryCache::removeResourcesWithOrigin): >+ * page/DOMWindow.cpp: >+ (WebCore::DOMWindow::getMatchedCSSRules const): >+ (WebCore::DOMWindow::createWindow): >+ * page/EventHandler.cpp: >+ (WebCore::textDistance): >+ * page/Page.cpp: >+ (WebCore::Page::userStyleSheet const): >+ * page/animation/CSSPropertyAnimation.cpp: >+ (WebCore::blendFilterOperations): >+ * page/ios/FrameIOS.mm: >+ (WebCore::Frame::initWithSimpleHTMLDocument): >+ (WebCore::Frame::interpretationsForCurrentRoot const): >+ * page/mac/ServicesOverlayController.mm: >+ (WebCore::ServicesOverlayController::Highlight::fadeIn): >+ (WebCore::ServicesOverlayController::Highlight::fadeOut): >+ * platform/SharedBuffer.cpp: >+ (WebCore::SharedBuffer::tryCreateArrayBuffer const): >+ * platform/audio/HRTFElevation.cpp: >+ (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation): >+ * platform/audio/SincResampler.cpp: >+ (WebCore::SincResampler::consumeSource): >+ * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: >+ (WebCore::AudioFileReader::createBus): >+ * platform/audio/mac/AudioFileReaderMac.cpp: >+ (WebCore::AudioFileReader::createBus): >+ * platform/graphics/Icon.h: >+ (WebCore::Icon::create): >+ * platform/graphics/InbandTextTrackPrivate.h: >+ (WebCore::InbandTextTrackPrivate::create): >+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: >+ (WebCore::AVFWrapper::shouldWaitForLoadingOfResource): >+ * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: >+ (WebCore::fulfillRequestWithKeyData): >+ (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): >+ * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: >+ * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: >+ (WebCore::MediaSourcePrivateAVFObjC::create): >+ (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): >+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: >+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: >+ (WebCore::SourceBufferPrivateAVFObjC::create): >+ (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): >+ * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: >+ * platform/graphics/ca/TileController.cpp: >+ (WebCore::TileController::createTileLayer): >+ * platform/graphics/ca/TileController.h: >+ * platform/graphics/ca/win/CACFLayerTreeHost.cpp: >+ (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable): >+ (WebCore::CACFLayerTreeHost::create): >+ * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: >+ (WebCore::GPUBuffer::create): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::MediaPlayerPrivateGStreamer::updateTracks): >+ (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): >+ (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): >+ (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): >+ (WebCore::MediaPlayerPrivateGStreamer::handleMessage): >+ (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): >+ (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerBase::paint): >+ * platform/graphics/gstreamer/mse/AppendPipeline.cpp: >+ (WebCore::AppendPipeline::appsinkNewSample): >+ * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp: >+ (WebCore::ISOProtectionSystemSpecificHeaderBox::parse): >+ * platform/graphics/iso/ISOTrackEncryptionBox.cpp: >+ (WebCore::ISOTrackEncryptionBox::parse): >+ * platform/graphics/texmap/TextureMapperAnimation.cpp: >+ (WebCore::applyFilterAnimation): >+ * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: >+ (WebCore::TextureMapperPlatformLayerBuffer::clone): >+ * platform/graphics/transforms/TransformOperations.cpp: >+ (WebCore::TransformOperations::blendByMatchingOperations const): >+ * platform/image-decoders/ico/ICOImageDecoder.cpp: >+ (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex): >+ * platform/mock/mediasource/MockBox.cpp: >+ (WebCore::MockInitializationBox::MockInitializationBox): >+ * platform/mock/mediasource/MockSourceBufferPrivate.cpp: >+ (WebCore::MockSourceBufferPrivate::create): >+ (WebCore::MockSourceBufferPrivate::append): >+ * platform/mock/mediasource/MockSourceBufferPrivate.h: >+ * platform/mock/mediasource/MockTracks.h: >+ (WebCore::MockTextTrackPrivate::create): >+ (WebCore::MockVideoTrackPrivate::create): >+ * platform/network/FormData.h: >+ (WebCore::FormData::decode): >+ * platform/network/cocoa/CookieStorageObserver.h: >+ * platform/network/cocoa/CookieStorageObserver.mm: >+ (WebCore::CookieStorageObserver::create): >+ * platform/network/soup/ResourceRequestSoup.cpp: >+ (WebCore::appendEncodedBlobItemToSoupMessageBody): >+ (WebCore::ResourceRequest::updateSoupMessageBody const): >+ * platform/text/hyphen/HyphenationLibHyphen.cpp: >+ (WebCore::HyphenationDictionary::createNull): >+ (WebCore::HyphenationDictionary::create): >+ * platform/win/SearchPopupMenuWin.cpp: >+ (WebCore::SearchPopupMenuWin::SearchPopupMenuWin): >+ (WebCore::SearchPopupMenuWin::popupMenu): >+ * platform/win/SearchPopupMenuWin.h: >+ * rendering/RenderThemeIOS.mm: >+ (WebCore::applyCommonButtonPaddingToStyle): >+ (WebCore::RenderThemeIOS::paintProgressBar): >+ (WebCore::RenderThemeIOS::adjustButtonStyle const): >+ (WebCore::paintAttachmentIcon): >+ * rendering/svg/SVGRenderTreeAsText.cpp: >+ (WebCore::writeSVGResourceContainer): >+ * storage/Storage.cpp: >+ (WebCore::Storage::create): >+ (WebCore::Storage::Storage): >+ * storage/Storage.h: >+ (WebCore::Storage::area const): >+ * storage/StorageNamespace.h: >+ * storage/StorageNamespaceProvider.cpp: >+ (WebCore::StorageNamespaceProvider::localStorageArea): >+ * storage/StorageNamespaceProvider.h: >+ * svg/SVGElement.cpp: >+ (WebCore::SVGElement::getPresentationAttribute): >+ * svg/SVGFEBlendElement.cpp: >+ (WebCore::SVGFEBlendElement::build): >+ * svg/SVGFEColorMatrixElement.cpp: >+ (WebCore::SVGFEColorMatrixElement::build): >+ * svg/SVGFEComponentTransferElement.cpp: >+ (WebCore::SVGFEComponentTransferElement::build): >+ * svg/SVGFECompositeElement.cpp: >+ (WebCore::SVGFECompositeElement::build): >+ * svg/SVGFEDiffuseLightingElement.cpp: >+ (WebCore::SVGFEDiffuseLightingElement::build): >+ * svg/SVGFEDisplacementMapElement.cpp: >+ (WebCore::SVGFEDisplacementMapElement::build): >+ * svg/SVGFEDropShadowElement.cpp: >+ (WebCore::SVGFEDropShadowElement::build): >+ * svg/SVGFEGaussianBlurElement.cpp: >+ (WebCore::SVGFEGaussianBlurElement::build): >+ * svg/SVGFEMergeElement.cpp: >+ (WebCore::SVGFEMergeElement::build): >+ * svg/SVGFEMorphologyElement.cpp: >+ (WebCore::SVGFEMorphologyElement::build): >+ * svg/SVGFEOffsetElement.cpp: >+ (WebCore::SVGFEOffsetElement::build): >+ * svg/SVGFESpecularLightingElement.cpp: >+ (WebCore::SVGFESpecularLightingElement::build): >+ * svg/SVGFETileElement.cpp: >+ (WebCore::SVGFETileElement::build): >+ * testing/GCObservation.h: >+ * xml/XSLTProcessor.cpp: >+ (WebCore::XSLTProcessor::createDocumentFromSource): >+ * xml/parser/XMLDocumentParser.cpp: >+ (WebCore::XMLDocumentParser::parseDocumentFragment): >+ > 2018-12-17 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index a196ae855ac757771a13f2e8ddc94d0a03e465c9..77684e8bcadb484e27ac9984ad4b776561b9b2c0 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,136 @@ >+2018-12-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use Ref<> as much as possible >+ https://bugs.webkit.org/show_bug.cgi?id=192808 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * PluginProcess/WebProcessConnection.cpp: >+ (WebKit::WebProcessConnection::create): >+ * PluginProcess/WebProcessConnection.h: >+ * UIProcess/API/Cocoa/WKConnection.mm: >+ (-[WKConnection sendMessageWithName:body:]): >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]): >+ (-[WKWebView _takeViewSnapshot]): >+ (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): >+ * UIProcess/API/glib/WebKitGeolocationProvider.cpp: >+ (WebKit::WebKitGeolocationProvider::notifyPositionChanged): >+ * UIProcess/API/glib/WebKitWebContext.cpp: >+ (webkit_web_context_allow_tls_certificate_for_host): >+ * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: >+ (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): >+ * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm: >+ (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): >+ * UIProcess/BackingStore.cpp: >+ (WebKit::BackingStore::incorporateUpdate): >+ * UIProcess/Cocoa/NavigationState.mm: >+ (WebKit::createErrorWithRecoveryAttempter): >+ * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: >+ * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: >+ (WebKit::PlaybackSessionManagerProxy::create): >+ * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: >+ * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: >+ (WebKit::VideoFullscreenManagerProxy::create): >+ * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: >+ (WebKit::WebPasteboardProxy::setPasteboardBufferForType): >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (WebKit::WebViewImpl::takeViewSnapshot): >+ * UIProcess/Downloads/DownloadProxyMap.cpp: >+ (WebKit::DownloadProxyMap::createDownloadProxy): >+ * UIProcess/Notifications/WebNotificationManagerProxy.cpp: >+ (WebKit::WebNotificationManagerProxy::show): >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::didCreateSubframe): >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::getStatistics): >+ (WebKit::WebProcessPool::requestWebContentStatistics): >+ (WebKit::WebProcessPool::requestNetworkingStatistics): >+ * UIProcess/WebProcessPool.h: >+ * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: >+ (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): >+ * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: >+ (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): >+ * UIProcess/gtk/WebInspectorProxyGtk.cpp: >+ (WebKit::WebInspectorProxy::platformCreateFrontendPage): >+ * UIProcess/ios/WKGeolocationProviderIOS.mm: >+ (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): >+ * UIProcess/mac/PageClientImplMac.mm: >+ (WebKit::PageClientImpl::setPromisedDataForImage): >+ * UIProcess/win/WebInspectorProxyWin.cpp: >+ (WebKit::WebInspectorProxy::platformCreateFrontendPage): >+ * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm: >+ (-[WKDOMRange initWithDocument:]): >+ * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: >+ (WebKit::InjectedBundleRangeHandle::renderedImage): >+ * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: >+ (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): >+ * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: >+ (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement): >+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: >+ (WebKit::NetscapePlugin::snapshot): >+ * WebProcess/Plugins/PDF/PDFPlugin.mm: >+ (WebKit::PDFPlugin::addArchiveResource): >+ (WebKit::PDFPlugin::snapshot): >+ (WebKit::PDFPlugin::writeItemsToPasteboard): >+ * WebProcess/Plugins/PluginProcessConnectionManager.cpp: >+ (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): >+ * WebProcess/Plugins/PluginProxy.cpp: >+ (WebKit::PluginProxy::snapshot): >+ * WebProcess/Plugins/PluginView.cpp: >+ (WebKit::PluginView::performURLRequest): >+ * WebProcess/WebCoreSupport/WebChromeClient.cpp: >+ (WebKit::WebChromeClient::exceededDatabaseQuota): >+ (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): >+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: >+ (WebKit::WebPlatformStrategies::getPathnamesForType): >+ * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: >+ (WebKit::convertCairoSurfaceToShareableBitmap): >+ * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: >+ (WebKit::WebDragClient::declareAndWriteDragImage): >+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: >+ (WebKit::WebPage::dictionaryPopupInfoForRange): >+ * WebProcess/WebPage/DrawingAreaImpl.cpp: >+ (WebKit::DrawingAreaImpl::display): >+ * WebProcess/WebPage/FindController.cpp: >+ (WebKit::FindController::updateFindIndicator): >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: >+ (WebKit::RemoteLayerTreeDrawingArea::flushLayers): >+ * WebProcess/WebPage/WebFrame.cpp: >+ (WebKit::WebFrame::webArchiveData): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): >+ (WebKit::WebPage::performDragControllerAction): >+ * WebProcess/WebPage/ios/FindControllerIOS.mm: >+ (WebKit::FindController::updateFindIndicator): >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::replaceDictatedText): >+ (WebKit::WebPage::getPositionInformation): >+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: >+ (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): >+ * WebProcess/WebStorage/StorageNamespaceImpl.cpp: >+ (WebKit::StorageNamespaceImpl::createSessionStorageNamespace): >+ (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace): >+ (WebKit::StorageNamespaceImpl::createLocalStorageNamespace): >+ (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace): >+ (WebKit::StorageNamespaceImpl::storageArea): >+ (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): >+ (WebKit::StorageNamespaceImpl::copy): >+ * WebProcess/WebStorage/StorageNamespaceImpl.h: >+ * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp: >+ (WebKit::WebStorageNamespaceProvider::getOrCreate): >+ (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace): >+ (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): >+ (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace): >+ (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace): >+ * WebProcess/WebStorage/WebStorageNamespaceProvider.h: >+ * WebProcess/cocoa/PlaybackSessionManager.mm: >+ (WebKit::PlaybackSessionManager::createModelAndInterface): >+ * WebProcess/cocoa/VideoFullscreenManager.mm: >+ (WebKit::VideoFullscreenManager::createModelAndInterface): >+ > 2018-12-17 Jiewen Tan <jiewen_tan@apple.com> > > [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky >diff --git a/Source/WebKitLegacy/ChangeLog b/Source/WebKitLegacy/ChangeLog >index ad6fa805e6c71725d124c9775f18ca4b876b39c9..312dc0324c511a2a6503ba613b4089c6eb89b518 100644 >--- a/Source/WebKitLegacy/ChangeLog >+++ b/Source/WebKitLegacy/ChangeLog >@@ -1,3 +1,25 @@ >+2018-12-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use Ref<> as much as possible >+ https://bugs.webkit.org/show_bug.cgi?id=192808 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Storage/StorageNamespaceImpl.cpp: >+ (WebKit::StorageNamespaceImpl::copy): >+ (WebKit::StorageNamespaceImpl::storageArea): >+ * Storage/StorageNamespaceImpl.h: >+ * Storage/WebStorageNamespaceProvider.cpp: >+ (WebKit::WebStorageNamespaceProvider::create): >+ (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace): >+ (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): >+ (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace): >+ (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace): >+ * Storage/WebStorageNamespaceProvider.h: >+ * WebCoreSupport/WebViewGroup.cpp: >+ (WebViewGroup::getOrCreate): >+ * WebCoreSupport/WebViewGroup.h: >+ > 2018-12-11 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win][WebKitLegacy][Clang] WebKit.h warning: 'IWebEditingDelegate2::shouldInsertNode' hides overloaded virtual function [-Woverloaded-virtual] >diff --git a/Source/WebKitLegacy/ios/ChangeLog b/Source/WebKitLegacy/ios/ChangeLog >index e844f90513c336c24e639fef698bd8381b644ac2..d2c61c8e533a2f1abd75e4e5a45ba17fbab98cb7 100644 >--- a/Source/WebKitLegacy/ios/ChangeLog >+++ b/Source/WebKitLegacy/ios/ChangeLog >@@ -1,3 +1,20 @@ >+2018-12-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use Ref<> as much as possible >+ https://bugs.webkit.org/show_bug.cgi?id=192808 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/SearchPopupMenuIOS.cpp: >+ (SearchPopupMenuIOS::SearchPopupMenuIOS): >+ (SearchPopupMenuIOS::popupMenu): >+ * WebCoreSupport/SearchPopupMenuIOS.h: >+ * WebCoreSupport/WebVisiblePosition.mm: >+ (-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]): >+ (-[WebVisiblePosition enclosingRangeWithCorrectionIndicator]): >+ * WebView/WebPDFViewPlaceholder.mm: >+ (-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]): >+ > 2018-12-17 Zalan Bujtas <zalan@apple.com> > > Unreviewed build fix. >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index e24389c31e7c7067ffe45bc6410bb4a5fe419ada..8987a62c19d1dd2bc0076b8c9c5444dc0c0648a2 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,32 @@ >+2018-12-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use Ref<> as much as possible >+ https://bugs.webkit.org/show_bug.cgi?id=192808 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * DOM/DOM.mm: >+ (-[DOMNode getPreviewSnapshotImage:andRects:]): >+ * Plugins/Hosted/NetscapePluginHostManager.mm: >+ (WebKit::NetscapePluginHostManager::instantiatePlugin): >+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm: >+ (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript): >+ (WebKit::NetscapePluginInstanceProxy::loadRequest): >+ * Plugins/WebNetscapePluginView.mm: >+ (-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]): >+ (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): >+ * WebCoreSupport/WebContextMenuClient.mm: >+ (WebContextMenuClient::imageForCurrentSharingServicePickerItem): >+ * WebCoreSupport/WebFrameLoaderClient.mm: >+ (WebFrameLoaderClient::transitionToCommittedForNewPage): >+ * WebView/WebFrame.mm: >+ (-[WebFrame getDictationResultRanges:andMetadatas:]): >+ * WebView/WebHTMLView.mm: >+ (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]): >+ * WebView/WebView.mm: >+ (+[WebView _addUserScriptToGroup:world:source:url:whitelist:blacklist:injectionTime:injectedFrames:]): >+ (+[WebView _addUserStyleSheetToGroup:world:source:url:whitelist:blacklist:injectedFrames:]): >+ > 2018-12-17 Ryosuke Niwa <rniwa@webkit.org> > > offsetLeft and offsetParent should adjust across shadow boundaries >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 40ac05381fb7d06946dbb44a0e1e461918b2c03f..bb91c552e81f191ba8d5042412dbeb5d2909da8e 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,39 @@ >+2018-12-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use Ref<> as much as possible >+ https://bugs.webkit.org/show_bug.cgi?id=192808 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Plugins/PluginDatabase.cpp: >+ (WebCore::PluginDatabase::refresh): >+ * Plugins/PluginView.cpp: >+ (WebCore::PluginView::mediaCanStart): >+ (WebCore::PluginView::performRequest): >+ (WebCore::PluginView::bindingInstance): >+ * Plugins/PluginView.h: >+ * WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebFrameLoaderClient::dispatchDidFailToStartPlugin const): >+ (WebFrameLoaderClient::createPlugin): >+ (WebFrameLoaderClient::createJavaAppletWidget): >+ * WebCoreSupport/WebFrameLoaderClient.h: >+ * WebFrame.cpp: >+ (WebFrame::loadData): >+ (WebFrame::loadPlainTextString): >+ (WebFrame::loadHTMLString): >+ * WebFrame.h: >+ * WebKitQuartzCoreAdditions/CAView.cpp: >+ (WKQCA::CAView::create): >+ * WebKitQuartzCoreAdditions/CAView.h: >+ * WebKitQuartzCoreAdditions/CVDisplayLink.cpp: >+ (WKQCA::CVDisplayLink::create): >+ * WebKitQuartzCoreAdditions/CVDisplayLink.h: >+ * WebKitQuartzCoreAdditions/ImageConversion.cpp: >+ (WKQCA::getImageCopy): >+ * WebView.cpp: >+ (WebView::addUserScriptToGroup): >+ (WebView::addUserStyleSheetToGroup): >+ > 2018-12-12 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win][Clang][WebKitLegacy] warning: expected a qualified name after 'typename' of COMEnumVariant and COMPropertyBag >diff --git a/Source/JavaScriptCore/API/JSTypedArray.cpp b/Source/JavaScriptCore/API/JSTypedArray.cpp >index 4adc769e6e6a69018490042a332110cecad8f3a8..4a95fcd95b39077e1c6102a47eba457a0b673a6d 100644 >--- a/Source/JavaScriptCore/API/JSTypedArray.cpp >+++ b/Source/JavaScriptCore/API/JSTypedArray.cpp >@@ -185,7 +185,7 @@ JSObjectRef JSObjectMakeTypedArrayWithBytesNoCopy(JSContextRef ctx, JSTypedArray > > unsigned elementByteSize = elementSize(toTypedArrayType(arrayType)); > >- RefPtr<ArrayBuffer> buffer = ArrayBuffer::createFromBytes(bytes, length, [=](void* p) { >+ Ref<ArrayBuffer> buffer = ArrayBuffer::createFromBytes(bytes, length, [=](void* p) { > if (destructor) > destructor(p, destructorContext); > }); >diff --git a/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.cpp b/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.cpp >index 173d03e5f99cfafb31b715f6a0a8be4cbab7188f..0d7942aaf79ad2a67f96d72442d9b5128e48f433 100644 >--- a/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.cpp >+++ b/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.cpp >@@ -41,7 +41,7 @@ void ArrayBufferViewWatchpointAdaptor::add( > Watchpoint* watchpoint = common.watchpoints.add(codeBlock); > ArrayBufferNeuteringWatchpoint* neuteringWatchpoint = > ArrayBufferNeuteringWatchpoint::create(vm); >- neuteringWatchpoint->set()->add(watchpoint); >+ neuteringWatchpoint->set().add(watchpoint); > codeBlock->addConstant(neuteringWatchpoint); > // FIXME: We don't need to set this watchpoint at all for shared buffers. > // https://bugs.webkit.org/show_bug.cgi?id=164108 >diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp >index 6b0f319388648cd295b6f11c573ab73844219787..0b34f46ce2618d72a46a9eb8bd72fd2a65db3f5d 100644 >--- a/Source/JavaScriptCore/heap/Heap.cpp >+++ b/Source/JavaScriptCore/heap/Heap.cpp >@@ -306,8 +306,8 @@ Heap::Heap(VM* vm, HeapType heapType) > , m_lastEdenGCLength(0.01) > , m_fullActivityCallback(GCActivityCallback::tryCreateFullTimer(this)) > , m_edenActivityCallback(GCActivityCallback::tryCreateEdenTimer(this)) >- , m_sweeper(adoptRef(new IncrementalSweeper(this))) >- , m_stopIfNecessaryTimer(adoptRef(new StopIfNecessaryTimer(vm))) >+ , m_sweeper(adoptRef(*new IncrementalSweeper(this))) >+ , m_stopIfNecessaryTimer(adoptRef(*new StopIfNecessaryTimer(vm))) > , m_deferralDepth(0) > #if USE(FOUNDATION) > , m_delayedReleaseRecursionCount(0) >@@ -2339,7 +2339,7 @@ GCActivityCallback* Heap::edenActivityCallback() > > IncrementalSweeper& Heap::sweeper() > { >- return *m_sweeper; >+ return m_sweeper.get(); > } > > void Heap::setGarbageCollectionTimerEnabled(bool enable) >diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h >index c8aed4a36a588201f1527e5eaafa1453295c0019..9da4aa3abd1c2e72ea89597c3bef9d88dd5dc688 100644 >--- a/Source/JavaScriptCore/heap/Heap.h >+++ b/Source/JavaScriptCore/heap/Heap.h >@@ -629,8 +629,8 @@ class Heap { > > RefPtr<FullGCActivityCallback> m_fullActivityCallback; > RefPtr<GCActivityCallback> m_edenActivityCallback; >- RefPtr<IncrementalSweeper> m_sweeper; >- RefPtr<StopIfNecessaryTimer> m_stopIfNecessaryTimer; >+ Ref<IncrementalSweeper> m_sweeper; >+ Ref<StopIfNecessaryTimer> m_stopIfNecessaryTimer; > > Vector<HeapObserver*> m_observers; > >diff --git a/Source/JavaScriptCore/heap/IsoCellSet.cpp b/Source/JavaScriptCore/heap/IsoCellSet.cpp >index 620dd1598067e8c04c7ec5d663a26b0a8612cc4e..b8e430191e6b1dc29aa5c0f10cdd6e9bb198fda9 100644 >--- a/Source/JavaScriptCore/heap/IsoCellSet.cpp >+++ b/Source/JavaScriptCore/heap/IsoCellSet.cpp >@@ -46,7 +46,7 @@ IsoCellSet::~IsoCellSet() > BasicRawSentinelNode<IsoCellSet>::remove(); > } > >-RefPtr<SharedTask<MarkedBlock::Handle*()>> IsoCellSet::parallelNotEmptyMarkedBlockSource() >+Ref<SharedTask<MarkedBlock::Handle*()>> IsoCellSet::parallelNotEmptyMarkedBlockSource() > { > class Task : public SharedTask<MarkedBlock::Handle*()> { > public: >@@ -78,7 +78,7 @@ RefPtr<SharedTask<MarkedBlock::Handle*()>> IsoCellSet::parallelNotEmptyMarkedBlo > bool m_done { false }; > }; > >- return adoptRef(new Task(*this)); >+ return adoptRef(*new Task(*this)); > } > > NEVER_INLINE Bitmap<MarkedBlock::atomsPerBlock>* IsoCellSet::addSlow(size_t blockIndex) >diff --git a/Source/JavaScriptCore/heap/IsoCellSet.h b/Source/JavaScriptCore/heap/IsoCellSet.h >index 16c9cbb2b7c3297427d87462bd824a13686c0ce7..dada672c491dc0381f58fa1a672b6c6c0b7e2e58 100644 >--- a/Source/JavaScriptCore/heap/IsoCellSet.h >+++ b/Source/JavaScriptCore/heap/IsoCellSet.h >@@ -51,7 +51,7 @@ class IsoCellSet : public BasicRawSentinelNode<IsoCellSet> { > > bool contains(HeapCell* cell) const; > >- JS_EXPORT_PRIVATE RefPtr<SharedTask<MarkedBlock::Handle*()>> parallelNotEmptyMarkedBlockSource(); >+ JS_EXPORT_PRIVATE Ref<SharedTask<MarkedBlock::Handle*()>> parallelNotEmptyMarkedBlockSource(); > > // This will have to do a combined search over whatever Subspace::forEachMarkedCell uses and > // our m_blocksWithBits. >@@ -59,7 +59,7 @@ class IsoCellSet : public BasicRawSentinelNode<IsoCellSet> { > void forEachMarkedCell(const Func&); > > template<typename Func> >- RefPtr<SharedTask<void(SlotVisitor&)>> forEachMarkedCellInParallel(const Func&); >+ Ref<SharedTask<void(SlotVisitor&)>> forEachMarkedCellInParallel(const Func&); > > template<typename Func> > void forEachLiveCell(const Func&); >diff --git a/Source/JavaScriptCore/heap/IsoCellSetInlines.h b/Source/JavaScriptCore/heap/IsoCellSetInlines.h >index ac412a7781ad53686914e4c3fb02631f022d9cfb..ce7de8e190ea8e53f93364c7cf1fce5ed34a6f74 100644 >--- a/Source/JavaScriptCore/heap/IsoCellSetInlines.h >+++ b/Source/JavaScriptCore/heap/IsoCellSetInlines.h >@@ -79,7 +79,7 @@ void IsoCellSet::forEachMarkedCell(const Func& func) > } > > template<typename Func> >-RefPtr<SharedTask<void(SlotVisitor&)>> IsoCellSet::forEachMarkedCellInParallel(const Func& func) >+Ref<SharedTask<void(SlotVisitor&)>> IsoCellSet::forEachMarkedCellInParallel(const Func& func) > { > class Task : public SharedTask<void(SlotVisitor&)> { > public: >@@ -106,12 +106,12 @@ RefPtr<SharedTask<void(SlotVisitor&)>> IsoCellSet::forEachMarkedCellInParallel(c > > private: > IsoCellSet& m_set; >- RefPtr<SharedTask<MarkedBlock::Handle*()>> m_blockSource; >+ Ref<SharedTask<MarkedBlock::Handle*()>> m_blockSource; > Func m_func; > Lock m_lock; > }; > >- return adoptRef(new Task(*this, func)); >+ return adoptRef(*new Task(*this, func)); > } > > template<typename Func> >diff --git a/Source/JavaScriptCore/heap/Subspace.cpp b/Source/JavaScriptCore/heap/Subspace.cpp >index d377f9aeafb8d35e7036d0d9287213310afb8b31..e14a3749227f746760aa8a409404af2d440eb17a 100644 >--- a/Source/JavaScriptCore/heap/Subspace.cpp >+++ b/Source/JavaScriptCore/heap/Subspace.cpp >@@ -89,7 +89,7 @@ MarkedBlock::Handle* Subspace::findEmptyBlockToSteal() > return nullptr; > } > >-RefPtr<SharedTask<BlockDirectory*()>> Subspace::parallelDirectorySource() >+Ref<SharedTask<BlockDirectory*()>> Subspace::parallelDirectorySource() > { > class Task : public SharedTask<BlockDirectory*()> { > public: >@@ -112,10 +112,10 @@ RefPtr<SharedTask<BlockDirectory*()>> Subspace::parallelDirectorySource() > Lock m_lock; > }; > >- return adoptRef(new Task(m_firstDirectory)); >+ return adoptRef(*new Task(m_firstDirectory)); > } > >-RefPtr<SharedTask<MarkedBlock::Handle*()>> Subspace::parallelNotEmptyMarkedBlockSource() >+Ref<SharedTask<MarkedBlock::Handle*()>> Subspace::parallelNotEmptyMarkedBlockSource() > { > return createParallelSourceAdapter<BlockDirectory*, MarkedBlock::Handle*>( > parallelDirectorySource(), >diff --git a/Source/JavaScriptCore/heap/Subspace.h b/Source/JavaScriptCore/heap/Subspace.h >index ba3a14c63ec7285dd4d4fe2f3eeb7b8ad9a5f4b1..83ef4d749fbc8678675c9234804773db18cac9a6 100644 >--- a/Source/JavaScriptCore/heap/Subspace.h >+++ b/Source/JavaScriptCore/heap/Subspace.h >@@ -70,7 +70,7 @@ class Subspace { > template<typename Func> > void forEachDirectory(const Func&); > >- RefPtr<SharedTask<BlockDirectory*()>> parallelDirectorySource(); >+ Ref<SharedTask<BlockDirectory*()>> parallelDirectorySource(); > > template<typename Func> > void forEachMarkedBlock(const Func&); >@@ -78,7 +78,7 @@ class Subspace { > template<typename Func> > void forEachNotEmptyMarkedBlock(const Func&); > >- JS_EXPORT_PRIVATE RefPtr<SharedTask<MarkedBlock::Handle*()>> parallelNotEmptyMarkedBlockSource(); >+ JS_EXPORT_PRIVATE Ref<SharedTask<MarkedBlock::Handle*()>> parallelNotEmptyMarkedBlockSource(); > > template<typename Func> > void forEachLargeAllocation(const Func&); >@@ -87,7 +87,7 @@ class Subspace { > void forEachMarkedCell(const Func&); > > template<typename Func> >- RefPtr<SharedTask<void(SlotVisitor&)>> forEachMarkedCellInParallel(const Func&); >+ Ref<SharedTask<void(SlotVisitor&)>> forEachMarkedCellInParallel(const Func&); > > template<typename Func> > void forEachLiveCell(const Func&); >diff --git a/Source/JavaScriptCore/heap/SubspaceInlines.h b/Source/JavaScriptCore/heap/SubspaceInlines.h >index e83b382df806ef24fe0da80c50e28609740a6263..167127ff43843eb614e0b1a6cf7693a50a7bacb8 100644 >--- a/Source/JavaScriptCore/heap/SubspaceInlines.h >+++ b/Source/JavaScriptCore/heap/SubspaceInlines.h >@@ -84,7 +84,7 @@ void Subspace::forEachMarkedCell(const Func& func) > } > > template<typename Func> >-RefPtr<SharedTask<void(SlotVisitor&)>> Subspace::forEachMarkedCellInParallel(const Func& func) >+Ref<SharedTask<void(SlotVisitor&)>> Subspace::forEachMarkedCellInParallel(const Func& func) > { > class Task : public SharedTask<void(SlotVisitor&)> { > public: >@@ -121,13 +121,13 @@ RefPtr<SharedTask<void(SlotVisitor&)>> Subspace::forEachMarkedCellInParallel(con > > private: > Subspace& m_subspace; >- RefPtr<SharedTask<MarkedBlock::Handle*()>> m_blockSource; >+ Ref<SharedTask<MarkedBlock::Handle*()>> m_blockSource; > Func m_func; > Lock m_lock; > bool m_needToVisitLargeAllocations { true }; > }; > >- return adoptRef(new Task(*this, func)); >+ return adoptRef(*new Task(*this, func)); > } > > template<typename Func> >diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp >index f644071d3f97c6dd6a6a64014d15f1e42da7408c..0b9961b8ac39f3ed02df28fe846e2d2c898d5db9 100644 >--- a/Source/JavaScriptCore/jsc.cpp >+++ b/Source/JavaScriptCore/jsc.cpp >@@ -1777,7 +1777,7 @@ EncodedJSValue JSC_HOST_CALL functionDollarAgentReceiveBroadcast(ExecState* exec > message = Worker::current().dequeue(); > } > >- RefPtr<ArrayBuffer> nativeBuffer = ArrayBuffer::create(message->releaseContents()); >+ Ref<ArrayBuffer> nativeBuffer = ArrayBuffer::create(message->releaseContents()); > ArrayBufferSharingMode sharingMode = nativeBuffer->sharingMode(); > JSArrayBuffer* jsBuffer = JSArrayBuffer::create(vm, exec->lexicalGlobalObject()->arrayBufferStructure(sharingMode), WTFMove(nativeBuffer)); > >diff --git a/Source/JavaScriptCore/runtime/ArrayBuffer.cpp b/Source/JavaScriptCore/runtime/ArrayBuffer.cpp >index 4e5ef1541b4b462dec0462ec916208d5e199971f..895b29b6c9e15235d345d9428a35393a3c8a8772 100644 >--- a/Source/JavaScriptCore/runtime/ArrayBuffer.cpp >+++ b/Source/JavaScriptCore/runtime/ArrayBuffer.cpp >@@ -289,20 +289,20 @@ unsigned ArrayBuffer::clampIndex(double index) const > return clampValue(index, 0, currentLength); > } > >-RefPtr<ArrayBuffer> ArrayBuffer::slice(double begin, double end) const >+Ref<ArrayBuffer> ArrayBuffer::slice(double begin, double end) const > { > return sliceImpl(clampIndex(begin), clampIndex(end)); > } > >-RefPtr<ArrayBuffer> ArrayBuffer::slice(double begin) const >+Ref<ArrayBuffer> ArrayBuffer::slice(double begin) const > { > return sliceImpl(clampIndex(begin), byteLength()); > } > >-RefPtr<ArrayBuffer> ArrayBuffer::sliceImpl(unsigned begin, unsigned end) const >+Ref<ArrayBuffer> ArrayBuffer::sliceImpl(unsigned begin, unsigned end) const > { > unsigned size = begin <= end ? end - begin : 0; >- RefPtr<ArrayBuffer> result = ArrayBuffer::create(static_cast<const char*>(data()) + begin, size); >+ Ref<ArrayBuffer> result = ArrayBuffer::create(static_cast<const char*>(data()) + begin, size); > result->setSharingMode(sharingMode()); > return result; > } >diff --git a/Source/JavaScriptCore/runtime/ArrayBuffer.h b/Source/JavaScriptCore/runtime/ArrayBuffer.h >index f699c945ae404e2e0bbd7cfbc5e949d283ea8bdd..30fba6a6a0846a172b39f167ca2e44c001bf25f2 100644 >--- a/Source/JavaScriptCore/runtime/ArrayBuffer.h >+++ b/Source/JavaScriptCore/runtime/ArrayBuffer.h >@@ -128,8 +128,8 @@ class ArrayBuffer : public GCIncomingRefCounted<ArrayBuffer> { > > inline size_t gcSizeEstimateInBytes() const; > >- JS_EXPORT_PRIVATE RefPtr<ArrayBuffer> slice(double begin, double end) const; >- JS_EXPORT_PRIVATE RefPtr<ArrayBuffer> slice(double begin) const; >+ JS_EXPORT_PRIVATE Ref<ArrayBuffer> slice(double begin, double end) const; >+ JS_EXPORT_PRIVATE Ref<ArrayBuffer> slice(double begin) const; > > inline void pin(); > inline void unpin(); >@@ -154,7 +154,7 @@ class ArrayBuffer : public GCIncomingRefCounted<ArrayBuffer> { > static Ref<ArrayBuffer> createInternal(ArrayBufferContents&&, const void*, unsigned); > static RefPtr<ArrayBuffer> tryCreate(unsigned numElements, unsigned elementByteSize, ArrayBufferContents::InitializationPolicy); > ArrayBuffer(ArrayBufferContents&&); >- RefPtr<ArrayBuffer> sliceImpl(unsigned begin, unsigned end) const; >+ Ref<ArrayBuffer> sliceImpl(unsigned begin, unsigned end) const; > inline unsigned clampIndex(double index) const; > static inline unsigned clampValue(double x, unsigned left, unsigned right); > >diff --git a/Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp b/Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp >index d1a6c2b96ca5a8ff7f7a314e602a1aca8254c128..64fff4a87b05c398c8811e8db6c5d3d66a100862 100644 >--- a/Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp >+++ b/Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp >@@ -37,7 +37,7 @@ const ClassInfo ArrayBufferNeuteringWatchpoint::s_info = { > > ArrayBufferNeuteringWatchpoint::ArrayBufferNeuteringWatchpoint(VM& vm) > : Base(vm, vm.arrayBufferNeuteringWatchpointStructure.get()) >- , m_set(adoptRef(new WatchpointSet(IsWatched))) >+ , m_set(adoptRef(*new WatchpointSet(IsWatched))) > { > } > >@@ -62,7 +62,7 @@ Structure* ArrayBufferNeuteringWatchpoint::createStructure(VM& vm) > > void ArrayBufferNeuteringWatchpoint::fireAll() > { >- set()->fireAll(*vm(), "Array buffer was neutered"); >+ m_set->fireAll(*vm(), "Array buffer was neutered"); > } > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.h b/Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.h >index 9a6f71a968cc1946a0d793611e052bd6ebbe01a7..e5d6d0974a58ebb0b3a3e8815544a5a58fc4232d 100644 >--- a/Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.h >+++ b/Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.h >@@ -44,14 +44,14 @@ class ArrayBufferNeuteringWatchpoint final : public JSCell { > > static Structure* createStructure(VM&); > >- WatchpointSet* set() { return m_set.get(); } >+ WatchpointSet& set() { return m_set.get(); } > > void fireAll(); > > private: > explicit ArrayBufferNeuteringWatchpoint(VM&); > >- RefPtr<WatchpointSet> m_set; >+ Ref<WatchpointSet> m_set; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp b/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp >index 6c0b97105b7e7719697b5421a2636f1a4af2e07e..7918b62b0722acbef7aa729c40b476931c0de86b 100644 >--- a/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp >+++ b/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp >@@ -56,9 +56,7 @@ static EncodedJSValue JSC_HOST_CALL arrayBufferProtoFuncSlice(ExecState* exec) > } else > end = thisObject->impl()->byteLength(); > >- RefPtr<ArrayBuffer> newBuffer = thisObject->impl()->slice(begin, end); >- if (!newBuffer) >- return JSValue::encode(throwOutOfMemoryError(exec, scope)); >+ Ref<ArrayBuffer> newBuffer = thisObject->impl()->slice(begin, end); > > Structure* structure = callee->globalObject(vm)->arrayBufferStructure(newBuffer->sharingMode()); > >diff --git a/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp b/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp >index af8ff5a0a80ce8baaad07a1d5bca6140cee030e1..238ee67c3828419b33f149e2b43b6265e874d76d 100644 >--- a/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp >@@ -68,7 +68,7 @@ void NavigatorEME::requestMediaKeySystemAccess(Navigator&, Document& document, c > } > > // 6.2. Let implementation be the implementation of keySystem. >- RefPtr<CDM> implementation = CDM::create(document, keySystem); >+ auto implementation = CDM::create(document, keySystem); > tryNextSupportedConfiguration(WTFMove(implementation), WTFMove(supportedConfigurations), WTFMove(promise)); > }); > } >diff --git a/Source/WebCore/Modules/fetch/FetchBody.cpp b/Source/WebCore/Modules/fetch/FetchBody.cpp >index 07a4cddd1d4b3cf4339f2b0c987a3e1d271af2f0..2ce3c8a0f87399419b9f08cb3fe4bcb2d7780d78 100644 >--- a/Source/WebCore/Modules/fetch/FetchBody.cpp >+++ b/Source/WebCore/Modules/fetch/FetchBody.cpp >@@ -234,14 +234,14 @@ void FetchBody::loadingSucceeded() > m_consumer.loadingSucceeded(); > } > >-RefPtr<FormData> FetchBody::bodyAsFormData(ScriptExecutionContext& context) const >+Ref<FormData> FetchBody::bodyAsFormData(ScriptExecutionContext& context) const > { > if (isText()) > return FormData::create(UTF8Encoding().encode(textBody(), UnencodableHandling::Entities)); > if (isURLSearchParams()) > return FormData::create(UTF8Encoding().encode(urlSearchParamsBody().toString(), UnencodableHandling::Entities)); > if (isBlob()) { >- RefPtr<FormData> body = FormData::create(); >+ auto body = FormData::create(); > body->appendBlob(blobBody().url()); > return body; > } >@@ -251,15 +251,13 @@ RefPtr<FormData> FetchBody::bodyAsFormData(ScriptExecutionContext& context) cons > return FormData::create(arrayBufferViewBody().baseAddress(), arrayBufferViewBody().byteLength()); > if (isFormData()) { > ASSERT(!context.isWorkerGlobalScope()); >- RefPtr<FormData> body = const_cast<FormData*>(&formDataBody()); >+ Ref<FormData> body = makeRef(const_cast<FormData&>(formDataBody())); > body->generateFiles(&downcast<Document>(context)); > return body; > } >- if (auto* data = m_consumer.data()) >- return FormData::create(data->data(), data->size()); >- >- ASSERT_NOT_REACHED(); >- return nullptr; >+ auto* data = m_consumer.data(); >+ ASSERT(data); >+ return FormData::create(data->data(), data->size()); > } > > FetchBody::TakenData FetchBody::take() >diff --git a/Source/WebCore/Modules/fetch/FetchBody.h b/Source/WebCore/Modules/fetch/FetchBody.h >index daad7c42c4779b1a40695d0f150d7f9f4b996c52..b7b22015cdc0263beb430f49b98359265f460e77 100644 >--- a/Source/WebCore/Modules/fetch/FetchBody.h >+++ b/Source/WebCore/Modules/fetch/FetchBody.h >@@ -63,7 +63,7 @@ class FetchBody { > void loadingFailed(); > void loadingSucceeded(); > >- RefPtr<FormData> bodyAsFormData(ScriptExecutionContext&) const; >+ Ref<FormData> bodyAsFormData(ScriptExecutionContext&) const; > > using TakenData = Variant<std::nullptr_t, Ref<FormData>, Ref<SharedBuffer>>; > TakenData take(); >diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp >index 9d250675fde7c2ec1fb631a91feea7cc438c5a9b..58a72b121ce1f9353967ab2a3d4bb7d779df8d35 100644 >--- a/Source/WebCore/Modules/geolocation/Geolocation.cpp >+++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp >@@ -304,10 +304,10 @@ void Geolocation::getCurrentPosition(Ref<PositionCallback>&& successCallback, Re > if (!frame()) > return; > >- RefPtr<GeoNotifier> notifier = GeoNotifier::create(*this, WTFMove(successCallback), WTFMove(errorCallback), WTFMove(options)); >- startRequest(notifier.get()); >+ auto notifier = GeoNotifier::create(*this, WTFMove(successCallback), WTFMove(errorCallback), WTFMove(options)); >+ startRequest(notifier.ptr()); > >- m_oneShots.add(notifier); >+ m_oneShots.add(WTFMove(notifier)); > } > > int Geolocation::watchPosition(Ref<PositionCallback>&& successCallback, RefPtr<PositionErrorCallback>&& errorCallback, PositionOptions&& options) >@@ -315,14 +315,14 @@ int Geolocation::watchPosition(Ref<PositionCallback>&& successCallback, RefPtr<P > if (!frame()) > return 0; > >- RefPtr<GeoNotifier> notifier = GeoNotifier::create(*this, WTFMove(successCallback), WTFMove(errorCallback), WTFMove(options)); >- startRequest(notifier.get()); >+ auto notifier = GeoNotifier::create(*this, WTFMove(successCallback), WTFMove(errorCallback), WTFMove(options)); >+ startRequest(notifier.ptr()); > > int watchID; > // Keep asking for the next id until we're given one that we don't already have. > do { > watchID = m_scriptExecutionContext->circularSequentialID(); >- } while (!m_watchers.add(watchID, WTFMove(notifier))); >+ } while (!m_watchers.add(watchID, notifier.copyRef())); > return watchID; > } > >diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >index 258d89a5adabca588a19a48d978f6ee221f8de7e..1847439190a8b79bef706432fd2f9d7556907365 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >@@ -97,11 +97,11 @@ uint64_t IDBDatabase::version() const > return m_info.version(); > } > >-RefPtr<DOMStringList> IDBDatabase::objectStoreNames() const >+Ref<DOMStringList> IDBDatabase::objectStoreNames() const > { > ASSERT(&originThread() == &Thread::current()); > >- RefPtr<DOMStringList> objectStoreNames = DOMStringList::create(); >+ auto objectStoreNames = DOMStringList::create(); > for (auto& name : m_info.objectStoreNames()) > objectStoreNames->append(name); > objectStoreNames->sort(); >diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h >index 76a12859101046e652b8edab4f703e0d4ad1593e..15dacb12811d031b70e1e1cf74e9b0939d9f3275 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h >+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h >@@ -54,7 +54,7 @@ class IDBDatabase : public ThreadSafeRefCounted<IDBDatabase>, public EventTarget > // IDBDatabase IDL > const String name() const; > uint64_t version() const; >- RefPtr<DOMStringList> objectStoreNames() const; >+ Ref<DOMStringList> objectStoreNames() const; > > struct ObjectStoreParameters { > std::optional<IDBKeyPath> keyPath; >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >index 7dc5e0f799c0a62862032efd1efcbaad8ad64e94..8e072a836824bd67970adc6a7e050087a519d665 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >@@ -122,11 +122,11 @@ const std::optional<IDBKeyPath>& IDBObjectStore::keyPath() const > return m_info.keyPath(); > } > >-RefPtr<DOMStringList> IDBObjectStore::indexNames() const >+Ref<DOMStringList> IDBObjectStore::indexNames() const > { > ASSERT(&m_transaction.database().originThread() == &Thread::current()); > >- RefPtr<DOMStringList> indexNames = DOMStringList::create(); >+ auto indexNames = DOMStringList::create(); > > if (!m_deleted) { > for (auto& name : m_info.indexNames()) >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >index ed60647e2077b39a97dbc4de807935ba39a1d79d..d04499319c817e59ebcb55156dd8a04253ce8aaa 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >@@ -64,7 +64,7 @@ class IDBObjectStore final : public ActiveDOMObject { > const String& name() const; > ExceptionOr<void> setName(const String&); > const std::optional<IDBKeyPath>& keyPath() const; >- RefPtr<DOMStringList> indexNames() const; >+ Ref<DOMStringList> indexNames() const; > IDBTransaction& transaction(); > bool autoIncrement() const; > >diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >index ce728fce263885b207978b6c84f1bed478d7dc12..175bdda7271b5016c19b27e825e4a8f23c8959cd 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >@@ -372,13 +372,13 @@ void IDBTransaction::removeRequest(IDBRequest& request) > m_openRequests.remove(&request); > } > >-void IDBTransaction::scheduleOperation(RefPtr<IDBClient::TransactionOperation>&& operation) >+void IDBTransaction::scheduleOperation(Ref<IDBClient::TransactionOperation>&& operation) > { > ASSERT(!m_transactionOperationMap.contains(operation->identifier())); > ASSERT(&m_database->originThread() == &Thread::current()); > > auto identifier = operation->identifier(); >- m_pendingTransactionOperationQueue.append(operation); >+ m_pendingTransactionOperationQueue.append(operation.copyRef()); > m_transactionOperationMap.set(identifier, WTFMove(operation)); > > schedulePendingOperationTimer(); >diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h >index ecac146e5d692efea999cef1106a76b131182723..bd6dde567738547abf1ba498fa970d38cf429c78 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h >+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h >@@ -162,7 +162,7 @@ class IDBTransaction : public ThreadSafeRefCounted<IDBTransaction>, public Event > void finishAbortOrCommit(); > void abortInProgressOperations(const IDBError&); > >- void scheduleOperation(RefPtr<IDBClient::TransactionOperation>&&); >+ void scheduleOperation(Ref<IDBClient::TransactionOperation>&&); > void pendingOperationTimerFired(); > void completedOperationTimerFired(); > >diff --git a/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h b/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h >index e85512531b464d3d361e34b3b89aac136d0b1fec..8ddb56e178b72ef21a666eb169dfc16ee9892de3 100644 >--- a/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h >+++ b/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h >@@ -181,40 +181,37 @@ class TransactionOperationImpl final : public TransactionOperation { > } > }; > >-inline RefPtr<TransactionOperation> createTransactionOperation( >+inline Ref<TransactionOperation> createTransactionOperation( > IDBTransaction& transaction, > void (IDBTransaction::*complete)(const IDBResultData&), > void (IDBTransaction::*perform)(TransactionOperation&)) > { >- auto operation = new TransactionOperationImpl<>(transaction, complete, perform); >- return adoptRef(operation); >+ return adoptRef(*new TransactionOperationImpl<>(transaction, complete, perform)); > } > > template<typename MP1, typename P1> >-RefPtr<TransactionOperation> createTransactionOperation( >+Ref<TransactionOperation> createTransactionOperation( > IDBTransaction& transaction, > void (IDBTransaction::*complete)(const IDBResultData&), > void (IDBTransaction::*perform)(TransactionOperation&, MP1), > const P1& parameter1) > { >- auto operation = new TransactionOperationImpl<MP1>(transaction, complete, perform, parameter1); >- return adoptRef(operation); >+ return adoptRef(*new TransactionOperationImpl<MP1>(transaction, complete, perform, parameter1)); > } > > template<typename MP1, typename P1, typename MP2, typename P2> >-RefPtr<TransactionOperation> createTransactionOperation( >+Ref<TransactionOperation> createTransactionOperation( > IDBTransaction& transaction, > void (IDBTransaction::*complete)(const IDBResultData&), > void (IDBTransaction::*perform)(TransactionOperation&, MP1, MP2), > const P1& parameter1, > const P2& parameter2) > { >- auto operation = new TransactionOperationImpl<MP1, MP2>(transaction, complete, perform, parameter1, parameter2); >- return adoptRef(operation); >+ return adoptRef(*new TransactionOperationImpl<MP1, MP2>(transaction, complete, perform, parameter1, parameter2)); > } > > template<typename MP1, typename P1, typename MP2, typename P2, typename MP3, typename P3> >-RefPtr<TransactionOperation> createTransactionOperation( >+Ref<TransactionOperation> createTransactionOperation( > IDBTransaction& transaction, > void (IDBTransaction::*complete)(const IDBResultData&), > void (IDBTransaction::*perform)(TransactionOperation&, MP1, MP2, MP3), >@@ -222,24 +219,22 @@ RefPtr<TransactionOperation> createTransactionOperation( > const P2& parameter2, > const P3& parameter3) > { >- auto operation = new TransactionOperationImpl<MP1, MP2, MP3>(transaction, complete, perform, parameter1, parameter2, parameter3); >- return adoptRef(operation); >+ return adoptRef(*new TransactionOperationImpl<MP1, MP2, MP3>(transaction, complete, perform, parameter1, parameter2, parameter3)); > } > > template<typename MP1, typename P1> >-RefPtr<TransactionOperation> createTransactionOperation( >+Ref<TransactionOperation> createTransactionOperation( > IDBTransaction& transaction, > IDBRequest& request, > void (IDBTransaction::*complete)(IDBRequest&, const IDBResultData&), > void (IDBTransaction::*perform)(TransactionOperation&, MP1), > const P1& parameter1) > { >- auto operation = new TransactionOperationImpl<MP1>(transaction, request, complete, perform, parameter1); >- return adoptRef(operation); >+ return adoptRef(*new TransactionOperationImpl<MP1>(transaction, request, complete, perform, parameter1)); > } > > template<typename MP1, typename P1, typename MP2, typename P2> >-RefPtr<TransactionOperation> createTransactionOperation( >+Ref<TransactionOperation> createTransactionOperation( > IDBTransaction& transaction, > IDBRequest& request, > void (IDBTransaction::*complete)(IDBRequest&, const IDBResultData&), >@@ -247,12 +242,11 @@ RefPtr<TransactionOperation> createTransactionOperation( > const P1& parameter1, > const P2& parameter2) > { >- auto operation = new TransactionOperationImpl<MP1, MP2>(transaction, request, complete, perform, parameter1, parameter2); >- return adoptRef(operation); >+ return adoptRef(*new TransactionOperationImpl<MP1, MP2>(transaction, request, complete, perform, parameter1, parameter2)); > } > > template<typename MP1, typename MP2, typename MP3, typename P1, typename P2, typename P3> >-RefPtr<TransactionOperation> createTransactionOperation( >+Ref<TransactionOperation> createTransactionOperation( > IDBTransaction& transaction, > IDBRequest& request, > void (IDBTransaction::*complete)(IDBRequest&, const IDBResultData&), >@@ -261,8 +255,7 @@ RefPtr<TransactionOperation> createTransactionOperation( > const P2& parameter2, > const P3& parameter3) > { >- auto operation = new TransactionOperationImpl<MP1, MP2, MP3>(transaction, request, complete, perform, parameter1, parameter2, parameter3); >- return adoptRef(operation); >+ return adoptRef(*new TransactionOperationImpl<MP1, MP2, MP3>(transaction, request, complete, perform, parameter1, parameter2, parameter3)); > } > > } // namespace IDBClient >diff --git a/Source/WebCore/Modules/mediastream/MediaDevices.cpp b/Source/WebCore/Modules/mediastream/MediaDevices.cpp >index 14bb977536bbfbff2eac630906409440dbfa3cfc..3aa43a99ae0981c8fc0df516cbcea6fb41876127 100644 >--- a/Source/WebCore/Modules/mediastream/MediaDevices.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaDevices.cpp >@@ -110,8 +110,7 @@ void MediaDevices::getUserMedia(const StreamConstraints& constraints, Promise&& > videoConstraints.setDefaultVideoConstraints(); > > auto request = UserMediaRequest::create(*document, { MediaStreamRequest::Type::UserMedia, WTFMove(audioConstraints), WTFMove(videoConstraints) }, WTFMove(promise)); >- if (request) >- request->start(); >+ request->start(); > > return; > } >@@ -123,8 +122,7 @@ ExceptionOr<void> MediaDevices::getDisplayMedia(const StreamConstraints& constra > return Exception { InvalidStateError }; > > auto request = UserMediaRequest::create(*document, { MediaStreamRequest::Type::DisplayMedia, { }, createMediaConstraints(constraints.video) }, WTFMove(promise)); >- if (request) >- request->start(); >+ request->start(); > > return { }; > } >diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp >index e10b96bc91d6fe58cc0ab9eca6126af2b368193c..a1cb74ba619bb724e4a6e057b9d9fdb9380709ad 100644 >--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp >+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp >@@ -49,9 +49,9 @@ > > namespace WebCore { > >-RefPtr<UserMediaRequest> UserMediaRequest::create(Document& document, MediaStreamRequest&& request, DOMPromiseDeferred<IDLInterface<MediaStream>>&& promise) >+Ref<UserMediaRequest> UserMediaRequest::create(Document& document, MediaStreamRequest&& request, DOMPromiseDeferred<IDLInterface<MediaStream>>&& promise) > { >- auto result = adoptRef(new UserMediaRequest(document, WTFMove(request), WTFMove(promise))); >+ auto result = adoptRef(*new UserMediaRequest(document, WTFMove(request), WTFMove(promise))); > result->suspendIfNeeded(); > return result; > } >diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.h b/Source/WebCore/Modules/mediastream/UserMediaRequest.h >index de51fd9fc43eb297e5d2a27e764aa4d27c30a5f1..6de7e5c8d7ba413e20368e54027807517b751d95 100644 >--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.h >+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.h >@@ -48,7 +48,7 @@ class SecurityOrigin; > > class UserMediaRequest : public RefCounted<UserMediaRequest>, public ActiveDOMObject { > public: >- static RefPtr<UserMediaRequest> create(Document&, MediaStreamRequest&&, DOMPromiseDeferred<IDLInterface<MediaStream>>&&); >+ static Ref<UserMediaRequest> create(Document&, MediaStreamRequest&&, DOMPromiseDeferred<IDLInterface<MediaStream>>&&); > virtual ~UserMediaRequest(); > > void start(); >diff --git a/Source/WebCore/Modules/webaudio/AudioParam.cpp b/Source/WebCore/Modules/webaudio/AudioParam.cpp >index 0ff0e204380e7fddbc0080bc54caa87a973e08ef..75068e190a19a44940659dbdd374df2784d9bb8c 100644 >--- a/Source/WebCore/Modules/webaudio/AudioParam.cpp >+++ b/Source/WebCore/Modules/webaudio/AudioParam.cpp >@@ -135,7 +135,7 @@ void AudioParam::calculateFinalValues(float* values, unsigned numberOfValues, bo > > // Now sum all of the audio-rate connections together (unity-gain summing junction). > // Note that connections would normally be mono, but we mix down to mono if necessary. >- RefPtr<AudioBus> summingBus = AudioBus::create(1, numberOfValues, false); >+ auto summingBus = AudioBus::create(1, numberOfValues, false); > summingBus->setChannelMemory(0, values, numberOfValues); > > for (auto& output : m_renderingOutputs) { >diff --git a/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp b/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp >index 88ae04abbe39e51734ebb017e20f261fbb041e56..b9cc20cd2e5afc7611b370306e10412847b208d6 100644 >--- a/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp >+++ b/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp >@@ -87,8 +87,8 @@ void ScriptProcessorNode::initialize() > // Create double buffers on both the input and output sides. > // These AudioBuffers will be directly accessed in the main thread by JavaScript. > for (unsigned i = 0; i < 2; ++i) { >- RefPtr<AudioBuffer> inputBuffer = m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, bufferSize(), sampleRate) : 0; >- RefPtr<AudioBuffer> outputBuffer = m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, bufferSize(), sampleRate) : 0; >+ auto inputBuffer = m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, bufferSize(), sampleRate) : 0; >+ auto outputBuffer = m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, bufferSize(), sampleRate) : 0; > > m_inputBuffers.append(inputBuffer); > m_outputBuffers.append(outputBuffer); >diff --git a/Source/WebCore/Modules/webdatabase/SQLStatement.cpp b/Source/WebCore/Modules/webdatabase/SQLStatement.cpp >index 091a30a26f519bdc6839d0bc67f058663b674ad1..7e13d060b3516d25e0b23c9dd6404f7ab0635bb2 100644 >--- a/Source/WebCore/Modules/webdatabase/SQLStatement.cpp >+++ b/Source/WebCore/Modules/webdatabase/SQLStatement.cpp >@@ -145,7 +145,7 @@ bool SQLStatement::execute(Database& db) > } > } > >- RefPtr<SQLResultSet> resultSet = SQLResultSet::create(); >+ auto resultSet = SQLResultSet::create(); > > // Step so we can fetch the column names. > result = statement.step(); >@@ -193,7 +193,7 @@ bool SQLStatement::execute(Database& db) > // For now, this seems sufficient > resultSet->setRowsAffected(database.lastChanges()); > >- m_resultSet = resultSet; >+ m_resultSet = WTFMove(resultSet); > return true; > } > >diff --git a/Source/WebCore/Modules/webgpu/WebGPU.cpp b/Source/WebCore/Modules/webgpu/WebGPU.cpp >index 3d154ac5a21ae61c657a300fad9636ba0d83d907..0dc411ae303e4b086edbf9f868f85db4d1ac64ff 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPU.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPU.cpp >@@ -40,10 +40,7 @@ Ref<WebGPU> WebGPU::create() > void WebGPU::requestAdapter(const WebGPUAdapterDescriptor& descriptor, WebGPUAdapterPromise&& deferred) const > { > auto adapter = WebGPUAdapter::create(descriptor); >- if (!adapter) >- deferred.reject(); >- >- deferred.resolve(*adapter); >+ deferred.resolve(adapter.get()); > } > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp b/Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp >index eeec4df68c62e417d4db3b7112234df3ce2fe9a8..77f9f491e4fc1619e00db926748eaababbd511ba 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp >@@ -34,10 +34,10 @@ > > namespace WebCore { > >-RefPtr<WebGPUAdapter> WebGPUAdapter::create(const WebGPUAdapterDescriptor& descriptor) >+Ref<WebGPUAdapter> WebGPUAdapter::create(const WebGPUAdapterDescriptor& descriptor) > { > // FIXME: Validation on descriptor. >- return adoptRef(new WebGPUAdapter(descriptor)); >+ return adoptRef(*new WebGPUAdapter(descriptor)); > } > > WebGPUAdapter::WebGPUAdapter(const WebGPUAdapterDescriptor& descriptor) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUAdapter.h b/Source/WebCore/Modules/webgpu/WebGPUAdapter.h >index 4b8eff5213b6bf2c9502e6163e6a48d6d45b3fec..8d04e54bf2a6408e9e88254c8204cec55c168084 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUAdapter.h >+++ b/Source/WebCore/Modules/webgpu/WebGPUAdapter.h >@@ -39,7 +39,7 @@ struct WebGPUAdapterDescriptor; > > class WebGPUAdapter : public RefCounted<WebGPUAdapter> { > public: >- static RefPtr<WebGPUAdapter> create(const WebGPUAdapterDescriptor&); >+ static Ref<WebGPUAdapter> create(const WebGPUAdapterDescriptor&); > > RefPtr<WebGPUDevice> createDevice(); > >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBuffer.cpp b/Source/WebCore/Modules/webgpu/WebGPUBuffer.cpp >index 34941d0ea5f79251cb48ddebf741343f9e4ba709..909a5c7642f24af64248d999dc31c4e420f40861 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUBuffer.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUBuffer.cpp >@@ -30,9 +30,9 @@ > > namespace WebCore { > >-RefPtr<WebGPUBuffer> WebGPUBuffer::create(Ref<GPUBuffer>&& buffer) >+Ref<WebGPUBuffer> WebGPUBuffer::create(Ref<GPUBuffer>&& buffer) > { >- return adoptRef(new WebGPUBuffer(WTFMove(buffer))); >+ return adoptRef(*new WebGPUBuffer(WTFMove(buffer))); > } > > WebGPUBuffer::WebGPUBuffer(Ref<GPUBuffer>&& buffer) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBuffer.h b/Source/WebCore/Modules/webgpu/WebGPUBuffer.h >index e276425bd42b5d682fbe2428a4006e23f4923875..51aebf2e2a785a19da3b0db6868adacd7cbcb248 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUBuffer.h >+++ b/Source/WebCore/Modules/webgpu/WebGPUBuffer.h >@@ -36,7 +36,7 @@ namespace WebCore { > > class WebGPUBuffer : public RefCounted<WebGPUBuffer> { > public: >- static RefPtr<WebGPUBuffer> create(Ref<GPUBuffer>&&); >+ static Ref<WebGPUBuffer> create(Ref<GPUBuffer>&&); > > const GPUBuffer& buffer() const { return m_buffer.get(); } > >diff --git a/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp b/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp >index dbb803be27321b9be6cdf59d911afbc033842942..b6ecaaa15e42adc8e2e51a45e27a4d4684a12a74 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp >@@ -37,9 +37,9 @@ > > namespace WebCore { > >-RefPtr<WebGPUCommandBuffer> WebGPUCommandBuffer::create(Ref<GPUCommandBuffer>&& buffer) >+Ref<WebGPUCommandBuffer> WebGPUCommandBuffer::create(Ref<GPUCommandBuffer>&& buffer) > { >- return adoptRef(new WebGPUCommandBuffer(WTFMove(buffer))); >+ return adoptRef(*new WebGPUCommandBuffer(WTFMove(buffer))); > } > > WebGPUCommandBuffer::WebGPUCommandBuffer(Ref<GPUCommandBuffer>&& buffer) >@@ -65,8 +65,9 @@ RefPtr<WebGPURenderPassEncoder> WebGPUCommandBuffer::beginRenderPass(WebGPURende > gpuRenderPassDescriptor.colorAttachments.append(GPURenderPassColorAttachmentDescriptor { colorAttachment.attachment->texture(), colorAttachment.clearColor }); > } > >- auto encoder = GPURenderPassEncoder::create(m_commandBuffer.get(), WTFMove(gpuRenderPassDescriptor)); >- return encoder ? WebGPURenderPassEncoder::create(*this, encoder.releaseNonNull()) : nullptr; >+ if (auto encoder = GPURenderPassEncoder::create(m_commandBuffer.get(), WTFMove(gpuRenderPassDescriptor))) >+ return WebGPURenderPassEncoder::create(*this, encoder.releaseNonNull()); >+ return nullptr; > } > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h b/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h >index 72df312ff880b78f7eca116932526392437bd1ef..98ee40cddd444b10565bcd47d3748435cbcbe9ad 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h >+++ b/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h >@@ -41,7 +41,7 @@ struct WebGPURenderPassDescriptor; > > class WebGPUCommandBuffer : public RefCounted<WebGPUCommandBuffer> { > public: >- static RefPtr<WebGPUCommandBuffer> create(Ref<GPUCommandBuffer>&&); >+ static Ref<WebGPUCommandBuffer> create(Ref<GPUCommandBuffer>&&); > > const GPUCommandBuffer& commandBuffer() const { return m_commandBuffer.get(); } > >diff --git a/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp b/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >index 77ba4cbc08f96b1e322c69d487f705941286c438..e40ea982779a7935d8360827089a0f0175341915 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >@@ -46,8 +46,9 @@ namespace WebCore { > > RefPtr<WebGPUDevice> WebGPUDevice::create(Ref<WebGPUAdapter>&& adapter) > { >- auto device = GPUDevice::create(); // FIXME: Take adapter into account when creating m_device. >- return device ? adoptRef(new WebGPUDevice(WTFMove(adapter), device.releaseNonNull())) : nullptr; >+ if (auto device = GPUDevice::create()) // FIXME: Take adapter into account when creating m_device. >+ return adoptRef(new WebGPUDevice(WTFMove(adapter), device.releaseNonNull())); >+ return nullptr; > } > > WebGPUDevice::WebGPUDevice(Ref<WebGPUAdapter>&& adapter, Ref<GPUDevice>&& device) >@@ -60,15 +61,17 @@ WebGPUDevice::WebGPUDevice(Ref<WebGPUAdapter>&& adapter, Ref<GPUDevice>&& device > RefPtr<WebGPUBuffer> WebGPUDevice::createBuffer(WebGPUBufferDescriptor&& descriptor) const > { > // FIXME: Validation on descriptor needed? >- auto buffer = m_device->createBuffer(GPUBufferDescriptor { descriptor.size, descriptor.usage }); >- return buffer ? WebGPUBuffer::create(buffer.releaseNonNull()) : nullptr; >+ if (auto buffer = m_device->createBuffer(GPUBufferDescriptor { descriptor.size, descriptor.usage })) >+ return WebGPUBuffer::create(buffer.releaseNonNull()); >+ return nullptr; > } > > RefPtr<WebGPUShaderModule> WebGPUDevice::createShaderModule(WebGPUShaderModuleDescriptor&& descriptor) const > { > // FIXME: What can be validated here? >- auto module = m_device->createShaderModule(GPUShaderModuleDescriptor { descriptor.code }); >- return module ? WebGPUShaderModule::create(module.releaseNonNull()) : nullptr; >+ if (auto module = m_device->createShaderModule(GPUShaderModuleDescriptor { descriptor.code })) >+ return WebGPUShaderModule::create(module.releaseNonNull()); >+ return nullptr; > } > > static std::optional<GPUPipelineStageDescriptor> validateAndConvertPipelineStage(const WebGPUPipelineStageDescriptor& descriptor) >@@ -89,14 +92,16 @@ RefPtr<WebGPURenderPipeline> WebGPUDevice::createRenderPipeline(WebGPURenderPipe > return nullptr; > } > >- auto pipeline = m_device->createRenderPipeline(GPURenderPipelineDescriptor { WTFMove(*vertexStage), WTFMove(*fragmentStage), descriptor.primitiveTopology, descriptor.inputState }); >- return pipeline ? WebGPURenderPipeline::create(pipeline.releaseNonNull()) : nullptr; >+ if (auto pipeline = m_device->createRenderPipeline(GPURenderPipelineDescriptor { WTFMove(*vertexStage), WTFMove(*fragmentStage), descriptor.primitiveTopology, descriptor.inputState })) >+ return WebGPURenderPipeline::create(pipeline.releaseNonNull()); >+ return nullptr; > } > > RefPtr<WebGPUCommandBuffer> WebGPUDevice::createCommandBuffer() const > { >- auto commandBuffer = m_device->createCommandBuffer(); >- return commandBuffer ? WebGPUCommandBuffer::create(commandBuffer.releaseNonNull()) : nullptr; >+ if (auto commandBuffer = m_device->createCommandBuffer()) >+ return WebGPUCommandBuffer::create(commandBuffer.releaseNonNull()); >+ return nullptr; > } > > RefPtr<WebGPUQueue> WebGPUDevice::getQueue() >diff --git a/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp b/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp >index 1a1c52cbc9750cb74a6db7657b2ce81d6a07081a..daf1b08227d4656039c372d3531c0ff98647b4d1 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp >@@ -35,9 +35,9 @@ > > namespace WebCore { > >-RefPtr<WebGPURenderPassEncoder> WebGPURenderPassEncoder::create(Ref<WebGPUCommandBuffer>&& commandBuffer, Ref<GPURenderPassEncoder>&& encoder) >+Ref<WebGPURenderPassEncoder> WebGPURenderPassEncoder::create(Ref<WebGPUCommandBuffer>&& commandBuffer, Ref<GPURenderPassEncoder>&& encoder) > { >- return adoptRef(new WebGPURenderPassEncoder(WTFMove(commandBuffer), WTFMove(encoder))); >+ return adoptRef(*new WebGPURenderPassEncoder(WTFMove(commandBuffer), WTFMove(encoder))); > } > > WebGPURenderPassEncoder::WebGPURenderPassEncoder(Ref<WebGPUCommandBuffer>&& creator, Ref<GPURenderPassEncoder>&& encoder) >diff --git a/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h b/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h >index 31296e3e9e828e104210ed405978e2e2f31fc07f..87a7eaf19f099071db7d3af0a8d14a00ee92a58a 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h >+++ b/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h >@@ -40,7 +40,7 @@ class WebGPUBuffer; > > class WebGPURenderPassEncoder final : public WebGPUProgrammablePassEncoder { > public: >- static RefPtr<WebGPURenderPassEncoder> create(Ref<WebGPUCommandBuffer>&&, Ref<GPURenderPassEncoder>&&); >+ static Ref<WebGPURenderPassEncoder> create(Ref<WebGPUCommandBuffer>&&, Ref<GPURenderPassEncoder>&&); > > // FIXME: Last argument should be Vector<unsigned long>. Why is the generated code incorrectly assuming the IDL wants a sequence<unsigned int>? > void setVertexBuffers(unsigned long, Vector<RefPtr<WebGPUBuffer>>&&, Vector<unsigned>&&); >diff --git a/Source/WebCore/Modules/webgpu/WebGPURenderPipeline.cpp b/Source/WebCore/Modules/webgpu/WebGPURenderPipeline.cpp >index 3ccf3c0da26556af38f973862a488ec0c31ea9fa..106c57680d975791fff3381c1f9d66113928645e 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPURenderPipeline.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPURenderPipeline.cpp >@@ -32,9 +32,9 @@ > > namespace WebCore { > >-RefPtr<WebGPURenderPipeline> WebGPURenderPipeline::create(Ref<GPURenderPipeline>&& pipeline) >+Ref<WebGPURenderPipeline> WebGPURenderPipeline::create(Ref<GPURenderPipeline>&& pipeline) > { >- return adoptRef(new WebGPURenderPipeline(WTFMove(pipeline))); >+ return adoptRef(*new WebGPURenderPipeline(WTFMove(pipeline))); > } > > WebGPURenderPipeline::WebGPURenderPipeline(Ref<GPURenderPipeline>&& pipeline) >diff --git a/Source/WebCore/Modules/webgpu/WebGPURenderPipeline.h b/Source/WebCore/Modules/webgpu/WebGPURenderPipeline.h >index 2c8b8668faf6be091494551fc73cacd920f97d22..3917fad767fccb0ed75bdeb74ca6a0da13cc8f76 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPURenderPipeline.h >+++ b/Source/WebCore/Modules/webgpu/WebGPURenderPipeline.h >@@ -36,7 +36,7 @@ namespace WebCore { > > class WebGPURenderPipeline : public RefCounted<WebGPURenderPipeline> { > public: >- static RefPtr<WebGPURenderPipeline> create(Ref<GPURenderPipeline>&&); >+ static Ref<WebGPURenderPipeline> create(Ref<GPURenderPipeline>&&); > > Ref<GPURenderPipeline> renderPipeline() { return m_renderPipeline.copyRef(); } > >diff --git a/Source/WebCore/Modules/webgpu/WebGPUShaderModule.cpp b/Source/WebCore/Modules/webgpu/WebGPUShaderModule.cpp >index e823b044a8f02cd6bc5923041cf8e596b861b98e..994c2eca0a98bc5f6d364d93609df9cd2a1c7f3d 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUShaderModule.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUShaderModule.cpp >@@ -30,9 +30,9 @@ > > namespace WebCore { > >-RefPtr<WebGPUShaderModule> WebGPUShaderModule::create(Ref<GPUShaderModule>&& module) >+Ref<WebGPUShaderModule> WebGPUShaderModule::create(Ref<GPUShaderModule>&& module) > { >- return adoptRef(new WebGPUShaderModule(WTFMove(module))); >+ return adoptRef(*new WebGPUShaderModule(WTFMove(module))); > } > > WebGPUShaderModule::WebGPUShaderModule(Ref<GPUShaderModule>&& module) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUShaderModule.h b/Source/WebCore/Modules/webgpu/WebGPUShaderModule.h >index 4202994d47ec24a1fe09a6eb4c6f7457a0ac418d..64660b31e456ffa08056dee55b6cad45b33378f0 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUShaderModule.h >+++ b/Source/WebCore/Modules/webgpu/WebGPUShaderModule.h >@@ -36,7 +36,7 @@ namespace WebCore { > > class WebGPUShaderModule : public RefCounted<WebGPUShaderModule> { > public: >- static RefPtr<WebGPUShaderModule> create(Ref<GPUShaderModule>&&); >+ static Ref<WebGPUShaderModule> create(Ref<GPUShaderModule>&&); > > const GPUShaderModule* module() const { return m_module.ptr(); } > >diff --git a/Source/WebCore/Modules/webgpu/WebGPUTexture.cpp b/Source/WebCore/Modules/webgpu/WebGPUTexture.cpp >index c6780ef61b0299fee195f125f56ce4d8e862c727..9d9d7f963bd2e9157d85cdd37c18309e2636cad1 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUTexture.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUTexture.cpp >@@ -44,8 +44,9 @@ WebGPUTexture::WebGPUTexture(Ref<GPUTexture>&& texture) > > RefPtr<WebGPUTextureView> WebGPUTexture::createDefaultTextureView() > { >- auto gpuTexture = m_texture->createDefaultTextureView(); >- return gpuTexture ? WebGPUTextureView::create(gpuTexture.releaseNonNull()) : nullptr; >+ if (auto gpuTexture = m_texture->createDefaultTextureView()) >+ return WebGPUTextureView::create(gpuTexture.releaseNonNull()); >+ return nullptr; > } > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/webgpu/WebGPUTextureView.cpp b/Source/WebCore/Modules/webgpu/WebGPUTextureView.cpp >index 0459a53a288ecf3b268fc2c06645b74b1234651c..7265945a23e9c10d26a703dfe442d0f47ab0f008 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUTextureView.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUTextureView.cpp >@@ -30,9 +30,9 @@ > > namespace WebCore { > >-RefPtr<WebGPUTextureView> WebGPUTextureView::create(Ref<GPUTexture>&& view) >+Ref<WebGPUTextureView> WebGPUTextureView::create(Ref<GPUTexture>&& view) > { >- return adoptRef(new WebGPUTextureView(WTFMove(view))); >+ return adoptRef(*new WebGPUTextureView(WTFMove(view))); > } > > WebGPUTextureView::WebGPUTextureView(Ref<GPUTexture>&& view) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUTextureView.h b/Source/WebCore/Modules/webgpu/WebGPUTextureView.h >index 40fd81492b081dfcdc91bef5382ad3f798a936f7..fbeb8bc665604277e0df39503f8791beca092adb 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUTextureView.h >+++ b/Source/WebCore/Modules/webgpu/WebGPUTextureView.h >@@ -35,7 +35,7 @@ namespace WebCore { > > class WebGPUTextureView : public RefCounted<WebGPUTextureView> { > public: >- static RefPtr<WebGPUTextureView> create(Ref<GPUTexture>&&); >+ static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&); > > Ref<GPUTexture> texture() { return m_texture.copyRef(); } > private: >diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp >index f114ba949b0b32d0f6e689212dfd51f3e12315b2..f962daa9dc77c8144bb6bf657b7fd0ac2a300da2 100644 >--- a/Source/WebCore/accessibility/AXObjectCache.cpp >+++ b/Source/WebCore/accessibility/AXObjectCache.cpp >@@ -1799,13 +1799,13 @@ RefPtr<Range> AXObjectCache::rangeMatchesTextNearRange(RefPtr<Range> originalRan > if (endPosition.isNull()) > endPosition = lastPositionInOrAfterNode(&originalRange->endContainer()); > >- RefPtr<Range> searchRange = Range::create(m_document, startPosition, endPosition); >- if (!searchRange || searchRange->collapsed()) >+ auto searchRange = Range::create(m_document, startPosition, endPosition); >+ if (searchRange->collapsed()) > return nullptr; > >- RefPtr<Range> range = Range::create(m_document, startPosition, originalRange->startPosition()); >- unsigned targetOffset = TextIterator::rangeLength(range.get(), true); >- return findClosestPlainText(*searchRange.get(), matchText, { }, targetOffset); >+ auto range = Range::create(m_document, startPosition, originalRange->startPosition()); >+ unsigned targetOffset = TextIterator::rangeLength(range.ptr(), true); >+ return findClosestPlainText(searchRange.get(), matchText, { }, targetOffset); > } > > static bool isReplacedNodeOrBR(Node* node) >diff --git a/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp b/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp >index 6ff644cf5f0d0a2981b4ce7d8aab933676cd09f0..f7cd3aa8adda6a4bcfa41094ed458cbc37f1fc0b 100644 >--- a/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp >+++ b/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp >@@ -337,8 +337,8 @@ void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject* obje > // Consider previous text objects that might be present for > // the current accessibility object to ensure we emit the > // right offset (e.g. multiline text areas). >- RefPtr<Range> range = Range::create(document, node->parentNode(), 0, node, 0); >- offsetToEmit = offset + TextIterator::rangeLength(range.get()); >+ auto range = Range::create(document, node->parentNode(), 0, node, 0); >+ offsetToEmit = offset + TextIterator::rangeLength(range.ptr()); > } > > g_signal_emit_by_name(wrapper, detail.data(), offsetToEmit, textToEmit.length(), textToEmit.utf8().data()); >diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp >index a6e963deabf7d01f507893b02623234f608da607..bc16e4b29031139dc64d6c23689aed94675047b2 100644 >--- a/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp >+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp >@@ -260,8 +260,8 @@ static gint webkitAccessibleHyperlinkGetStartIndex(AtkHyperlink* link) > if (!parentNode) > return 0; > >- RefPtr<Range> range = Range::create(node->document(), firstPositionInOrBeforeNode(parentNode), firstPositionInOrBeforeNode(node)); >- return getRangeLengthForObject(coreObject, range.get()); >+ auto range = Range::create(node->document(), firstPositionInOrBeforeNode(parentNode), firstPositionInOrBeforeNode(node)); >+ return getRangeLengthForObject(coreObject, range.ptr()); > } > > static gint webkitAccessibleHyperlinkGetEndIndex(AtkHyperlink* link) >@@ -286,8 +286,8 @@ static gint webkitAccessibleHyperlinkGetEndIndex(AtkHyperlink* link) > if (!parentNode) > return 0; > >- RefPtr<Range> range = Range::create(node->document(), firstPositionInOrBeforeNode(parentNode), lastPositionInOrAfterNode(node)); >- return getRangeLengthForObject(coreObject, range.get()); >+ auto range = Range::create(node->document(), firstPositionInOrBeforeNode(parentNode), lastPositionInOrAfterNode(node)); >+ return getRangeLengthForObject(coreObject, range.ptr()); > } > > static gboolean webkitAccessibleHyperlinkIsValid(AtkHyperlink* link) >diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp >index 18c9e9b5797c9916d2625a9fb40c67ff631037de..da402da0be0cfc415b0eed57b44ff2d79abcc814 100644 >--- a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp >+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp >@@ -406,13 +406,13 @@ static void getSelectionOffsetsForObject(AccessibilityObject* coreObject, Visibl > > // Calculate position of the selected range inside the object. > Position parentFirstPosition = firstPositionInOrBeforeNode(node); >- RefPtr<Range> rangeInParent = Range::create(node->document(), parentFirstPosition, nodeRangeStart); >+ auto rangeInParent = Range::create(node->document(), parentFirstPosition, nodeRangeStart); > > // Set values for start offsets and calculate initial range length. > // These values might be adjusted later to cover special cases. >- startOffset = webCoreOffsetToAtkOffset(coreObject, TextIterator::rangeLength(rangeInParent.get(), true)); >- RefPtr<Range> nodeRange = Range::create(node->document(), nodeRangeStart, nodeRangeEnd); >- int rangeLength = TextIterator::rangeLength(nodeRange.get(), true); >+ startOffset = webCoreOffsetToAtkOffset(coreObject, TextIterator::rangeLength(rangeInParent.ptr(), true)); >+ auto nodeRange = Range::create(node->document(), nodeRangeStart, nodeRangeEnd); >+ int rangeLength = TextIterator::rangeLength(nodeRange.ptr(), true); > > // Special cases that are only relevant when working with *_END boundaries. > if (selection.affinity() == UPSTREAM) { >diff --git a/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm b/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm >index 8c7b1cf38b9cb88db78c698e6a0676649e2c0e74..7fb62f8e9d0a7d3ecae702a439562fc1c5c02372 100644 >--- a/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm >+++ b/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm >@@ -2401,12 +2401,12 @@ - (NSRange)_convertToNSRange:(Range *)range > if (&range->endContainer() != scope && !range->endContainer().isDescendantOf(scope)) > return NSMakeRange(NSNotFound, 0); > >- RefPtr<Range> testRange = Range::create(scope->document(), scope, 0, &range->startContainer(), range->startOffset()); >+ auto testRange = Range::create(scope->document(), scope, 0, &range->startContainer(), range->startOffset()); > ASSERT(&testRange->startContainer() == scope); >- int startPosition = TextIterator::rangeLength(testRange.get()); >+ int startPosition = TextIterator::rangeLength(testRange.ptr()); > testRange->setEnd(range->endContainer(), range->endOffset()); > ASSERT(&testRange->startContainer() == scope); >- int endPosition = TextIterator::rangeLength(testRange.get()); >+ int endPosition = TextIterator::rangeLength(testRange.ptr()); > return NSMakeRange(startPosition, endPosition - startPosition); > } > >diff --git a/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp b/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp >index 9fc306cce0fa3e8a85c7cfee0da13638850d8715..3545d5d511ff868198b19352a08d4e1d256a33cd 100644 >--- a/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp >+++ b/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp >@@ -78,8 +78,8 @@ class JSGlobalObjectCallback final : public RefCounted<JSGlobalObjectCallback>, > JSGlobalObjectTask::JSGlobalObjectTask(JSDOMGlobalObject& globalObject, Ref<Microtask>&& task) > : ScriptExecutionContext::Task({ }) > { >- RefPtr<JSGlobalObjectCallback> callback = JSGlobalObjectCallback::create(globalObject, WTFMove(task)); >- m_task = [callback] (ScriptExecutionContext&) { >+ auto callback = JSGlobalObjectCallback::create(globalObject, WTFMove(task)); >+ m_task = [callback = WTFMove(callback)] (ScriptExecutionContext&) { > callback->call(); > }; > } >diff --git a/Source/WebCore/bindings/js/JSDOMWindowBase.cpp b/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >index f2eb2f78be6bee815bd05a1f8b00fd591a287aab..e7d937eea74c16bf9d1af683144f53d745e9e289 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >+++ b/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >@@ -209,8 +209,8 @@ void JSDOMWindowBase::queueTaskToEventLoop(JSGlobalObject& object, Ref<JSC::Micr > { > JSDOMWindowBase& thisObject = static_cast<JSDOMWindowBase&>(object); > >- RefPtr<JSMicrotaskCallback> callback = JSMicrotaskCallback::create(thisObject, WTFMove(task)); >- auto microtask = std::make_unique<ActiveDOMCallbackMicrotask>(MicrotaskQueue::mainThreadQueue(), *thisObject.scriptExecutionContext(), [callback]() mutable { >+ auto callback = JSMicrotaskCallback::create(thisObject, WTFMove(task)); >+ auto microtask = std::make_unique<ActiveDOMCallbackMicrotask>(MicrotaskQueue::mainThreadQueue(), *thisObject.scriptExecutionContext(), [callback = WTFMove(callback)]() mutable { > callback->call(); > }); > >diff --git a/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp b/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp >index 380ad5bd152013e896b87ab4165557622f7e16cf..d831604cbaeb87f07d12eadda4bf0531a70bb402 100644 >--- a/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp >+++ b/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp >@@ -133,9 +133,9 @@ void JSWorkerGlobalScopeBase::queueTaskToEventLoop(JSGlobalObject& object, Ref<J > { > JSWorkerGlobalScopeBase& thisObject = static_cast<JSWorkerGlobalScopeBase&>(object); > >- RefPtr<JSMicrotaskCallback> callback = JSMicrotaskCallback::create(thisObject, WTFMove(task)); >+ auto callback = JSMicrotaskCallback::create(thisObject, WTFMove(task)); > auto& context = thisObject.wrapped(); >- auto microtask = std::make_unique<ActiveDOMCallbackMicrotask>(context.microtaskQueue(), context, [callback]() mutable { >+ auto microtask = std::make_unique<ActiveDOMCallbackMicrotask>(context.microtaskQueue(), context, [callback = WTFMove(callback)]() mutable { > callback->call(); > }); > >diff --git a/Source/WebCore/bindings/js/ScriptControllerMac.mm b/Source/WebCore/bindings/js/ScriptControllerMac.mm >index ca4f87189cc2951996c89d138c3566a31c0cc249..df9476a16bb3fbc8c48c6ec7d68b3c2ebd65a37e 100644 >--- a/Source/WebCore/bindings/js/ScriptControllerMac.mm >+++ b/Source/WebCore/bindings/js/ScriptControllerMac.mm >@@ -85,10 +85,10 @@ RefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget( > NPObject* npObject = [widgetView createPluginScriptableObject]; > if (!npObject) > return nullptr; >- RefPtr<Instance> instance = JSC::Bindings::CInstance::create(npObject, WTFMove(rootObject)); >+ auto instance = JSC::Bindings::CInstance::create(npObject, WTFMove(rootObject)); > // -createPluginScriptableObject returns a retained NPObject. The caller is expected to release it. > _NPN_ReleaseObject(npObject); >- return instance; >+ return WTFMove(instance); > #endif > } > >diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp >index 2b8d9c0528ba8ceb9873cb6f133593635bc3faa5..429d5e30edcddd1aec513d79eae3805a702b69bd 100644 >--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp >+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp >@@ -2823,7 +2823,7 @@ class CloneDeserializer : CloneBase { > } > IntSize imageSize(width, height); > RELEASE_ASSERT(!length || (imageSize.area() * 4).unsafeGet() <= length); >- RefPtr<ImageData> result = ImageData::create(imageSize); >+ auto result = ImageData::create(imageSize); > if (!result) { > fail(); > return JSValue(); >@@ -2958,7 +2958,7 @@ class CloneDeserializer : CloneBase { > } > > RELEASE_ASSERT(m_sharedBuffers->at(index)); >- RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(WTFMove(m_sharedBuffers->at(index))); >+ auto buffer = ArrayBuffer::create(WTFMove(m_sharedBuffers->at(index))); > JSValue result = getJSValue(buffer.get()); > m_gcBuffer.appendWithCrashOnOverflow(result); > return result; >@@ -3484,7 +3484,7 @@ RefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef originC > auto scope = DECLARE_CATCH_SCOPE(vm); > > JSValue value = toJS(exec, apiValue); >- RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(*exec, value); >+ auto serializedValue = SerializedScriptValue::create(*exec, value); > if (UNLIKELY(scope.exception())) { > if (exception) > *exception = toRef(exec, scope.exception()->value()); >diff --git a/Source/WebCore/bridge/objc/objc_instance.h b/Source/WebCore/bridge/objc/objc_instance.h >index 5f285e91b8df5d515e5560d44965da6404154eb4..1b7896be19050e73b53fd95752f255f83a9c3041 100644 >--- a/Source/WebCore/bridge/objc/objc_instance.h >+++ b/Source/WebCore/bridge/objc/objc_instance.h >@@ -34,7 +34,7 @@ class ObjcClass; > > class ObjcInstance : public Instance { > public: >- static RefPtr<ObjcInstance> create(ObjectStructPtr, RefPtr<RootObject>&&); >+ static Ref<ObjcInstance> create(ObjectStructPtr, RefPtr<RootObject>&&); > virtual ~ObjcInstance(); > > static void setGlobalException(NSString*, JSGlobalObject* exceptionEnvironment = 0); // A null exceptionEnvironment means the exception should propogate to any execution environment. >diff --git a/Source/WebCore/bridge/objc/objc_instance.mm b/Source/WebCore/bridge/objc/objc_instance.mm >index 0aec0ceeaf9c6c2a62e2b085ba0e7bc4ff8ea1cd..051dacaffc66adf7242cc4601cd32a5c117ffdee 100644 >--- a/Source/WebCore/bridge/objc/objc_instance.mm >+++ b/Source/WebCore/bridge/objc/objc_instance.mm >@@ -104,16 +104,17 @@ ObjcInstance::ObjcInstance(id instance, RefPtr<RootObject>&& rootObject) > { > } > >-RefPtr<ObjcInstance> ObjcInstance::create(id instance, RefPtr<RootObject>&& rootObject) >+Ref<ObjcInstance> ObjcInstance::create(id instance, RefPtr<RootObject>&& rootObject) > { > auto result = wrapperCache().add((__bridge CFTypeRef)instance, nullptr); > if (result.isNewEntry) { >- RefPtr<ObjcInstance> wrapper = adoptRef(new ObjcInstance(instance, WTFMove(rootObject))); >- result.iterator->value = wrapper.get(); >+ auto wrapper = adoptRef(*new ObjcInstance(instance, WTFMove(rootObject))); >+ result.iterator->value = wrapper.ptr(); > return wrapper; > } > >- return result.iterator->value; >+ ASSERT(result.iterator->value); >+ return *result.iterator->value; > } > > ObjcInstance::~ObjcInstance() >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index 677841206fbe1e4e3789a0f802bdd1c1d334b8ea..6c95066941d53e65aee5fd15bcf300dc421aaacc 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -812,7 +812,7 @@ static RefPtr<CSSValue> positionOffsetValue(const RenderStyle& style, CSSPropert > return CSSValuePool::singleton().createIdentifierValue(CSSValueAuto); > } > >-RefPtr<CSSPrimitiveValue> ComputedStyleExtractor::currentColorOrValidColor(const RenderStyle* style, const Color& color) const >+Ref<CSSPrimitiveValue> ComputedStyleExtractor::currentColorOrValidColor(const RenderStyle* style, const Color& color) const > { > // This function does NOT look at visited information, so that computed style doesn't expose that. > if (!color.isValid()) >@@ -4217,12 +4217,12 @@ Ref<MutableStyleProperties> ComputedStyleExtractor::copyProperties() > return copyPropertiesInSet(computedProperties, numComputedProperties); > } > >-RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand& shorthand) >+Ref<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand& shorthand) > { > auto list = CSSValueList::createSpaceSeparated(); > for (size_t i = 0; i < shorthand.length(); ++i) > list->append(propertyValue(shorthand.properties()[i], DoNotUpdateLayout).releaseNonNull()); >- return WTFMove(list); >+ return list; > } > > RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand& shorthand) >@@ -4254,12 +4254,12 @@ RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForSidesShortha > return WTFMove(list); > } > >-RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand& shorthand) >+Ref<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand& shorthand) > { > auto list = CSSValueList::createSlashSeparated(); > for (size_t i = 0; i < shorthand.length(); ++i) > list->append(propertyValue(shorthand.properties()[i], DoNotUpdateLayout).releaseNonNull()); >- return WTFMove(list); >+ return list; > } > > Ref<MutableStyleProperties> ComputedStyleExtractor::copyPropertiesInSet(const CSSPropertyID* set, unsigned length) >@@ -4354,8 +4354,8 @@ Ref<CSSValueList> ComputedStyleExtractor::getBackgroundShorthandValue() > static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyBackgroundSize, CSSPropertyBackgroundOrigin, CSSPropertyBackgroundClip }; > > auto list = CSSValueList::createSlashSeparated(); >- list->append(*getCSSPropertyValuesForShorthandProperties(StylePropertyShorthand(CSSPropertyBackground, propertiesBeforeSlashSeperator))); >- list->append(*getCSSPropertyValuesForShorthandProperties(StylePropertyShorthand(CSSPropertyBackground, propertiesAfterSlashSeperator))); >+ list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShorthand(CSSPropertyBackground, propertiesBeforeSlashSeperator))); >+ list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShorthand(CSSPropertyBackground, propertiesAfterSlashSeperator))); > return list; > } > >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.h b/Source/WebCore/css/CSSComputedStyleDeclaration.h >index bdf343272a6aa41b76e31d2a19ff711772367f73..afe204be16889ca71dc9545cb67149b76abe99ce 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.h >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.h >@@ -87,14 +87,14 @@ class ComputedStyleExtractor { > RenderElement* styledRenderer() const; > > RefPtr<CSSValue> svgPropertyValue(CSSPropertyID, EUpdateLayout); >- RefPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintType, const String& url, const Color&, const Color& currentColor) const; >+ Ref<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintType, const String& url, const Color&, const Color& currentColor) const; > static Ref<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle&, AdjustPixelValuesForComputedStyle = AdjustPixelValues); >- RefPtr<CSSPrimitiveValue> currentColorOrValidColor(const RenderStyle*, const Color&) const; >+ Ref<CSSPrimitiveValue> currentColorOrValidColor(const RenderStyle*, const Color&) const; > >- RefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&); >+ Ref<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&); > RefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&); > Ref<CSSValueList> getBackgroundShorthandValue(); >- RefPtr<CSSValueList> getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&); >+ Ref<CSSValueList> getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&); > > RefPtr<Element> m_element; > PseudoId m_pseudoElementSpecifier; >diff --git a/Source/WebCore/css/CSSFontFaceSource.cpp b/Source/WebCore/css/CSSFontFaceSource.cpp >index 33a8589e1761b0a81cd9c45465f59bed5b0e0ba9..09527f1b126c7cb5f2dddcbda421a285e05adf31 100644 >--- a/Source/WebCore/css/CSSFontFaceSource.cpp >+++ b/Source/WebCore/css/CSSFontFaceSource.cpp >@@ -170,9 +170,8 @@ void CSSFontFaceSource::load(CSSFontSelector* fontSelector) > if (m_immediateSource) { > ASSERT(!m_immediateFontCustomPlatformData); > bool wrapping; >- RefPtr<SharedBuffer> buffer = SharedBuffer::create(static_cast<const char*>(m_immediateSource->baseAddress()), m_immediateSource->byteLength()); >- ASSERT(buffer); >- m_immediateFontCustomPlatformData = CachedFont::createCustomFontData(*buffer, String(), wrapping); >+ auto buffer = SharedBuffer::create(static_cast<const char*>(m_immediateSource->baseAddress()), m_immediateSource->byteLength()); >+ m_immediateFontCustomPlatformData = CachedFont::createCustomFontData(buffer.get(), String(), wrapping); > success = static_cast<bool>(m_immediateFontCustomPlatformData); > } else { > // We are only interested in whether or not fontForFamily() returns null or not. Luckily, none of >diff --git a/Source/WebCore/css/CSSStyleSheet.cpp b/Source/WebCore/css/CSSStyleSheet.cpp >index 1ecc5ba3708792fa637f16b12cd73e11efb04a62..82b65f870848f16729b72ff28b3f57a2adfece8c 100644 >--- a/Source/WebCore/css/CSSStyleSheet.cpp >+++ b/Source/WebCore/css/CSSStyleSheet.cpp >@@ -259,11 +259,11 @@ RefPtr<CSSRuleList> CSSStyleSheet::rules() > if (!canAccessRules()) > return nullptr; > // IE behavior. >- RefPtr<StaticCSSRuleList> ruleList = StaticCSSRuleList::create(); >+ auto ruleList = StaticCSSRuleList::create(); > unsigned ruleCount = length(); > for (unsigned i = 0; i < ruleCount; ++i) > ruleList->rules().append(item(i)); >- return ruleList; >+ return WTFMove(ruleList); > } > > ExceptionOr<unsigned> CSSStyleSheet::insertRule(const String& ruleString, unsigned index) >diff --git a/Source/WebCore/css/FontFace.cpp b/Source/WebCore/css/FontFace.cpp >index a24a53626890a8a91d11738ca9a58a45371bb8b8..e349171287890b9874a704ab7b41bf69cda55afc 100644 >--- a/Source/WebCore/css/FontFace.cpp >+++ b/Source/WebCore/css/FontFace.cpp >@@ -373,7 +373,7 @@ String FontFace::unicodeRange() const > m_backing->updateStyleIfNeeded(); > if (!m_backing->ranges().size()) > return "U+0-10FFFF"_s; >- RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); >+ auto values = CSSValueList::createCommaSeparated(); > for (auto& range : m_backing->ranges()) > values->append(CSSUnicodeRangeValue::create(range.from, range.to)); > return values->cssText(); >@@ -390,7 +390,7 @@ String FontFace::featureSettings() const > m_backing->updateStyleIfNeeded(); > if (!m_backing->featureSettings().size()) > return "normal"_s; >- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); >+ auto list = CSSValueList::createCommaSeparated(); > for (auto& feature : m_backing->featureSettings()) > list->append(CSSFontFeatureValue::create(FontTag(feature.tag()), feature.value())); > return list->cssText(); >diff --git a/Source/WebCore/css/InspectorCSSOMWrappers.cpp b/Source/WebCore/css/InspectorCSSOMWrappers.cpp >index fdb8e3af79ac62b789560b83c37eb743c8fe612f..bdefec4a7fa7c40b369a0a3d2f0e3d36b7287748 100644 >--- a/Source/WebCore/css/InspectorCSSOMWrappers.cpp >+++ b/Source/WebCore/css/InspectorCSSOMWrappers.cpp >@@ -79,9 +79,9 @@ void InspectorCSSOMWrappers::collectFromStyleSheetContents(StyleSheetContents* s > { > if (!styleSheet) > return; >- RefPtr<CSSStyleSheet> styleSheetWrapper = CSSStyleSheet::create(*styleSheet); >- m_styleSheetCSSOMWrapperSet.add(styleSheetWrapper); >- collect(styleSheetWrapper.get()); >+ auto styleSheetWrapper = CSSStyleSheet::create(*styleSheet); >+ m_styleSheetCSSOMWrapperSet.add(styleSheetWrapper.copyRef()); >+ collect(styleSheetWrapper.ptr()); > } > > void InspectorCSSOMWrappers::collectFromStyleSheets(const Vector<RefPtr<CSSStyleSheet>>& sheets) >diff --git a/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp b/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp >index 331e8363fae87ab453fc1e7d5539e09806fb1352..b3e4b9a0c54fb9367e0467142259497cb2141d6c 100644 >--- a/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp >@@ -48,7 +48,7 @@ static RefPtr<CSSPrimitiveValue> glyphOrientationToCSSPrimitiveValue(GlyphOrient > RELEASE_ASSERT_NOT_REACHED(); > } > >-static RefPtr<CSSValue> strokeDashArrayToCSSValueList(const Vector<SVGLengthValue>& dashes) >+static Ref<CSSValue> strokeDashArrayToCSSValueList(const Vector<SVGLengthValue>& dashes) > { > if (dashes.isEmpty()) > return CSSPrimitiveValue::createIdentifier(CSSValueNone); >@@ -60,10 +60,10 @@ static RefPtr<CSSValue> strokeDashArrayToCSSValueList(const Vector<SVGLengthValu > return WTFMove(list); > } > >-RefPtr<CSSValue> ComputedStyleExtractor::adjustSVGPaintForCurrentColor(SVGPaintType paintType, const String& url, const Color& color, const Color& currentColor) const >+Ref<CSSValue> ComputedStyleExtractor::adjustSVGPaintForCurrentColor(SVGPaintType paintType, const String& url, const Color& color, const Color& currentColor) const > { > if (paintType >= SVGPaintType::URINone) { >- RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); >+ auto values = CSSValueList::createSpaceSeparated(); > values->append(CSSPrimitiveValue::create(url, CSSPrimitiveValue::UnitType::CSS_URI)); > if (paintType == SVGPaintType::URINone) > values->append(CSSPrimitiveValue::createIdentifier(CSSValueNone)); >@@ -71,7 +71,7 @@ RefPtr<CSSValue> ComputedStyleExtractor::adjustSVGPaintForCurrentColor(SVGPaintT > values->append(CSSPrimitiveValue::create(currentColor)); > else if (paintType == SVGPaintType::URIRGBColor) > values->append(CSSPrimitiveValue::create(color)); >- return values; >+ return WTFMove(values); > } > if (paintType == SVGPaintType::None) > return CSSPrimitiveValue::createIdentifier(CSSValueNone); >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index 74fa3f5398fe6fbe4246ce6c10d38d59f8e2b3a6..6a20360a546026a1cff8127ae8151eaf23300442 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -1980,8 +1980,8 @@ bool StyleResolver::createFilterOperations(const CSSValue& inValue, FilterOperat > String cssUrl = primitiveValue.stringValue(); > URL url = document().completeURL(cssUrl); > >- RefPtr<ReferenceFilterOperation> operation = ReferenceFilterOperation::create(cssUrl, url.fragmentIdentifier()); >- operations.operations().append(operation); >+ auto operation = ReferenceFilterOperation::create(cssUrl, url.fragmentIdentifier()); >+ operations.operations().append(WTFMove(operation)); > continue; > } > >diff --git a/Source/WebCore/css/StyleRule.cpp b/Source/WebCore/css/StyleRule.cpp >index 0dc1098f54f84bbf2ba7bba35971b68d5a9dbbec..1eefeb8bd10c254b824bc06cd5b8aef06602184f 100644 >--- a/Source/WebCore/css/StyleRule.cpp >+++ b/Source/WebCore/css/StyleRule.cpp >@@ -45,12 +45,12 @@ struct SameSizeAsStyleRuleBase : public WTF::RefCountedBase { > > COMPILE_ASSERT(sizeof(StyleRuleBase) == sizeof(SameSizeAsStyleRuleBase), StyleRuleBase_should_stay_small); > >-RefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet) const >+Ref<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet) const > { > return createCSSOMWrapper(parentSheet, nullptr); > } > >-RefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* parentRule) const >+Ref<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* parentRule) const > { > return createCSSOMWrapper(nullptr, parentRule); > } >@@ -131,7 +131,7 @@ Ref<StyleRuleBase> StyleRuleBase::copy() const > CRASH(); > } > >-RefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const >+Ref<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const > { > RefPtr<CSSRule> rule; > StyleRuleBase& self = const_cast<StyleRuleBase&>(*this); >@@ -169,11 +169,13 @@ RefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet, CS > case Charset: > case Keyframe: > ASSERT_NOT_REACHED(); >- return nullptr; >+ break; > } >+ ASSERT(rule); >+ > if (parentRule) > rule->setParentRule(parentRule); >- return rule; >+ return rule.releaseNonNull(); > } > > unsigned StyleRule::averageSizeInBytes() >diff --git a/Source/WebCore/css/StyleRule.h b/Source/WebCore/css/StyleRule.h >index 6807141feea71b076afa9a4a69a3cd26fc532288..718052313844032f75c9c6cd1e5aa93dbedd42af 100644 >--- a/Source/WebCore/css/StyleRule.h >+++ b/Source/WebCore/css/StyleRule.h >@@ -84,8 +84,8 @@ class StyleRuleBase : public WTF::RefCountedBase { > } > > // FIXME: There shouldn't be any need for the null parent version. >- RefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet = nullptr) const; >- RefPtr<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const; >+ Ref<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet = nullptr) const; >+ Ref<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const; > > protected: > StyleRuleBase(Type type, bool hasDocumentSecurityOrigin = false) >@@ -108,7 +108,7 @@ class StyleRuleBase : public WTF::RefCountedBase { > private: > WEBCORE_EXPORT void destroy(); > >- RefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const; >+ Ref<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const; > > unsigned m_type : 5; > // This is only needed to support getMatchedCSSRules. >diff --git a/Source/WebCore/dom/ChildListMutationScope.cpp b/Source/WebCore/dom/ChildListMutationScope.cpp >index 0fee84cd7eb26792e3df6d467e90a62f1fd0cc54..814d46b05a67c1599a2328c3832fe40af5b633ac 100644 >--- a/Source/WebCore/dom/ChildListMutationScope.cpp >+++ b/Source/WebCore/dom/ChildListMutationScope.cpp >@@ -60,7 +60,7 @@ ChildListMutationAccumulator::~ChildListMutationAccumulator() > accumulatorMap().remove(m_target.ptr()); > } > >-RefPtr<ChildListMutationAccumulator> ChildListMutationAccumulator::getOrCreate(ContainerNode& target) >+Ref<ChildListMutationAccumulator> ChildListMutationAccumulator::getOrCreate(ContainerNode& target) > { > AccumulatorMap::AddResult result = accumulatorMap().add(&target, nullptr); > RefPtr<ChildListMutationAccumulator> accumulator; >@@ -70,7 +70,8 @@ RefPtr<ChildListMutationAccumulator> ChildListMutationAccumulator::getOrCreate(C > accumulator = adoptRef(new ChildListMutationAccumulator(target, MutationObserverInterestGroup::createForChildListMutation(target))); > result.iterator->value = accumulator.get(); > } >- return accumulator; >+ ASSERT(accumulator); >+ return accumulator.releaseNonNull(); > } > > inline bool ChildListMutationAccumulator::isAddedNodeInOrder(Node& child) >diff --git a/Source/WebCore/dom/ChildListMutationScope.h b/Source/WebCore/dom/ChildListMutationScope.h >index 9b943716dbc84c93b26f2931bea83e7d113aea58..2966767768f0d714742e36bce5b61086977f91ff 100644 >--- a/Source/WebCore/dom/ChildListMutationScope.h >+++ b/Source/WebCore/dom/ChildListMutationScope.h >@@ -44,7 +44,7 @@ class MutationObserverInterestGroup; > // ChildListMutationAccumulator is not meant to be used directly; ChildListMutationScope is the public interface. > class ChildListMutationAccumulator : public RefCounted<ChildListMutationAccumulator> { > public: >- static RefPtr<ChildListMutationAccumulator> getOrCreate(ContainerNode&); >+ static Ref<ChildListMutationAccumulator> getOrCreate(ContainerNode&); > ~ChildListMutationAccumulator(); > > void childAdded(Node&); >diff --git a/Source/WebCore/dom/DocumentMarkerController.cpp b/Source/WebCore/dom/DocumentMarkerController.cpp >index d55c56f13693258b72dfcbda546bbc7c6f89a302..5b08630c3300b9a7902fa7bcbe22d6e1c2c66c14 100644 >--- a/Source/WebCore/dom/DocumentMarkerController.cpp >+++ b/Source/WebCore/dom/DocumentMarkerController.cpp >@@ -161,9 +161,7 @@ static void updateRenderedRectsForMarker(RenderedDocumentMarker& marker, Node& n > ASSERT(!node.document().view() || !node.document().view()->needsLayout()); > > // FIXME: We should refactor this so that we don't use Range (because we only have one Node), but still share code with absoluteTextQuads(). >- RefPtr<Range> markerRange = Range::create(node.document(), &node, marker.startOffset(), &node, marker.endOffset()); >- if (!markerRange) >- return; >+ auto markerRange = Range::create(node.document(), &node, marker.startOffset(), &node, marker.endOffset()); > Vector<FloatQuad> absoluteMarkerQuads; > markerRange->absoluteTextQuads(absoluteMarkerQuads, true); > >diff --git a/Source/WebCore/dom/InlineStyleSheetOwner.cpp b/Source/WebCore/dom/InlineStyleSheetOwner.cpp >index 109f724c583160a718cb5874d0eff84eaa4fffbd..a9d628c68d284b770355dc4e0a6d1c275400e737 100644 >--- a/Source/WebCore/dom/InlineStyleSheetOwner.cpp >+++ b/Source/WebCore/dom/InlineStyleSheetOwner.cpp >@@ -172,12 +172,12 @@ void InlineStyleSheetOwner::createSheet(Element& element, const String& text) > if (!contentSecurityPolicy.allowInlineStyle(document.url(), m_startTextPosition.m_line, text, hasKnownNonce)) > return; > >- RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(m_media, MediaQueryParserContext(document)); >+ auto mediaQueries = MediaQuerySet::create(m_media, MediaQueryParserContext(document)); > > MediaQueryEvaluator screenEval("screen"_s, true); > MediaQueryEvaluator printEval("print"_s, true); > LOG(MediaQueries, "InlineStyleSheetOwner::createSheet evaluating queries"); >- if (!screenEval.evaluate(*mediaQueries) && !printEval.evaluate(*mediaQueries)) >+ if (!screenEval.evaluate(mediaQueries.get()) && !printEval.evaluate(mediaQueries.get())) > return; > > if (m_styleScope) >@@ -188,7 +188,7 @@ void InlineStyleSheetOwner::createSheet(Element& element, const String& text) > if (auto* cachedSheet = inlineStyleSheetCache().get(*cacheKey)) { > ASSERT(cachedSheet->isCacheable()); > m_sheet = CSSStyleSheet::createInline(*cachedSheet, element, m_startTextPosition); >- m_sheet->setMediaQueries(mediaQueries.releaseNonNull()); >+ m_sheet->setMediaQueries(WTFMove(mediaQueries)); > if (!element.isInShadowTree()) > m_sheet->setTitle(element.title()); > >@@ -203,7 +203,7 @@ void InlineStyleSheetOwner::createSheet(Element& element, const String& text) > auto contents = StyleSheetContents::create(String(), parserContextForElement(element)); > > m_sheet = CSSStyleSheet::createInline(contents.get(), element, m_startTextPosition); >- m_sheet->setMediaQueries(mediaQueries.releaseNonNull()); >+ m_sheet->setMediaQueries(WTFMove(mediaQueries)); > if (!element.isInShadowTree()) > m_sheet->setTitle(element.title()); > >diff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h >index cf09143128c9e2b1392ea9fc97dc8e005dab4ffa..df2ae8bbd81932bc46c366c07cde7b8098fd2a8f 100644 >--- a/Source/WebCore/dom/PointerEvent.h >+++ b/Source/WebCore/dom/PointerEvent.h >@@ -49,7 +49,7 @@ class PointerEvent final : public MouseEvent { > bool isPrimary { false }; > }; > >- static RefPtr<PointerEvent> create(const AtomicString& type, Init&& initializer) >+ static Ref<PointerEvent> create(const AtomicString& type, Init&& initializer) > { > return adoptRef(*new PointerEvent(type, WTFMove(initializer))); > } >diff --git a/Source/WebCore/dom/UserGestureIndicator.h b/Source/WebCore/dom/UserGestureIndicator.h >index cf8e393b863f7e4993cd20a23f9ae8552539e7ca..0de8469052b5cb310a9a26edd43e838b053132ad 100644 >--- a/Source/WebCore/dom/UserGestureIndicator.h >+++ b/Source/WebCore/dom/UserGestureIndicator.h >@@ -46,9 +46,9 @@ enum class UserGestureType { EscapeKey, Other }; > > class UserGestureToken : public RefCounted<UserGestureToken> { > public: >- static RefPtr<UserGestureToken> create(ProcessingUserGestureState state, UserGestureType gestureType) >+ static Ref<UserGestureToken> create(ProcessingUserGestureState state, UserGestureType gestureType) > { >- return adoptRef(new UserGestureToken(state, gestureType)); >+ return adoptRef(*new UserGestureToken(state, gestureType)); > } > > WEBCORE_EXPORT ~UserGestureToken(); >diff --git a/Source/WebCore/editing/AlternativeTextController.cpp b/Source/WebCore/editing/AlternativeTextController.cpp >index 582be0de5932c5cbe49c51f0c81b8dc980717d1e..98abc736d7506843f321c0d6c424909c807ca85f 100644 >--- a/Source/WebCore/editing/AlternativeTextController.cpp >+++ b/Source/WebCore/editing/AlternativeTextController.cpp >@@ -200,7 +200,7 @@ void AlternativeTextController::applyAlternativeTextToRange(const Range& range, > // relative to the start position of the containing paragraph. We use correctionStartOffsetInParagraph > // to store this value. In order to obtain this offset, we need to first create a range > // which spans from the start of paragraph to the start position of rangeWithAlternative. >- RefPtr<Range> correctionStartOffsetInParagraphAsRange = Range::create(paragraphRangeContainingCorrection->startContainer().document(), paragraphRangeContainingCorrection->startPosition(), paragraphRangeContainingCorrection->startPosition()); >+ Ref<Range> correctionStartOffsetInParagraphAsRange = Range::create(paragraphRangeContainingCorrection->startContainer().document(), paragraphRangeContainingCorrection->startPosition(), paragraphRangeContainingCorrection->startPosition()); > > Position startPositionOfRangeWithAlternative = range.startPosition(); > if (!startPositionOfRangeWithAlternative.containerNode()) >@@ -210,7 +210,7 @@ void AlternativeTextController::applyAlternativeTextToRange(const Range& range, > return; > > // Take note of the location of autocorrection so that we can add marker after the replacement took place. >- int correctionStartOffsetInParagraph = TextIterator::rangeLength(correctionStartOffsetInParagraphAsRange.get()); >+ int correctionStartOffsetInParagraph = TextIterator::rangeLength(correctionStartOffsetInParagraphAsRange.ptr()); > > // Clone the range, since the caller of this method may want to keep the original range around. > auto rangeWithAlternative = range.cloneRange(); >@@ -266,12 +266,12 @@ void AlternativeTextController::respondToUnappliedSpellCorrection(const VisibleS > Ref<Frame> protector(m_frame); > m_frame.document()->updateLayout(); > m_frame.selection().setSelection(selectionOfCorrected, FrameSelection::defaultSetSelectionOptions() | FrameSelection::SpellCorrectionTriggered); >- RefPtr<Range> range = Range::create(*m_frame.document(), m_frame.selection().selection().start(), m_frame.selection().selection().end()); >+ auto range = Range::create(*m_frame.document(), m_frame.selection().selection().start(), m_frame.selection().selection().end()); > > DocumentMarkerController& markers = m_frame.document()->markers(); >- markers.removeMarkers(range.get(), OptionSet<DocumentMarker::MarkerType> { DocumentMarker::Spelling, DocumentMarker::Autocorrected }, DocumentMarkerController::RemovePartiallyOverlappingMarker); >- markers.addMarker(range.get(), DocumentMarker::Replacement); >- markers.addMarker(range.get(), DocumentMarker::SpellCheckingExemption); >+ markers.removeMarkers(range.ptr(), OptionSet<DocumentMarker::MarkerType> { DocumentMarker::Spelling, DocumentMarker::Autocorrected }, DocumentMarkerController::RemovePartiallyOverlappingMarker); >+ markers.addMarker(range.ptr(), DocumentMarker::Replacement); >+ markers.addMarker(range.ptr(), DocumentMarker::SpellCheckingExemption); > } > > void AlternativeTextController::timerFired() >@@ -443,12 +443,10 @@ void AlternativeTextController::respondToUnappliedEditing(EditCommandComposition > { > if (!command->wasCreateLinkCommand()) > return; >- RefPtr<Range> range = Range::create(*m_frame.document(), command->startingSelection().start(), command->startingSelection().end()); >- if (!range) >- return; >+ auto range = Range::create(*m_frame.document(), command->startingSelection().start(), command->startingSelection().end()); > DocumentMarkerController& markers = m_frame.document()->markers(); >- markers.addMarker(range.get(), DocumentMarker::Replacement); >- markers.addMarker(range.get(), DocumentMarker::SpellCheckingExemption); >+ markers.addMarker(range.ptr(), DocumentMarker::Replacement); >+ markers.addMarker(range.ptr(), DocumentMarker::SpellCheckingExemption); > } > > AlternativeTextClient* AlternativeTextController::alternativeTextClient() >@@ -526,15 +524,15 @@ void AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionA > if (endOfSelection == precedingCharacterPosition) > return; > >- RefPtr<Range> precedingCharacterRange = Range::create(*m_frame.document(), precedingCharacterPosition, endOfSelection); >- String string = plainText(precedingCharacterRange.get()); >+ auto precedingCharacterRange = Range::create(*m_frame.document(), precedingCharacterPosition, endOfSelection); >+ String string = plainText(precedingCharacterRange.ptr()); > if (string.isEmpty() || !deprecatedIsEditingWhitespace(string[string.length() - 1])) > return; > > // Mark this whitespace to indicate we have deleted an autocorrection following this > // whitespace. So if the user types the same original word again at this position, we > // won't autocorrect it again. >- m_frame.document()->markers().addMarker(precedingCharacterRange.get(), DocumentMarker::DeletedAutocorrection, m_originalStringForLastDeletedAutocorrection); >+ m_frame.document()->markers().addMarker(precedingCharacterRange.ptr(), DocumentMarker::DeletedAutocorrection, m_originalStringForLastDeletedAutocorrection); > } > > bool AlternativeTextController::processMarkersOnTextToBeReplacedByResult(const TextCheckingResult& result, Range& rangeWithAlternative, const String& stringToBeReplaced) >@@ -575,21 +573,19 @@ bool AlternativeTextController::respondToMarkerAtEndOfWord(const DocumentMarker& > if (!shouldStartTimerFor(marker, endOfWordPosition.offsetInContainerNode())) > return false; > Node* node = endOfWordPosition.containerNode(); >- RefPtr<Range> wordRange = Range::create(*m_frame.document(), node, marker.startOffset(), node, marker.endOffset()); >- if (!wordRange) >- return false; >- String currentWord = plainText(wordRange.get()); >+ auto wordRange = Range::create(*m_frame.document(), node, marker.startOffset(), node, marker.endOffset()); >+ String currentWord = plainText(wordRange.ptr()); > if (!currentWord.length()) > return false; > m_originalText = currentWord; > switch (marker.type()) { > case DocumentMarker::Spelling: >- m_rangeWithAlternative = wordRange; >+ m_rangeWithAlternative = WTFMove(wordRange); > m_details = emptyString(); > startAlternativeTextUITimer(AlternativeTextTypeSpellingSuggestions); > break; > case DocumentMarker::Replacement: >- m_rangeWithAlternative = wordRange; >+ m_rangeWithAlternative = WTFMove(wordRange); > m_details = marker.description(); > startAlternativeTextUITimer(AlternativeTextTypeReversion); > break; >@@ -599,7 +595,7 @@ bool AlternativeTextController::respondToMarkerAtEndOfWord(const DocumentMarker& > auto& markerData = WTF::get<DocumentMarker::DictationData>(marker.data()); > if (currentWord != markerData.originalText) > return false; >- m_rangeWithAlternative = wordRange; >+ m_rangeWithAlternative = WTFMove(wordRange); > m_details = markerData.context; > startAlternativeTextUITimer(AlternativeTextTypeDictationAlternatives); > } >diff --git a/Source/WebCore/editing/ApplyStyleCommand.cpp b/Source/WebCore/editing/ApplyStyleCommand.cpp >index c3d814ad1d3fda6af869688bfc2ca1b79c95c6a3..7a3a1600fba937dad7426f74b6036971fc8ce267 100644 >--- a/Source/WebCore/editing/ApplyStyleCommand.cpp >+++ b/Source/WebCore/editing/ApplyStyleCommand.cpp >@@ -250,10 +250,10 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle& style) > if (!scope) > return; > >- RefPtr<Range> startRange = Range::create(document(), firstPositionInNode(scope), visibleStart.deepEquivalent().parentAnchoredEquivalent()); >- RefPtr<Range> endRange = Range::create(document(), firstPositionInNode(scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); >- int startIndex = TextIterator::rangeLength(startRange.get(), true); >- int endIndex = TextIterator::rangeLength(endRange.get(), true); >+ auto startRange = Range::create(document(), firstPositionInNode(scope), visibleStart.deepEquivalent().parentAnchoredEquivalent()); >+ auto endRange = Range::create(document(), firstPositionInNode(scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); >+ int startIndex = TextIterator::rangeLength(startRange.ptr(), true); >+ int endIndex = TextIterator::rangeLength(endRange.ptr(), true); > > VisiblePosition paragraphStart(startOfParagraph(visibleStart)); > VisiblePosition nextParagraphStart(endOfParagraph(paragraphStart).next()); >@@ -284,10 +284,12 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle& style) > nextParagraphStart = endOfParagraph(paragraphStart).next(); > } > >- startRange = TextIterator::rangeFromLocationAndLength(scope, startIndex, 0, true); >- endRange = TextIterator::rangeFromLocationAndLength(scope, endIndex, 0, true); >- if (startRange && endRange) >- updateStartEnd(startRange->startPosition(), endRange->startPosition()); >+ { >+ auto startRange = TextIterator::rangeFromLocationAndLength(scope, startIndex, 0, true); >+ auto endRange = TextIterator::rangeFromLocationAndLength(scope, endIndex, 0, true); >+ if (startRange && endRange) >+ updateStartEnd(startRange->startPosition(), endRange->startPosition()); >+ } > } > > static Ref<MutableStyleProperties> copyStyleOrCreateEmpty(const StyleProperties* style) >@@ -1051,9 +1053,9 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(EditingStyle& style, Node* > elementsToPushDown.append(*styledElement); > } > >- RefPtr<EditingStyle> styleToPushDown = EditingStyle::create(); >+ auto styleToPushDown = EditingStyle::create(); > if (is<HTMLElement>(*current)) >- removeInlineStyleFromElement(style, downcast<HTMLElement>(*current), RemoveIfNeeded, styleToPushDown.get()); >+ removeInlineStyleFromElement(style, downcast<HTMLElement>(*current), RemoveIfNeeded, styleToPushDown.ptr()); > > // The inner loop will go through children on each level > // FIXME: we should aggregate inline child elements together so that we don't wrap each child separately. >@@ -1072,7 +1074,7 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(EditingStyle& style, Node* > // Apply style to all nodes containing targetNode and their siblings but NOT to targetNode > // But if we've removed styledElement then always apply the style. > if (&child != targetNode || styledElement) >- applyInlineStyleToPushDown(child, styleToPushDown.get()); >+ applyInlineStyleToPushDown(child, styleToPushDown.ptr()); > > // We found the next node for the outer loop (contains targetNode) > // When reached targetNode, stop the outer loop upon the completion of the current inner loop >diff --git a/Source/WebCore/editing/CompositeEditCommand.cpp b/Source/WebCore/editing/CompositeEditCommand.cpp >index ac1f2710dc711844b1b3137a934264cb5c1db083..30b372fb54eae9b95df8ce7f645a4ce3eb34e226 100644 >--- a/Source/WebCore/editing/CompositeEditCommand.cpp >+++ b/Source/WebCore/editing/CompositeEditCommand.cpp >@@ -382,8 +382,7 @@ Vector<RefPtr<StaticRange>> CompositeEditCommand::targetRanges() const > if (!firstRange) > return { }; > >- RefPtr<StaticRange> range = StaticRange::createFromRange(*firstRange); >- return { 1, range }; >+ return { 1, StaticRange::createFromRange(*firstRange) }; > } > > Vector<RefPtr<StaticRange>> CompositeEditCommand::targetRangesForBindings() const >@@ -768,15 +767,15 @@ void CompositeEditCommand::replaceTextInNodePreservingMarkers(Text& node, unsign > DocumentMarkerController& markerController = document().markers(); > auto markers = copyMarkers(markerController.markersInRange(Range::create(document(), &node, offset, &node, offset + count), DocumentMarker::allMarkers())); > replaceTextInNode(node, offset, count, replacementText); >- RefPtr<Range> newRange = Range::create(document(), &node, offset, &node, offset + replacementText.length()); >+ auto newRange = Range::create(document(), &node, offset, &node, offset + replacementText.length()); > for (const auto& marker : markers) { > #if PLATFORM(IOS_FAMILY) > if (marker.isDictation()) { >- markerController.addMarker(newRange.get(), marker.type(), marker.description(), marker.alternatives(), marker.metadata()); >+ markerController.addMarker(newRange.ptr(), marker.type(), marker.description(), marker.alternatives(), marker.metadata()); > continue; > } > #endif >- markerController.addMarker(newRange.get(), marker.type(), marker.description()); >+ markerController.addMarker(newRange.ptr(), marker.type(), marker.description()); > } > } > >@@ -1414,14 +1413,14 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap > > startIndex = 0; > if (startInParagraph) { >- RefPtr<Range> startRange = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), visibleStart.deepEquivalent().parentAnchoredEquivalent()); >- startIndex = TextIterator::rangeLength(startRange.get(), true); >+ auto startRange = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), visibleStart.deepEquivalent().parentAnchoredEquivalent()); >+ startIndex = TextIterator::rangeLength(startRange.ptr(), true); > } > > endIndex = 0; > if (endInParagraph) { >- RefPtr<Range> endRange = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); >- endIndex = TextIterator::rangeLength(endRange.get(), true); >+ auto endRange = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); >+ endIndex = TextIterator::rangeLength(endRange.ptr(), true); > } > } > } >@@ -1437,14 +1436,14 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap > // start and end can't be used directly to create a Range; they are "editing positions" > Position startRangeCompliant = start.parentAnchoredEquivalent(); > Position endRangeCompliant = end.parentAnchoredEquivalent(); >- RefPtr<Range> range = Range::create(document(), startRangeCompliant.deprecatedNode(), startRangeCompliant.deprecatedEditingOffset(), endRangeCompliant.deprecatedNode(), endRangeCompliant.deprecatedEditingOffset()); >+ auto range = Range::create(document(), startRangeCompliant.deprecatedNode(), startRangeCompliant.deprecatedEditingOffset(), endRangeCompliant.deprecatedNode(), endRangeCompliant.deprecatedEditingOffset()); > > // FIXME: This is an inefficient way to preserve style on nodes in the paragraph to move. It > // shouldn't matter though, since moved paragraphs will usually be quite small. > RefPtr<DocumentFragment> fragment; > // This used to use a ternary for initialization, but that confused some versions of GCC, see bug 37912 > if (startOfParagraphToMove != endOfParagraphToMove) >- fragment = createFragmentFromMarkup(document(), serializePreservingVisualAppearance(*range, nullptr, AnnotateForInterchange::No, ConvertBlocksToInlines::Yes), emptyString()); >+ fragment = createFragmentFromMarkup(document(), serializePreservingVisualAppearance(range.get(), nullptr, AnnotateForInterchange::No, ConvertBlocksToInlines::Yes), emptyString()); > > // A non-empty paragraph's style is moved when we copy and move it. We don't move > // anything if we're given an empty paragraph, but an empty paragraph can have style >diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp >index 1bc9b40e6fe9ca797cbf67e76d6e6655eb0975a6..a6d1760c2b0cf94f982133e212de45c19ddf52af 100644 >--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp >+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp >@@ -693,9 +693,9 @@ void DeleteSelectionCommand::mergeParagraphs() > return; > } > >- RefPtr<Range> range = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), endOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent()); >- RefPtr<Range> rangeToBeReplaced = Range::create(document(), mergeDestination.deepEquivalent().parentAnchoredEquivalent(), mergeDestination.deepEquivalent().parentAnchoredEquivalent()); >- if (!frame().editor().client()->shouldMoveRangeAfterDelete(range.get(), rangeToBeReplaced.get())) >+ auto range = Range::create(document(), startOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent(), endOfParagraphToMove.deepEquivalent().parentAnchoredEquivalent()); >+ auto rangeToBeReplaced = Range::create(document(), mergeDestination.deepEquivalent().parentAnchoredEquivalent(), mergeDestination.deepEquivalent().parentAnchoredEquivalent()); >+ if (!frame().editor().client()->shouldMoveRangeAfterDelete(range.ptr(), rangeToBeReplaced.ptr())) > return; > > // moveParagraphs will insert placeholders if it removes blocks that would require their use, don't let block >diff --git a/Source/WebCore/editing/Editing.cpp b/Source/WebCore/editing/Editing.cpp >index cca4ede1ba44c233a6381877eaca5815874eee5c..86d021d18a47913eea0b76648ef9ff9cf042d5d2 100644 >--- a/Source/WebCore/editing/Editing.cpp >+++ b/Source/WebCore/editing/Editing.cpp >@@ -1117,9 +1117,9 @@ VisiblePosition visiblePositionForIndexUsingCharacterIterator(Node& node, int in > if (index <= 0) > return { firstPositionInOrBeforeNode(&node), DOWNSTREAM }; > >- RefPtr<Range> range = Range::create(node.document()); >+ auto range = Range::create(node.document()); > range->selectNodeContents(node); >- CharacterIterator it(*range); >+ CharacterIterator it(range.get()); > it.advance(index - 1); > return { it.atEnd() ? range->endPosition() : it.range()->endPosition(), UPSTREAM }; > } >diff --git a/Source/WebCore/editing/EditingStyle.cpp b/Source/WebCore/editing/EditingStyle.cpp >index 64216c986064b67ee3995e001389d1c8adb4738a..b38c1509ee979be9e40fe3bad290d4742660006c 100644 >--- a/Source/WebCore/editing/EditingStyle.cpp >+++ b/Source/WebCore/editing/EditingStyle.cpp >@@ -714,7 +714,7 @@ void EditingStyle::removeStyleConflictingWithStyleOfNode(Node& node) > return; > > RefPtr<MutableStyleProperties> parentStyle = copyPropertiesFromComputedStyle(node.parentNode(), EditingPropertiesInEffect); >- RefPtr<EditingStyle> nodeStyle = EditingStyle::create(&node, EditingPropertiesInEffect); >+ auto nodeStyle = EditingStyle::create(&node, EditingPropertiesInEffect); > nodeStyle->removeEquivalentProperties(*parentStyle); > > MutableStyleProperties* style = nodeStyle->style(); >@@ -828,8 +828,8 @@ bool EditingStyle::conflictsWithInlineStyleOfElement(StyledElement& element, Ref > bool shouldRemoveStrikeThrough = strikeThroughChange() == TextDecorationChange::Remove; > if (shouldRemoveUnderline || shouldRemoveStrikeThrough) { > if (RefPtr<CSSValueList> valueList = textDecorationValueList(*inlineStyle)) { >- RefPtr<CSSValueList> newValueList = valueList->copy(); >- RefPtr<CSSValueList> extractedValueList = CSSValueList::createSpaceSeparated(); >+ auto newValueList = valueList->copy(); >+ auto extractedValueList = CSSValueList::createSpaceSeparated(); > > Ref<CSSPrimitiveValue> underline = CSSValuePool::singleton().createIdentifierValue(CSSValueUnderline); > if (shouldRemoveUnderline && valueList->hasValue(underline.ptr())) { >@@ -850,7 +850,7 @@ bool EditingStyle::conflictsWithInlineStyleOfElement(StyledElement& element, Ref > if (extractedValueList->length()) { > conflicts = true; > if (newValueList->length()) >- newInlineStyle->setProperty(CSSPropertyTextDecoration, newValueList); >+ newInlineStyle->setProperty(CSSPropertyTextDecoration, WTFMove(newValueList)); > else > newInlineStyle->removeProperty(CSSPropertyTextDecoration); > >@@ -1071,7 +1071,7 @@ void EditingStyle::prepareToApplyAt(const Position& position, ShouldPreserveWrit > // ReplaceSelectionCommand::handleStyleSpans() requires that this function only removes the editing style. > // If this function was modified in the future to delete all redundant properties, then add a boolean value to indicate > // which one of editingStyleAtPosition or computedStyle is called. >- RefPtr<EditingStyle> editingStyleAtPosition = EditingStyle::create(position, EditingPropertiesInEffect); >+ auto editingStyleAtPosition = EditingStyle::create(position, EditingPropertiesInEffect); > StyleProperties* styleAtPosition = editingStyleAtPosition->m_mutableStyle.get(); > > RefPtr<CSSValue> unicodeBidi; >@@ -1158,7 +1158,7 @@ static RefPtr<MutableStyleProperties> extractEditingProperties(const StyleProper > > void EditingStyle::mergeInlineAndImplicitStyleOfElement(StyledElement& element, CSSPropertyOverrideMode mode, PropertiesToInclude propertiesToInclude) > { >- RefPtr<EditingStyle> styleFromRules = EditingStyle::create(); >+ auto styleFromRules = EditingStyle::create(); > styleFromRules->mergeStyleFromRulesForSerialization(element); > > if (element.inlineStyle()) >@@ -1288,7 +1288,7 @@ void EditingStyle::mergeStyleFromRulesForSerialization(StyledElement& element) > // The property value, if it's a percentage, may not reflect the actual computed value. > // For example: style="height: 1%; overflow: visible;" in quirksmode > // FIXME: There are others like this, see <rdar://problem/5195123> Slashdot copy/paste fidelity problem >- RefPtr<MutableStyleProperties> fromComputedStyle = MutableStyleProperties::create(); >+ auto fromComputedStyle = MutableStyleProperties::create(); > ComputedStyleExtractor computedStyle(&element); > > { >@@ -1304,7 +1304,7 @@ void EditingStyle::mergeStyleFromRulesForSerialization(StyledElement& element) > } > } > } >- m_mutableStyle->mergeAndOverrideOnConflict(*fromComputedStyle); >+ m_mutableStyle->mergeAndOverrideOnConflict(fromComputedStyle.get()); > } > > static void removePropertiesInStyle(MutableStyleProperties* styleToRemovePropertiesFrom, MutableStyleProperties* style) >@@ -1328,7 +1328,7 @@ void EditingStyle::removeStyleFromRulesAndContext(StyledElement& element, Node* > m_mutableStyle = getPropertiesNotIn(*m_mutableStyle, *styleFromMatchedRules); > > // 2. Remove style present in context and not overridden by matched rules. >- RefPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingPropertiesInEffect); >+ auto computedStyle = EditingStyle::create(context, EditingPropertiesInEffect); > if (computedStyle->m_mutableStyle) { > if (!computedStyle->m_mutableStyle->getPropertyCSSValue(CSSPropertyBackgroundColor)) > computedStyle->m_mutableStyle->setProperty(CSSPropertyBackgroundColor, CSSValueTransparent); >@@ -1802,7 +1802,7 @@ static bool fontWeightIsBold(T& style) > template<typename T> > static Ref<MutableStyleProperties> extractPropertiesNotIn(StyleProperties& styleWithRedundantProperties, T& baseStyle) > { >- RefPtr<EditingStyle> result = EditingStyle::create(&styleWithRedundantProperties); >+ auto result = EditingStyle::create(&styleWithRedundantProperties); > result->removeEquivalentProperties(baseStyle); > ASSERT(result->style()); > Ref<MutableStyleProperties> mutableStyle = *result->style(); >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index e5ae71336fb1fadf1f7e69e8becdfc3c97d8b3d3..59a4b81aa1717613a2a467758bfb90e5120fbd48 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -1795,9 +1795,9 @@ void Editor::setBaseWritingDirection(WritingDirection direction) > return; > } > >- RefPtr<MutableStyleProperties> style = MutableStyleProperties::create(); >+ auto style = MutableStyleProperties::create(); > style->setProperty(CSSPropertyDirection, direction == WritingDirection::LeftToRight ? "ltr" : direction == WritingDirection::RightToLeft ? "rtl" : "inherit", false); >- applyParagraphStyleToSelection(style.get(), EditAction::SetWritingDirection); >+ applyParagraphStyleToSelection(style.ptr(), EditAction::SetWritingDirection); > } > > WritingDirection Editor::baseWritingDirectionForSelectionStart() const >@@ -2023,8 +2023,8 @@ void Editor::setComposition(const String& text, const Vector<CompositionUnderlin > > unsigned start = std::min(baseOffset + selectionStart, extentOffset); > unsigned end = std::min(std::max(start, baseOffset + selectionEnd), extentOffset); >- RefPtr<Range> selectedRange = Range::create(baseNode->document(), baseNode, start, baseNode, end); >- m_frame.selection().setSelectedRange(selectedRange.get(), DOWNSTREAM, FrameSelection::ShouldCloseTyping::No); >+ auto selectedRange = Range::create(baseNode->document(), baseNode, start, baseNode, end); >+ m_frame.selection().setSelectedRange(selectedRange.ptr(), DOWNSTREAM, FrameSelection::ShouldCloseTyping::No); > } > } > >diff --git a/Source/WebCore/editing/EditorCommand.cpp b/Source/WebCore/editing/EditorCommand.cpp >index 56ca5bf0a7f89340ec7b242f015b0e578cc39d57..9fdac1d6119538ace3d4bf8c0ee3179f47c8bd31 100644 >--- a/Source/WebCore/editing/EditorCommand.cpp >+++ b/Source/WebCore/editing/EditorCommand.cpp >@@ -142,16 +142,16 @@ static bool executeToggleStyle(Frame& frame, EditorCommandSource source, EditAct > > static bool executeApplyParagraphStyle(Frame& frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, const String& propertyValue) > { >- RefPtr<MutableStyleProperties> style = MutableStyleProperties::create(); >+ auto style = MutableStyleProperties::create(); > style->setProperty(propertyID, propertyValue); > // FIXME: We don't call shouldApplyStyle when the source is DOM; is there a good reason for that? > switch (source) { > case CommandFromMenuOrKeyBinding: >- frame.editor().applyParagraphStyleToSelection(style.get(), action); >+ frame.editor().applyParagraphStyleToSelection(style.ptr(), action); > return true; > case CommandFromDOM: > case CommandFromDOMWithUserInterface: >- frame.editor().applyParagraphStyle(style.get()); >+ frame.editor().applyParagraphStyle(style.ptr()); > return true; > } > ASSERT_NOT_REACHED(); >@@ -582,27 +582,27 @@ static bool executeJustifyRight(Frame& frame, Event*, EditorCommandSource source > > static bool executeMakeTextWritingDirectionLeftToRight(Frame& frame, Event*, EditorCommandSource, const String&) > { >- RefPtr<MutableStyleProperties> style = MutableStyleProperties::create(); >+ auto style = MutableStyleProperties::create(); > style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed); > style->setProperty(CSSPropertyDirection, CSSValueLtr); >- frame.editor().applyStyle(style.get(), EditAction::SetWritingDirection); >+ frame.editor().applyStyle(style.ptr(), EditAction::SetWritingDirection); > return true; > } > > static bool executeMakeTextWritingDirectionNatural(Frame& frame, Event*, EditorCommandSource, const String&) > { >- RefPtr<MutableStyleProperties> style = MutableStyleProperties::create(); >+ auto style = MutableStyleProperties::create(); > style->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal); >- frame.editor().applyStyle(style.get(), EditAction::SetWritingDirection); >+ frame.editor().applyStyle(style.ptr(), EditAction::SetWritingDirection); > return true; > } > > static bool executeMakeTextWritingDirectionRightToLeft(Frame& frame, Event*, EditorCommandSource, const String&) > { >- RefPtr<MutableStyleProperties> style = MutableStyleProperties::create(); >+ auto style = MutableStyleProperties::create(); > style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed); > style->setProperty(CSSPropertyDirection, CSSValueRtl); >- frame.editor().applyStyle(style.get(), EditAction::SetWritingDirection); >+ frame.editor().applyStyle(style.ptr(), EditAction::SetWritingDirection); > return true; > } > >diff --git a/Source/WebCore/editing/FormatBlockCommand.cpp b/Source/WebCore/editing/FormatBlockCommand.cpp >index 6f53208fe6c2148a025637b610eb32adc6f01872..e436c7fde21dbb2034b59c5b95289fa3cfed70a9 100644 >--- a/Source/WebCore/editing/FormatBlockCommand.cpp >+++ b/Source/WebCore/editing/FormatBlockCommand.cpp >@@ -68,14 +68,14 @@ void FormatBlockCommand::formatRange(const Position& start, const Position& end, > RefPtr<Node> outerBlock = (start.deprecatedNode() == nodeToSplitTo) ? start.deprecatedNode() : splitTreeToNode(*start.deprecatedNode(), *nodeToSplitTo); > RefPtr<Node> nodeAfterInsertionPosition = outerBlock; > >- RefPtr<Range> range = Range::create(document(), start, endOfSelection); >+ auto range = Range::create(document(), start, endOfSelection); > Element* refNode = enclosingBlockFlowElement(end); > Element* root = editableRootForPosition(start); > // Root is null for elements with contenteditable=false. > if (!root || !refNode) > return; > if (isElementForFormatBlock(refNode->tagQName()) && start == startOfBlock(start) >- && (end == endOfBlock(end) || isNodeVisiblyContainedWithin(*refNode, *range)) >+ && (end == endOfBlock(end) || isNodeVisiblyContainedWithin(*refNode, range.get())) > && refNode != root && !root->isDescendantOf(*refNode)) { > // Already in a block element that only contains the current paragraph > if (refNode->hasTagName(tagName())) >diff --git a/Source/WebCore/editing/RemoveFormatCommand.cpp b/Source/WebCore/editing/RemoveFormatCommand.cpp >index c19b774ad6b303b3950c6a1157405f948baccac2..4ec0b4e55c3eaf6408f2505996ca1dcdaa5f2353 100644 >--- a/Source/WebCore/editing/RemoveFormatCommand.cpp >+++ b/Source/WebCore/editing/RemoveFormatCommand.cpp >@@ -83,13 +83,13 @@ void RemoveFormatCommand::doApply() > // Get the default style for this editable root, it's the style that we'll give the > // content that we're operating on. > Node* root = endingSelection().rootEditableElement(); >- RefPtr<EditingStyle> defaultStyle = EditingStyle::create(root); >+ auto defaultStyle = EditingStyle::create(root); > > // We want to remove everything but transparent background. > // FIXME: We shouldn't access style(). > defaultStyle->style()->setProperty(CSSPropertyBackgroundColor, CSSValueTransparent); > >- applyCommandToComposite(ApplyStyleCommand::create(document(), defaultStyle.get(), isElementForRemoveFormatCommand, editingAction())); >+ applyCommandToComposite(ApplyStyleCommand::create(document(), defaultStyle.ptr(), isElementForRemoveFormatCommand, editingAction())); > } > > } >diff --git a/Source/WebCore/editing/ReplaceRangeWithTextCommand.cpp b/Source/WebCore/editing/ReplaceRangeWithTextCommand.cpp >index 502bc04d353b283e1892ede248c8be0665df7091..041f9d117d6a01eb2c585a8b214d33dce8d8800f 100644 >--- a/Source/WebCore/editing/ReplaceRangeWithTextCommand.cpp >+++ b/Source/WebCore/editing/ReplaceRangeWithTextCommand.cpp >@@ -89,8 +89,7 @@ RefPtr<DataTransfer> ReplaceRangeWithTextCommand::inputEventDataTransfer() const > > Vector<RefPtr<StaticRange>> ReplaceRangeWithTextCommand::targetRanges() const > { >- RefPtr<StaticRange> range = StaticRange::createFromRange(*m_rangeToBeReplaced); >- return { 1, range }; >+ return { 1, StaticRange::createFromRange(*m_rangeToBeReplaced) }; > } > > } // namespace WebCore >diff --git a/Source/WebCore/editing/ReplaceSelectionCommand.cpp b/Source/WebCore/editing/ReplaceSelectionCommand.cpp >index 4804e90a8e229cb984d6f4c7651c2f918b5ec565..f8239d2aa71ffc1f715176ea0f5366a260d97fcd 100644 >--- a/Source/WebCore/editing/ReplaceSelectionCommand.cpp >+++ b/Source/WebCore/editing/ReplaceSelectionCommand.cpp >@@ -496,7 +496,7 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert > StyledElement* element = downcast<StyledElement>(node.get()); > > const StyleProperties* inlineStyle = element->inlineStyle(); >- RefPtr<EditingStyle> newInlineStyle = EditingStyle::create(inlineStyle); >+ auto newInlineStyle = EditingStyle::create(inlineStyle); > if (inlineStyle) { > if (is<HTMLElement>(*element)) { > Vector<QualifiedName> attributes; >@@ -766,7 +766,7 @@ static bool handleStyleSpansBeforeInsertion(ReplacementFragment& fragment, const > return false; > > Node* wrappingStyleSpan = topNode; >- RefPtr<EditingStyle> styleAtInsertionPos = EditingStyle::create(insertionPos.parentAnchoredEquivalent()); >+ auto styleAtInsertionPos = EditingStyle::create(insertionPos.parentAnchoredEquivalent()); > String styleText = styleAtInsertionPos->style()->asText(); > > // FIXME: This string comparison is a naive way of comparing two styles. >@@ -804,7 +804,7 @@ void ReplaceSelectionCommand::handleStyleSpans(InsertedNodes& insertedNodes) > if (!wrappingStyleSpan) > return; > >- RefPtr<EditingStyle> style = EditingStyle::create(wrappingStyleSpan->inlineStyle()); >+ auto style = EditingStyle::create(wrappingStyleSpan->inlineStyle()); > ContainerNode* context = wrappingStyleSpan->parentNode(); > > // If Mail wraps the fragment with a Paste as Quotation blockquote, or if you're pasting into a quoted region, >diff --git a/Source/WebCore/editing/SpellingCorrectionCommand.cpp b/Source/WebCore/editing/SpellingCorrectionCommand.cpp >index c109db04b7e70d80f1a48f858df4dbc36af3783b..7db3f9b45d8b3f7676e30f97e076a5ea9838237e 100644 >--- a/Source/WebCore/editing/SpellingCorrectionCommand.cpp >+++ b/Source/WebCore/editing/SpellingCorrectionCommand.cpp >@@ -124,8 +124,7 @@ String SpellingCorrectionCommand::inputEventData() const > > Vector<RefPtr<StaticRange>> SpellingCorrectionCommand::targetRanges() const > { >- RefPtr<StaticRange> range = StaticRange::createFromRange(m_rangeToBeCorrected); >- return { 1, range }; >+ return { 1, StaticRange::createFromRange(m_rangeToBeCorrected) }; > } > > RefPtr<DataTransfer> SpellingCorrectionCommand::inputEventDataTransfer() const >diff --git a/Source/WebCore/editing/TextCheckingHelper.cpp b/Source/WebCore/editing/TextCheckingHelper.cpp >index 00a257f07c6671b7683ab3e472f1a9f357ad773a..e89e870a56b70946c7ad7ebbc1ce95140c520e47 100644 >--- a/Source/WebCore/editing/TextCheckingHelper.cpp >+++ b/Source/WebCore/editing/TextCheckingHelper.cpp >@@ -337,8 +337,8 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b > if (inSameParagraph(paragraphRange->startPosition(), m_range->endPosition())) { > // Determine the character offset from the end of the original search range to the end of the paragraph, > // since we will want to ignore results in this area. >- RefPtr<Range> endOffsetAsRange = Range::create(paragraphRange->startContainer().document(), paragraphRange->startPosition(), m_range->endPosition()); >- currentEndOffset = TextIterator::rangeLength(endOffsetAsRange.get()); >+ auto endOffsetAsRange = Range::create(paragraphRange->startContainer().document(), paragraphRange->startPosition(), m_range->endPosition()); >+ currentEndOffset = TextIterator::rangeLength(endOffsetAsRange.ptr()); > lastIteration = true; > } > if (currentStartOffset < currentEndOffset) { >@@ -397,8 +397,8 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b > if (!misspelledWord.isEmpty() && (!checkGrammar || badGrammarPhrase.isEmpty() || spellingLocation <= grammarDetailLocation)) { > int spellingOffset = spellingLocation - currentStartOffset; > if (!firstIteration) { >- RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer().document(), m_range->startPosition(), paragraphRange->startPosition()); >- spellingOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get()); >+ auto paragraphOffsetAsRange = Range::create(paragraphRange->startContainer().document(), m_range->startPosition(), paragraphRange->startPosition()); >+ spellingOffset += TextIterator::rangeLength(paragraphOffsetAsRange.ptr()); > } > outIsSpelling = true; > outFirstFoundOffset = spellingOffset; >@@ -408,8 +408,8 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b > if (checkGrammar && !badGrammarPhrase.isEmpty()) { > int grammarPhraseOffset = grammarPhraseLocation - currentStartOffset; > if (!firstIteration) { >- RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer().document(), m_range->startPosition(), paragraphRange->startPosition()); >- grammarPhraseOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get()); >+ auto paragraphOffsetAsRange = Range::create(paragraphRange->startContainer().document(), m_range->startPosition(), paragraphRange->startPosition()); >+ grammarPhraseOffset += TextIterator::rangeLength(paragraphOffsetAsRange.ptr()); > } > outIsSpelling = false; > outFirstFoundOffset = grammarPhraseOffset; >diff --git a/Source/WebCore/editing/TypingCommand.cpp b/Source/WebCore/editing/TypingCommand.cpp >index 79b43ceb28367f885eab5edca98a22ce5a2a8d61..67063ee1562ae31f22025b358511fdf4d998a571 100644 >--- a/Source/WebCore/editing/TypingCommand.cpp >+++ b/Source/WebCore/editing/TypingCommand.cpp >@@ -265,8 +265,8 @@ void TypingCommand::insertText(Document& document, const String& text, const Vis > return; > } > >- RefPtr<TypingCommand> cmd = TypingCommand::create(document, InsertText, newText, options, compositionType); >- applyTextInsertionCommand(frame.get(), *cmd, selectionForInsertion, currentSelection); >+ auto cmd = TypingCommand::create(document, InsertText, newText, options, compositionType); >+ applyTextInsertionCommand(frame.get(), cmd.get(), selectionForInsertion, currentSelection); > } > > void TypingCommand::insertLineBreak(Document& document, Options options) >@@ -499,8 +499,7 @@ bool TypingCommand::willAddTypingToOpenCommand(ETypingCommand commandType, TextG > if (!range || isEditingTextAreaOrTextInput()) > return frame().editor().willApplyEditing(*this, CompositeEditCommand::targetRangesForBindings()); > >- RefPtr<StaticRange> staticRange = StaticRange::createFromRange(*range); >- return frame().editor().willApplyEditing(*this, { 1, staticRange }); >+ return frame().editor().willApplyEditing(*this, { 1, StaticRange::createFromRange(*range) }); > } > > void TypingCommand::typingAddedToOpenCommand(ETypingCommand commandTypeForAddedTyping) >diff --git a/Source/WebCore/editing/VisibleUnits.cpp b/Source/WebCore/editing/VisibleUnits.cpp >index 3950361bbad5914dddd32343ba788b3017479c41..7db72c8f07fc80141faece50d719c962cdfac470 100644 >--- a/Source/WebCore/editing/VisibleUnits.cpp >+++ b/Source/WebCore/editing/VisibleUnits.cpp >@@ -1893,10 +1893,10 @@ int distanceBetweenPositions(const VisiblePosition& vp, const VisiblePosition& o > bool thisIsStart = (vp < other); > > // Start must come first in the Range constructor. >- RefPtr<Range> range = Range::create(vp.deepEquivalent().deprecatedNode()->document(), >+ auto range = Range::create(vp.deepEquivalent().deprecatedNode()->document(), > (thisIsStart ? vp : other), > (thisIsStart ? other : vp)); >- int distance = TextIterator::rangeLength(range.get()); >+ int distance = TextIterator::rangeLength(range.ptr()); > > return (thisIsStart ? -distance : distance); > } >diff --git a/Source/WebCore/editing/cocoa/EditorCocoa.mm b/Source/WebCore/editing/cocoa/EditorCocoa.mm >index 5ccf44624096813e86927eb303932489ff029b91..5de716fa1ac4a9b69c85f0966ba293bfabb26bfc 100644 >--- a/Source/WebCore/editing/cocoa/EditorCocoa.mm >+++ b/Source/WebCore/editing/cocoa/EditorCocoa.mm >@@ -139,7 +139,7 @@ void Editor::writeSelection(PasteboardWriterData& pasteboardWriterData) > > RefPtr<SharedBuffer> Editor::selectionInWebArchiveFormat() > { >- RefPtr<LegacyWebArchive> archive = LegacyWebArchive::createFromSelection(&m_frame); >+ auto archive = LegacyWebArchive::createFromSelection(&m_frame); > if (!archive) > return nullptr; > return SharedBuffer::create(archive->rawDataRepresentation().get()); >diff --git a/Source/WebCore/editing/ios/DictationCommandIOS.cpp b/Source/WebCore/editing/ios/DictationCommandIOS.cpp >index 75f54a13104a34f38d1d684a37f2ea8963421d18..2c4b60d014331115cb912c70ed9fcc5b2534f3bd 100644 >--- a/Source/WebCore/editing/ios/DictationCommandIOS.cpp >+++ b/Source/WebCore/editing/ios/DictationCommandIOS.cpp >@@ -67,8 +67,8 @@ void DictationCommandIOS::doApply() > Element* root = afterResults.rootEditableElement(); > > // FIXME: Add the result marker using a Position cached before results are inserted, instead of relying on TextIterators. >- RefPtr<Range> rangeToEnd = Range::create(document(), createLegacyEditingPosition((Node *)root, 0), afterResults.deepEquivalent()); >- int endIndex = TextIterator::rangeLength(rangeToEnd.get(), true); >+ auto rangeToEnd = Range::create(document(), createLegacyEditingPosition((Node *)root, 0), afterResults.deepEquivalent()); >+ int endIndex = TextIterator::rangeLength(rangeToEnd.ptr(), true); > int startIndex = endIndex - resultLength; > > if (startIndex >= 0) { >diff --git a/Source/WebCore/editing/ios/EditorIOS.mm b/Source/WebCore/editing/ios/EditorIOS.mm >index f37fde7ff45dbb55a55602982eef2c89cc4e4c77..230f5e3b41732b1e6284509d1445587da3df2910 100644 >--- a/Source/WebCore/editing/ios/EditorIOS.mm >+++ b/Source/WebCore/editing/ios/EditorIOS.mm >@@ -83,7 +83,7 @@ void Editor::setTextAlignmentForChangedBaseWritingDirection(WritingDirection dir > // If the text has left or right alignment, flip left->right and right->left. > // Otherwise, do nothing. > >- RefPtr<EditingStyle> selectionStyle = EditingStyle::styleAtSelectionStart(m_frame.selection().selection()); >+ auto selectionStyle = EditingStyle::styleAtSelectionStart(m_frame.selection().selection()); > if (!selectionStyle || !selectionStyle->style()) > return; > >@@ -138,17 +138,17 @@ void Editor::setTextAlignmentForChangedBaseWritingDirection(WritingDirection dir > return; > } > >- RefPtr<MutableStyleProperties> style = MutableStyleProperties::create(); >+ auto style = MutableStyleProperties::create(); > style->setProperty(CSSPropertyTextAlign, newValue); >- applyParagraphStyle(style.get()); >+ applyParagraphStyle(style.ptr()); > } > > void Editor::removeUnchangeableStyles() > { > // This function removes styles that the user cannot modify by applying their default values. > >- RefPtr<EditingStyle> editingStyle = EditingStyle::create(m_frame.document()->bodyOrFrameset()); >- RefPtr<MutableStyleProperties> defaultStyle = editingStyle.get()->style()->mutableCopy(); >+ auto editingStyle = EditingStyle::create(m_frame.document()->bodyOrFrameset()); >+ auto defaultStyle = editingStyle->style()->mutableCopy(); > > // Text widgets implement background color via the UIView property. Their body element will not have one. > defaultStyle->setProperty(CSSPropertyBackgroundColor, "rgba(255, 255, 255, 0.0)"); >@@ -164,7 +164,7 @@ void Editor::removeUnchangeableStyles() > defaultStyle->removeProperty(CSSPropertyWebkitTextDecorationsInEffect); // implements underline > > // FIXME add EditAction::MatchStlye <rdar://problem/9156507> Undo rich text's paste & match style should say "Undo Match Style" >- applyStyleToSelection(defaultStyle.get(), EditAction::ChangeAttributes); >+ applyStyleToSelection(defaultStyle.ptr(), EditAction::ChangeAttributes); > } > > static void getImage(Element& imageElement, RefPtr<Image>& image, CachedImage*& cachedImage) >@@ -209,8 +209,8 @@ void Editor::writeImageToPasteboard(Pasteboard& pasteboard, Element& imageElemen > > Position beforeImagePosition(&imageElement, Position::PositionIsBeforeAnchor); > Position afterImagePosition(&imageElement, Position::PositionIsAfterAnchor); >- RefPtr<Range> imageRange = Range::create(imageElement.document(), beforeImagePosition, afterImagePosition); >- client()->getClientPasteboardDataForRange(imageRange.get(), pasteboardImage.clientTypes, pasteboardImage.clientData); >+ auto imageRange = Range::create(imageElement.document(), beforeImagePosition, afterImagePosition); >+ client()->getClientPasteboardDataForRange(imageRange.ptr(), pasteboardImage.clientTypes, pasteboardImage.clientData); > > pasteboard.write(pasteboardImage); > } >diff --git a/Source/WebCore/editing/mac/EditorMac.mm b/Source/WebCore/editing/mac/EditorMac.mm >index 4622f866bd2061185f32955ee7e79be1d692f25f..3fe6f4e7e452125b51fa1fc7d48061c2c46bb77d 100644 >--- a/Source/WebCore/editing/mac/EditorMac.mm >+++ b/Source/WebCore/editing/mac/EditorMac.mm >@@ -160,8 +160,8 @@ void Editor::replaceNodeFromPasteboard(Node* node, const String& pasteboardName) > return; > > Ref<Frame> protector(m_frame); >- RefPtr<Range> range = Range::create(node->document(), Position(node, Position::PositionIsBeforeAnchor), Position(node, Position::PositionIsAfterAnchor)); >- m_frame.selection().setSelection(VisibleSelection(*range), FrameSelection::DoNotSetFocus); >+ auto range = Range::create(node->document(), Position(node, Position::PositionIsBeforeAnchor), Position(node, Position::PositionIsAfterAnchor)); >+ m_frame.selection().setSelection(VisibleSelection(range.get()), FrameSelection::DoNotSetFocus); > > Pasteboard pasteboard(pasteboardName); > >@@ -176,9 +176,9 @@ void Editor::replaceNodeFromPasteboard(Node* node, const String& pasteboardName) > ALLOW_DEPRECATED_DECLARATIONS_END > > bool chosePlainText; >- if (RefPtr<DocumentFragment> fragment = webContentFromPasteboard(pasteboard, *range, true, chosePlainText)) { >+ if (RefPtr<DocumentFragment> fragment = webContentFromPasteboard(pasteboard, range.get(), true, chosePlainText)) { > maybeCopyNodeAttributesToFragment(*node, *fragment); >- if (shouldInsertFragment(*fragment, range.get(), EditorInsertAction::Pasted)) >+ if (shouldInsertFragment(*fragment, range.ptr(), EditorInsertAction::Pasted)) > pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(pasteboard), false, MailBlockquoteHandling::IgnoreBlockquote); > } > >@@ -187,7 +187,7 @@ void Editor::replaceNodeFromPasteboard(Node* node, const String& pasteboardName) > > RefPtr<SharedBuffer> Editor::imageInWebArchiveFormat(Element& imageElement) > { >- RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(imageElement); >+ auto archive = LegacyWebArchive::create(imageElement); > if (!archive) > return nullptr; > return SharedBuffer::create(archive->rawDataRepresentation().get()); >diff --git a/Source/WebCore/editing/markup.cpp b/Source/WebCore/editing/markup.cpp >index 795b12d0e63b015a9f559ac72f8b61aabda19834..b83dacd0c2b2863aa22b6df39354bcfaf3cefb06 100644 >--- a/Source/WebCore/editing/markup.cpp >+++ b/Source/WebCore/editing/markup.cpp >@@ -764,9 +764,9 @@ static RefPtr<EditingStyle> styleFromMatchedRulesAndInlineDecl(Node& node) > return nullptr; > > auto& element = downcast<HTMLElement>(node); >- RefPtr<EditingStyle> style = EditingStyle::create(element.inlineStyle()); >+ auto style = EditingStyle::create(element.inlineStyle()); > style->mergeStyleFromRules(element); >- return style; >+ return WTFMove(style); > } > > static bool isElementPresentational(const Node* node) >@@ -1211,8 +1211,8 @@ RefPtr<DocumentFragment> createFragmentForTransformToFragment(Document& outputDo > // Based on the documentation I can find, it looks like we want to start parsing the fragment in the InBody insertion mode. > // Unfortunately, that's an implementation detail of the parser. > // We achieve that effect here by passing in a fake body element as context for the fragment. >- RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(outputDoc); >- fragment->parseHTML(sourceString, fakeBody.get()); >+ auto fakeBody = HTMLBodyElement::create(outputDoc); >+ fragment->parseHTML(sourceString, fakeBody.ptr()); > } else if (sourceMIMEType == "text/plain") > fragment->parserAppendChild(Text::create(outputDoc, sourceString)); > else { >diff --git a/Source/WebCore/fileapi/FileReaderLoader.cpp b/Source/WebCore/fileapi/FileReaderLoader.cpp >index 043412902a40fe4171b7652d98b0a3e2e28d5157..897155a12291dc4e535234e088a8c42efa09b5a7 100644 >--- a/Source/WebCore/fileapi/FileReaderLoader.cpp >+++ b/Source/WebCore/fileapi/FileReaderLoader.cpp >@@ -217,9 +217,7 @@ void FileReaderLoader::didReceiveData(const char* data, int dataLength) > void FileReaderLoader::didFinishLoading(unsigned long) > { > if (m_variableLength && m_totalBytes > m_bytesLoaded) { >- RefPtr<ArrayBuffer> newData = m_rawData->slice(0, m_bytesLoaded); >- >- m_rawData = newData; >+ m_rawData = m_rawData->slice(0, m_bytesLoaded); > m_totalBytes = m_bytesLoaded; > } > cleanup(); >diff --git a/Source/WebCore/html/FTPDirectoryDocument.cpp b/Source/WebCore/html/FTPDirectoryDocument.cpp >index d7e2b75a453120b02d7c742d460f46a4dd59948e..d78110cc9edb9da004d41584ac49dbae0024e9f2 100644 >--- a/Source/WebCore/html/FTPDirectoryDocument.cpp >+++ b/Source/WebCore/html/FTPDirectoryDocument.cpp >@@ -281,7 +281,7 @@ void FTPDirectoryDocumentParser::parseAndAppendOneLine(const String& inputLine) > > static inline RefPtr<SharedBuffer> createTemplateDocumentData(const Settings& settings) > { >- RefPtr<SharedBuffer> buffer = SharedBuffer::createWithContentsOfFile(settings.ftpDirectoryTemplatePath()); >+ auto buffer = SharedBuffer::createWithContentsOfFile(settings.ftpDirectoryTemplatePath()); > if (buffer) > LOG(FTP, "Loaded FTPDirectoryTemplate of length %zu\n", buffer->size()); > return buffer; >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 0dcc88905063d2eb2709e62e34e95ea073b288a4..1810e725e18349ab366568ee1850cdbbbef99f68 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -1029,7 +1029,7 @@ void HTMLMediaElement::mediaPlayerActiveSourceBuffersChanged(const MediaPlayer*) > > void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) > { >- RefPtr<Event> event = Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::Yes); >+ auto event = Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::Yes); > > // Don't set the event target, the event queue will set it in GenericEventQueue::timerFired and setting it here > // will trigger an ASSERT if this element has been marked for deletion. >@@ -6445,7 +6445,7 @@ bool HTMLMediaElement::createMediaControls() > if (hasMediaControls()) > return true; > >- RefPtr<MediaControls> mediaControls = MediaControls::create(document()); >+ auto mediaControls = MediaControls::create(document()); > if (!mediaControls) > return false; > >diff --git a/Source/WebCore/html/HTMLTableElement.cpp b/Source/WebCore/html/HTMLTableElement.cpp >index ff96f4f2435b098e06662f33cc205e000b37916d..224807a2634f01e93349e77a93cf4501dafd1e3e 100644 >--- a/Source/WebCore/html/HTMLTableElement.cpp >+++ b/Source/WebCore/html/HTMLTableElement.cpp >@@ -473,9 +473,9 @@ HTMLTableElement::CellBorders HTMLTableElement::cellBorders() const > return NoBorders; > } > >-RefPtr<StyleProperties> HTMLTableElement::createSharedCellStyle() >+Ref<StyleProperties> HTMLTableElement::createSharedCellStyle() > { >- RefPtr<MutableStyleProperties> style = MutableStyleProperties::create(); >+ auto style = MutableStyleProperties::create(); > > auto& cssValuePool = CSSValuePool::singleton(); > switch (cellBorders()) { >@@ -511,7 +511,7 @@ RefPtr<StyleProperties> HTMLTableElement::createSharedCellStyle() > if (m_padding) > style->setProperty(CSSPropertyPadding, cssValuePool.createValue(m_padding, CSSPrimitiveValue::CSS_PX)); > >- return style; >+ return WTFMove(style); > } > > const StyleProperties* HTMLTableElement::additionalCellStyle() >diff --git a/Source/WebCore/html/HTMLTableElement.h b/Source/WebCore/html/HTMLTableElement.h >index 91035f27ca4d43430a8793aed97a1981a39913b0..a7b7f81ee4bcf071f8825e3bb674dc9521e93ca4 100644 >--- a/Source/WebCore/html/HTMLTableElement.h >+++ b/Source/WebCore/html/HTMLTableElement.h >@@ -86,7 +86,7 @@ class HTMLTableElement final : public HTMLElement { > > CellBorders cellBorders() const; > >- RefPtr<StyleProperties> createSharedCellStyle(); >+ Ref<StyleProperties> createSharedCellStyle(); > > HTMLTableSectionElement* lastBody() const; > >diff --git a/Source/WebCore/html/URLUtils.h b/Source/WebCore/html/URLUtils.h >index 656abfbda0bdbce393b88cc52344b9cd616e76e9..3a8d5413f93148e13f49f968550629f4c09c3404 100644 >--- a/Source/WebCore/html/URLUtils.h >+++ b/Source/WebCore/html/URLUtils.h >@@ -83,7 +83,7 @@ String URLUtils<T>::toJSON() const > template <typename T> > String URLUtils<T>::origin() const > { >- RefPtr<SecurityOrigin> origin = SecurityOrigin::create(href()); >+ auto origin = SecurityOrigin::create(href()); > return origin->toString(); > } > >diff --git a/Source/WebCore/html/parser/HTMLConstructionSite.cpp b/Source/WebCore/html/parser/HTMLConstructionSite.cpp >index aca51a77f03153392662f40c3d4e2579bddd04b2..e2b43dd5e3b1599fedf84045b2f281f06d031643 100644 >--- a/Source/WebCore/html/parser/HTMLConstructionSite.cpp >+++ b/Source/WebCore/html/parser/HTMLConstructionSite.cpp >@@ -672,7 +672,7 @@ RefPtr<Element> HTMLConstructionSite::createHTMLElementOrFindCustomElementInterf > // http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#create-an-element-for-the-token > Document& ownerDocument = ownerDocumentForCurrentNode(); > bool insideTemplateElement = !ownerDocument.frame(); >- RefPtr<Element> element = HTMLElementFactory::createKnownElement(localName, ownerDocument, insideTemplateElement ? nullptr : form(), true); >+ auto element = HTMLElementFactory::createKnownElement(localName, ownerDocument, insideTemplateElement ? nullptr : form(), true); > if (UNLIKELY(!element)) { > if (auto* elementInterface = findCustomElementInterface(ownerDocument, localName)) { > if (!m_isParsingFragment) { >diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.cpp b/Source/WebCore/html/shadow/TextControlInnerElements.cpp >index 08c6e50b58548dc87713e20c2084096642a13fa4..e1192aff70ae97b03e1b7c26c1c0541a02d246a8 100644 >--- a/Source/WebCore/html/shadow/TextControlInnerElements.cpp >+++ b/Source/WebCore/html/shadow/TextControlInnerElements.cpp >@@ -122,7 +122,7 @@ std::optional<ElementStyle> TextControlInnerElement::resolveCustomStyle(const Re > // Set "flex-basis: 1em". Note that CSSPrimitiveValue::computeLengthInt() only needs the element's > // style to calculate em lengths. Since the element might not be in a document, just pass nullptr > // for the root element style and the render view. >- RefPtr<CSSPrimitiveValue> emSize = CSSPrimitiveValue::create(1, CSSPrimitiveValue::CSS_EMS); >+ auto emSize = CSSPrimitiveValue::create(1, CSSPrimitiveValue::CSS_EMS); > int pixels = emSize->computeLength<int>(CSSToLengthConversionData { newStyle.get(), nullptr, nullptr, 1.0, false }); > newStyle->setFlexBasis(Length { pixels, Fixed }); > } >diff --git a/Source/WebCore/html/track/WebVTTParser.cpp b/Source/WebCore/html/track/WebVTTParser.cpp >index 11227a7ea443ab0dbf92cce11b2c3b617e2090d8..35c293292eb0193507670b890a426202d89e5f8e 100644 >--- a/Source/WebCore/html/track/WebVTTParser.cpp >+++ b/Source/WebCore/html/track/WebVTTParser.cpp >@@ -502,14 +502,14 @@ Ref<DocumentFragment> WebVTTParser::createDocumentFragmentFromCueText(Document& > > void WebVTTParser::createNewCue() > { >- RefPtr<WebVTTCueData> cue = WebVTTCueData::create(); >+ auto cue = WebVTTCueData::create(); > cue->setStartTime(m_currentStartTime); > cue->setEndTime(m_currentEndTime); > cue->setContent(m_currentContent.toString()); > cue->setId(m_currentId); > cue->setSettings(m_currentSettings); > >- m_cuelist.append(cue); >+ m_cuelist.append(WTFMove(cue)); > if (m_client) > m_client->newCuesParsed(); > } >diff --git a/Source/WebCore/inspector/DOMPatchSupport.cpp b/Source/WebCore/inspector/DOMPatchSupport.cpp >index 643fdd79a5fe182e3f3c91d2942be876c39390b3..c8dba0231eb15531e3907c9b596ec11c2227b026 100644 >--- a/Source/WebCore/inspector/DOMPatchSupport.cpp >+++ b/Source/WebCore/inspector/DOMPatchSupport.cpp >@@ -115,7 +115,7 @@ ExceptionOr<Node*> DOMPatchSupport::patchNode(Node& node, const String& markup) > > Node* previousSibling = node.previousSibling(); > // FIXME: This code should use one of createFragment* in markup.h >- RefPtr<DocumentFragment> fragment = DocumentFragment::create(m_document); >+ auto fragment = DocumentFragment::create(m_document); > if (m_document.isHTMLDocument()) > fragment->parseHTML(markup, node.parentElement() ? node.parentElement() : m_document.documentElement()); > else >@@ -143,7 +143,7 @@ ExceptionOr<Node*> DOMPatchSupport::patchNode(Node& node, const String& markup) > > if (innerPatchChildren(*parentNode, oldList, newList).hasException()) { > // Fall back to total replace. >- auto result = m_domEditor.replaceChild(*parentNode, *fragment, node); >+ auto result = m_domEditor.replaceChild(*parentNode, fragment.get(), node); > if (result.hasException()) > return result.releaseException(); > } >diff --git a/Source/WebCore/inspector/InspectorCanvas.cpp b/Source/WebCore/inspector/InspectorCanvas.cpp >index 1f38aa2004b2573488b160d739cfe9633efc6ec5..c0ec3f8b72585519573b2bc4ce0deaefe702a23f 100644 >--- a/Source/WebCore/inspector/InspectorCanvas.cpp >+++ b/Source/WebCore/inspector/InspectorCanvas.cpp >@@ -475,7 +475,7 @@ Ref<Inspector::Protocol::Recording::InitialState> InspectorCanvas::buildInitialS > if (is<CanvasRenderingContext2D>(m_context)) { > auto& context2d = downcast<CanvasRenderingContext2D>(m_context); > for (auto& state : context2d.stateStack()) { >- RefPtr<JSON::Object> statePayload = JSON::Object::create(); >+ auto statePayload = JSON::Object::create(); > > statePayload->setArray(stringIndexForKey("setTransform"_s), buildArrayForAffineTransform(state.transform)); > statePayload->setDouble(stringIndexForKey("globalAlpha"_s), context2d.globalAlpha()); >@@ -533,7 +533,7 @@ Ref<Inspector::Protocol::Recording::InitialState> InspectorCanvas::buildInitialS > else if (is<WebGLRenderingContextBase>(m_context)) { > WebGLRenderingContextBase& contextWebGLBase = downcast<WebGLRenderingContextBase>(m_context); > if (std::optional<WebGLContextAttributes> webGLContextAttributes = contextWebGLBase.getContextAttributes()) { >- RefPtr<JSON::Object> webGLContextAttributesPayload = JSON::Object::create(); >+ auto webGLContextAttributesPayload = JSON::Object::create(); > webGLContextAttributesPayload->setBoolean("alpha"_s, webGLContextAttributes->alpha); > webGLContextAttributesPayload->setBoolean("depth"_s, webGLContextAttributes->depth); > webGLContextAttributesPayload->setBoolean("stencil"_s, webGLContextAttributes->stencil); >@@ -643,8 +643,8 @@ Ref<JSON::ArrayOf<JSON::Value>> InspectorCanvas::buildAction(const String& name, > action->addItem(WTFMove(parametersData)); > action->addItem(WTFMove(swizzleTypes)); > >- RefPtr<ScriptCallStack> trace = Inspector::createScriptCallStack(JSExecState::currentState(), Inspector::ScriptCallStack::maxCallStackSizeToCapture); >- action->addItem(indexForData(WTFMove(trace))); >+ auto trace = Inspector::createScriptCallStack(JSExecState::currentState(), Inspector::ScriptCallStack::maxCallStackSizeToCapture); >+ action->addItem(indexForData(trace.ptr())); > > return action; > } >diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp >index 8e1c4829dff5beac1d6fc03209cebfd0c4505774..a0c3887a6efc2a051c3a353147d7136cf8ac8ab4 100644 >--- a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp >+++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp >@@ -230,7 +230,7 @@ void InspectorFrontendClientLocal::openInNewTab(const String& url) > FrameLoadRequest frameLoadRequest { *mainFrame.document(), mainFrame.document()->securityOrigin(), { }, "_blank"_s, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown }; > > bool created; >- RefPtr<Frame> frame = WebCore::createWindow(mainFrame, mainFrame, WTFMove(frameLoadRequest), { }, created); >+ auto frame = WebCore::createWindow(mainFrame, mainFrame, WTFMove(frameLoadRequest), { }, created); > if (!frame) > return; > >diff --git a/Source/WebCore/inspector/InspectorStyleSheet.cpp b/Source/WebCore/inspector/InspectorStyleSheet.cpp >index 3cdec85051ed0c314e7e42c49bfba085555377c7..9498e760bd9642a97d65e3e9c5a3340342119666 100644 >--- a/Source/WebCore/inspector/InspectorStyleSheet.cpp >+++ b/Source/WebCore/inspector/InspectorStyleSheet.cpp >@@ -440,7 +440,7 @@ static RefPtr<CSSRuleList> asCSSRuleList(CSSStyleSheet* styleSheet) > if (!styleSheet) > return nullptr; > >- RefPtr<StaticCSSRuleList> list = StaticCSSRuleList::create(); >+ auto list = StaticCSSRuleList::create(); > Vector<RefPtr<CSSRule>>& listRules = list->rules(); > for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) > listRules.append(styleSheet->item(i)); >@@ -636,7 +636,7 @@ Ref<Inspector::Protocol::CSS::CSSStyle> InspectorStyle::styleWithProperties() co > > auto status = it->disabled ? Inspector::Protocol::CSS::CSSPropertyStatus::Disabled : Inspector::Protocol::CSS::CSSPropertyStatus::Active; > >- RefPtr<Inspector::Protocol::CSS::CSSProperty> property = Inspector::Protocol::CSS::CSSProperty::create() >+ auto property = Inspector::Protocol::CSS::CSSProperty::create() > .setName(name.convertToASCIILowercase()) > .setValue(propertyEntry.value) > .release(); >@@ -696,11 +696,11 @@ Ref<Inspector::Protocol::CSS::CSSStyle> InspectorStyle::styleWithProperties() co > shouldInactivate = true; > } > } else >- propertyNameToPreviousActiveProperty.set(canonicalPropertyName, property); >+ propertyNameToPreviousActiveProperty.set(canonicalPropertyName, property.copyRef()); > > if (shouldInactivate) { > activeIt->value->setStatus(Inspector::Protocol::CSS::CSSPropertyStatus::Inactive); >- propertyNameToPreviousActiveProperty.set(canonicalPropertyName, property); >+ propertyNameToPreviousActiveProperty.set(canonicalPropertyName, property.copyRef()); > } > } else { > bool implicit = m_style->isPropertyImplicit(name); >@@ -1332,12 +1332,12 @@ bool InspectorStyleSheet::ensureSourceData() > if (!m_parsedStyleSheet->hasText()) > return false; > >- RefPtr<StyleSheetContents> newStyleSheet = StyleSheetContents::create(); >+ auto newStyleSheet = StyleSheetContents::create(); > auto ruleSourceDataResult = std::make_unique<RuleSourceDataList>(); > > CSSParserContext context(parserContextForDocument(m_pageStyleSheet->ownerDocument())); > StyleSheetHandler handler(m_parsedStyleSheet->text(), m_pageStyleSheet->ownerDocument(), ruleSourceDataResult.get()); >- CSSParser::parseSheetForInspector(context, newStyleSheet.get(), m_parsedStyleSheet->text(), handler); >+ CSSParser::parseSheetForInspector(context, newStyleSheet.ptr(), m_parsedStyleSheet->text(), handler); > m_parsedStyleSheet->setSourceData(WTFMove(ruleSourceDataResult)); > return m_parsedStyleSheet->hasSourceData(); > } >diff --git a/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp b/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp >index f2ed5ef8766d0479ae47d0d2334dd97a49030e9d..cad66693a7e7538f29cc21a999fc1672c7511322 100644 >--- a/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp >@@ -438,8 +438,8 @@ void InspectorCanvasAgent::didCreateCanvasRenderingContext(CanvasRenderingContex > > context.canvasBase().addObserver(*this); > >- RefPtr<InspectorCanvas> inspectorCanvas = InspectorCanvas::create(context); >- m_identifierToInspectorCanvas.set(inspectorCanvas->identifier(), inspectorCanvas); >+ auto inspectorCanvas = InspectorCanvas::create(context); >+ m_identifierToInspectorCanvas.set(inspectorCanvas->identifier(), inspectorCanvas.copyRef()); > > if (!m_enabled) > return; >@@ -450,7 +450,7 @@ void InspectorCanvasAgent::didCreateCanvasRenderingContext(CanvasRenderingContex > if (m_recordingAutoCaptureFrameCount) { > RecordingOptions recordingOptions; > recordingOptions.frameCount = m_recordingAutoCaptureFrameCount.value(); >- startRecording(*inspectorCanvas, Inspector::Protocol::Recording::Initiator::AutoCapture, WTFMove(recordingOptions)); >+ startRecording(inspectorCanvas.get(), Inspector::Protocol::Recording::Initiator::AutoCapture, WTFMove(recordingOptions)); > } > } > >diff --git a/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp b/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp >index ae3acafd090b0ac15c7efd6feb89594648d89950..dea5c9a31d4c928bb34e18cbdd45494aeb1abf2d 100644 >--- a/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp >@@ -176,14 +176,14 @@ static RefPtr<KeyPath> keyPathFromIDBKeyPath(const std::optional<IDBKeyPath>& id > return KeyPath::create().setType(KeyPath::Type::Null).release(); > > auto visitor = WTF::makeVisitor([](const String& string) { >- RefPtr<KeyPath> keyPath = KeyPath::create().setType(KeyPath::Type::String).release(); >+ auto keyPath = KeyPath::create().setType(KeyPath::Type::String).release(); > keyPath->setString(string); > return keyPath; > }, [](const Vector<String>& vector) { > auto array = JSON::ArrayOf<String>::create(); > for (auto& string : vector) > array->addItem(string); >- RefPtr<KeyPath> keyPath = KeyPath::create().setType(KeyPath::Type::Array).release(); >+ auto keyPath = KeyPath::create().setType(KeyPath::Type::Array).release(); > keyPath->setArray(WTFMove(array)); > return keyPath; > }); >diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >index ee44eacabde5aa1073245594825ca76dd23117d5..c0ec3ef68bbe7c129d96a021edc48b562411d71e 100644 >--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >@@ -892,7 +892,7 @@ void InspectorPageAgent::archive(ErrorString& errorString, String* data) > { > #if ENABLE(WEB_ARCHIVE) && USE(CF) > Frame& frame = mainFrame(); >- RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(frame); >+ auto archive = LegacyWebArchive::create(frame); > if (!archive) { > errorString = "Could not create web archive for main frame"_s; > return; >diff --git a/Source/WebCore/loader/EmptyClients.cpp b/Source/WebCore/loader/EmptyClients.cpp >index 9f65aebc9df6a65bd2ff487dfa367b7c3edfb962..560c3a5060cae62e00c6284e259737821039ecd9 100644 >--- a/Source/WebCore/loader/EmptyClients.cpp >+++ b/Source/WebCore/loader/EmptyClients.cpp >@@ -383,14 +383,14 @@ class EmptyStorageNamespaceProvider final : public StorageNamespaceProvider { > }; > > struct EmptyStorageNamespace final : public StorageNamespace { >- RefPtr<StorageArea> storageArea(const SecurityOriginData&) final { return adoptRef(*new EmptyStorageArea); } >- RefPtr<StorageNamespace> copy(Page*) final { return adoptRef(*new EmptyStorageNamespace); } >+ Ref<StorageArea> storageArea(const SecurityOriginData&) final { return adoptRef(*new EmptyStorageArea); } >+ Ref<StorageNamespace> copy(Page*) final { return adoptRef(*new EmptyStorageNamespace); } > }; > >- RefPtr<StorageNamespace> createSessionStorageNamespace(Page&, unsigned) final; >- RefPtr<StorageNamespace> createLocalStorageNamespace(unsigned) final; >- RefPtr<StorageNamespace> createEphemeralLocalStorageNamespace(Page&, unsigned) final; >- RefPtr<StorageNamespace> createTransientLocalStorageNamespace(SecurityOrigin&, unsigned) final; >+ Ref<StorageNamespace> createSessionStorageNamespace(Page&, unsigned) final; >+ Ref<StorageNamespace> createLocalStorageNamespace(unsigned) final; >+ Ref<StorageNamespace> createEphemeralLocalStorageNamespace(Page&, unsigned) final; >+ Ref<StorageNamespace> createTransientLocalStorageNamespace(SecurityOrigin&, unsigned) final; > }; > > class EmptyUserContentProvider final : public UserContentProvider { >@@ -513,22 +513,22 @@ void EmptyEditorClient::registerRedoStep(UndoStep&) > { > } > >-RefPtr<StorageNamespace> EmptyStorageNamespaceProvider::createSessionStorageNamespace(Page&, unsigned) >+Ref<StorageNamespace> EmptyStorageNamespaceProvider::createSessionStorageNamespace(Page&, unsigned) > { > return adoptRef(*new EmptyStorageNamespace); > } > >-RefPtr<StorageNamespace> EmptyStorageNamespaceProvider::createLocalStorageNamespace(unsigned) >+Ref<StorageNamespace> EmptyStorageNamespaceProvider::createLocalStorageNamespace(unsigned) > { > return adoptRef(*new EmptyStorageNamespace); > } > >-RefPtr<StorageNamespace> EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace(Page&, unsigned) >+Ref<StorageNamespace> EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace(Page&, unsigned) > { > return adoptRef(*new EmptyStorageNamespace); > } > >-RefPtr<StorageNamespace> EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace(SecurityOrigin&, unsigned) >+Ref<StorageNamespace> EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace(SecurityOrigin&, unsigned) > { > return adoptRef(*new EmptyStorageNamespace); > } >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index 55354791147e588a094eb6cbac1b427a17efddae..a873b1d0eac728d8fef6d0b2580e2f854e734aa7 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -1338,7 +1338,7 @@ void FrameLoader::loadURL(FrameLoadRequest&& frameLoadRequest, const String& ref > ResourceRequest request(newURL); > if (!referrer.isEmpty()) { > request.setHTTPReferrer(referrer); >- RefPtr<SecurityOrigin> referrerOrigin = SecurityOrigin::createFromString(referrer); >+ auto referrerOrigin = SecurityOrigin::createFromString(referrer); > addHTTPOriginIfNeeded(request, referrerOrigin->toString()); > } > if (&m_frame.tree().top() != &m_frame) >@@ -3489,7 +3489,7 @@ bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con > > switch (disposition) { > case XFrameOptionsSameOrigin: { >- RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url); >+ auto origin = SecurityOrigin::create(url); > if (!origin->isSameSchemeHostPort(topFrame.document()->securityOrigin())) > return true; > for (Frame* frame = m_frame.tree().parent(); frame; frame = frame->tree().parent()) { >@@ -3639,7 +3639,7 @@ void FrameLoader::loadDifferentDocumentItem(HistoryItem& item, FrameLoadType loa > request.setHTTPMethod("POST"); > request.setHTTPBody(WTFMove(formData)); > request.setHTTPContentType(item.formContentType()); >- RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString(item.referrer()); >+ auto securityOrigin = SecurityOrigin::createFromString(item.referrer()); > addHTTPOriginIfNeeded(request, securityOrigin->toString()); > addHTTPUpgradeInsecureRequestsIfNeeded(request); > >diff --git a/Source/WebCore/loader/WorkerThreadableLoader.cpp b/Source/WebCore/loader/WorkerThreadableLoader.cpp >index e1d60eb90e7b73497c1aadc1b34ed7c35c46ae6e..4bad183e08548c47ddd98229ee9e62b4eb49b5cb 100644 >--- a/Source/WebCore/loader/WorkerThreadableLoader.cpp >+++ b/Source/WebCore/loader/WorkerThreadableLoader.cpp >@@ -74,7 +74,7 @@ void WorkerThreadableLoader::loadResourceSynchronously(WorkerGlobalScope& worker > String mode = loadResourceSynchronouslyMode; > mode.append(String::number(runLoop.createUniqueId())); > >- RefPtr<WorkerThreadableLoader> loader = WorkerThreadableLoader::create(workerGlobalScope, client, mode, WTFMove(request), options, String()); >+ auto loader = WorkerThreadableLoader::create(workerGlobalScope, client, mode, WTFMove(request), options, String()); > MessageQueueWaitResult result = MessageQueueMessageReceived; > while (!loader->done() && result != MessageQueueTerminated) > result = runLoop.runInMode(&workerGlobalScope, mode); >diff --git a/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp b/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp >index 5fd39be7bd140bee42b91a28af86df74a7e74d72..c3b5e3e1f22934106662609b4a01039c20e91101 100644 >--- a/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp >+++ b/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp >@@ -131,16 +131,16 @@ void MHTMLParser::addResourceToArchive(ArchiveResource* resource, MHTMLArchive* > return; > } > >- RefPtr<MHTMLArchive> subframe = MHTMLArchive::create(); >+ auto subframe = MHTMLArchive::create(); > subframe->setMainResource(*resource); >- m_frames.append(subframe); >+ m_frames.append(WTFMove(subframe)); > } > > RefPtr<ArchiveResource> MHTMLParser::parseNextPart(const MIMEHeader& mimeHeader, const String& endOfPartBoundary, const String& endOfDocumentBoundary, bool& endOfArchiveReached) > { > ASSERT(endOfPartBoundary.isEmpty() == endOfDocumentBoundary.isEmpty()); > >- RefPtr<SharedBuffer> content = SharedBuffer::create(); >+ auto content = SharedBuffer::create(); > const bool checkBoundary = !endOfPartBoundary.isEmpty(); > bool endOfPartReached = false; > if (mimeHeader.contentTransferEncoding() == MIMEHeader::Binary) { >@@ -211,7 +211,7 @@ RefPtr<ArchiveResource> MHTMLParser::parseNextPart(const MIMEHeader& mimeHeader, > LOG_ERROR("Invalid encoding for MHTML part."); > return nullptr; > } >- RefPtr<SharedBuffer> contentBuffer = SharedBuffer::create(WTFMove(data)); >+ auto contentBuffer = SharedBuffer::create(WTFMove(data)); > // FIXME: the URL in the MIME header could be relative, we should resolve it if it is. > // The specs mentions 5 ways to resolve a URL: http://tools.ietf.org/html/rfc2557#section-5 > // IE and Firefox (UNMht) seem to generate only absolute URLs. >diff --git a/Source/WebCore/loader/cache/MemoryCache.cpp b/Source/WebCore/loader/cache/MemoryCache.cpp >index ee97b2bd4fd0722b5ba3bd5faee1bc6dfc166620..f8631352c220dd1fb54581257be568598f3f6d98 100644 >--- a/Source/WebCore/loader/cache/MemoryCache.cpp >+++ b/Source/WebCore/loader/cache/MemoryCache.cpp >@@ -216,11 +216,8 @@ bool MemoryCache::addImageToCache(NativeImagePtr&& image, const URL& url, const > PAL::SessionID sessionID = PAL::SessionID::defaultSessionID(); > removeImageFromCache(url, domainForCachePartition); // Remove cache entry if it already exists. > >- RefPtr<BitmapImage> bitmapImage = BitmapImage::create(WTFMove(image), nullptr); >- if (!bitmapImage) >- return false; >- >- auto cachedImage = std::make_unique<CachedImage>(url, bitmapImage.get(), sessionID, domainForCachePartition); >+ auto bitmapImage = BitmapImage::create(WTFMove(image), nullptr); >+ auto cachedImage = std::make_unique<CachedImage>(url, bitmapImage.ptr(), sessionID, domainForCachePartition); > > cachedImage->addClient(dummyCachedImageClient()); > cachedImage->setDecodedSize(bitmapImage->decodedSize()); >@@ -541,7 +538,7 @@ void MemoryCache::removeResourcesWithOrigin(SecurityOrigin& origin) > resourcesWithOrigin.append(&resource); > continue; > } >- RefPtr<SecurityOrigin> resourceOrigin = SecurityOrigin::create(resource.url()); >+ auto resourceOrigin = SecurityOrigin::create(resource.url()); > if (resourceOrigin->equal(&origin)) > resourcesWithOrigin.append(&resource); > } >diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp >index 2772950454b30b852284d6ceb5156227b6a97de2..68994accbdbdbdb54cab51bb433c8ff64d4ba31b 100644 >--- a/Source/WebCore/page/DOMWindow.cpp >+++ b/Source/WebCore/page/DOMWindow.cpp >@@ -1484,7 +1484,7 @@ RefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* element, const String > > bool allowCrossOrigin = frame->settings().crossOriginCheckInGetMatchedCSSRulesDisabled(); > >- RefPtr<StaticCSSRuleList> ruleList = StaticCSSRuleList::create(); >+ auto ruleList = StaticCSSRuleList::create(); > for (auto& rule : matchedRules) { > if (!allowCrossOrigin && !rule->hasDocumentSecurityOrigin()) > continue; >@@ -2245,7 +2245,7 @@ ExceptionOr<RefPtr<Frame>> DOMWindow::createWindow(const String& urlString, cons > // We pass the opener frame for the lookupFrame in case the active frame is different from > // the opener frame, and the name references a frame relative to the opener frame. > bool created; >- RefPtr<Frame> newFrame = WebCore::createWindow(*activeFrame, openerFrame, WTFMove(frameLoadRequest), windowFeatures, created); >+ auto newFrame = WebCore::createWindow(*activeFrame, openerFrame, WTFMove(frameLoadRequest), windowFeatures, created); > if (!newFrame) > return RefPtr<Frame> { nullptr }; > >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index 6d141eafdafaca72378a1e34cc9b8eeb2531c1d3..51ba891fe1733396b7e80f79e8101b171ce89edc 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -654,8 +654,8 @@ bool EventHandler::handleMousePressEventTripleClick(const MouseEventWithHitTestR > > static int textDistance(const Position& start, const Position& end) > { >- RefPtr<Range> range = Range::create(start.anchorNode()->document(), start, end); >- return TextIterator::rangeLength(range.get(), true); >+ auto range = Range::create(start.anchorNode()->document(), start, end); >+ return TextIterator::rangeLength(range.ptr(), true); > } > > bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestResults& event) >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index ac40b80e2c958a7f6fa7be563b9807ce1e23ac09..3a468b6c46e138740f1b68fd0439fb3285383df1 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -1395,7 +1395,7 @@ const String& Page::userStyleSheet() const > // and what should happen when it finishes loading, especially with respect > // to when the load event fires, when Document::close is called, and when > // layout/paint are allowed to happen. >- RefPtr<SharedBuffer> data = SharedBuffer::createWithContentsOfFile(m_userStyleSheetPath); >+ auto data = SharedBuffer::createWithContentsOfFile(m_userStyleSheetPath); > if (!data) > return m_userStyleSheet; > >diff --git a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp >index b462b9f55fa63fb2b39338d2037769db2fd90f44..b428e5221afe1b2b74d02f1ad4f2b2590ad650b9 100644 >--- a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp >+++ b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp >@@ -191,11 +191,11 @@ static inline FilterOperations blendFilterOperations(const CSSPropertyBlendingCl > if (blendedOp) > result.operations().append(blendedOp); > else { >- RefPtr<FilterOperation> identityOp = PassthroughFilterOperation::create(); >+ auto identityOp = PassthroughFilterOperation::create(); > if (progress > 0.5) >- result.operations().append(toOp ? toOp : identityOp); >+ result.operations().append(toOp ? toOp : WTFMove(identityOp)); > else >- result.operations().append(fromOp ? fromOp : identityOp); >+ result.operations().append(fromOp ? fromOp : WTFMove(identityOp)); > } > } > return result; >diff --git a/Source/WebCore/page/ios/FrameIOS.mm b/Source/WebCore/page/ios/FrameIOS.mm >index 583cfd31648800e7381665d3d54649e897b5a908..05c85c66b8ee9e3f7f7e43bcc5702b0261fa64d9 100644 >--- a/Source/WebCore/page/ios/FrameIOS.mm >+++ b/Source/WebCore/page/ios/FrameIOS.mm >@@ -81,14 +81,14 @@ void Frame::initWithSimpleHTMLDocument(const String& style, const URL& url) > { > m_loader->initForSynthesizedDocument(url); > >- RefPtr<HTMLDocument> document = HTMLDocument::createSynthesizedDocument(this, url); >+ auto document = HTMLDocument::createSynthesizedDocument(this, url); > document->setCompatibilityMode(DocumentCompatibilityMode::LimitedQuirksMode); > document->createDOMWindow(); >- setDocument(document); >+ setDocument(document.copyRef()); > >- auto rootElement = HTMLHtmlElement::create(*document); >+ auto rootElement = HTMLHtmlElement::create(document.get()); > >- auto body = HTMLBodyElement::create(*document); >+ auto body = HTMLBodyElement::create(document.get()); > if (!style.isEmpty()) > body->setAttribute(HTMLNames::styleAttr, style); > >@@ -629,16 +629,16 @@ NSArray *Frame::interpretationsForCurrentRoot() const > for (auto* marker : document()->markers().markersFor(*node, DocumentMarker::DictationPhraseWithAlternatives)) { > // First, add text that precede the marker. > if (precedingTextStartPosition != createLegacyEditingPosition(node, marker->startOffset())) { >- RefPtr<Range> precedingTextRange = Range::create(*document(), precedingTextStartPosition, createLegacyEditingPosition(node, marker->startOffset())); >- String precedingText = plainText(precedingTextRange.get()); >+ auto precedingTextRange = Range::create(*document(), precedingTextStartPosition, createLegacyEditingPosition(node, marker->startOffset())); >+ String precedingText = plainText(precedingTextRange.ptr()); > if (!precedingText.isEmpty()) { > for (auto& interpretation : interpretations) > append(interpretation, precedingText); > } > } > >- RefPtr<Range> rangeForMarker = Range::create(*document(), createLegacyEditingPosition(node, marker->startOffset()), createLegacyEditingPosition(node, marker->endOffset())); >- String visibleTextForMarker = plainText(rangeForMarker.get()); >+ auto rangeForMarker = Range::create(*document(), createLegacyEditingPosition(node, marker->startOffset()), createLegacyEditingPosition(node, marker->endOffset())); >+ String visibleTextForMarker = plainText(rangeForMarker.ptr()); > size_t interpretationsCountForCurrentMarker = marker->alternatives().size() + 1; > for (size_t i = 0; i < interpretationsCount; ++i) { > // Determine text for the ith interpretation. It will either be the visible text, or one of its >@@ -658,8 +658,8 @@ NSArray *Frame::interpretationsForCurrentRoot() const > } > > // Finally, add any text after the last marker. >- RefPtr<Range> afterLastMarkerRange = Range::create(*document(), precedingTextStartPosition, createLegacyEditingPosition(root, rootChildCount)); >- String textAfterLastMarker = plainText(afterLastMarkerRange.get()); >+ auto afterLastMarkerRange = Range::create(*document(), precedingTextStartPosition, createLegacyEditingPosition(root, rootChildCount)); >+ String textAfterLastMarker = plainText(afterLastMarkerRange.ptr()); > if (!textAfterLastMarker.isEmpty()) { > for (auto& interpretation : interpretations) > append(interpretation, textAfterLastMarker); >diff --git a/Source/WebCore/page/mac/ServicesOverlayController.mm b/Source/WebCore/page/mac/ServicesOverlayController.mm >index f3409fa2ef50e0e6d160edf95380ac921b15f0d0..c96bed10869f675dbf5145f9f3e0f4123f02fbe7 100644 >--- a/Source/WebCore/page/mac/ServicesOverlayController.mm >+++ b/Source/WebCore/page/mac/ServicesOverlayController.mm >@@ -156,8 +156,8 @@ void ServicesOverlayController::Highlight::fadeIn() > [animation setRemovedOnCompletion:false]; > [animation setToValue:@1]; > >- RefPtr<PlatformCAAnimation> platformAnimation = PlatformCAAnimationCocoa::create(animation.get()); >- downcast<GraphicsLayerCA>(layer()).platformCALayer()->addAnimationForKey("FadeHighlightIn", *platformAnimation); >+ auto platformAnimation = PlatformCAAnimationCocoa::create(animation.get()); >+ downcast<GraphicsLayerCA>(layer()).platformCALayer()->addAnimationForKey("FadeHighlightIn", platformAnimation.get()); > } > > void ServicesOverlayController::Highlight::fadeOut() >@@ -174,8 +174,8 @@ void ServicesOverlayController::Highlight::fadeOut() > retainedSelf->didFinishFadeOutAnimation(); > }]; > >- RefPtr<PlatformCAAnimation> platformAnimation = PlatformCAAnimationCocoa::create(animation.get()); >- downcast<GraphicsLayerCA>(layer()).platformCALayer()->addAnimationForKey("FadeHighlightOut", *platformAnimation); >+ auto platformAnimation = PlatformCAAnimationCocoa::create(animation.get()); >+ downcast<GraphicsLayerCA>(layer()).platformCALayer()->addAnimationForKey("FadeHighlightOut", platformAnimation.get()); > [CATransaction commit]; > } > >diff --git a/Source/WebCore/platform/SharedBuffer.cpp b/Source/WebCore/platform/SharedBuffer.cpp >index 9f19cfef3bbe500948f52a50089d37859b713e23..46fc811cc35335e9d3afa6dbb33ef919c2d60ae2 100644 >--- a/Source/WebCore/platform/SharedBuffer.cpp >+++ b/Source/WebCore/platform/SharedBuffer.cpp >@@ -119,7 +119,7 @@ SharedBufferDataView SharedBuffer::getSomeData(size_t position) const > > RefPtr<ArrayBuffer> SharedBuffer::tryCreateArrayBuffer() const > { >- RefPtr<ArrayBuffer> arrayBuffer = ArrayBuffer::createUninitialized(static_cast<unsigned>(size()), sizeof(char)); >+ auto arrayBuffer = ArrayBuffer::tryCreateUninitialized(static_cast<unsigned>(size()), sizeof(char)); > if (!arrayBuffer) { > WTFLogAlways("SharedBuffer::tryCreateArrayBuffer Unable to create buffer. Requested size was %zu x %lu\n", size(), sizeof(char)); > return nullptr; >diff --git a/Source/WebCore/platform/audio/HRTFElevation.cpp b/Source/WebCore/platform/audio/HRTFElevation.cpp >index f65cde3c1aff45f66d5f2236367192f0cb307a07..9e71ae9f747e98b956a0c0c5b0489db3b89ded25 100644 >--- a/Source/WebCore/platform/audio/HRTFElevation.cpp >+++ b/Source/WebCore/platform/audio/HRTFElevation.cpp >@@ -171,8 +171,8 @@ bool HRTFElevation::calculateKernelsForAzimuthElevation(int azimuth, int elevati > // (hardware) sample-rate. > unsigned startFrame = index * ResponseFrameSize; > unsigned stopFrame = startFrame + ResponseFrameSize; >- RefPtr<AudioBus> preSampleRateConvertedResponse = AudioBus::createBufferFromRange(bus, startFrame, stopFrame); >- RefPtr<AudioBus> response = AudioBus::createBySampleRateConverting(preSampleRateConvertedResponse.get(), false, sampleRate); >+ auto preSampleRateConvertedResponse = AudioBus::createBufferFromRange(bus, startFrame, stopFrame); >+ auto response = AudioBus::createBySampleRateConverting(preSampleRateConvertedResponse.get(), false, sampleRate); > AudioChannel* leftEarImpulseResponse = response->channel(AudioBus::ChannelLeft); > AudioChannel* rightEarImpulseResponse = response->channel(AudioBus::ChannelRight); > #else >diff --git a/Source/WebCore/platform/audio/SincResampler.cpp b/Source/WebCore/platform/audio/SincResampler.cpp >index e79d6c18deb9a07045af569e7450de12d470c84a..8977f39869d6b6502643544f41d2b6da387ae979 100644 >--- a/Source/WebCore/platform/audio/SincResampler.cpp >+++ b/Source/WebCore/platform/audio/SincResampler.cpp >@@ -132,7 +132,7 @@ void SincResampler::consumeSource(float* buffer, unsigned numberOfSourceFrames) > return; > > // Wrap the provided buffer by an AudioBus for use by the source provider. >- RefPtr<AudioBus> bus = AudioBus::create(1, numberOfSourceFrames, false); >+ auto bus = AudioBus::create(1, numberOfSourceFrames, false); > > // FIXME: Find a way to make the following const-correct: > bus->setChannelMemory(0, buffer, numberOfSourceFrames); >diff --git a/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp >index b9120773dd51015c162784cd2718090768efb7d6..cde30a8a8b20d55cb54d2f8953fe9f4baa9a5b48 100644 >--- a/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp >+++ b/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp >@@ -352,7 +352,7 @@ RefPtr<AudioBus> AudioFileReader::createBus(float sampleRate, bool mixToMono) > if (m_errorOccurred) > return nullptr; > >- RefPtr<AudioBus> audioBus = AudioBus::create(m_channels, m_channelSize, true); >+ auto audioBus = AudioBus::create(m_channels, m_channelSize, true); > audioBus->setSampleRate(m_sampleRate); > > copyGstreamerBuffersToAudioChannel(m_frontLeftBuffers.get(), audioBus->channel(0)); >diff --git a/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp b/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp >index 2af518b9624825b0b4c7144ebe446e5c124b1c67..dc144115ac296e82f33be9c2df2304a2b8a62118 100644 >--- a/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp >+++ b/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp >@@ -180,7 +180,7 @@ RefPtr<AudioBus> AudioFileReader::createBus(float sampleRate, bool mixToMono) > size_t busChannelCount = mixToMono ? 1 : numberOfChannels; > > // Create AudioBus where we'll put the PCM audio data >- RefPtr<AudioBus> audioBus = AudioBus::create(busChannelCount, numberOfFrames); >+ auto audioBus = AudioBus::create(busChannelCount, numberOfFrames); > audioBus->setSampleRate(narrowPrecisionToFloat(m_clientDataFormat.mSampleRate)); // save for later > > // Only allocated in the mixToMono case >diff --git a/Source/WebCore/platform/graphics/Icon.h b/Source/WebCore/platform/graphics/Icon.h >index 1fdfecda71c604c095115d55d55433eb0d6f33e4..1628112a1c0b7e50b404cfd2634fd6c254fcb12e 100644 >--- a/Source/WebCore/platform/graphics/Icon.h >+++ b/Source/WebCore/platform/graphics/Icon.h >@@ -51,7 +51,7 @@ class Icon : public RefCounted<Icon> { > void paint(GraphicsContext&, const FloatRect&); > > #if PLATFORM(WIN) >- static RefPtr<Icon> create(HICON hIcon) { return adoptRef(new Icon(hIcon)); } >+ static Ref<Icon> create(HICON hIcon) { return adoptRef(*new Icon(hIcon)); } > #endif > > #if PLATFORM(IOS_FAMILY) >diff --git a/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h b/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h >index 38b5191c620842ed0afdc7b06dee109ed2df29a8..13f187893b440ffb58d3beb1f63f4b4d213b5685 100644 >--- a/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h >+++ b/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h >@@ -39,7 +39,7 @@ class InbandTextTrackPrivate : public TrackPrivateBase { > Generic, > WebVTT > }; >- static RefPtr<InbandTextTrackPrivate> create(CueFormat format) { return adoptRef(new InbandTextTrackPrivate(format)); } >+ static Ref<InbandTextTrackPrivate> create(CueFormat format) { return adoptRef(*new InbandTextTrackPrivate(format)); } > virtual ~InbandTextTrackPrivate() = default; > > InbandTextTrackPrivateClient* client() const override { return m_client; } >diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >index b8cb8506b9987fb052ace9814de3bfa6c10dd694..a935500389abdb3d14e76ed87d33da473a6f6152 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >+++ b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >@@ -1891,8 +1891,8 @@ bool AVFWrapper::shouldWaitForLoadingOfResource(AVCFAssetResourceLoadingRequestR > // Create an initData with the following layout: > // [4 bytes: keyURI size], [keyURI size bytes: keyURI] > unsigned keyURISize = keyURI.length() * sizeof(UChar); >- RefPtr<ArrayBuffer> initDataBuffer = ArrayBuffer::create(4 + keyURISize, 1); >- RefPtr<JSC::DataView> initDataView = JSC::DataView::create(initDataBuffer.copyRef(), 0, initDataBuffer->byteLength()); >+ auto initDataBuffer = ArrayBuffer::create(4 + keyURISize, 1); >+ auto initDataView = JSC::DataView::create(initDataBuffer.copyRef(), 0, initDataBuffer->byteLength()); > initDataView->set<uint32_t>(0, keyURISize, true); > > auto keyURIArray = Uint16Array::create(initDataBuffer.copyRef(), 4, keyURI.length()); >@@ -1908,7 +1908,7 @@ bool AVFWrapper::shouldWaitForLoadingOfResource(AVCFAssetResourceLoadingRequestR > } > #endif > >- RefPtr<WebCoreAVCFResourceLoader> resourceLoader = WebCoreAVCFResourceLoader::create(m_owner, avRequest); >+ auto resourceLoader = WebCoreAVCFResourceLoader::create(m_owner, avRequest); > m_owner->m_resourceLoaderMap.add(avRequest, resourceLoader); > resourceLoader->startLoading(); > return true; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h >index 21287214a3bf5ce140804550d9aeec38a30611a9..1a4b181aacb8963005cce5abd8733ac1c2d916e3 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h >@@ -39,9 +39,9 @@ class SourceBufferPrivateAVFObjC; > class AudioTrackPrivateMediaSourceAVFObjC final : public AudioTrackPrivateAVF { > WTF_MAKE_NONCOPYABLE(AudioTrackPrivateMediaSourceAVFObjC) > public: >- static RefPtr<AudioTrackPrivateMediaSourceAVFObjC> create(AVAssetTrack *track, SourceBufferPrivateAVFObjC* parent) >+ static Ref<AudioTrackPrivateMediaSourceAVFObjC> create(AVAssetTrack *track, SourceBufferPrivateAVFObjC* parent) > { >- return adoptRef(new AudioTrackPrivateMediaSourceAVFObjC(track, parent)); >+ return adoptRef(*new AudioTrackPrivateMediaSourceAVFObjC(track, parent)); > } > > void setEnabled(bool) final; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >index d05785cae3616dffbe9939e03da5193c6914954f..310780c3acabd81555c3d019e3b48c6cf777a9e7 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -1749,7 +1749,7 @@ static void fulfillRequestWithKeyData(AVAssetResourceLoadingRequest *request, Ar > > ASSERT(start <= std::numeric_limits<int>::max()); > ASSERT(end <= std::numeric_limits<int>::max()); >- RefPtr<ArrayBuffer> requestedKeyData = keyData->slice(static_cast<int>(start), static_cast<int>(end)); >+ auto requestedKeyData = keyData->slice(static_cast<int>(start), static_cast<int>(end)); > RetainPtr<NSData> nsData = adoptNS([[NSData alloc] initWithBytes:requestedKeyData->data() length:requestedKeyData->byteLength()]); > [dataRequest respondWithData:nsData.get()]; > } >@@ -1817,8 +1817,8 @@ bool MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource(AVAssetR > #endif > #endif > >- RefPtr<WebCoreAVFResourceLoader> resourceLoader = WebCoreAVFResourceLoader::create(this, avRequest); >- m_resourceLoaderMap.add((__bridge CFTypeRef)avRequest, resourceLoader); >+ auto resourceLoader = WebCoreAVFResourceLoader::create(this, avRequest); >+ m_resourceLoaderMap.add((__bridge CFTypeRef)avRequest, resourceLoader.copyRef()); > resourceLoader->startLoading(); > return true; > } >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h >index 0c04af90430291f12a1219eb3c4358cca4f2bd1a..16812759e0a1aefcf48bef1a4364d584c9181dc6 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h >@@ -53,7 +53,7 @@ class WebCoreDecompressionSession; > > class MediaSourcePrivateAVFObjC final : public MediaSourcePrivate { > public: >- static RefPtr<MediaSourcePrivateAVFObjC> create(MediaPlayerPrivateMediaSourceAVFObjC*, MediaSourcePrivateClient*); >+ static Ref<MediaSourcePrivateAVFObjC> create(MediaPlayerPrivateMediaSourceAVFObjC*, MediaSourcePrivateClient*); > virtual ~MediaSourcePrivateAVFObjC(); > > MediaPlayerPrivateMediaSourceAVFObjC* player() const { return m_player; } >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm >index e084c90d5fd77e66ebd2ae84e3167dfd9e9373cc..2b37ec7dfeab465f11f7a507e08892ed97890a02 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm >@@ -44,10 +44,10 @@ namespace WebCore { > #pragma mark - > #pragma mark MediaSourcePrivateAVFObjC > >-RefPtr<MediaSourcePrivateAVFObjC> MediaSourcePrivateAVFObjC::create(MediaPlayerPrivateMediaSourceAVFObjC* parent, MediaSourcePrivateClient* client) >+Ref<MediaSourcePrivateAVFObjC> MediaSourcePrivateAVFObjC::create(MediaPlayerPrivateMediaSourceAVFObjC* parent, MediaSourcePrivateClient* client) > { >- RefPtr<MediaSourcePrivateAVFObjC> mediaSourcePrivate = adoptRef(new MediaSourcePrivateAVFObjC(parent, client)); >- client->setPrivateAndOpen(*mediaSourcePrivate); >+ auto mediaSourcePrivate = adoptRef(*new MediaSourcePrivateAVFObjC(parent, client)); >+ client->setPrivateAndOpen(mediaSourcePrivate.copyRef()); > return mediaSourcePrivate; > } > >@@ -76,7 +76,7 @@ MediaSourcePrivate::AddStatus MediaSourcePrivateAVFObjC::addSourceBuffer(const C > #if ENABLE(ENCRYPTED_MEDIA) > newSourceBuffer->setCDMInstance(m_cdmInstance.get()); > #endif >- outPrivate = newSourceBuffer; >+ outPrivate = newSourceBuffer.copyRef(); > m_sourceBuffers.append(WTFMove(newSourceBuffer)); > > return Ok; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >index 8300dc3b6e39e8cab145aeba2176e9811dfc9871..f17626234b9b5a0ade8c27547a44657a482acd17 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >@@ -79,7 +79,7 @@ class SourceBufferPrivateAVFObjCErrorClient { > > class SourceBufferPrivateAVFObjC final : public SourceBufferPrivate { > public: >- static RefPtr<SourceBufferPrivateAVFObjC> create(MediaSourcePrivateAVFObjC*); >+ static Ref<SourceBufferPrivateAVFObjC> create(MediaSourcePrivateAVFObjC*); > virtual ~SourceBufferPrivateAVFObjC(); > > void clearMediaSource() { m_mediaSource = nullptr; } >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >index a99feb7f653c99116d0f339ec3775fc20cef0bed..1c5663660d9aedcc89e6b5233b8fc4ab3d6ed6cb 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >@@ -430,7 +430,7 @@ using namespace PAL; > > class MediaDescriptionAVFObjC final : public MediaDescription { > public: >- static RefPtr<MediaDescriptionAVFObjC> create(AVAssetTrack* track) { return adoptRef(new MediaDescriptionAVFObjC(track)); } >+ static Ref<MediaDescriptionAVFObjC> create(AVAssetTrack* track) { return adoptRef(*new MediaDescriptionAVFObjC(track)); } > virtual ~MediaDescriptionAVFObjC() { } > > AtomicString codec() const override { return m_codec; } >@@ -484,9 +484,9 @@ static void bufferWasConsumedCallback(CMNotificationCenterRef, const void*, CFSt > sourceBuffer->bufferWasConsumed(); > } > >-RefPtr<SourceBufferPrivateAVFObjC> SourceBufferPrivateAVFObjC::create(MediaSourcePrivateAVFObjC* parent) >+Ref<SourceBufferPrivateAVFObjC> SourceBufferPrivateAVFObjC::create(MediaSourcePrivateAVFObjC* parent) > { >- return adoptRef(new SourceBufferPrivateAVFObjC(parent)); >+ return adoptRef(*new SourceBufferPrivateAVFObjC(parent)); > } > > SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC(MediaSourcePrivateAVFObjC* parent) >@@ -551,16 +551,16 @@ void SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset(AVAsset* asset) > > if ([track hasMediaCharacteristic:AVMediaCharacteristicVisual]) { > SourceBufferPrivateClient::InitializationSegment::VideoTrackInformation info; >- RefPtr<VideoTrackPrivateMediaSourceAVFObjC> videoTrack = VideoTrackPrivateMediaSourceAVFObjC::create(track, this); >- info.track = videoTrack; >- m_videoTracks.append(videoTrack); >+ auto videoTrack = VideoTrackPrivateMediaSourceAVFObjC::create(track, this); >+ info.track = videoTrack.copyRef(); >+ m_videoTracks.append(WTFMove(videoTrack)); > info.description = MediaDescriptionAVFObjC::create(track); > segment.videoTracks.append(info); > } else if ([track hasMediaCharacteristic:AVMediaCharacteristicAudible]) { > SourceBufferPrivateClient::InitializationSegment::AudioTrackInformation info; >- RefPtr<AudioTrackPrivateMediaSourceAVFObjC> audioTrack = AudioTrackPrivateMediaSourceAVFObjC::create(track, this); >- info.track = audioTrack; >- m_audioTracks.append(audioTrack); >+ auto audioTrack = AudioTrackPrivateMediaSourceAVFObjC::create(track, this); >+ info.track = audioTrack.copyRef(); >+ m_audioTracks.append(WTFMove(audioTrack)); > info.description = MediaDescriptionAVFObjC::create(track); > segment.audioTracks.append(info); > } >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h >index f456f0a96f2e2bc262deafc39f532db9d5b06e8f..5dd7e6230fe8e05b4ff345e3b19414ab091f3e1d 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h >@@ -42,9 +42,9 @@ class SourceBufferPrivateAVFObjC; > class VideoTrackPrivateMediaSourceAVFObjC final : public VideoTrackPrivateAVF { > WTF_MAKE_NONCOPYABLE(VideoTrackPrivateMediaSourceAVFObjC) > public: >- static RefPtr<VideoTrackPrivateMediaSourceAVFObjC> create(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent) >+ static Ref<VideoTrackPrivateMediaSourceAVFObjC> create(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent) > { >- return adoptRef(new VideoTrackPrivateMediaSourceAVFObjC(track, parent)); >+ return adoptRef(*new VideoTrackPrivateMediaSourceAVFObjC(track, parent)); > } > > bool selected() const override; >diff --git a/Source/WebCore/platform/graphics/ca/TileController.cpp b/Source/WebCore/platform/graphics/ca/TileController.cpp >index 80cfc4fac345c92ecd61737fc9254dcd8b755bf8..91db6541c4b123aeb346ea392ae043840d2439d1 100644 >--- a/Source/WebCore/platform/graphics/ca/TileController.cpp >+++ b/Source/WebCore/platform/graphics/ca/TileController.cpp >@@ -724,9 +724,9 @@ int TileController::rightMarginWidth() const > return (m_marginSize * m_marginEdges.right()) / tileGrid().scale(); > } > >-RefPtr<PlatformCALayer> TileController::createTileLayer(const IntRect& tileRect, TileGrid& grid) >+Ref<PlatformCALayer> TileController::createTileLayer(const IntRect& tileRect, TileGrid& grid) > { >- RefPtr<PlatformCALayer> layer = m_tileCacheLayer->createCompatibleLayerOrTakeFromPool(PlatformCALayer::LayerTypeTiledBackingTileLayer, &grid, tileRect.size()); >+ auto layer = m_tileCacheLayer->createCompatibleLayerOrTakeFromPool(PlatformCALayer::LayerTypeTiledBackingTileLayer, &grid, tileRect.size()); > > layer->setAnchorPoint(FloatPoint3D()); > layer->setPosition(tileRect.location()); >diff --git a/Source/WebCore/platform/graphics/ca/TileController.h b/Source/WebCore/platform/graphics/ca/TileController.h >index ae19b8c5171fd5741a5515f76a69886662faf07c..db9d453107bd4900516520d5a067520ac266a4ce 100644 >--- a/Source/WebCore/platform/graphics/ca/TileController.h >+++ b/Source/WebCore/platform/graphics/ca/TileController.h >@@ -134,7 +134,7 @@ class TileController final : public TiledBacking { > > void updateTileCoverageMap(); > >- RefPtr<PlatformCALayer> createTileLayer(const IntRect&, TileGrid&); >+ Ref<PlatformCALayer> createTileLayer(const IntRect&, TileGrid&); > > const TileGrid& tileGrid() const { return *m_tileGrid; } > >diff --git a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp >index 2a9d91ae1c78d1d735ce491b3ada9aa80f67443e..1aba46f4c3bca5d1b2ac3c0c455a1d9b6ee08156 100644 >--- a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp >+++ b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp >@@ -106,7 +106,7 @@ bool CACFLayerTreeHost::acceleratedCompositingAvailable() > return available; > } > >- RefPtr<CACFLayerTreeHost> host = CACFLayerTreeHost::create(); >+ auto host = CACFLayerTreeHost::create(); > > if (!host) { > available = false; >@@ -125,7 +125,7 @@ RefPtr<CACFLayerTreeHost> CACFLayerTreeHost::create() > { > if (!acceleratedCompositingAvailable()) > return nullptr; >- RefPtr<CACFLayerTreeHost> host = WKCACFViewLayerTreeHost::create(); >+ auto host = WKCACFViewLayerTreeHost::create(); > if (!host) { > LOG_ERROR("Failed to create layer tree host for accelerated compositing."); > return nullptr; >diff --git a/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm b/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm >index 406e085fff1f19a9dbfdb81c64931f468a4f9795..fcc276dbe14295381b43325c0cc26dfd48534ae7 100644 >--- a/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm >+++ b/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm >@@ -55,11 +55,11 @@ RefPtr<GPUBuffer> GPUBuffer::create(const GPUDevice& device, GPUBufferDescriptor > return nullptr; > } > >- RefPtr<ArrayBuffer> arrayBuffer = ArrayBuffer::createFromBytes(pageAlignedCopy, descriptor.size, [] (void* ptr) { >+ auto arrayBuffer = ArrayBuffer::createFromBytes(pageAlignedCopy, descriptor.size, [] (void* ptr) { > Gigacage::alignedFree(Gigacage::Primitive, ptr); > }); > arrayBuffer->ref(); >- ArrayBuffer* arrayBufferContents = arrayBuffer.get(); >+ ArrayBuffer* arrayBufferContents = arrayBuffer.ptr(); > // FIXME: Default this MTLResourceOptions. > PlatformBufferSmartPtr mtlBuffer = adoptNS([device.platformDevice() > newBufferWithBytesNoCopy:arrayBuffer->data() >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 94768dc1a92a2f64bf2ce21268814aa29a09f6cf..de78db607fa11f7a58deff4a982423bb8ba8dd75 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -734,9 +734,9 @@ void MediaPlayerPrivateGStreamer::updateTracks() > CREATE_TRACK(video, Video) > } else if (type & GST_STREAM_TYPE_TEXT && !useMediaSource) { > #if ENABLE(VIDEO_TRACK) >- RefPtr<InbandTextTrackPrivateGStreamer> track = InbandTextTrackPrivateGStreamer::create(textTrackIndex++, stream); >- m_textTracks.add(streamId, track); >- m_player->addTextTrack(*track); >+ auto track = InbandTextTrackPrivateGStreamer::create(textTrackIndex++, stream); >+ m_textTracks.add(streamId, track.copyRef()); >+ m_player->addTextTrack(track.get()); > #endif > } else > GST_WARNING("Unknown track type found for stream %s", streamId.utf8().data()); >@@ -894,10 +894,10 @@ void MediaPlayerPrivateGStreamer::notifyPlayerOfVideo() > } > } > >- RefPtr<VideoTrackPrivateGStreamer> track = VideoTrackPrivateGStreamer::create(makeWeakPtr(*this), i, pad); >+ auto track = VideoTrackPrivateGStreamer::create(makeWeakPtr(*this), i, pad); > ASSERT(streamId == track->id()); >- m_videoTracks.add(streamId, track); >- m_player->addVideoTrack(*track); >+ m_videoTracks.add(streamId, track.copyRef()); >+ m_player->addVideoTrack(track.get()); > } > > purgeInvalidVideoTracks(validVideoStreams); >@@ -968,7 +968,7 @@ void MediaPlayerPrivateGStreamer::notifyPlayerOfAudio() > } > } > >- RefPtr<AudioTrackPrivateGStreamer> track = AudioTrackPrivateGStreamer::create(makeWeakPtr(*this), i, pad); >+ auto track = AudioTrackPrivateGStreamer::create(makeWeakPtr(*this), i, pad); > ASSERT(streamId == track->id()); > m_audioTracks.add(streamId, track); > m_player->addAudioTrack(*track); >@@ -1029,9 +1029,9 @@ void MediaPlayerPrivateGStreamer::notifyPlayerOfText() > } > } > >- RefPtr<InbandTextTrackPrivateGStreamer> track = InbandTextTrackPrivateGStreamer::create(i, pad); >- m_textTracks.add(streamId, track); >- m_player->addTextTrack(*track); >+ auto track = InbandTextTrackPrivateGStreamer::create(i, pad); >+ m_textTracks.add(streamId, track.copyRef()); >+ m_player->addTextTrack(track.get()); > } > > purgeInvalidTextTracks(validTextStreams); >@@ -1298,7 +1298,7 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message) > case GST_MESSAGE_ELEMENT: > if (gst_is_missing_plugin_message(message)) { > if (gst_install_plugins_supported()) { >- RefPtr<MediaPlayerRequestInstallMissingPluginsCallback> missingPluginCallback = MediaPlayerRequestInstallMissingPluginsCallback::create([weakThis = makeWeakPtr(*this)](uint32_t result, MediaPlayerRequestInstallMissingPluginsCallback& missingPluginCallback) { >+ auto missingPluginCallback = MediaPlayerRequestInstallMissingPluginsCallback::create([weakThis = makeWeakPtr(*this)](uint32_t result, MediaPlayerRequestInstallMissingPluginsCallback& missingPluginCallback) { > if (!weakThis) { > GST_INFO("got missing pluging installation callback in destroyed player with result %u", result); > return; >@@ -1313,10 +1313,10 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message) > weakThis->changePipelineState(GST_STATE_READY); > weakThis->changePipelineState(GST_STATE_PAUSED); > }); >- m_missingPluginCallbacks.append(missingPluginCallback); >+ m_missingPluginCallbacks.append(missingPluginCallback.copyRef()); > GUniquePtr<char> detail(gst_missing_plugin_message_get_installer_detail(message)); > GUniquePtr<char> description(gst_missing_plugin_message_get_description(message)); >- m_player->client().requestInstallMissingPlugins(String::fromUTF8(detail.get()), String::fromUTF8(description.get()), *missingPluginCallback); >+ m_player->client().requestInstallMissingPlugins(String::fromUTF8(detail.get()), String::fromUTF8(description.get()), missingPluginCallback.get()); > } > } > #if ENABLE(VIDEO_TRACK) && USE(GSTREAMER_MPEGTS) >@@ -1448,7 +1448,7 @@ void MediaPlayerPrivateGStreamer::processMpegTsSection(GstMpegtsSection* section > const GstMpegtsPMTStream* stream = static_cast<const GstMpegtsPMTStream*>(g_ptr_array_index(pmt->streams, i)); > if (stream->stream_type == 0x05 || stream->stream_type >= 0x80) { > AtomicString pid = String::number(stream->pid); >- RefPtr<InbandMetadataTextTrackPrivateGStreamer> track = InbandMetadataTextTrackPrivateGStreamer::create( >+ auto track = InbandMetadataTextTrackPrivateGStreamer::create( > InbandTextTrackPrivate::Metadata, InbandTextTrackPrivate::Data, pid); > > // 4.7.10.12.2 Sourcing in-band text tracks >@@ -2133,7 +2133,7 @@ bool MediaPlayerPrivateGStreamer::loadNextLocation() > URL newUrl = URL(baseUrl, newLocation); > convertToInternalProtocol(newUrl); > >- RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(m_url); >+ auto securityOrigin = SecurityOrigin::create(m_url); > if (securityOrigin->canRequest(newUrl)) { > GST_INFO_OBJECT(pipeline(), "New media url: %s", newUrl.string().utf8().data()); > >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >index 897f292025dd4aac265dd9bddf2b778386cb9b61..356351342f0a55197998fe7181b9c8a553fdc664 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >@@ -878,7 +878,7 @@ void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext& context, const Floa > if (m_renderingCanBeAccelerated) > paintingOptions.m_orientationDescription.setImageOrientationEnum(m_videoSourceOrientation); > >- RefPtr<ImageGStreamer> gstImage = ImageGStreamer::createImage(m_sample.get()); >+ auto gstImage = ImageGStreamer::createImage(m_sample.get()); > if (!gstImage) > return; > >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >index 026a20573ec32adb2a3bc8a686023ea80ad83108..d092920c26bd60e983bfa14366d5639efffce456 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >@@ -434,7 +434,7 @@ void AppendPipeline::appsinkNewSample(GRefPtr<GstSample>&& sample) > return; > } > >- RefPtr<MediaSampleGStreamer> mediaSample = WebCore::MediaSampleGStreamer::create(WTFMove(sample), m_presentationSize, trackId()); >+ auto mediaSample = WebCore::MediaSampleGStreamer::create(WTFMove(sample), m_presentationSize, trackId()); > > GST_TRACE("append: trackId=%s PTS=%s DTS=%s DUR=%s presentationSize=%.0fx%.0f", > mediaSample->trackID().string().utf8().data(), >@@ -456,7 +456,7 @@ void AppendPipeline::appsinkNewSample(GRefPtr<GstSample>&& sample) > mediaSample->applyPtsOffset(MediaTime::zeroTime()); > } > >- m_sourceBufferPrivate->didReceiveSample(*mediaSample); >+ m_sourceBufferPrivate->didReceiveSample(mediaSample.get()); > } > > void AppendPipeline::didReceiveInitializationSegment() >diff --git a/Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp b/Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp >index 7cbf54eb3c35ea139c0e70629df8dabdb545d07e..6e4b64fb4200bb090c055877bc96b512d551f98a 100644 >--- a/Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp >+++ b/Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp >@@ -44,9 +44,6 @@ bool ISOProtectionSystemSpecificHeaderBox::parse(DataView& view, unsigned& offse > if (!buffer) > return false; > auto systemID = buffer->slice(offset, offset + 16); >- if (!systemID) >- return false; >- > offset += 16; > > m_systemID.resize(16); >@@ -63,8 +60,6 @@ bool ISOProtectionSystemSpecificHeaderBox::parse(DataView& view, unsigned& offse > auto& currentKeyID = m_keyIDs[keyID]; > currentKeyID.resize(16); > auto parsedKeyID = buffer->slice(offset, offset + 16); >- if (!parsedKeyID) >- return false; > offset += 16; > memcpy(currentKeyID.data(), parsedKeyID->data(), 16); > } >@@ -76,9 +71,6 @@ bool ISOProtectionSystemSpecificHeaderBox::parse(DataView& view, unsigned& offse > if (buffer->byteLength() - offset < dataSize) > return false; > auto parsedData = buffer->slice(offset, offset + dataSize); >- if (!parsedData) >- return false; >- > offset += dataSize; > > m_data.resize(dataSize); >diff --git a/Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.cpp b/Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.cpp >index 57a5694d5eae139eed28595a132306bc5c75a04f..2c94f4d3cc1b76175d92388626f180b9cb80216b 100644 >--- a/Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.cpp >+++ b/Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.cpp >@@ -64,9 +64,6 @@ bool ISOTrackEncryptionBox::parse(DataView& view, unsigned& offset) > return false; > > auto keyIDBuffer = buffer->slice(offset, offset + 16); >- if (!keyIDBuffer) >- return false; >- > offset += 16; > > m_defaultKID.resize(16); >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp >index 667f230172359146317fc861a27ec8406be0741f..01a2742439c227f222b8ceb2ca60a31fc94ff9f4 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp >@@ -54,11 +54,11 @@ static FilterOperations applyFilterAnimation(const FilterOperations& from, const > if (blendedOp) > result.operations().append(blendedOp); > else { >- RefPtr<FilterOperation> identityOp = PassthroughFilterOperation::create(); >+ auto identityOp = PassthroughFilterOperation::create(); > if (progress > 0.5) >- result.operations().append(toOp ? toOp : identityOp); >+ result.operations().append(toOp ? toOp : WTFMove(identityOp)); > else >- result.operations().append(fromOp ? fromOp : identityOp); >+ result.operations().append(fromOp ? fromOp : WTFMove(identityOp)); > } > } > >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp >index c66e463620028650b45c50611bb26dc442e27c8f..8cc58d61d9b503797f072725e0c6d783de5d1de6 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp >@@ -60,9 +60,9 @@ std::unique_ptr<TextureMapperPlatformLayerBuffer> TextureMapperPlatformLayerBuff > notImplemented(); > return nullptr; > } >- RefPtr<BitmapTexture> texture = BitmapTextureGL::create(TextureMapperContextAttributes::get(), m_internalFormat); >+ auto texture = BitmapTextureGL::create(TextureMapperContextAttributes::get(), m_internalFormat); > texture->reset(m_size); >- static_cast<BitmapTextureGL&>(*texture).copyFromExternalTexture(m_textureID); >+ static_cast<BitmapTextureGL&>(texture.get()).copyFromExternalTexture(m_textureID); > return std::make_unique<TextureMapperPlatformLayerBuffer>(WTFMove(texture), m_extraFlags); > } > >diff --git a/Source/WebCore/platform/graphics/transforms/TransformOperations.cpp b/Source/WebCore/platform/graphics/transforms/TransformOperations.cpp >index f944f07a58e2adddb2da1925a353f73be44e282f..b1452fe2b667bdef31a8bc9ce31f4e6d2ec7b381 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformOperations.cpp >+++ b/Source/WebCore/platform/graphics/transforms/TransformOperations.cpp >@@ -87,11 +87,11 @@ TransformOperations TransformOperations::blendByMatchingOperations(const Transfo > if (blendedOperation) > result.operations().append(blendedOperation); > else { >- RefPtr<TransformOperation> identityOperation = IdentityTransformOperation::create(); >+ auto identityOperation = IdentityTransformOperation::create(); > if (progress > 0.5) >- result.operations().append(toOperation ? toOperation : identityOperation); >+ result.operations().append(toOperation ? toOperation : WTFMove(identityOperation)); > else >- result.operations().append(fromOperation ? fromOperation : identityOperation); >+ result.operations().append(fromOperation ? fromOperation : WTFMove(identityOperation)); > } > } > >diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp >index 860da38638ef52a90ed1fd89b52dee965430153c..06c0a19f30d39d1919d2b4cfd41d447ec0542182 100644 >--- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp >+++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp >@@ -144,8 +144,8 @@ void ICOImageDecoder::setDataForPNGDecoderAtIndex(size_t index) > // Copy out PNG data to a separate vector and send to the PNG decoder. > // FIXME: Save this copy by making the PNG decoder able to take an > // optional offset. >- RefPtr<SharedBuffer> pngData(SharedBuffer::create(&m_data->data()[dirEntry.m_imageOffset], m_data->size() - dirEntry.m_imageOffset)); >- m_pngDecoders[index]->setData(*pngData, isAllDataReceived()); >+ auto pngData = SharedBuffer::create(&m_data->data()[dirEntry.m_imageOffset], m_data->size() - dirEntry.m_imageOffset); >+ m_pngDecoders[index]->setData(pngData.get(), isAllDataReceived()); > } > > void ICOImageDecoder::decode(size_t index, bool onlySize, bool allDataReceived) >diff --git a/Source/WebCore/platform/mock/mediasource/MockBox.cpp b/Source/WebCore/platform/mock/mediasource/MockBox.cpp >index e54ba376da6166457c2328971814cff385fa6e18..100912b329333fc3ebc33c517bb2d47376b8d266 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockBox.cpp >+++ b/Source/WebCore/platform/mock/mediasource/MockBox.cpp >@@ -97,11 +97,11 @@ MockInitializationBox::MockInitializationBox(ArrayBuffer* data) > size_t offset = 16; > > while (offset < m_length) { >- RefPtr<ArrayBuffer> subBuffer = data->slice(offset); >- if (MockBox::peekType(subBuffer.get()) != MockTrackBox::type()) >+ auto subBuffer = data->slice(offset); >+ if (MockBox::peekType(subBuffer.ptr()) != MockTrackBox::type()) > break; > >- MockTrackBox trackBox(subBuffer.get()); >+ MockTrackBox trackBox(subBuffer.ptr()); > offset += trackBox.length(); > m_tracks.append(trackBox); > } >diff --git a/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp b/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp >index 2a8b24bd2f921e1c1f350022277a83387ec37afe..4258897be6be3911e60bedac101f33e099bcd123 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp >+++ b/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp >@@ -105,7 +105,7 @@ Ref<MediaSample> MockMediaSample::createNonDisplayingCopy() const > > class MockMediaDescription final : public MediaDescription { > public: >- static RefPtr<MockMediaDescription> create(const MockTrackBox& box) { return adoptRef(new MockMediaDescription(box)); } >+ static Ref<MockMediaDescription> create(const MockTrackBox& box) { return adoptRef(*new MockMediaDescription(box)); } > virtual ~MockMediaDescription() = default; > > AtomicString codec() const override { return m_box.codec(); } >@@ -118,9 +118,9 @@ class MockMediaDescription final : public MediaDescription { > MockTrackBox m_box; > }; > >-RefPtr<MockSourceBufferPrivate> MockSourceBufferPrivate::create(MockMediaSourcePrivate* parent) >+Ref<MockSourceBufferPrivate> MockSourceBufferPrivate::create(MockMediaSourcePrivate* parent) > { >- return adoptRef(new MockSourceBufferPrivate(parent)); >+ return adoptRef(*new MockSourceBufferPrivate(parent)); > } > > MockSourceBufferPrivate::MockSourceBufferPrivate(MockMediaSourcePrivate* parent) >@@ -142,17 +142,17 @@ void MockSourceBufferPrivate::append(Vector<unsigned char>&& data) > SourceBufferPrivateClient::AppendResult result = SourceBufferPrivateClient::AppendSucceeded; > > while (m_inputBuffer.size() && result == SourceBufferPrivateClient::AppendSucceeded) { >- RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(m_inputBuffer.data(), m_inputBuffer.size()); >- size_t boxLength = MockBox::peekLength(buffer.get()); >+ auto buffer = ArrayBuffer::create(m_inputBuffer.data(), m_inputBuffer.size()); >+ size_t boxLength = MockBox::peekLength(buffer.ptr()); > if (boxLength > buffer->byteLength()) > break; > >- String type = MockBox::peekType(buffer.get()); >+ String type = MockBox::peekType(buffer.ptr()); > if (type == MockInitializationBox::type()) { >- MockInitializationBox initBox = MockInitializationBox(buffer.get()); >+ MockInitializationBox initBox = MockInitializationBox(buffer.ptr()); > didReceiveInitializationSegment(initBox); > } else if (type == MockSampleBox::type()) { >- MockSampleBox sampleBox = MockSampleBox(buffer.get()); >+ MockSampleBox sampleBox = MockSampleBox(buffer.ptr()); > didReceiveSample(sampleBox); > } else > result = SourceBufferPrivateClient::ParsingFailed; >diff --git a/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h b/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h >index b3f8af42a2f42aeb9edece6ab33b5e87a5272529..15760053cbf0f05294338c47f2611523ba9824c2 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h >+++ b/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h >@@ -41,7 +41,7 @@ class VideoTrackPrivate; > > class MockSourceBufferPrivate final : public SourceBufferPrivate { > public: >- static RefPtr<MockSourceBufferPrivate> create(MockMediaSourcePrivate*); >+ static Ref<MockSourceBufferPrivate> create(MockMediaSourcePrivate*); > virtual ~MockSourceBufferPrivate(); > > void clearMediaSource() { m_mediaSource = nullptr; } >diff --git a/Source/WebCore/platform/mock/mediasource/MockTracks.h b/Source/WebCore/platform/mock/mediasource/MockTracks.h >index b46ca6b6011b02290d6b830fbe0b603fd2dbad0c..f4c0092294881a4faef1c0df7520834c69e22023 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockTracks.h >+++ b/Source/WebCore/platform/mock/mediasource/MockTracks.h >@@ -53,7 +53,7 @@ class MockAudioTrackPrivate : public AudioTrackPrivate { > > class MockTextTrackPrivate : public InbandTextTrackPrivate { > public: >- static RefPtr<MockTextTrackPrivate> create(const MockTrackBox& box) { return adoptRef(new MockTextTrackPrivate(box)); } >+ static Ref<MockTextTrackPrivate> create(const MockTrackBox& box) { return adoptRef(*new MockTextTrackPrivate(box)); } > virtual ~MockTextTrackPrivate() = default; > > virtual AtomicString id() const { return m_id; } >@@ -72,7 +72,7 @@ class MockTextTrackPrivate : public InbandTextTrackPrivate { > > class MockVideoTrackPrivate : public VideoTrackPrivate { > public: >- static RefPtr<MockVideoTrackPrivate> create(const MockTrackBox& box) { return adoptRef(new MockVideoTrackPrivate(box)); } >+ static Ref<MockVideoTrackPrivate> create(const MockTrackBox& box) { return adoptRef(*new MockVideoTrackPrivate(box)); } > virtual ~MockVideoTrackPrivate() = default; > > virtual AtomicString id() const { return m_id; } >diff --git a/Source/WebCore/platform/network/FormData.h b/Source/WebCore/platform/network/FormData.h >index d7c1e5faa0de50783bfb47724bf59919ab66f91d..c49f42178120a4c3d2b4d302684b2d83af1f46f2 100644 >--- a/Source/WebCore/platform/network/FormData.h >+++ b/Source/WebCore/platform/network/FormData.h >@@ -305,7 +305,7 @@ void FormData::encode(Encoder& encoder) const > template<typename Decoder> > RefPtr<FormData> FormData::decode(Decoder& decoder) > { >- RefPtr<FormData> data = FormData::create(); >+ auto data = FormData::create(); > > if (!decoder.decode(data->m_alwaysStream)) > return nullptr; >@@ -319,7 +319,7 @@ RefPtr<FormData> FormData::decode(Decoder& decoder) > if (!decoder.decode(data->m_identifier)) > return nullptr; > >- return data; >+ return WTFMove(data); > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/network/cocoa/CookieStorageObserver.h b/Source/WebCore/platform/network/cocoa/CookieStorageObserver.h >index 624ccc5e128071d7417b8d16e4e854fd753aee69..8e7733c57ad50d1ee6645bdcb9a3238ccdd7de69 100644 >--- a/Source/WebCore/platform/network/cocoa/CookieStorageObserver.h >+++ b/Source/WebCore/platform/network/cocoa/CookieStorageObserver.h >@@ -37,7 +37,7 @@ namespace WebCore { > > class CookieStorageObserver : public ThreadSafeRefCounted<CookieStorageObserver> { > public: >- static RefPtr<CookieStorageObserver> create(NSHTTPCookieStorage *); >+ static Ref<CookieStorageObserver> create(NSHTTPCookieStorage *); > CookieStorageObserver(NSHTTPCookieStorage *); > ~CookieStorageObserver(); > >diff --git a/Source/WebCore/platform/network/cocoa/CookieStorageObserver.mm b/Source/WebCore/platform/network/cocoa/CookieStorageObserver.mm >index 918171c6b0707aa0800e9b8df294b41e1cf789d0..5d25ae10d2f1aba7383b7036216e37791672e48b 100644 >--- a/Source/WebCore/platform/network/cocoa/CookieStorageObserver.mm >+++ b/Source/WebCore/platform/network/cocoa/CookieStorageObserver.mm >@@ -74,9 +74,9 @@ @end > > namespace WebCore { > >-RefPtr<CookieStorageObserver> CookieStorageObserver::create(NSHTTPCookieStorage *cookieStorage) >+Ref<CookieStorageObserver> CookieStorageObserver::create(NSHTTPCookieStorage *cookieStorage) > { >- return adoptRef(new CookieStorageObserver(cookieStorage)); >+ return adoptRef(*new CookieStorageObserver(cookieStorage)); > } > > CookieStorageObserver::CookieStorageObserver(NSHTTPCookieStorage *cookieStorage) >diff --git a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >index aa95737be79abd14f19ba21b922ccb101650c488..0f6ea19787a46c7474b41648f24584957b00d2a5 100644 >--- a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >@@ -52,7 +52,7 @@ static uint64_t appendEncodedBlobItemToSoupMessageBody(SoupMessage* soupMessage, > if (fileModificationTime->secondsSinceEpoch().secondsAs<time_t>() != blobItem.file()->expectedModificationTime()->secondsSinceEpoch().secondsAs<time_t>()) > return 0; > >- if (RefPtr<SharedBuffer> buffer = SharedBuffer::createWithContentsOfFile(blobItem.file()->path())) { >+ if (auto buffer = SharedBuffer::createWithContentsOfFile(blobItem.file()->path())) { > if (buffer->isEmpty()) > return 0; > >@@ -82,7 +82,7 @@ void ResourceRequest::updateSoupMessageBody(SoupMessage* soupMessage) const > bodySize += bytes.size(); > soup_message_body_append(soupMessage->request_body, SOUP_MEMORY_TEMPORARY, bytes.data(), bytes.size()); > }, [&] (const FormDataElement::EncodedFileData& fileData) { >- if (RefPtr<SharedBuffer> buffer = SharedBuffer::createWithContentsOfFile(fileData.filename)) { >+ if (auto buffer = SharedBuffer::createWithContentsOfFile(fileData.filename)) { > if (buffer->isEmpty()) > return; > >diff --git a/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp b/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp >index c90869301618558b60e1f304818dbdd9e51dbc12..2d7b66d937905dcc22f4a13e95a0af06bb48b7af 100644 >--- a/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp >+++ b/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp >@@ -169,14 +169,14 @@ class HyphenationDictionary : public RefCounted<HyphenationDictionary> { > > virtual ~HyphenationDictionary() = default; > >- static RefPtr<HyphenationDictionary> createNull() >+ static Ref<HyphenationDictionary> createNull() > { >- return adoptRef(new HyphenationDictionary()); >+ return adoptRef(*new HyphenationDictionary()); > } > >- static RefPtr<HyphenationDictionary> create(const CString& dictPath) >+ static Ref<HyphenationDictionary> create(const CString& dictPath) > { >- return adoptRef(new HyphenationDictionary(dictPath)); >+ return adoptRef(*new HyphenationDictionary(dictPath)); > } > > HyphenDict* libhyphenDictionary() const >diff --git a/Source/WebCore/platform/win/SearchPopupMenuWin.cpp b/Source/WebCore/platform/win/SearchPopupMenuWin.cpp >index ac7cb667bce8a2718bac7df16e6bc4918d43db76..8e74b076935aa0dccd7ea837ace67b3ce7ce155a 100644 >--- a/Source/WebCore/platform/win/SearchPopupMenuWin.cpp >+++ b/Source/WebCore/platform/win/SearchPopupMenuWin.cpp >@@ -27,13 +27,13 @@ > namespace WebCore { > > SearchPopupMenuWin::SearchPopupMenuWin(PopupMenuClient* client) >- : m_popup(adoptRef(new PopupMenuWin(client))) >+ : m_popup(adoptRef(*new PopupMenuWin(client))) > { > } > > PopupMenu* SearchPopupMenuWin::popupMenu() > { >- return m_popup.get(); >+ return m_popup.ptr(); > } > > bool SearchPopupMenuWin::enabled() >diff --git a/Source/WebCore/platform/win/SearchPopupMenuWin.h b/Source/WebCore/platform/win/SearchPopupMenuWin.h >index e5060b8ab9b9feaf35bfb8b37b19a3cd1956511e..9a7ae8823c5c43ff946a6157afc57b59dc1543e0 100644 >--- a/Source/WebCore/platform/win/SearchPopupMenuWin.h >+++ b/Source/WebCore/platform/win/SearchPopupMenuWin.h >@@ -36,7 +36,7 @@ class SearchPopupMenuWin : public SearchPopupMenu { > virtual bool enabled(); > > private: >- RefPtr<PopupMenuWin> m_popup; >+ Ref<PopupMenuWin> m_popup; > }; > > } >diff --git a/Source/WebCore/rendering/RenderThemeIOS.mm b/Source/WebCore/rendering/RenderThemeIOS.mm >index 52b4d745b99733ac6af0b5b72c360b6b2d4b0a9b..ee1e226831cf6497c04df3b5077ad7579885e889 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.mm >+++ b/Source/WebCore/rendering/RenderThemeIOS.mm >@@ -562,7 +562,7 @@ void RenderThemeIOS::adjustRoundBorderRadius(RenderStyle& style, RenderBox& box) > static void applyCommonButtonPaddingToStyle(RenderStyle& style, const Element& element) > { > Document& document = element.document(); >- RefPtr<CSSPrimitiveValue> emSize = CSSPrimitiveValue::create(0.5, CSSPrimitiveValue::CSS_EMS); >+ auto emSize = CSSPrimitiveValue::create(0.5, CSSPrimitiveValue::CSS_EMS); > int pixels = emSize->computeLength<int>(CSSToLengthConversionData(&style, document.renderStyle(), document.renderView(), document.frame()->pageZoomFactor())); > style.setPaddingBox(LengthBox(0, pixels, 0, pixels)); > } >@@ -917,12 +917,12 @@ bool RenderThemeIOS::paintProgressBar(const RenderObject& renderer, const PaintI > context.setStrokeStyle(SolidStroke); > > const float verticalRenderingPosition = rect.y() + verticalOffset; >- RefPtr<Gradient> strokeGradient = Gradient::create(Gradient::LinearData { FloatPoint(rect.x(), verticalRenderingPosition), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1) }); >+ auto strokeGradient = Gradient::create(Gradient::LinearData { FloatPoint(rect.x(), verticalRenderingPosition), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1) }); > strokeGradient->addColorStop(0.0, Color(0x8d, 0x8d, 0x8d)); > strokeGradient->addColorStop(0.45, Color(0xee, 0xee, 0xee)); > strokeGradient->addColorStop(0.55, Color(0xee, 0xee, 0xee)); > strokeGradient->addColorStop(1.0, Color(0x8d, 0x8d, 0x8d)); >- context.setStrokeGradient(strokeGradient.releaseNonNull()); >+ context.setStrokeGradient(WTFMove(strokeGradient)); > > context.setFillColor(Color(255, 255, 255)); > >@@ -937,10 +937,10 @@ bool RenderThemeIOS::paintProgressBar(const RenderObject& renderer, const PaintI > paintInfo.context().clipRoundedRect(FloatRoundedRect(border, roundedCornerRadius, roundedCornerRadius, roundedCornerRadius, roundedCornerRadius)); > > float upperGradientHeight = progressBarHeight / 2.; >- RefPtr<Gradient> upperGradient = Gradient::create(Gradient::LinearData { FloatPoint(rect.x(), verticalRenderingPosition + 0.5), FloatPoint(rect.x(), verticalRenderingPosition + upperGradientHeight - 1.5) }); >+ auto upperGradient = Gradient::create(Gradient::LinearData { FloatPoint(rect.x(), verticalRenderingPosition + 0.5), FloatPoint(rect.x(), verticalRenderingPosition + upperGradientHeight - 1.5) }); > upperGradient->addColorStop(0.0, Color(133, 133, 133, 188)); > upperGradient->addColorStop(1.0, Color(18, 18, 18, 51)); >- context.setFillGradient(upperGradient.releaseNonNull()); >+ context.setFillGradient(WTFMove(upperGradient)); > > context.fillRect(FloatRect(rect.x(), verticalRenderingPosition, rect.width(), upperGradientHeight)); > >@@ -949,20 +949,20 @@ bool RenderThemeIOS::paintProgressBar(const RenderObject& renderer, const PaintI > // 2) Draw the progress bar. > double position = clampTo(renderProgress.position(), 0.0, 1.0); > double barWidth = position * rect.width(); >- RefPtr<Gradient> barGradient = Gradient::create(Gradient::LinearData { FloatPoint(rect.x(), verticalRenderingPosition + 0.5), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1) }); >+ auto barGradient = Gradient::create(Gradient::LinearData { FloatPoint(rect.x(), verticalRenderingPosition + 0.5), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1) }); > barGradient->addColorStop(0.0, Color(195, 217, 247)); > barGradient->addColorStop(0.45, Color(118, 164, 228)); > barGradient->addColorStop(0.49, Color(118, 164, 228)); > barGradient->addColorStop(0.51, Color(36, 114, 210)); > barGradient->addColorStop(0.55, Color(36, 114, 210)); > barGradient->addColorStop(1.0, Color(57, 142, 244)); >- context.setFillGradient(barGradient.releaseNonNull()); >+ context.setFillGradient(WTFMove(barGradient)); > >- RefPtr<Gradient> barStrokeGradient = Gradient::create(Gradient::LinearData { FloatPoint(rect.x(), verticalRenderingPosition), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1) }); >+ auto barStrokeGradient = Gradient::create(Gradient::LinearData { FloatPoint(rect.x(), verticalRenderingPosition), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1) }); > barStrokeGradient->addColorStop(0.0, Color(95, 107, 183)); > barStrokeGradient->addColorStop(0.5, Color(66, 106, 174, 240)); > barStrokeGradient->addColorStop(1.0, Color(38, 104, 166)); >- context.setStrokeGradient(barStrokeGradient.releaseNonNull()); >+ context.setStrokeGradient(WTFMove(barStrokeGradient)); > > Path barPath; > int left = rect.x(); >@@ -1025,7 +1025,7 @@ void RenderThemeIOS::adjustButtonStyle(StyleResolver& selector, RenderStyle& sty > // CSSPrimitiveValue::computeLengthInt only needs the element's style to calculate em lengths. > // Since the element might not be in a document, just pass nullptr for the root element style > // and the render view. >- RefPtr<CSSPrimitiveValue> emSize = CSSPrimitiveValue::create(1.0, CSSPrimitiveValue::CSS_EMS); >+ auto emSize = CSSPrimitiveValue::create(1.0, CSSPrimitiveValue::CSS_EMS); > int pixels = emSize->computeLength<int>(CSSToLengthConversionData(&style, nullptr, nullptr, 1.0, false)); > style.setPaddingBox(LengthBox(0, pixels, 0, pixels)); > >@@ -1743,11 +1743,8 @@ static void paintAttachmentIcon(GraphicsContext& context, RenderAttachmentInfo& > if (!info.icon) > return; > >- RefPtr<Image> iconImage = BitmapImage::create([info.icon CGImage]); >- if (!iconImage) >- return; >- >- context.drawImage(*iconImage, info.iconRect); >+ auto iconImage = BitmapImage::create([info.icon CGImage]); >+ context.drawImage(iconImage.get(), info.iconRect); > } > > static void paintAttachmentText(GraphicsContext& context, RenderAttachmentInfo& info) >diff --git a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp >index fabc8b2ab8bffa19f3eabde4c06a99dfbfe3694c..155744d3fddb704413b7a069caf56be3584dc301 100644 >--- a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp >+++ b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp >@@ -423,8 +423,8 @@ void writeSVGResourceContainer(TextStream& ts, const RenderSVGResourceContainer& > ts << "\n"; > // Creating a placeholder filter which is passed to the builder. > FloatRect dummyRect; >- RefPtr<SVGFilter> dummyFilter = SVGFilter::create(AffineTransform(), dummyRect, dummyRect, dummyRect, true); >- if (auto builder = filter.buildPrimitives(*dummyFilter)) { >+ auto dummyFilter = SVGFilter::create(AffineTransform(), dummyRect, dummyRect, dummyRect, true); >+ if (auto builder = filter.buildPrimitives(dummyFilter.get())) { > TextStream::IndentScope indentScope(ts); > > if (FilterEffect* lastEffect = builder->lastEffect()) >diff --git a/Source/WebCore/storage/Storage.cpp b/Source/WebCore/storage/Storage.cpp >index 568723889278ec7ab244b5c95a4f6b5ed25dff76..c269a855946beebd6a0bed91a8aab909204b2dfe 100644 >--- a/Source/WebCore/storage/Storage.cpp >+++ b/Source/WebCore/storage/Storage.cpp >@@ -37,17 +37,16 @@ > > namespace WebCore { > >-Ref<Storage> Storage::create(DOMWindow& window, RefPtr<StorageArea>&& storageArea) >+Ref<Storage> Storage::create(DOMWindow& window, Ref<StorageArea>&& storageArea) > { > return adoptRef(*new Storage(window, WTFMove(storageArea))); > } > >-Storage::Storage(DOMWindow& window, RefPtr<StorageArea>&& storageArea) >+Storage::Storage(DOMWindow& window, Ref<StorageArea>&& storageArea) > : DOMWindowProperty(&window) > , m_storageArea(WTFMove(storageArea)) > { > ASSERT(frame()); >- ASSERT(m_storageArea); > > m_storageArea->incrementAccessCount(); > } >diff --git a/Source/WebCore/storage/Storage.h b/Source/WebCore/storage/Storage.h >index 8366bbc1b59c79f9e757de3a13f750a1cb378201..983e85a62a864c7a70df17d3aa502f25f7dc9fbc 100644 >--- a/Source/WebCore/storage/Storage.h >+++ b/Source/WebCore/storage/Storage.h >@@ -35,7 +35,7 @@ class StorageArea; > > class Storage : public ScriptWrappable, public RefCounted<Storage>, public DOMWindowProperty { > public: >- static Ref<Storage> create(DOMWindow&, RefPtr<StorageArea>&&); >+ static Ref<Storage> create(DOMWindow&, Ref<StorageArea>&&); > ~Storage(); > > unsigned length() const; >@@ -50,12 +50,12 @@ class Storage : public ScriptWrappable, public RefCounted<Storage>, public DOMWi > bool isSupportedPropertyName(const String&) const; > Vector<AtomicString> supportedPropertyNames() const; > >- StorageArea& area() const { return *m_storageArea; } >+ StorageArea& area() const { return m_storageArea.get(); } > > private: >- Storage(DOMWindow&, RefPtr<StorageArea>&&); >+ Storage(DOMWindow&, Ref<StorageArea>&&); > >- const RefPtr<StorageArea> m_storageArea; >+ const Ref<StorageArea> m_storageArea; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/storage/StorageNamespace.h b/Source/WebCore/storage/StorageNamespace.h >index 409a433e1d5c1f6e2d7d18a11976d9bb2ffc252a..55c66282b8bd68bc04782df47caded0c21294b48 100644 >--- a/Source/WebCore/storage/StorageNamespace.h >+++ b/Source/WebCore/storage/StorageNamespace.h >@@ -37,8 +37,8 @@ struct SecurityOriginData; > class StorageNamespace : public RefCounted<StorageNamespace> { > public: > virtual ~StorageNamespace() = default; >- virtual RefPtr<StorageArea> storageArea(const SecurityOriginData&) = 0; >- virtual RefPtr<StorageNamespace> copy(Page* newPage) = 0; >+ virtual Ref<StorageArea> storageArea(const SecurityOriginData&) = 0; >+ virtual Ref<StorageNamespace> copy(Page* newPage) = 0; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/storage/StorageNamespaceProvider.cpp b/Source/WebCore/storage/StorageNamespaceProvider.cpp >index 69c1b335308bbfcd97ba485653e16a6c97595c4f..5939affd3eb2f8eed46bf62bab4b15aeb5e95edf 100644 >--- a/Source/WebCore/storage/StorageNamespaceProvider.cpp >+++ b/Source/WebCore/storage/StorageNamespaceProvider.cpp >@@ -60,7 +60,7 @@ void StorageNamespaceProvider::removePage(Page& page) > m_pages.remove(&page); > } > >-RefPtr<StorageArea> StorageNamespaceProvider::localStorageArea(Document& document) >+Ref<StorageArea> StorageNamespaceProvider::localStorageArea(Document& document) > { > // This StorageNamespaceProvider was retrieved from the Document's Page, > // so the Document had better still actually have a Page. >diff --git a/Source/WebCore/storage/StorageNamespaceProvider.h b/Source/WebCore/storage/StorageNamespaceProvider.h >index 1916ccb227ed91f5ff926424f006982962b1a76f..dd7f9a46bd8479249c74d2a4c22452964e67aecd 100644 >--- a/Source/WebCore/storage/StorageNamespaceProvider.h >+++ b/Source/WebCore/storage/StorageNamespaceProvider.h >@@ -44,10 +44,10 @@ class StorageNamespaceProvider : public RefCounted<StorageNamespaceProvider> { > WEBCORE_EXPORT StorageNamespaceProvider(); > WEBCORE_EXPORT virtual ~StorageNamespaceProvider(); > >- virtual RefPtr<StorageNamespace> createSessionStorageNamespace(Page&, unsigned quota) = 0; >- virtual RefPtr<StorageNamespace> createEphemeralLocalStorageNamespace(Page&, unsigned quota) = 0; >+ virtual Ref<StorageNamespace> createSessionStorageNamespace(Page&, unsigned quota) = 0; >+ virtual Ref<StorageNamespace> createEphemeralLocalStorageNamespace(Page&, unsigned quota) = 0; > >- RefPtr<StorageArea> localStorageArea(Document&); >+ Ref<StorageArea> localStorageArea(Document&); > > void addPage(Page&); > void removePage(Page&); >@@ -59,8 +59,8 @@ class StorageNamespaceProvider : public RefCounted<StorageNamespaceProvider> { > StorageNamespace& localStorageNamespace(); > StorageNamespace& transientLocalStorageNamespace(SecurityOrigin&); > >- virtual RefPtr<StorageNamespace> createLocalStorageNamespace(unsigned quota) = 0; >- virtual RefPtr<StorageNamespace> createTransientLocalStorageNamespace(SecurityOrigin&, unsigned quota) = 0; >+ virtual Ref<StorageNamespace> createLocalStorageNamespace(unsigned quota) = 0; >+ virtual Ref<StorageNamespace> createTransientLocalStorageNamespace(SecurityOrigin&, unsigned quota) = 0; > > HashSet<Page*> m_pages; > >diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp >index 025b96bbcb4448611c7345b0cdfc7a10d96ce506..85f6ff12f3855e72f3515cf327b539b5f3d023b3 100644 >--- a/Source/WebCore/svg/SVGElement.cpp >+++ b/Source/WebCore/svg/SVGElement.cpp >@@ -1016,7 +1016,7 @@ RefPtr<DeprecatedCSSOMValue> SVGElement::getPresentationAttribute(const String& > if (!attribute) > return 0; > >- RefPtr<MutableStyleProperties> style = MutableStyleProperties::create(SVGAttributeMode); >+ auto style = MutableStyleProperties::create(SVGAttributeMode); > CSSPropertyID propertyID = cssPropertyIdForSVGAttributeName(attribute->name()); > style->setProperty(propertyID, attribute->value()); > auto cssValue = style->getPropertyCSSValue(propertyID); >diff --git a/Source/WebCore/svg/SVGFEBlendElement.cpp b/Source/WebCore/svg/SVGFEBlendElement.cpp >index 8c66d2c22160c42eed64029c27a2cb6491d1a56b..c241e30e39e6508a29b754c8786a9d8f80e3ac4c 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.cpp >+++ b/Source/WebCore/svg/SVGFEBlendElement.cpp >@@ -112,7 +112,7 @@ RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, F > if (!input1 || !input2) > return nullptr; > >- RefPtr<FilterEffect> effect = FEBlend::create(filter, mode()); >+ auto effect = FEBlend::create(filter, mode()); > FilterEffectVector& inputEffects = effect->inputEffects(); > inputEffects.reserveCapacity(2); > inputEffects.append(input1); >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >index 515d32ffbcd7e53a7bb4f58fdab825bf61c97b79..7513ace51790f86d8e9cf8e0c81646290723394f 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >@@ -143,7 +143,7 @@ RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuil > return nullptr; > } > >- RefPtr<FilterEffect> effect = FEColorMatrix::create(filter, filterType, filterValues); >+ auto effect = FEColorMatrix::create(filter, filterType, filterValues); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >index 57faf3b4630019703e3d87b9c3324327c47dbab2..52be9712bc5f61ab47e2268000f2b19680f6695c 100644 >--- a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >+++ b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >@@ -89,7 +89,7 @@ RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filt > alpha = downcast<SVGFEFuncAElement>(child).transferFunction(); > } > >- RefPtr<FilterEffect> effect = FEComponentTransfer::create(filter, red, green, blue, alpha); >+ auto effect = FEComponentTransfer::create(filter, red, green, blue, alpha); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/svg/SVGFECompositeElement.cpp b/Source/WebCore/svg/SVGFECompositeElement.cpp >index a10e3a721cfeabd4722aa097b1dcf87e2c25f9a7..d38557477c1689b218abdc9f0a9163f1495cbb30 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.cpp >+++ b/Source/WebCore/svg/SVGFECompositeElement.cpp >@@ -143,7 +143,7 @@ RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilde > if (!input1 || !input2) > return nullptr; > >- RefPtr<FilterEffect> effect = FEComposite::create(filter, svgOperator(), k1(), k2(), k3(), k4()); >+ auto effect = FEComposite::create(filter, svgOperator(), k1(), k2(), k3(), k4()); > FilterEffectVector& inputEffects = effect->inputEffects(); > inputEffects.reserveCapacity(2); > inputEffects.append(input1); >diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >index b9b023ac006c07eccdd077749d2725923d2bfd04..067f12cb703982c7ed14284f04c60d37c7e1d9c9 100644 >--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >@@ -189,7 +189,7 @@ RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filter > > Color color = renderer->style().colorByApplyingColorFilter(renderer->style().svgStyle().lightingColor()); > >- RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(), kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource)); >+ auto effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(), kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource)); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >index 435fc701df607cf0b0bd96ad771db5ffafd44f53..14f77f9f6f88131964bb42ea295d9137e69cdd3a 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >@@ -127,7 +127,7 @@ RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filter > if (!input1 || !input2) > return nullptr; > >- RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, xChannelSelector(), yChannelSelector(), scale()); >+ auto effect = FEDisplacementMap::create(filter, xChannelSelector(), yChannelSelector(), scale()); > FilterEffectVector& inputEffects = effect->inputEffects(); > inputEffects.reserveCapacity(2); > inputEffects.append(input1); >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.cpp b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >index 550f65e2743cf1ed6a6443f951ecf4bb8ef8c59b..d54e5f2b685e993579af951937765fa34ea3b1f5 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.cpp >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >@@ -134,7 +134,7 @@ RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuild > if (!input1) > return nullptr; > >- RefPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDeviationX(), stdDeviationY(), dx(), dy(), color, opacity); >+ auto effect = FEDropShadow::create(filter, stdDeviationX(), stdDeviationY(), dx(), dy(), color, opacity); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >index 933187e6d049a4fef7d714e6a395651141a4ca00..320f921fe0afbee282f4df78773debcc78812bc9 100644 >--- a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >+++ b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >@@ -124,7 +124,7 @@ RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBui > if (stdDeviationX() < 0 || stdDeviationY() < 0) > return nullptr; > >- RefPtr<FilterEffect> effect = FEGaussianBlur::create(filter, stdDeviationX(), stdDeviationY(), edgeMode()); >+ auto effect = FEGaussianBlur::create(filter, stdDeviationX(), stdDeviationY(), edgeMode()); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/svg/SVGFEMergeElement.cpp b/Source/WebCore/svg/SVGFEMergeElement.cpp >index 502a99193c89b0f7e91b8119b96bf5dc87435b89..fb92a35e8d440378c20c0c62585c7b5ea984d02a 100644 >--- a/Source/WebCore/svg/SVGFEMergeElement.cpp >+++ b/Source/WebCore/svg/SVGFEMergeElement.cpp >@@ -46,7 +46,7 @@ Ref<SVGFEMergeElement> SVGFEMergeElement::create(const QualifiedName& tagName, D > > RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) > { >- RefPtr<FilterEffect> effect = FEMerge::create(filter); >+ auto effect = FEMerge::create(filter); > FilterEffectVector& mergeInputs = effect->inputEffects(); > > for (auto& mergeNode : childrenOfType<SVGFEMergeNodeElement>(*this)) { >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.cpp b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >index fcbc63b62e6e106ebb5d56209e3f5299d8b0b6fc..e3e81afe1af7f126e4d9b07e8039c2e8ab8d8619 100644 >--- a/Source/WebCore/svg/SVGFEMorphologyElement.cpp >+++ b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >@@ -145,7 +145,7 @@ RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuild > if (xRadius < 0 || yRadius < 0) > return nullptr; > >- RefPtr<FilterEffect> effect = FEMorphology::create(filter, svgOperator(), xRadius, yRadius); >+ auto effect = FEMorphology::create(filter, svgOperator(), xRadius, yRadius); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/svg/SVGFEOffsetElement.cpp b/Source/WebCore/svg/SVGFEOffsetElement.cpp >index 28236984f41a5ba2fa623516bbf7041aadbd0222..c402e403eb2b9443988c8b0ea949b37fd024ead4 100644 >--- a/Source/WebCore/svg/SVGFEOffsetElement.cpp >+++ b/Source/WebCore/svg/SVGFEOffsetElement.cpp >@@ -92,7 +92,7 @@ RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, > if (!input1) > return nullptr; > >- RefPtr<FilterEffect> effect = FEOffset::create(filter, dx(), dy()); >+ auto effect = FEOffset::create(filter, dx(), dy()); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >index 3a2f4d23f973d57b1cdc69dde217737873d0cfe7..9e4d7fd427fcb1d0c1bbcea4345d5ebe95dce520 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >@@ -198,7 +198,7 @@ RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filte > > Color color = renderer->style().colorByApplyingColorFilter(renderer->style().svgStyle().lightingColor()); > >- RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(), specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource)); >+ auto effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(), specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource)); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/svg/SVGFETileElement.cpp b/Source/WebCore/svg/SVGFETileElement.cpp >index 3f3879d7e66a8c1ddf9923263b7fe00625489244..ae0d19198057b8f2422f1bbfc5180f53d0ea54ef 100644 >--- a/Source/WebCore/svg/SVGFETileElement.cpp >+++ b/Source/WebCore/svg/SVGFETileElement.cpp >@@ -81,7 +81,7 @@ RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Fi > if (!input1) > return nullptr; > >- RefPtr<FilterEffect> effect = FETile::create(filter); >+ auto effect = FETile::create(filter); > effect->inputEffects().append(input1); > return effect; > } >diff --git a/Source/WebCore/testing/GCObservation.h b/Source/WebCore/testing/GCObservation.h >index 86d958f576051b807e051c15aea0ba651bb4fb1b..ae118ef9ddfb80475e3df5403074a5a7cd864717 100644 >--- a/Source/WebCore/testing/GCObservation.h >+++ b/Source/WebCore/testing/GCObservation.h >@@ -35,9 +35,9 @@ namespace WebCore { > > class GCObservation final : public RefCounted<GCObservation> { > public: >- template<typename... Args> static RefPtr<GCObservation> create(Args&&... args) >+ template<typename... Args> static Ref<GCObservation> create(Args&&... args) > { >- return adoptRef(new GCObservation(std::forward<Args>(args)...)); >+ return adoptRef(*new GCObservation(std::forward<Args>(args)...)); > } > > bool wasCollected() const { return !m_observedValue; } >diff --git a/Source/WebCore/xml/XSLTProcessor.cpp b/Source/WebCore/xml/XSLTProcessor.cpp >index a9b17519692edb3cdc6a4ecf8f435fdf2c3b845f..99017abeb59933c30eac02e682c5246b2017c956 100644 >--- a/Source/WebCore/xml/XSLTProcessor.cpp >+++ b/Source/WebCore/xml/XSLTProcessor.cpp >@@ -100,7 +100,7 @@ Ref<Document> XSLTProcessor::createDocumentFromSource(const String& sourceString > frame->setDocument(result.copyRef()); > } > >- RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(sourceMIMEType); >+ auto decoder = TextResourceDecoder::create(sourceMIMEType); > decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncoding(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader); > result->setDecoder(WTFMove(decoder)); > >diff --git a/Source/WebCore/xml/parser/XMLDocumentParser.cpp b/Source/WebCore/xml/parser/XMLDocumentParser.cpp >index 1f28a8eba59df1e6e21fcc875e0f490baa60885f..b4250a02cebf90e2acc3edb37498aa488181ef83 100644 >--- a/Source/WebCore/xml/parser/XMLDocumentParser.cpp >+++ b/Source/WebCore/xml/parser/XMLDocumentParser.cpp >@@ -269,7 +269,7 @@ bool XMLDocumentParser::parseDocumentFragment(const String& chunk, DocumentFragm > return true; > } > >- RefPtr<XMLDocumentParser> parser = XMLDocumentParser::create(fragment, contextElement, parserContentPolicy); >+ auto parser = XMLDocumentParser::create(fragment, contextElement, parserContentPolicy); > bool wellFormed = parser->appendFragmentSource(chunk); > // Do not call finish(). The finish() and doEnd() implementations touch the main document and loader and can cause crashes in the fragment case. > parser->detach(); // Allows ~DocumentParser to assert it was detached before destruction. >diff --git a/Source/WebKit/PluginProcess/WebProcessConnection.cpp b/Source/WebKit/PluginProcess/WebProcessConnection.cpp >index 6d4a0ef4d6dbfd76730c04d78d0ba5c9b9cedb7f..366b983cc0bea583863a7cd6333f948df7484435 100644 >--- a/Source/WebKit/PluginProcess/WebProcessConnection.cpp >+++ b/Source/WebKit/PluginProcess/WebProcessConnection.cpp >@@ -49,7 +49,7 @@ using namespace WebCore; > > static IPC::Connection* currentConnection; > >-RefPtr<WebProcessConnection> WebProcessConnection::create(IPC::Connection::Identifier connectionIdentifier) >+Ref<WebProcessConnection> WebProcessConnection::create(IPC::Connection::Identifier connectionIdentifier) > { > return adoptRef(*new WebProcessConnection(connectionIdentifier)); > } >diff --git a/Source/WebKit/PluginProcess/WebProcessConnection.h b/Source/WebKit/PluginProcess/WebProcessConnection.h >index 321a083869386c4fbf5f28d07ed2dd6441c295c5..3a0a7a8979e3317d377268f8e69024ea2d62ca34 100644 >--- a/Source/WebKit/PluginProcess/WebProcessConnection.h >+++ b/Source/WebKit/PluginProcess/WebProcessConnection.h >@@ -43,7 +43,7 @@ struct PluginCreationParameters; > > class WebProcessConnection : public RefCounted<WebProcessConnection>, IPC::Connection::Client { > public: >- static RefPtr<WebProcessConnection> create(IPC::Connection::Identifier); >+ static Ref<WebProcessConnection> create(IPC::Connection::Identifier); > virtual ~WebProcessConnection(); > > IPC::Connection* connection() const { return m_connection.get(); } >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKConnection.mm b/Source/WebKit/UIProcess/API/Cocoa/WKConnection.mm >index b9fc8950fa33ca56f9a6509f6a2e1a8c0af9da17..c76496b7312467c366062faeec477269e3ae8cf5 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKConnection.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKConnection.mm >@@ -103,8 +103,8 @@ - (void)setDelegate:(id <WKConnectionDelegate>)delegate > > - (void)sendMessageWithName:(NSString *)messageName body:(id)messageBody > { >- RefPtr<WebKit::ObjCObjectGraph> wkMessageBody = WebKit::ObjCObjectGraph::create(messageBody); >- self._connection.postMessage(messageName, wkMessageBody.get()); >+ auto wkMessageBody = WebKit::ObjCObjectGraph::create(messageBody); >+ self._connection.postMessage(messageName, wkMessageBody.ptr()); > } > > - (WebKit::WebConnection&)_connection >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index b9bed1de94ef7176c3febdacc17e4dc4e1deaa7f..d14bd9d2b7eb32b3e18dfef32d0435c923db7168 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -1134,7 +1134,7 @@ - (void)takeSnapshotWithConfiguration:(WKSnapshotConfiguration *)snapshotConfigu > return; > } > >- RefPtr<WebKit::ShareableBitmap> bitmap = WebKit::ShareableBitmap::create(imageHandle, WebKit::SharedMemory::Protection::ReadOnly); >+ auto bitmap = WebKit::ShareableBitmap::create(imageHandle, WebKit::SharedMemory::Protection::ReadOnly); > RetainPtr<CGImageRef> cgImage = bitmap ? bitmap->makeCGImage() : nullptr; > RetainPtr<NSImage> nsImage = adoptNS([[NSImage alloc] initWithCGImage:cgImage.get() size:NSMakeSize(snapshotWidth, imageHeight)]); > handler(nsImage.get(), nil); >@@ -2063,8 +2063,8 @@ - (RefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot > #if HAVE(IOSURFACE_ACCELERATOR) > WebCore::IOSurface::Format compressedFormat = WebCore::IOSurface::Format::YUV422; > if (WebCore::IOSurface::allowConversionFromFormatToFormat(snapshotFormat, compressedFormat)) { >- RefPtr<WebKit::ViewSnapshot> viewSnapshot = WebKit::ViewSnapshot::create(nullptr); >- WebCore::IOSurface::convertToFormat(WTFMove(surface), WebCore::IOSurface::Format::YUV422, [viewSnapshot](std::unique_ptr<WebCore::IOSurface> convertedSurface) { >+ auto viewSnapshot = WebKit::ViewSnapshot::create(nullptr); >+ WebCore::IOSurface::convertToFormat(WTFMove(surface), WebCore::IOSurface::Format::YUV422, [viewSnapshot = viewSnapshot.copyRef()](std::unique_ptr<WebCore::IOSurface> convertedSurface) { > if (convertedSurface) > viewSnapshot->setSurface(WTFMove(convertedSurface)); > }); >@@ -5902,7 +5902,7 @@ - (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)im > return; > } > >- RefPtr<WebKit::ShareableBitmap> bitmap = WebKit::ShareableBitmap::create(imageHandle, WebKit::SharedMemory::Protection::ReadOnly); >+ auto bitmap = WebKit::ShareableBitmap::create(imageHandle, WebKit::SharedMemory::Protection::ReadOnly); > > if (!bitmap) { > copiedCompletionHandler(nullptr); >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp b/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp >index 007d111bad07b030cb9a80a37aacc95b25f93c42..95b02e83eec0100785759f0fd6b28d5cfff9ce57 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp >@@ -84,8 +84,8 @@ void WebKitGeolocationProvider::notifyPositionChanged(int timestamp, double lati > WebCore::GeolocationPosition corePosition { static_cast<double>(timestamp), latitude, longitude, accuracy }; > corePosition.altitude = altitude; > corePosition.altitudeAccuracy = altitudeAccuracy; >- RefPtr<WebGeolocationPosition> position = WebGeolocationPosition::create(WTFMove(corePosition)); >- m_geolocationManager->providerDidChangePosition(position.get()); >+ auto position = WebGeolocationPosition::create(WTFMove(corePosition)); >+ m_geolocationManager->providerDidChangePosition(position.ptr()); > } > > void WebKitGeolocationProvider::notifyErrorOccurred(const char* /* message */) >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp >index 7afa79c61ebcc02ecfb8ef99bddde13758624133..bce8058e59e6387042dcd268fa1993a6cd4b74cc 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp >@@ -1455,8 +1455,8 @@ void webkit_web_context_allow_tls_certificate_for_host(WebKitWebContext* context > g_return_if_fail(G_IS_TLS_CERTIFICATE(certificate)); > g_return_if_fail(host); > >- RefPtr<WebCertificateInfo> webCertificateInfo = WebCertificateInfo::create(WebCore::CertificateInfo(certificate, static_cast<GTlsCertificateFlags>(0))); >- context->priv->processPool->allowSpecificHTTPSCertificateForHost(webCertificateInfo.get(), String::fromUTF8(host)); >+ auto webCertificateInfo = WebCertificateInfo::create(WebCore::CertificateInfo(certificate, static_cast<GTlsCertificateFlags>(0))); >+ context->priv->processPool->allowSpecificHTTPSCertificateForHost(webCertificateInfo.ptr(), String::fromUTF8(host)); > } > > /** >diff --git a/Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp b/Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp >index f15ba68d1dfdca0056cc6cddf27cf6d72d1161d1..6a0d65bf018125a5f5c903a2571658c50f6b8487 100644 >--- a/Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp >+++ b/Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp >@@ -35,7 +35,7 @@ using namespace WebCore; > > std::optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(const ShareableBitmap::Handle& handle) > { >- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(handle, SharedMemory::Protection::ReadOnly); >+ auto bitmap = ShareableBitmap::create(handle, SharedMemory::Protection::ReadOnly); > if (!bitmap) > return std::nullopt; > >diff --git a/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm b/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm >index 67f1222a746c672c687d2afbd278c1db53898bcb..c52245b5f09e1e82804e1891fd549920f8d7b61a 100644 >--- a/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm >+++ b/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm >@@ -39,7 +39,7 @@ using namespace WebCore; > > std::optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(const ShareableBitmap::Handle& imageDataHandle) > { >- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(imageDataHandle, SharedMemory::Protection::ReadOnly); >+ auto bitmap = ShareableBitmap::create(imageDataHandle, SharedMemory::Protection::ReadOnly); > if (!bitmap) > return std::nullopt; > >diff --git a/Source/WebKit/UIProcess/BackingStore.cpp b/Source/WebKit/UIProcess/BackingStore.cpp >index c883642b5dc506b6276510b73485fcd4662ef481..5fd5af49b4cd57aeaff1686caace4ae5132fb96d 100644 >--- a/Source/WebKit/UIProcess/BackingStore.cpp >+++ b/Source/WebKit/UIProcess/BackingStore.cpp >@@ -48,7 +48,7 @@ void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo) > { > ASSERT(m_size == updateInfo.viewSize); > >- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(updateInfo.bitmapHandle); >+ auto bitmap = ShareableBitmap::create(updateInfo.bitmapHandle); > if (!bitmap) > return; > >diff --git a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >index f5ee4df18043d3b5a64b10d4c2e63740d9939772..313e1457355af97985d6b560a16796ba4bb4b5c7 100644 >--- a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >+++ b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >@@ -740,9 +740,9 @@ void NavigationState::NavigationClient::didCancelClientRedirect(WebPageProxy& pa > > static RetainPtr<NSError> createErrorWithRecoveryAttempter(WKWebView *webView, WebFrameProxy& webFrameProxy, NSError *originalError) > { >- RefPtr<API::FrameHandle> frameHandle = API::FrameHandle::create(webFrameProxy.frameID()); >+ auto frameHandle = API::FrameHandle::create(webFrameProxy.frameID()); > >- auto recoveryAttempter = adoptNS([[WKReloadFrameErrorRecoveryAttempter alloc] initWithWebView:webView frameHandle:wrapper(*frameHandle) urlString:originalError.userInfo[NSURLErrorFailingURLStringErrorKey]]); >+ auto recoveryAttempter = adoptNS([[WKReloadFrameErrorRecoveryAttempter alloc] initWithWebView:webView frameHandle:wrapper(frameHandle.get()) urlString:originalError.userInfo[NSURLErrorFailingURLStringErrorKey]]); > > auto userInfo = adoptNS([[NSMutableDictionary alloc] initWithObjectsAndKeys:recoveryAttempter.get(), _WKRecoveryAttempterErrorKey, nil]); > >diff --git a/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h b/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h >index 9d77410c09c1b7115a4041d297bb456838eae960..64a35f7e879db03dc0bf87722144c22bff3d9eca 100644 >--- a/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h >+++ b/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h >@@ -171,7 +171,7 @@ class PlaybackSessionModelContext final: public RefCounted<PlaybackSessionModelC > > class PlaybackSessionManagerProxy : public RefCounted<PlaybackSessionManagerProxy>, private IPC::MessageReceiver { > public: >- static RefPtr<PlaybackSessionManagerProxy> create(WebPageProxy&); >+ static Ref<PlaybackSessionManagerProxy> create(WebPageProxy&); > virtual ~PlaybackSessionManagerProxy(); > > void invalidate(); >diff --git a/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm b/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm >index 4c8fcbf8ef72e051e8a2291b5f4f16ffdc027067..8677a041c70d11b97698c47ec2b79adf31d901ce 100644 >--- a/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm >+++ b/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm >@@ -292,9 +292,9 @@ void PlaybackSessionModelContext::pictureInPictureActiveChanged(bool active) > > #pragma mark - PlaybackSessionManagerProxy > >-RefPtr<PlaybackSessionManagerProxy> PlaybackSessionManagerProxy::create(WebPageProxy& page) >+Ref<PlaybackSessionManagerProxy> PlaybackSessionManagerProxy::create(WebPageProxy& page) > { >- return adoptRef(new PlaybackSessionManagerProxy(page)); >+ return adoptRef(*new PlaybackSessionManagerProxy(page)); > } > > PlaybackSessionManagerProxy::PlaybackSessionManagerProxy(WebPageProxy& page) >diff --git a/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h b/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h >index a9299f1b7469b03ad234624bcd0b356bc928b692..297f968b3529e0c355cd4db1a899c20e8cc9024d 100644 >--- a/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h >+++ b/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h >@@ -119,7 +119,7 @@ class VideoFullscreenModelContext final > > class VideoFullscreenManagerProxy : public RefCounted<VideoFullscreenManagerProxy>, private IPC::MessageReceiver { > public: >- static RefPtr<VideoFullscreenManagerProxy> create(WebPageProxy&, PlaybackSessionManagerProxy&); >+ static Ref<VideoFullscreenManagerProxy> create(WebPageProxy&, PlaybackSessionManagerProxy&); > virtual ~VideoFullscreenManagerProxy(); > > void invalidate(); >diff --git a/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm b/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm >index a438fe71a86d327285aef5212ff3561264256d16..4cf30bf331e79421f239cca596311392f8f5a833 100644 >--- a/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm >+++ b/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm >@@ -314,9 +314,9 @@ void VideoFullscreenModelContext::didExitPictureInPicture() > > #pragma mark - VideoFullscreenManagerProxy > >-RefPtr<VideoFullscreenManagerProxy> VideoFullscreenManagerProxy::create(WebPageProxy& page, PlaybackSessionManagerProxy& playbackSessionManagerProxy) >+Ref<VideoFullscreenManagerProxy> VideoFullscreenManagerProxy::create(WebPageProxy& page, PlaybackSessionManagerProxy& playbackSessionManagerProxy) > { >- return adoptRef(new VideoFullscreenManagerProxy(page, playbackSessionManagerProxy)); >+ return adoptRef(*new VideoFullscreenManagerProxy(page, playbackSessionManagerProxy)); > } > > VideoFullscreenManagerProxy::VideoFullscreenManagerProxy(WebPageProxy& page, PlaybackSessionManagerProxy& playbackSessionManagerProxy) >diff --git a/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm >index 1710df19c42658f6f59c7c1807771af22e223dc2..1dad704ec996b1ef9d4c1a99b170bf7623d3689a 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm >@@ -159,8 +159,8 @@ void WebPasteboardProxy::setPasteboardBufferForType(const String& pasteboardName > return; > } > RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly); >- RefPtr<SharedBuffer> buffer = SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size); >- newChangeCount = PlatformPasteboard(pasteboardName).setBufferForType(buffer.get(), pasteboardType); >+ auto buffer = SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size); >+ newChangeCount = PlatformPasteboard(pasteboardName).setBufferForType(buffer.ptr(), pasteboardType); > } > > void WebPasteboardProxy::getNumberOfFiles(const String& pasteboardName, uint64_t& numberOfFiles) >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index 153650840a0036b3360d4079448ee07059a313b2..e463ac994bb9f8aac44fe82938be13616bb05928 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -4374,7 +4374,7 @@ RefPtr<ViewSnapshot> WebViewImpl::takeViewSnapshot() > if (!surface) > return nullptr; > >- RefPtr<ViewSnapshot> snapshot = ViewSnapshot::create(WTFMove(surface)); >+ auto snapshot = ViewSnapshot::create(WTFMove(surface)); > snapshot->setVolatile(true); > > return snapshot; >diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp b/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp >index 7509ddedb4c08e6be854bb7cef725a979d80dcee..86dc09c341da7f6ec41c6a82a371f17271f68c6a 100644 >--- a/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp >+++ b/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp >@@ -46,12 +46,12 @@ DownloadProxyMap::~DownloadProxyMap() > > DownloadProxy* DownloadProxyMap::createDownloadProxy(WebProcessPool& processPool, const WebCore::ResourceRequest& resourceRequest) > { >- RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(*this, processPool, resourceRequest); >- m_downloads.set(downloadProxy->downloadID(), downloadProxy); >+ auto downloadProxy = DownloadProxy::create(*this, processPool, resourceRequest); >+ m_downloads.set(downloadProxy->downloadID(), downloadProxy.copyRef()); > >- m_process->addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID().downloadID(), *downloadProxy); >+ m_process->addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID().downloadID(), downloadProxy.get()); > >- return downloadProxy.get(); >+ return downloadProxy.ptr(); > } > > void DownloadProxyMap::downloadFinished(DownloadProxy* downloadProxy) >diff --git a/Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp b/Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp >index 7965868be04339e7849f4dd3442c64dc956e668c..fae1f3fca888719be7f6272d205720bb890177fe 100644 >--- a/Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp >+++ b/Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp >@@ -96,11 +96,11 @@ HashMap<String, bool> WebNotificationManagerProxy::notificationPermissions() > void WebNotificationManagerProxy::show(WebPageProxy* webPage, const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection dir, const String& originString, uint64_t pageNotificationID) > { > uint64_t globalNotificationID = generateGlobalNotificationID(); >- RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, tag, lang, dir, originString, globalNotificationID); >+ auto notification = WebNotification::create(title, body, iconURL, tag, lang, dir, originString, globalNotificationID); > std::pair<uint64_t, uint64_t> notificationIDPair = std::make_pair(webPage->pageID(), pageNotificationID); > m_globalNotificationMap.set(globalNotificationID, notificationIDPair); >- m_notifications.set(notificationIDPair, std::make_pair(globalNotificationID, notification)); >- m_provider->show(*webPage, *notification); >+ m_notifications.set(notificationIDPair, std::make_pair(globalNotificationID, notification.copyRef())); >+ m_provider->show(*webPage, notification.get()); > } > > void WebNotificationManagerProxy::cancel(WebPageProxy* webPage, uint64_t pageNotificationID) >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 025c9c6cf56cf25434876fdbd166f14c08f81534..47088100ee31d07a66d7e9158e49958b8df859c6 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -3649,10 +3649,10 @@ void WebPageProxy::didCreateSubframe(uint64_t frameID) > > MESSAGE_CHECK(m_process->canCreateFrame(frameID)); > >- RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(*this, frameID); >+ auto subFrame = WebFrameProxy::create(*this, frameID); > > // Add the frame to the process wide map. >- m_process->frameCreated(frameID, *subFrame); >+ m_process->frameCreated(frameID, subFrame.get()); > } > > void WebPageProxy::didCreateWindow(uint64_t frameID, GlobalWindowIdentifier&& windowIdentifier) >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index fa43a3d1e783092bb7c0218147fd164f827b03c0..9e3f404bd6e6abb3ab2439aba727c6b5c39bef6b 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -1713,7 +1713,7 @@ void WebProcessPool::getStatistics(uint32_t statisticsMask, Function<void (API:: > return; > } > >- RefPtr<StatisticsRequest> request = StatisticsRequest::create(DictionaryCallback::create(WTFMove(callbackFunction))); >+ auto request = StatisticsRequest::create(DictionaryCallback::create(WTFMove(callbackFunction))); > > if (statisticsMask & StatisticsRequestTypeWebContent) > requestWebContentStatistics(request.get()); >@@ -1722,20 +1722,20 @@ void WebProcessPool::getStatistics(uint32_t statisticsMask, Function<void (API:: > requestNetworkingStatistics(request.get()); > } > >-void WebProcessPool::requestWebContentStatistics(StatisticsRequest* request) >+void WebProcessPool::requestWebContentStatistics(StatisticsRequest& request) > { > // FIXME (Multi-WebProcess) <rdar://problem/13200059>: Make getting statistics from multiple WebProcesses work. > } > >-void WebProcessPool::requestNetworkingStatistics(StatisticsRequest* request) >+void WebProcessPool::requestNetworkingStatistics(StatisticsRequest& request) > { > if (!m_networkProcess) { > LOG_ERROR("Attempt to get NetworkProcess statistics but the NetworkProcess is unavailable"); > return; > } > >- uint64_t requestID = request->addOutstandingRequest(); >- m_statisticsRequests.set(requestID, request); >+ uint64_t requestID = request.addOutstandingRequest(); >+ m_statisticsRequests.set(requestID, &request); > m_networkProcess->send(Messages::NetworkProcess::GetNetworkProcessStatistics(requestID), 0); > } > >diff --git a/Source/WebKit/UIProcess/WebProcessPool.h b/Source/WebKit/UIProcess/WebProcessPool.h >index 06343249baa725afb6cb444c5523253d17e080bc..e6b444e91427b96caa8843aeb3fa227cdd7b54e0 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.h >+++ b/Source/WebKit/UIProcess/WebProcessPool.h >@@ -487,8 +487,8 @@ class WebProcessPool final : public API::ObjectImpl<API::Object::Type::ProcessPo > WebProcessProxy& createNewWebProcess(WebsiteDataStore&, WebProcessProxy::IsPrewarmed = WebProcessProxy::IsPrewarmed::No); > void initializeNewWebProcess(WebProcessProxy&, WebsiteDataStore&); > >- void requestWebContentStatistics(StatisticsRequest*); >- void requestNetworkingStatistics(StatisticsRequest*); >+ void requestWebContentStatistics(StatisticsRequest&); >+ void requestNetworkingStatistics(StatisticsRequest&); > > void platformInitializeNetworkProcess(NetworkProcessCreationParameters&); > >diff --git a/Source/WebKit/UIProcess/gstreamer/WebPageProxyGStreamer.cpp b/Source/WebKit/UIProcess/gstreamer/WebPageProxyGStreamer.cpp >index 5e3fb65c230dbd84dae3702dd6ddf7d25324089d..e3ae514b037ce8f880498afe12a1f9ec31ba66b8 100644 >--- a/Source/WebKit/UIProcess/gstreamer/WebPageProxyGStreamer.cpp >+++ b/Source/WebKit/UIProcess/gstreamer/WebPageProxyGStreamer.cpp >@@ -34,8 +34,8 @@ namespace WebKit { > > void WebPageProxy::requestInstallMissingMediaPlugins(const String& details, const String& description) > { >- RefPtr<InstallMissingMediaPluginsPermissionRequest> request = InstallMissingMediaPluginsPermissionRequest::create(*this, details, description); >- if (pageClient().decidePolicyForInstallMissingMediaPluginsPermissionRequest(*request)) >+ auto request = InstallMissingMediaPluginsPermissionRequest::create(*this, details, description); >+ if (pageClient().decidePolicyForInstallMissingMediaPluginsPermissionRequest(request.get())) > return; > > request->deny(); >diff --git a/Source/WebKit/UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp >index 85164370f7b51bfb0910ea0041dbe1014427f863..92ead045e8b8fc2e4b9934426bd10a4a8e59f9dc 100644 >--- a/Source/WebKit/UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp >+++ b/Source/WebKit/UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp >@@ -53,18 +53,18 @@ WebPageProxy* RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow() > { > ASSERT(!m_webView); > >- RefPtr<WebPreferences> preferences = WebPreferences::create(String(), "WebKit2.", "WebKit2."); >+ auto preferences = WebPreferences::create(String(), "WebKit2.", "WebKit2."); > #if ENABLE(DEVELOPER_MODE) > // Allow developers to inspect the Web Inspector in debug builds without changing settings. > preferences->setDeveloperExtrasEnabled(true); > preferences->setLogsPageMessagesToSystemConsoleEnabled(true); > #endif >- RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(inspectorPageGroupIdentifierForPage(nullptr)); >+ auto pageGroup = WebPageGroup::create(inspectorPageGroupIdentifierForPage(nullptr)); > > auto pageConfiguration = API::PageConfiguration::create(); > pageConfiguration->setProcessPool(&inspectorProcessPool(inspectorLevelForPage(nullptr))); >- pageConfiguration->setPreferences(preferences.get()); >- pageConfiguration->setPageGroup(pageGroup.get()); >+ pageConfiguration->setPreferences(preferences.ptr()); >+ pageConfiguration->setPageGroup(pageGroup.ptr()); > m_webView = GTK_WIDGET(webkitWebViewBaseCreate(*pageConfiguration.ptr())); > g_signal_connect_swapped(m_webView, "destroy", G_CALLBACK(inspectorViewDestroyed), this); > g_object_add_weak_pointer(G_OBJECT(m_webView), reinterpret_cast<void**>(&m_webView)); >diff --git a/Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp >index b64e3359292b3feecf7e72eab30e0a6a719fd34c..ca187a64234112e8579bd86162d9b83fb429c83a 100644 >--- a/Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp >+++ b/Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp >@@ -138,7 +138,7 @@ WebPageProxy* WebInspectorProxy::platformCreateFrontendPage() > ASSERT(inspectedPage()); > ASSERT(!m_inspectorView); > >- RefPtr<WebPreferences> preferences = WebPreferences::create(String(), "WebKit2.", "WebKit2."); >+ auto preferences = WebPreferences::create(String(), "WebKit2.", "WebKit2."); > #if ENABLE(DEVELOPER_MODE) > // Allow developers to inspect the Web Inspector in debug builds without changing settings. > preferences->setDeveloperExtrasEnabled(true); >@@ -146,12 +146,12 @@ WebPageProxy* WebInspectorProxy::platformCreateFrontendPage() > #endif > preferences->setJavaScriptRuntimeFlags({ > }); >- RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(inspectorPageGroupIdentifierForPage(inspectedPage())); >+ auto pageGroup = WebPageGroup::create(inspectorPageGroupIdentifierForPage(inspectedPage())); > > auto pageConfiguration = API::PageConfiguration::create(); > pageConfiguration->setProcessPool(&inspectorProcessPool(inspectionLevel())); >- pageConfiguration->setPreferences(preferences.get()); >- pageConfiguration->setPageGroup(pageGroup.get()); >+ pageConfiguration->setPreferences(preferences.ptr()); >+ pageConfiguration->setPageGroup(pageGroup.ptr()); > m_inspectorView = GTK_WIDGET(webkitWebViewBaseCreate(*pageConfiguration.ptr())); > g_object_add_weak_pointer(G_OBJECT(m_inspectorView), reinterpret_cast<void**>(&m_inspectorView)); > g_signal_connect(m_inspectorView, "destroy", G_CALLBACK(inspectorViewDestroyed), this); >diff --git a/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm b/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm >index c1cf58758ecba9857a0a61ad48d6bfa3e1c0d7f3..9a47e2649f693cd2b3b55cec20e173c2fb4b13b0 100644 >--- a/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm >@@ -186,7 +186,7 @@ - (void)geolocationAuthorizationGranted > if ([uiDelegate respondsToSelector:@selector(_webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:)]) { > URL requestFrameURL(URL(), request.frame->url()); > RetainPtr<WKFrameInfo> frameInfo = wrapper(API::FrameInfo::create(*request.frame.get(), *request.origin.get())); >- RefPtr<WebKit::CompletionHandlerCallChecker> checker = WebKit::CompletionHandlerCallChecker::create(uiDelegate, @selector(_webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:)); >+ auto checker = WebKit::CompletionHandlerCallChecker::create(uiDelegate, @selector(_webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:)); > WKWebView *viewFromRequest = request.view.get(); > [uiDelegate _webView:viewFromRequest requestGeolocationAuthorizationForURL:requestFrameURL frame:frameInfo.get() decisionHandler:makeBlockPtr([request = WTFMove(request), checker = WTFMove(checker)](BOOL authorized) { > if (checker->completionHandlerHasBeenCalled()) >diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm >index 11235a127e277a01876038c9746f7f8ed2ccba31..9feffddf410412e76d2c0c3dfd67bf1e1bd2b0b6 100644 >--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm >+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm >@@ -384,9 +384,9 @@ void PageClientImpl::startDrag(const WebCore::DragItem& item, const ShareableBit > > void PageClientImpl::setPromisedDataForImage(const String& pasteboardName, Ref<SharedBuffer>&& imageBuffer, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL, RefPtr<SharedBuffer>&& archiveBuffer) > { >- RefPtr<Image> image = BitmapImage::create(); >+ auto image = BitmapImage::create(); > image->setData(WTFMove(imageBuffer), true); >- m_impl->setPromisedDataForImage(image.get(), filename, extension, title, url, visibleURL, archiveBuffer.get(), pasteboardName); >+ m_impl->setPromisedDataForImage(image.ptr(), filename, extension, title, url, visibleURL, archiveBuffer.get(), pasteboardName); > } > > void PageClientImpl::updateSecureInputState() >diff --git a/Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp b/Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp >index cbfe30e9e0be8321518196355f779808b824f2f6..3798bfbb5a9c414f60fdc3cbea9c7c0db3e02313 100644 >--- a/Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp >+++ b/Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp >@@ -192,7 +192,7 @@ WebPageProxy* WebInspectorProxy::platformCreateFrontendPage() > { > ASSERT(inspectedPage()); > >- RefPtr<WebPreferences> preferences = WebPreferences::create(String(), "WebKit2.", "WebKit2."); >+ auto preferences = WebPreferences::create(String(), "WebKit2.", "WebKit2."); > #if ENABLE(DEVELOPER_MODE) > // Allow developers to inspect the Web Inspector in debug builds without changing settings. > preferences->setDeveloperExtrasEnabled(true); >@@ -200,11 +200,11 @@ WebPageProxy* WebInspectorProxy::platformCreateFrontendPage() > #endif > preferences->setAllowFileAccessFromFileURLs(true); > preferences->setJavaScriptRuntimeFlags({ }); >- RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(inspectorPageGroupIdentifierForPage(inspectedPage())); >+ auto pageGroup = WebPageGroup::create(inspectorPageGroupIdentifierForPage(inspectedPage())); > auto pageConfiguration = API::PageConfiguration::create(); > pageConfiguration->setProcessPool(&inspectorProcessPool(inspectionLevel())); >- pageConfiguration->setPreferences(preferences.get()); >- pageConfiguration->setPageGroup(pageGroup.get()); >+ pageConfiguration->setPreferences(preferences.ptr()); >+ pageConfiguration->setPageGroup(pageGroup.ptr()); > > WKPageNavigationClientV0 navigationClient = { > { 0, this }, >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm b/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm >index 82509017900f4789449ec5defc7128a175c66997..931343eb1bb8732ea5d3b5424c5306c8462e9ab3 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm >@@ -50,8 +50,8 @@ - (id)_initWithImpl:(WebCore::Range*)impl > > - (id)initWithDocument:(WKDOMDocument *)document > { >- RefPtr<WebCore::Range> range = WebCore::Range::create(*WebKit::toWebCoreDocument(document)); >- self = [self _initWithImpl:range.get()]; >+ auto range = WebCore::Range::create(*WebKit::toWebCoreDocument(document)); >+ self = [self _initWithImpl:range.ptr()]; > if (!self) > return nil; > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp b/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp >index e99f3570d0e30badfe01dacfdb3faf450e7cae6f..8c295baebfba2e06b5b761855bf2ed98299fed91 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp >@@ -138,7 +138,7 @@ RefPtr<WebImage> InjectedBundleRangeHandle::renderedImage(SnapshotOptions option > IntSize backingStoreSize = paintRect.size(); > backingStoreSize.scale(scaleFactor); > >- RefPtr<ShareableBitmap> backingStore = ShareableBitmap::createShareable(backingStoreSize, { }); >+ auto backingStore = ShareableBitmap::createShareable(backingStoreSize, { }); > if (!backingStore) > return nullptr; > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp >index 21a31233e6fc9e2818a2fcfa30191a5fa15788b5..9512302b282e41ed1b24719a2d0448dc747fffdf 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp >@@ -168,8 +168,8 @@ void InjectedBundlePageEditorClient::getPasteboardDataForRange(WebPage& page, Ra > pasteboardTypes.append(type->string()); > > for (auto item : dataArray->elementsOfType<API::Data>()) { >- RefPtr<SharedBuffer> buffer = SharedBuffer::create(item->bytes(), item->size()); >- pasteboardData.append(buffer); >+ auto buffer = SharedBuffer::create(item->bytes(), item->size()); >+ pasteboardData.append(WTFMove(buffer)); > } > } > } >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp >index ec09867bf038ee58c9fe2d387406489d663b8d8e..6e282d9e0b90b290eaa08987a42b8f898ca9b005 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp >@@ -78,10 +78,10 @@ void InjectedBundlePageUIClient::mouseDidMoveOverElement(WebPage* page, const Hi > if (!m_client.mouseDidMoveOverElement) > return; > >- RefPtr<InjectedBundleHitTestResult> hitTestResult = InjectedBundleHitTestResult::create(coreHitTestResult); >+ auto hitTestResult = InjectedBundleHitTestResult::create(coreHitTestResult); > > WKTypeRef userDataToPass = 0; >- m_client.mouseDidMoveOverElement(toAPI(page), toAPI(hitTestResult.get()), toAPI(modifiers), &userDataToPass, m_client.base.clientInfo); >+ m_client.mouseDidMoveOverElement(toAPI(page), toAPI(hitTestResult.ptr()), toAPI(modifiers), &userDataToPass, m_client.base.clientInfo); > userData = adoptRef(toImpl(userDataToPass)); > } > >diff --git a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >index c6a50691740a5db3e65f197571b7bd4005bb71a0..88c0a2d9c6312d2c0ea06a557f5a01e2c39a4c95 100644 >--- a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >+++ b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >@@ -751,7 +751,7 @@ RefPtr<ShareableBitmap> NetscapePlugin::snapshot() > IntSize backingStoreSize = m_pluginSize; > backingStoreSize.scale(contentsScaleFactor()); > >- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(backingStoreSize, { }); >+ auto bitmap = ShareableBitmap::createShareable(backingStoreSize, { }); > auto context = bitmap->createGraphicsContext(); > > // FIXME: We should really call applyDeviceScaleFactor instead of scale, but that ends up calling into WKSI >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >index c2cba090fbbdb2d9a190b1aff8fe355cd6fc3264..0199b84f8f4e28f769a7421951889131dc8774ea 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >@@ -943,7 +943,7 @@ void PDFPlugin::addArchiveResource() > RetainPtr<NSURLResponse> response = adoptNS([[NSHTTPURLResponse alloc] initWithURL:m_sourceURL statusCode:200 HTTPVersion:(NSString*)kCFHTTPVersion1_1 headerFields:headers]); > ResourceResponse synthesizedResponse(response.get()); > >- RefPtr<ArchiveResource> resource = ArchiveResource::create(SharedBuffer::create(m_data.get()), m_sourceURL, "application/pdf", String(), String(), synthesizedResponse); >+ auto resource = ArchiveResource::create(SharedBuffer::create(m_data.get()), m_sourceURL, "application/pdf", String(), String(), synthesizedResponse); > pluginView()->frame()->document()->loader()->addArchiveResource(resource.releaseNonNull()); > } > >@@ -1257,7 +1257,7 @@ RefPtr<ShareableBitmap> PDFPlugin::snapshot() > IntSize backingStoreSize = size(); > backingStoreSize.scale(contentsScaleFactor); > >- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(backingStoreSize, { }); >+ auto bitmap = ShareableBitmap::createShareable(backingStoreSize, { }); > auto context = bitmap->createGraphicsContext(); > > context->scale(FloatSize(contentsScaleFactor, -contentsScaleFactor)); >@@ -1853,11 +1853,7 @@ void PDFPlugin::writeItemsToPasteboard(NSString *pasteboardName, NSArray *items, > RetainPtr<NSString> plainTextString = adoptNS([[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); > webProcess.parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::SetPasteboardStringForType(pasteboardName, type, plainTextString.get()), Messages::WebPasteboardProxy::SetPasteboardStringForType::Reply(newChangeCount), 0); > } else { >- RefPtr<SharedBuffer> buffer = SharedBuffer::create(data); >- >- if (!buffer) >- continue; >- >+ auto buffer = SharedBuffer::create(data); > SharedMemory::Handle handle; > RefPtr<SharedMemory> sharedMemory = SharedMemory::allocate(buffer->size()); > memcpy(sharedMemory->data(), buffer->data(), buffer->size()); >diff --git a/Source/WebKit/WebProcess/Plugins/PluginProcessConnectionManager.cpp b/Source/WebKit/WebProcess/Plugins/PluginProcessConnectionManager.cpp >index 31479afc29adf4ac852bb3ce3d83c4129247bfc0..658ecd9d2378904b347d0d3a6f467e944d2f0757 100644 >--- a/Source/WebKit/WebProcess/Plugins/PluginProcessConnectionManager.cpp >+++ b/Source/WebKit/WebProcess/Plugins/PluginProcessConnectionManager.cpp >@@ -84,8 +84,8 @@ PluginProcessConnection* PluginProcessConnectionManager::getPluginProcessConnect > if (!IPC::Connection::identifierIsValid(connectionIdentifier)) > return nullptr; > >- RefPtr<PluginProcessConnection> pluginProcessConnection = PluginProcessConnection::create(this, pluginProcessToken, connectionIdentifier, supportsAsynchronousInitialization); >- m_pluginProcessConnections.append(pluginProcessConnection); >+ auto pluginProcessConnection = PluginProcessConnection::create(this, pluginProcessToken, connectionIdentifier, supportsAsynchronousInitialization); >+ m_pluginProcessConnections.append(pluginProcessConnection.copyRef()); > > { > LockHolder locker(m_tokensAndConnectionsMutex); >@@ -94,7 +94,7 @@ PluginProcessConnection* PluginProcessConnectionManager::getPluginProcessConnect > m_tokensAndConnections.set(pluginProcessToken, pluginProcessConnection->connection()); > } > >- return pluginProcessConnection.get(); >+ return pluginProcessConnection.ptr(); > } > > void PluginProcessConnectionManager::removePluginProcessConnection(PluginProcessConnection* pluginProcessConnection) >diff --git a/Source/WebKit/WebProcess/Plugins/PluginProxy.cpp b/Source/WebKit/WebProcess/Plugins/PluginProxy.cpp >index 885fca3e14cf06d05c74b03bb94f3abb6bc91d16..970ea1fe7ca9645dd9c777ccd5e362a66dead58b 100644 >--- a/Source/WebKit/WebProcess/Plugins/PluginProxy.cpp >+++ b/Source/WebKit/WebProcess/Plugins/PluginProxy.cpp >@@ -247,8 +247,7 @@ RefPtr<ShareableBitmap> PluginProxy::snapshot() > if (snapshotStoreHandle.isNull()) > return nullptr; > >- RefPtr<ShareableBitmap> snapshotBuffer = ShareableBitmap::create(snapshotStoreHandle); >- return snapshotBuffer; >+ return ShareableBitmap::create(snapshotStoreHandle); > } > > bool PluginProxy::isTransparent() >diff --git a/Source/WebKit/WebProcess/Plugins/PluginView.cpp b/Source/WebKit/WebProcess/Plugins/PluginView.cpp >index 4495c991122d0843dab0c84da60ba5a7c97ba6c8..592a487150ed7af8eee8527006ceebc9c371e83a 100644 >--- a/Source/WebKit/WebProcess/Plugins/PluginView.cpp >+++ b/Source/WebKit/WebProcess/Plugins/PluginView.cpp >@@ -1174,8 +1174,8 @@ void PluginView::performURLRequest(URLRequest* request) > } > > // This request is to load a URL and create a stream. >- RefPtr<Stream> stream = PluginView::Stream::create(this, request->requestID(), request->request()); >- addStream(stream.get()); >+ auto stream = PluginView::Stream::create(this, request->requestID(), request->request()); >+ addStream(stream.ptr()); > stream->start(); > } > >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index b31b117f0edab398b25124064e16227faf786255..78e67354071b3654700f16f40ecafd9956e61179 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -718,8 +718,8 @@ void WebChromeClient::exceededDatabaseQuota(Frame& frame, const String& database > auto currentQuota = tracker.quota(originData); > auto currentOriginUsage = tracker.usage(originData); > uint64_t newQuota = 0; >- RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(originData.databaseIdentifier())->securityOrigin()); >- newQuota = m_page.injectedBundleUIClient().didExceedDatabaseQuota(&m_page, securityOrigin.get(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()); >+ auto securityOrigin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(originData.databaseIdentifier())->securityOrigin()); >+ newQuota = m_page.injectedBundleUIClient().didExceedDatabaseQuota(&m_page, securityOrigin.ptr(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()); > > if (!newQuota) { > WebProcess::singleton().parentProcessConnection()->sendSync( >@@ -737,8 +737,8 @@ void WebChromeClient::reachedMaxAppCacheSize(int64_t) > > void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin& origin, int64_t totalBytesNeeded) > { >- RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::createFromString(origin.toString()); >- if (m_page.injectedBundleUIClient().didReachApplicationCacheOriginQuota(&m_page, securityOrigin.get(), totalBytesNeeded)) >+ auto securityOrigin = API::SecurityOrigin::createFromString(origin.toString()); >+ if (m_page.injectedBundleUIClient().didReachApplicationCacheOriginQuota(&m_page, securityOrigin.ptr(), totalBytesNeeded)) > return; > > auto& cacheStorage = m_page.corePage()->applicationCacheStorage(); >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index d05fc996c1d4ed9f756fc885e93cd65b2c45d02c..1f91e8cfc4a059f9ef781e1461109873a37137e1 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -767,10 +767,10 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(const Navigati > > RefPtr<API::Object> userData; > >- RefPtr<InjectedBundleNavigationAction> action = InjectedBundleNavigationAction::create(m_frame, navigationAction, formState); >+ auto action = InjectedBundleNavigationAction::create(m_frame, navigationAction, formState); > > // Notify the bundle client. >- WKBundlePagePolicyAction policy = webPage->injectedBundlePolicyClient().decidePolicyForNewWindowAction(webPage, m_frame, action.get(), request, frameName, userData); >+ WKBundlePagePolicyAction policy = webPage->injectedBundlePolicyClient().decidePolicyForNewWindowAction(webPage, m_frame, action.ptr(), request, frameName, userData); > if (policy == WKBundlePagePolicyActionUse) { > function(PolicyAction::Use); > return; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >index f9b0ceef9cf0bfaf34f64da8b31607847142a0a3..16542fb90615c3237f1577c36299423b7cb8f356 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >@@ -195,7 +195,7 @@ void WebPlatformStrategies::getPathnamesForType(Vector<String>& pathnames, const > Messages::WebPasteboardProxy::GetPasteboardPathnamesForType::Reply(pathnames, sandboxExtensionsHandleArray), 0); > ASSERT(pathnames.size() == sandboxExtensionsHandleArray.size()); > for (size_t i = 0; i < sandboxExtensionsHandleArray.size(); i++) { >- if (RefPtr<SandboxExtension> extension = SandboxExtension::create(WTFMove(sandboxExtensionsHandleArray[i]))) >+ if (auto extension = SandboxExtension::create(WTFMove(sandboxExtensionsHandleArray[i]))) > extension->consumePermanently(); > } > } >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp b/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp >index 8716120f71dcf9ac23d8d13ebdf93c67df33d896..1867c984905c9200e022de36b8d065efff244f20 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp >@@ -50,7 +50,7 @@ static RefPtr<ShareableBitmap> convertCairoSurfaceToShareableBitmap(cairo_surfac > return nullptr; > > IntSize imageSize(cairo_image_surface_get_width(surface), cairo_image_surface_get_height(surface)); >- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(imageSize, { }); >+ auto bitmap = ShareableBitmap::createShareable(imageSize, { }); > auto graphicsContext = bitmap->createGraphicsContext(); > > ASSERT(graphicsContext->hasPlatformContext()); >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm >index ffee2a646cc6e89f2433f3a47fe7f647347a802e..f87d93443f7c58a82c4363f034a006013b6aa17f 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm >+++ b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm >@@ -132,7 +132,7 @@ void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Eleme > title = WTF::userVisibleString(url); > } > >- RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(element); >+ auto archive = LegacyWebArchive::create(element); > > NSURLResponse *response = image->response().nsURLResponse(); > >diff --git a/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm b/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >index a38cd2bf63794c8e9f1d212a3e78b3e8c4ef8c6b..8ce565fb956f36cb752ef811a1245eb55ddcf9b3 100644 >--- a/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >+++ b/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >@@ -164,7 +164,7 @@ DictionaryPopupInfo WebPage::dictionaryPopupInfoForRange(Frame& frame, Range& ra > if (presentationTransition == TextIndicatorPresentationTransition::BounceAndCrossfade) > indicatorOptions |= TextIndicatorOptionIncludeSnapshotWithSelectionHighlight; > >- RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(range, indicatorOptions, presentationTransition); >+ auto textIndicator = TextIndicator::createWithRange(range, indicatorOptions, presentationTransition); > if (!textIndicator) { > editor.setIsGettingDictionaryPopupInfo(false); > return dictionaryPopupInfo; >diff --git a/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp >index 7824e5cf71b47db09eea35a769fa7641a72d7f32..6a86b002b86f42a01cf48e5df6900acf58f831a9 100644 >--- a/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp >+++ b/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp >@@ -417,7 +417,7 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo) > IntSize bitmapSize = bounds.size(); > float deviceScaleFactor = m_webPage.corePage()->deviceScaleFactor(); > bitmapSize.scale(deviceScaleFactor); >- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bitmapSize, { }); >+ auto bitmap = ShareableBitmap::createShareable(bitmapSize, { }); > if (!bitmap) > return; > >diff --git a/Source/WebKit/WebProcess/WebPage/FindController.cpp b/Source/WebKit/WebProcess/WebPage/FindController.cpp >index 9fefdbca12cf59e6e325cc9c24ebe4f30929d1f3..63cc28392e480dfbd5432d69000fa38f22de662f 100644 >--- a/Source/WebKit/WebProcess/WebPage/FindController.cpp >+++ b/Source/WebKit/WebProcess/WebPage/FindController.cpp >@@ -343,7 +343,7 @@ void FindController::hideFindUI() > > bool FindController::updateFindIndicator(Frame& selectedFrame, bool isShowingOverlay, bool shouldAnimate) > { >- RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(selectedFrame, TextIndicatorOptionIncludeMarginIfRangeMatchesSelection, shouldAnimate ? TextIndicatorPresentationTransition::Bounce : TextIndicatorPresentationTransition::None); >+ auto indicator = TextIndicator::createWithSelectionInFrame(selectedFrame, TextIndicatorOptionIncludeMarginIfRangeMatchesSelection, shouldAnimate ? TextIndicatorPresentationTransition::Bounce : TextIndicatorPresentationTransition::None); > if (!indicator) > return false; > >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >index 80bd2139587b315df176d620b4589dc36599a2f6..6ac6039aa318495e37bb158947a6fd82eea55bf0 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >@@ -431,7 +431,7 @@ void RemoteLayerTreeDrawingArea::flushLayers() > m_pendingBackingStoreFlusher = backingStoreFlusher; > > uint64_t pageID = m_webPage.pageID(); >- dispatch_async(m_commitQueue, [backingStoreFlusher, pageID] { >+ dispatch_async(m_commitQueue, [backingStoreFlusher = WTFMove(backingStoreFlusher), pageID] { > backingStoreFlusher->flush(); > > MonotonicTime timestamp = MonotonicTime::now(); >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >index 189d1a188b24b6446d0527df8650f0a1a386810b..e47370efb5e0f41589b214b5ab719b7982c02ac3 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >@@ -838,7 +838,7 @@ void WebFrame::documentLoaderDetached(uint64_t navigationID) > #if PLATFORM(COCOA) > RetainPtr<CFDataRef> WebFrame::webArchiveData(FrameFilterFunction callback, void* context) > { >- RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(*coreFrame()->document(), [this, callback, context](Frame& frame) -> bool { >+ auto archive = LegacyWebArchive::create(*coreFrame()->document(), [this, callback, context](Frame& frame) -> bool { > if (!callback) > return true; > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index be6befb8147865fc0e81e81223b6c496ab7f1bd5..b4b7d7a7cc845e5532c3b206e7d9c0e25ea57dd9 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -1432,10 +1432,10 @@ void WebPage::navigateToPDFLinkWithSimulatedClick(const String& url, IntPoint do > const int singleClick = 1; > // FIXME: Set modifier keys. > // FIXME: This should probably set IsSimulated::Yes. >- RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, >+ auto mouseEvent = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, > MonotonicTime::now(), nullptr, singleClick, screenPoint, documentPoint, { }, { }, 0, 0, nullptr, 0, WebCore::NoTap, nullptr); > >- mainFrame->loader().urlSelected(mainFrameDocument->completeURL(url), emptyString(), mouseEvent.get(), LockHistory::No, LockBackForwardList::No, ShouldSendReferrer::MaybeSendReferrer, ShouldOpenExternalURLsPolicy::ShouldNotAllow); >+ mainFrame->loader().urlSelected(mainFrameDocument->completeURL(url), emptyString(), mouseEvent.ptr(), LockHistory::No, LockBackForwardList::No, ShouldSendReferrer::MaybeSendReferrer, ShouldOpenExternalURLsPolicy::ShouldNotAllow); > } > > void WebPage::stopLoadingFrame(uint64_t frameID) >@@ -3705,7 +3705,7 @@ void WebPage::performDragControllerAction(DragControllerAction action, const Web > > m_pendingDropSandboxExtension = SandboxExtension::create(WTFMove(sandboxExtensionHandle)); > for (size_t i = 0; i < sandboxExtensionsHandleArray.size(); i++) { >- if (RefPtr<SandboxExtension> extension = SandboxExtension::create(WTFMove(sandboxExtensionsHandleArray[i]))) >+ if (auto extension = SandboxExtension::create(WTFMove(sandboxExtensionsHandleArray[i]))) > m_pendingDropExtensionsForFileUpload.append(extension); > } > >diff --git a/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm >index 0c84f64c8c63ed1bbd60b73f3b568a4a278c1adf..fba5b056a4c9fad0171c1883f00cebf5a357f561 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm >@@ -94,7 +94,7 @@ bool FindController::updateFindIndicator(Frame& selectedFrame, bool isShowingOve > m_isShowingFindIndicator = false; > } > >- RefPtr<TextIndicator> textIndicator = TextIndicator::createWithSelectionInFrame(selectedFrame, findTextIndicatorOptions, TextIndicatorPresentationTransition::None, FloatSize(totalHorizontalMargin, totalVerticalMargin)); >+ auto textIndicator = TextIndicator::createWithSelectionInFrame(selectedFrame, findTextIndicatorOptions, TextIndicatorPresentationTransition::None, FloatSize(totalHorizontalMargin, totalVerticalMargin)); > if (!textIndicator) > return false; > >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 9df618a4d9ad8e9b1d63206c60051dafb76db235..103fea33ff1b112c530f59e6e56cd58eb34f1cee 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -1820,14 +1820,14 @@ void WebPage::replaceDictatedText(const String& oldText, const String& newText) > position = position.previous(); > if (position.isNull()) > position = startOfDocument(static_cast<Node*>(frame.document()->documentElement())); >- RefPtr<Range> range = Range::create(*frame.document(), position, frame.selection().selection().start()); >+ auto range = Range::create(*frame.document(), position, frame.selection().selection().start()); > >- if (plainTextReplacingNoBreakSpace(range.get()) != oldText) >+ if (plainTextReplacingNoBreakSpace(range.ptr()) != oldText) > return; > > // We don't want to notify the client that the selection has changed until we are done inserting the new text. > frame.editor().setIgnoreSelectionChanges(true); >- frame.selection().setSelectedRange(range.get(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes); >+ frame.selection().setSelectedRange(range.ptr(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes); > frame.editor().insertText(newText, 0); > frame.editor().setIgnoreSelectionChanges(false); > } >@@ -2136,17 +2136,15 @@ void WebPage::getPositionInformation(const InteractionInformationRequest& reques > } > > if (request.includeLinkIndicator) { >- RefPtr<Range> linkRange = rangeOfContents(*linkElement); >- if (linkRange) { >- float deviceScaleFactor = corePage()->deviceScaleFactor(); >- const float marginInPoints = 4; >+ Ref<Range> linkRange = rangeOfContents(*linkElement); >+ float deviceScaleFactor = corePage()->deviceScaleFactor(); >+ const float marginInPoints = 4; > >- RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges | >- TextIndicatorOptionIncludeMarginIfRangeMatchesSelection, TextIndicatorPresentationTransition::None, FloatSize(marginInPoints * deviceScaleFactor, marginInPoints * deviceScaleFactor)); >+ auto textIndicator = TextIndicator::createWithRange(linkRange.get(), TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges | >+ TextIndicatorOptionIncludeMarginIfRangeMatchesSelection, TextIndicatorPresentationTransition::None, FloatSize(marginInPoints * deviceScaleFactor, marginInPoints * deviceScaleFactor)); > >- if (textIndicator) >- info.linkIndicator = textIndicator->data(); >- } >+ if (textIndicator) >+ info.linkIndicator = textIndicator->data(); > } > > #if ENABLE(DATA_DETECTION) >@@ -2156,7 +2154,7 @@ void WebPage::getPositionInformation(const InteractionInformationRequest& reques > info.dataDetectorIdentifier = DataDetection::dataDetectorIdentifier(*element); > info.dataDetectorResults = element->document().frame()->dataDetectionResults(); > if (DataDetection::requiresExtendedContext(*element)) { >- RefPtr<Range> linkRange = Range::create(element->document()); >+ auto linkRange = Range::create(element->document()); > linkRange->selectNodeContents(*element); > info.textBefore = plainTextReplacingNoBreakSpace(rangeExpandedByCharactersInDirectionAtWordBoundary(linkRange->startPosition(), dataDetectionExtendedContextLength, DirectionBackward).get(), TextIteratorDefaultBehavior, true); > info.textAfter = plainTextReplacingNoBreakSpace(rangeExpandedByCharactersInDirectionAtWordBoundary(linkRange->endPosition(), dataDetectionExtendedContextLength, DirectionForward).get(), TextIteratorDefaultBehavior, true); >@@ -2181,7 +2179,7 @@ void WebPage::getPositionInformation(const InteractionInformationRequest& reques > // FIXME: Only select ExtendedColor on images known to need wide gamut > ShareableBitmap::Configuration bitmapConfiguration; > bitmapConfiguration.colorSpace.cgColorSpace = screenColorSpace(m_page->mainFrame().view()); >- if (RefPtr<ShareableBitmap> sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), bitmapConfiguration)) { >+ if (auto sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), bitmapConfiguration)) { > auto graphicsContext = sharedBitmap->createGraphicsContext(); > graphicsContext->drawImage(*image, FloatRect(0, 0, bitmapSize.width(), bitmapSize.height())); > info.image = sharedBitmap; >diff --git a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >index d2555c19908aba66a24c1c1bdd156f2d3d290483..47fc3c290f650e367db98d4c37135f93f64e4114 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >@@ -850,7 +850,7 @@ void TiledCoreAnimationDrawingArea::commitTransientZoom(double scale, FloatPoint > transform.scale(scale); > > RetainPtr<CABasicAnimation> renderViewAnimationCA = transientZoomSnapAnimationForKeyPath("transform"); >- RefPtr<PlatformCAAnimation> renderViewAnimation = PlatformCAAnimationCocoa::create(renderViewAnimationCA.get()); >+ auto renderViewAnimation = PlatformCAAnimationCocoa::create(renderViewAnimationCA.get()); > renderViewAnimation->setToValue(transform); > > RetainPtr<CALayer> shadowCALayer; >@@ -870,7 +870,7 @@ void TiledCoreAnimationDrawingArea::commitTransientZoom(double scale, FloatPoint > drawingArea->applyTransientZoomToPage(scale, origin); > }]; > >- zoomLayer->addAnimationForKey("transientZoomCommit", *renderViewAnimation); >+ zoomLayer->addAnimationForKey("transientZoomCommit", renderViewAnimation.get()); > > if (shadowCALayer) { > FloatRect shadowBounds = shadowLayerBoundsForFrame(frameView, scale); >diff --git a/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp b/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp >index 805fe9e4cbb5d726ff226fed58d20a1d7e9dbb21..883017265bba956dc9d22f6b60444b18060eff77 100644 >--- a/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp >+++ b/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp >@@ -40,24 +40,24 @@ > namespace WebKit { > using namespace WebCore; > >-RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createSessionStorageNamespace(uint64_t identifier, unsigned quotaInBytes) >+Ref<StorageNamespaceImpl> StorageNamespaceImpl::createSessionStorageNamespace(uint64_t identifier, unsigned quotaInBytes) > { >- return adoptRef(new StorageNamespaceImpl(StorageType::Session, identifier, nullptr, quotaInBytes)); >+ return adoptRef(*new StorageNamespaceImpl(StorageType::Session, identifier, nullptr, quotaInBytes)); > } > >-RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createEphemeralLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes) >+Ref<StorageNamespaceImpl> StorageNamespaceImpl::createEphemeralLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes) > { >- return adoptRef(new StorageNamespaceImpl(StorageType::EphemeralLocal, identifier, nullptr, quotaInBytes)); >+ return adoptRef(*new StorageNamespaceImpl(StorageType::EphemeralLocal, identifier, nullptr, quotaInBytes)); > } > >-RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes) >+Ref<StorageNamespaceImpl> StorageNamespaceImpl::createLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes) > { >- return adoptRef(new StorageNamespaceImpl(StorageType::Local, identifier, nullptr, quotaInBytes)); >+ return adoptRef(*new StorageNamespaceImpl(StorageType::Local, identifier, nullptr, quotaInBytes)); > } > >-RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createTransientLocalStorageNamespace(uint64_t identifier, WebCore::SecurityOrigin& topLevelOrigin, uint64_t quotaInBytes) >+Ref<StorageNamespaceImpl> StorageNamespaceImpl::createTransientLocalStorageNamespace(uint64_t identifier, WebCore::SecurityOrigin& topLevelOrigin, uint64_t quotaInBytes) > { >- return adoptRef(new StorageNamespaceImpl(StorageType::TransientLocal, identifier, &topLevelOrigin, quotaInBytes)); >+ return adoptRef(*new StorageNamespaceImpl(StorageType::TransientLocal, identifier, &topLevelOrigin, quotaInBytes)); > } > > StorageNamespaceImpl::StorageNamespaceImpl(WebCore::StorageType storageType, uint64_t storageNamespaceID, WebCore::SecurityOrigin* topLevelOrigin, unsigned quotaInBytes) >@@ -77,7 +77,7 @@ void StorageNamespaceImpl::didDestroyStorageAreaMap(StorageAreaMap& map) > m_storageAreaMaps.remove(map.securityOrigin().data()); > } > >-RefPtr<StorageArea> StorageNamespaceImpl::storageArea(const SecurityOriginData& securityOrigin) >+Ref<StorageArea> StorageNamespaceImpl::storageArea(const SecurityOriginData& securityOrigin) > { > if (m_storageType == StorageType::EphemeralLocal) > return ephemeralLocalStorageArea(securityOrigin); >@@ -185,16 +185,16 @@ class StorageNamespaceImpl::EphemeralStorageArea final : public StorageArea { > RefPtr<StorageMap> m_storageMap; > }; > >-RefPtr<StorageArea> StorageNamespaceImpl::ephemeralLocalStorageArea(const SecurityOriginData& securityOrigin) >+Ref<StorageArea> StorageNamespaceImpl::ephemeralLocalStorageArea(const SecurityOriginData& securityOrigin) > { > auto& slot = m_ephemeralLocalStorageAreas.add(securityOrigin, nullptr).iterator->value; > if (!slot) > slot = StorageNamespaceImpl::EphemeralStorageArea::create(securityOrigin, m_quotaInBytes); >- >- return slot.get(); >+ ASSERT(slot); >+ return *slot; > } > >-RefPtr<StorageNamespace> StorageNamespaceImpl::copy(Page* newPage) >+Ref<StorageNamespace> StorageNamespaceImpl::copy(Page* newPage) > { > ASSERT(m_storageNamespaceID); > >@@ -202,7 +202,7 @@ RefPtr<StorageNamespace> StorageNamespaceImpl::copy(Page* newPage) > return createSessionStorageNamespace(WebPage::fromCorePage(newPage)->pageID(), m_quotaInBytes); > > ASSERT(m_storageType == StorageType::EphemeralLocal); >- RefPtr<StorageNamespaceImpl> newNamespace = adoptRef(new StorageNamespaceImpl(m_storageType, m_storageNamespaceID, m_topLevelOrigin.get(), m_quotaInBytes)); >+ Ref<StorageNamespaceImpl> newNamespace = adoptRef(*new StorageNamespaceImpl(m_storageType, m_storageNamespaceID, m_topLevelOrigin.get(), m_quotaInBytes)); > > for (auto& iter : m_ephemeralLocalStorageAreas) > newNamespace->m_ephemeralLocalStorageAreas.set(iter.key, iter.value->copy()); >diff --git a/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.h b/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.h >index f13a22dcbd21b6740e45237f4dfad831256729e3..97db0b813baf5cb5a47d72ee5a0655e67500ed1d 100644 >--- a/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.h >+++ b/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.h >@@ -39,10 +39,10 @@ class WebPage; > > class StorageNamespaceImpl : public WebCore::StorageNamespace { > public: >- static RefPtr<StorageNamespaceImpl> createSessionStorageNamespace(uint64_t identifier, unsigned quotaInBytes); >- static RefPtr<StorageNamespaceImpl> createEphemeralLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes); >- static RefPtr<StorageNamespaceImpl> createLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes); >- static RefPtr<StorageNamespaceImpl> createTransientLocalStorageNamespace(uint64_t identifier, WebCore::SecurityOrigin& topLevelOrigin, uint64_t quotaInBytes); >+ static Ref<StorageNamespaceImpl> createSessionStorageNamespace(uint64_t identifier, unsigned quotaInBytes); >+ static Ref<StorageNamespaceImpl> createEphemeralLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes); >+ static Ref<StorageNamespaceImpl> createLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes); >+ static Ref<StorageNamespaceImpl> createTransientLocalStorageNamespace(uint64_t identifier, WebCore::SecurityOrigin& topLevelOrigin, uint64_t quotaInBytes); > > virtual ~StorageNamespaceImpl(); > >@@ -56,10 +56,10 @@ class StorageNamespaceImpl : public WebCore::StorageNamespace { > private: > explicit StorageNamespaceImpl(WebCore::StorageType, uint64_t storageNamespaceID, WebCore::SecurityOrigin* topLevelOrigin, unsigned quotaInBytes); > >- RefPtr<WebCore::StorageArea> storageArea(const WebCore::SecurityOriginData&) override; >- RefPtr<WebCore::StorageNamespace> copy(WebCore::Page*) override; >+ Ref<WebCore::StorageArea> storageArea(const WebCore::SecurityOriginData&) override; >+ Ref<WebCore::StorageNamespace> copy(WebCore::Page*) override; > >- RefPtr<WebCore::StorageArea> ephemeralLocalStorageArea(const WebCore::SecurityOriginData&); >+ Ref<WebCore::StorageArea> ephemeralLocalStorageArea(const WebCore::SecurityOriginData&); > > const WebCore::StorageType m_storageType; > const uint64_t m_storageNamespaceID; >diff --git a/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp b/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp >index 462de86c49004f1af691ed0b671618f03a7ffe2c..82557b72714ad872657eaf84968521a7136039e6 100644 >--- a/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp >+++ b/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp >@@ -41,14 +41,14 @@ static HashMap<uint64_t, WebStorageNamespaceProvider*>& storageNamespaceProvider > return storageNamespaceProviders; > } > >-RefPtr<WebStorageNamespaceProvider> WebStorageNamespaceProvider::getOrCreate(uint64_t identifier) >+Ref<WebStorageNamespaceProvider> WebStorageNamespaceProvider::getOrCreate(uint64_t identifier) > { > auto& slot = storageNamespaceProviders().add(identifier, nullptr).iterator->value; > if (slot) >- return slot; >+ return *slot; > >- RefPtr<WebStorageNamespaceProvider> storageNamespaceProvider = adoptRef(new WebStorageNamespaceProvider(identifier)); >- slot = storageNamespaceProvider.get(); >+ auto storageNamespaceProvider = adoptRef(*new WebStorageNamespaceProvider(identifier)); >+ slot = storageNamespaceProvider.ptr(); > > return storageNamespaceProvider; > } >@@ -65,22 +65,22 @@ WebStorageNamespaceProvider::~WebStorageNamespaceProvider() > storageNamespaceProviders().remove(m_identifier); > } > >-RefPtr<WebCore::StorageNamespace> WebStorageNamespaceProvider::createSessionStorageNamespace(Page& page, unsigned quota) >+Ref<WebCore::StorageNamespace> WebStorageNamespaceProvider::createSessionStorageNamespace(Page& page, unsigned quota) > { > return StorageNamespaceImpl::createSessionStorageNamespace(WebPage::fromCorePage(&page)->pageID(), quota); > } > >-RefPtr<WebCore::StorageNamespace> WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace(Page& page, unsigned quota) >+Ref<WebCore::StorageNamespace> WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace(Page& page, unsigned quota) > { > return StorageNamespaceImpl::createEphemeralLocalStorageNamespace(WebPage::fromCorePage(&page)->pageID(), quota); > } > >-RefPtr<WebCore::StorageNamespace> WebStorageNamespaceProvider::createLocalStorageNamespace(unsigned quota) >+Ref<WebCore::StorageNamespace> WebStorageNamespaceProvider::createLocalStorageNamespace(unsigned quota) > { > return StorageNamespaceImpl::createLocalStorageNamespace(m_identifier, quota); > } > >-RefPtr<WebCore::StorageNamespace> WebStorageNamespaceProvider::createTransientLocalStorageNamespace(WebCore::SecurityOrigin& topLevelOrigin, unsigned quota) >+Ref<WebCore::StorageNamespace> WebStorageNamespaceProvider::createTransientLocalStorageNamespace(WebCore::SecurityOrigin& topLevelOrigin, unsigned quota) > { > return StorageNamespaceImpl::createTransientLocalStorageNamespace(m_identifier, topLevelOrigin, quota); > } >diff --git a/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h b/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h >index 8ea25e6e7509eb2c17bd1f9484c3731f6c1ea795..3ce6db9f068e8038968114ef99ac25ace0411f34 100644 >--- a/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h >+++ b/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h >@@ -31,16 +31,16 @@ namespace WebKit { > > class WebStorageNamespaceProvider final : public WebCore::StorageNamespaceProvider { > public: >- static RefPtr<WebStorageNamespaceProvider> getOrCreate(uint64_t identifier); >+ static Ref<WebStorageNamespaceProvider> getOrCreate(uint64_t identifier); > virtual ~WebStorageNamespaceProvider(); > > private: > explicit WebStorageNamespaceProvider(uint64_t identifier); > >- RefPtr<WebCore::StorageNamespace> createSessionStorageNamespace(WebCore::Page&, unsigned quota) override; >- RefPtr<WebCore::StorageNamespace> createEphemeralLocalStorageNamespace(WebCore::Page&, unsigned quota) override; >- RefPtr<WebCore::StorageNamespace> createLocalStorageNamespace(unsigned quota) override; >- RefPtr<WebCore::StorageNamespace> createTransientLocalStorageNamespace(WebCore::SecurityOrigin&, unsigned quota) override; >+ Ref<WebCore::StorageNamespace> createSessionStorageNamespace(WebCore::Page&, unsigned quota) override; >+ Ref<WebCore::StorageNamespace> createEphemeralLocalStorageNamespace(WebCore::Page&, unsigned quota) override; >+ Ref<WebCore::StorageNamespace> createLocalStorageNamespace(unsigned quota) override; >+ Ref<WebCore::StorageNamespace> createTransientLocalStorageNamespace(WebCore::SecurityOrigin&, unsigned quota) override; > > const uint64_t m_identifier; > }; >diff --git a/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm b/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm >index cf3085b840f07fd7d059213525dd47dbe1beb471..fc659863252bfe4fa8c1e129b9ae8e830faf788a 100644 >--- a/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm >+++ b/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm >@@ -202,9 +202,9 @@ void PlaybackSessionManager::invalidate() > > PlaybackSessionManager::ModelInterfaceTuple PlaybackSessionManager::createModelAndInterface(uint64_t contextId) > { >- RefPtr<PlaybackSessionModelMediaElement> model = PlaybackSessionModelMediaElement::create(); >- RefPtr<PlaybackSessionInterfaceContext> interface = PlaybackSessionInterfaceContext::create(*this, contextId); >- model->addClient(*interface); >+ auto model = PlaybackSessionModelMediaElement::create(); >+ auto interface = PlaybackSessionInterfaceContext::create(*this, contextId); >+ model->addClient(interface.get()); > > return std::make_tuple(WTFMove(model), WTFMove(interface)); > } >diff --git a/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm b/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm >index 7f63309f32a0a83a38d0c28825e8173b0221f16e..5d6110b7909f34cce3e762bfd38d2b2f721d5216 100644 >--- a/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm >+++ b/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm >@@ -150,12 +150,12 @@ void VideoFullscreenManager::invalidate() > > VideoFullscreenManager::ModelInterfaceTuple VideoFullscreenManager::createModelAndInterface(uint64_t contextId) > { >- RefPtr<VideoFullscreenModelVideoElement> model = VideoFullscreenModelVideoElement::create(); >- RefPtr<VideoFullscreenInterfaceContext> interface = VideoFullscreenInterfaceContext::create(*this, contextId); >+ auto model = VideoFullscreenModelVideoElement::create(); >+ auto interface = VideoFullscreenInterfaceContext::create(*this, contextId); > m_playbackSessionManager->addClientForContext(contextId); > > interface->setLayerHostingContext(LayerHostingContext::createForExternalHostingProcess()); >- model->addClient(*interface); >+ model->addClient(interface.get()); > > return std::make_tuple(WTFMove(model), WTFMove(interface)); > } >diff --git a/Source/WebKitLegacy/Storage/StorageNamespaceImpl.cpp b/Source/WebKitLegacy/Storage/StorageNamespaceImpl.cpp >index 01815c13ac2a10296403273172267e3256e8c2ec..86db2d8718a54b2f6c2653f93c0aae9b2b9fd058 100644 >--- a/Source/WebKitLegacy/Storage/StorageNamespaceImpl.cpp >+++ b/Source/WebKitLegacy/Storage/StorageNamespaceImpl.cpp >@@ -93,31 +93,31 @@ StorageNamespaceImpl::~StorageNamespaceImpl() > close(); > } > >-RefPtr<StorageNamespace> StorageNamespaceImpl::copy(Page*) >+Ref<StorageNamespace> StorageNamespaceImpl::copy(Page*) > { > ASSERT(isMainThread()); > ASSERT(!m_isShutdown); > ASSERT(m_storageType == StorageType::Session || m_storageType == StorageType::EphemeralLocal); > >- RefPtr<StorageNamespaceImpl> newNamespace = adoptRef(new StorageNamespaceImpl(m_storageType, m_path, m_quota)); >+ auto newNamespace = adoptRef(*new StorageNamespaceImpl(m_storageType, m_path, m_quota)); > for (auto& iter : m_storageAreaMap) > newNamespace->m_storageAreaMap.set(iter.key, iter.value->copy()); > > return newNamespace; > } > >-RefPtr<StorageArea> StorageNamespaceImpl::storageArea(const SecurityOriginData& origin) >+Ref<StorageArea> StorageNamespaceImpl::storageArea(const SecurityOriginData& origin) > { > ASSERT(isMainThread()); > ASSERT(!m_isShutdown); > > RefPtr<StorageAreaImpl> storageArea; > if ((storageArea = m_storageAreaMap.get(origin))) >- return storageArea; >+ return storageArea.releaseNonNull(); > > storageArea = StorageAreaImpl::create(m_storageType, origin, m_syncManager.get(), m_quota); > m_storageAreaMap.set(origin, storageArea.get()); >- return storageArea; >+ return storageArea.releaseNonNull(); > } > > void StorageNamespaceImpl::close() >diff --git a/Source/WebKitLegacy/Storage/StorageNamespaceImpl.h b/Source/WebKitLegacy/Storage/StorageNamespaceImpl.h >index 27b8f9bab3ad339668540f480bfd65a966616137..c88f061ef5e50c9b1635ec3f8d6ba0ed7705caa7 100644 >--- a/Source/WebKitLegacy/Storage/StorageNamespaceImpl.h >+++ b/Source/WebKitLegacy/Storage/StorageNamespaceImpl.h >@@ -57,8 +57,8 @@ class StorageNamespaceImpl : public WebCore::StorageNamespace { > private: > StorageNamespaceImpl(WebCore::StorageType, const String& path, unsigned quota); > >- RefPtr<WebCore::StorageArea> storageArea(const WebCore::SecurityOriginData&) override; >- RefPtr<StorageNamespace> copy(WebCore::Page* newPage) override; >+ Ref<WebCore::StorageArea> storageArea(const WebCore::SecurityOriginData&) override; >+ Ref<StorageNamespace> copy(WebCore::Page* newPage) override; > > typedef HashMap<WebCore::SecurityOriginData, RefPtr<StorageAreaImpl>> StorageAreaMap; > StorageAreaMap m_storageAreaMap; >diff --git a/Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.cpp b/Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.cpp >index ed7ea3aa393da55937a1ad45a46d677c884abd9e..8362057ffd74f6d2da1aa47d77800491c9da11dc 100644 >--- a/Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.cpp >+++ b/Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.cpp >@@ -39,9 +39,9 @@ static HashSet<WebStorageNamespaceProvider*>& storageNamespaceProviders() > return storageNamespaceProviders; > } > >-RefPtr<WebStorageNamespaceProvider> WebStorageNamespaceProvider::create(const String& localStorageDatabasePath) >+Ref<WebStorageNamespaceProvider> WebStorageNamespaceProvider::create(const String& localStorageDatabasePath) > { >- return adoptRef(new WebStorageNamespaceProvider(localStorageDatabasePath)); >+ return adoptRef(*new WebStorageNamespaceProvider(localStorageDatabasePath)); > } > > WebStorageNamespaceProvider::WebStorageNamespaceProvider(const String& localStorageDatabasePath) >@@ -96,22 +96,22 @@ void WebStorageNamespaceProvider::syncLocalStorage() > } > } > >-RefPtr<StorageNamespace> WebStorageNamespaceProvider::createSessionStorageNamespace(Page&, unsigned quota) >+Ref<StorageNamespace> WebStorageNamespaceProvider::createSessionStorageNamespace(Page&, unsigned quota) > { > return StorageNamespaceImpl::createSessionStorageNamespace(quota); > } > >-RefPtr<StorageNamespace> WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace(Page&, unsigned quota) >+Ref<StorageNamespace> WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace(Page&, unsigned quota) > { > return StorageNamespaceImpl::createEphemeralLocalStorageNamespace(quota); > } > >-RefPtr<StorageNamespace> WebStorageNamespaceProvider::createLocalStorageNamespace(unsigned quota) >+Ref<StorageNamespace> WebStorageNamespaceProvider::createLocalStorageNamespace(unsigned quota) > { > return StorageNamespaceImpl::getOrCreateLocalStorageNamespace(m_localStorageDatabasePath, quota); > } > >-RefPtr<StorageNamespace> WebStorageNamespaceProvider::createTransientLocalStorageNamespace(SecurityOrigin&, unsigned quota) >+Ref<StorageNamespace> WebStorageNamespaceProvider::createTransientLocalStorageNamespace(SecurityOrigin&, unsigned quota) > { > // FIXME: A smarter implementation would create a special namespace type instead of just piggy-backing off > // SessionStorageNamespace here. >diff --git a/Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.h b/Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.h >index 0d207d343192c4fe7b97d038d581b2c4ec077abb..e589fee7a5c6c91cf94b7d23b486148179b8cff6 100644 >--- a/Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.h >+++ b/Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.h >@@ -35,7 +35,7 @@ namespace WebKit { > > class WebStorageNamespaceProvider final : public WebCore::StorageNamespaceProvider { > public: >- static RefPtr<WebStorageNamespaceProvider> create(const String& localStorageDatabasePath); >+ static Ref<WebStorageNamespaceProvider> create(const String& localStorageDatabasePath); > virtual ~WebStorageNamespaceProvider(); > > static void closeLocalStorage(); >@@ -49,10 +49,10 @@ class WebStorageNamespaceProvider final : public WebCore::StorageNamespaceProvid > private: > explicit WebStorageNamespaceProvider(const String& localStorageDatabasePath); > >- RefPtr<WebCore::StorageNamespace> createSessionStorageNamespace(WebCore::Page&, unsigned quota) override; >- RefPtr<WebCore::StorageNamespace> createEphemeralLocalStorageNamespace(WebCore::Page&, unsigned quota) override; >- RefPtr<WebCore::StorageNamespace> createLocalStorageNamespace(unsigned quota) override; >- RefPtr<WebCore::StorageNamespace> createTransientLocalStorageNamespace(WebCore::SecurityOrigin&, unsigned quota) override; >+ Ref<WebCore::StorageNamespace> createSessionStorageNamespace(WebCore::Page&, unsigned quota) override; >+ Ref<WebCore::StorageNamespace> createEphemeralLocalStorageNamespace(WebCore::Page&, unsigned quota) override; >+ Ref<WebCore::StorageNamespace> createLocalStorageNamespace(unsigned quota) override; >+ Ref<WebCore::StorageNamespace> createTransientLocalStorageNamespace(WebCore::SecurityOrigin&, unsigned quota) override; > > const String m_localStorageDatabasePath; > }; >diff --git a/Source/WebKitLegacy/WebCoreSupport/WebViewGroup.cpp b/Source/WebKitLegacy/WebCoreSupport/WebViewGroup.cpp >index c6b408710500619901b540605e0667d1a6213b9d..63cae2d0ad52cd513d8533200c3deefcc17c4b57 100644 >--- a/Source/WebKitLegacy/WebCoreSupport/WebViewGroup.cpp >+++ b/Source/WebKitLegacy/WebCoreSupport/WebViewGroup.cpp >@@ -42,18 +42,22 @@ static HashMap<String, RefPtr<WebViewGroup>>& webViewGroups() > return webViewGroups; > } > >-RefPtr<WebViewGroup> WebViewGroup::getOrCreate(const String& name, const String& localStorageDatabasePath) >+Ref<WebViewGroup> WebViewGroup::getOrCreate(const String& name, const String& localStorageDatabasePath) > { > if (name.isEmpty()) >- return adoptRef(new WebViewGroup(String(), localStorageDatabasePath)); >+ return adoptRef(*new WebViewGroup(String(), localStorageDatabasePath)); > > auto& webViewGroup = webViewGroups().add(name, nullptr).iterator->value; >- if (!webViewGroup) >- webViewGroup = adoptRef(new WebViewGroup(name, localStorageDatabasePath)); >- else if (!webViewGroup->m_storageNamespaceProvider && webViewGroup->m_localStorageDatabasePath.isEmpty() && !localStorageDatabasePath.isEmpty()) >+ if (!webViewGroup) { >+ auto result = adoptRef(*new WebViewGroup(name, localStorageDatabasePath)); >+ webViewGroup = result.copyRef(); >+ return result; >+ } >+ >+ if (!webViewGroup->m_storageNamespaceProvider && webViewGroup->m_localStorageDatabasePath.isEmpty() && !localStorageDatabasePath.isEmpty()) > webViewGroup->m_localStorageDatabasePath = localStorageDatabasePath; > >- return webViewGroup; >+ return *webViewGroup; > } > > WebViewGroup* WebViewGroup::get(const String& name) >diff --git a/Source/WebKitLegacy/WebCoreSupport/WebViewGroup.h b/Source/WebKitLegacy/WebCoreSupport/WebViewGroup.h >index fe05cd5486905cd29fb6884e7a87fbdc93272b5f..4d4137ce2aaac3a140d59c62c3963352f255b17c 100644 >--- a/Source/WebKitLegacy/WebCoreSupport/WebViewGroup.h >+++ b/Source/WebKitLegacy/WebCoreSupport/WebViewGroup.h >@@ -38,7 +38,7 @@ OBJC_CLASS WebView; > > class WebViewGroup : public RefCounted<WebViewGroup> { > public: >- static RefPtr<WebViewGroup> getOrCreate(const String& name, const String& localStorageDatabasePath); >+ static Ref<WebViewGroup> getOrCreate(const String& name, const String& localStorageDatabasePath); > ~WebViewGroup(); > > static WebViewGroup* get(const String& name); >diff --git a/Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.cpp b/Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.cpp >index d08493b0f42ccd362af442c03e49448d81d7f5d0..8049b1ccc272c3472599e4942e5006cb8681517a 100644 >--- a/Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.cpp >+++ b/Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.cpp >@@ -26,13 +26,13 @@ > using namespace WebCore; > > SearchPopupMenuIOS::SearchPopupMenuIOS(PopupMenuClient* client) >- : m_popup(adoptRef(new PopupMenuIOS(client))) >+ : m_popup(adoptRef(*new PopupMenuIOS(client))) > { > } > > PopupMenu* SearchPopupMenuIOS::popupMenu() > { >- return m_popup.get(); >+ return m_popup.ptr(); > } > > void SearchPopupMenuIOS::saveRecentSearches(const AtomicString&, const Vector<RecentSearch>& /*searchItems*/) >diff --git a/Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.h b/Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.h >index 716ed59c414723952d70dec52dbf8ef59879af4f..0ef44b42a660ae352c8bee69550ab2df0f9534e9 100644 >--- a/Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.h >+++ b/Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.h >@@ -38,7 +38,7 @@ class SearchPopupMenuIOS : public WebCore::SearchPopupMenu { > bool enabled() override; > > private: >- RefPtr<PopupMenuIOS> m_popup; >+ Ref<PopupMenuIOS> m_popup; > }; > > #endif // SearchPopupMenuIOS_h >diff --git a/Source/WebKitLegacy/ios/WebCoreSupport/WebVisiblePosition.mm b/Source/WebKitLegacy/ios/WebCoreSupport/WebVisiblePosition.mm >index 423c04900f4f0e6b9a5e689fc19c8737442b5b29..8591177a9cf2ae9260c7a0cfaf2f32a1361f6686 100644 >--- a/Source/WebKitLegacy/ios/WebCoreSupport/WebVisiblePosition.mm >+++ b/Source/WebKitLegacy/ios/WebCoreSupport/WebVisiblePosition.mm >@@ -433,8 +433,8 @@ - (DOMRange *)enclosingRangeWithDictationPhraseAlternatives:(NSArray **)alternat > for (size_t j = 0; j < markerAlternatives.size(); j++) > [(NSMutableArray *)*alternatives addObject:(NSString *)(markerAlternatives[j])]; > >- RefPtr<Range> range = Range::create(document, node, marker->startOffset(), node, marker->endOffset()); >- return kit(range.get()); >+ auto range = Range::create(document, node, marker->startOffset(), node, marker->endOffset()); >+ return kit(range.ptr()); > } > } > >@@ -462,8 +462,8 @@ - (DOMRange *)enclosingRangeWithCorrectionIndicator > for (size_t i = 0; i < markers.size(); i++) { > const DocumentMarker* marker = markers[i]; > if (marker->startOffset() <= offset && marker->endOffset() >= offset) { >- RefPtr<Range> range = Range::create(document, node, marker->startOffset(), node, marker->endOffset()); >- return kit(range.get()); >+ auto range = Range::create(document, node, marker->startOffset(), node, marker->endOffset()); >+ return kit(range.ptr()); > } > } > >diff --git a/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm b/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >index 96a6496c2c4460992c5c12c0dcfe67f340a6c1c8..a59198c334ee1498d9f34b9c096293dc36ca5ed4 100644 >--- a/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >+++ b/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >@@ -465,13 +465,13 @@ - (void)simulateClickOnLinkToURL:(NSURL *)URL > if (!URL) > return; > >- RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, >+ auto event = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, > MonotonicTime::now(), nullptr, 1, { }, { }, { }, { }, 0, 0, nullptr, 0, 0, nullptr, MouseEvent::IsSimulated::Yes); > > // Call to the frame loader because this is where our security checks are made. > Frame* frame = core([_dataSource webFrame]); > FrameLoadRequest frameLoadRequest { *frame->document(), frame->document()->securityOrigin(), { URL }, { }, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown }; >- frame->loader().loadFrameRequest(WTFMove(frameLoadRequest), event.get(), nullptr); >+ frame->loader().loadFrameRequest(WTFMove(frameLoadRequest), event.ptr(), nullptr); > } > > @end >diff --git a/Source/WebKitLegacy/mac/DOM/DOM.mm b/Source/WebKitLegacy/mac/DOM/DOM.mm >index f87e61533712f8eed70ceeb9e38635e3aa8f4ad4..1b6c822854a07f3d0c7a060176e4b810e7891fcc 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOM.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOM.mm >@@ -547,7 +547,7 @@ - (void)getPreviewSnapshotImage:(CGImageRef*)cgImage andRects:(NSArray **)rects > Ref<Range> range = rangeOfContents(node); > > const float margin = 4 / node.document().page()->pageScaleFactor(); >- RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(range, TextIndicatorOptionTightlyFitContent | >+ auto textIndicator = TextIndicator::createWithRange(range, TextIndicatorOptionTightlyFitContent | > TextIndicatorOptionRespectTextColor | > TextIndicatorOptionPaintBackgrounds | > TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges | >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >index 1f32dc9498ba4221d129391b8479aba30a979894..a04bc557bfddc976fd1805afeb7865b4d127ae6d 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >@@ -271,7 +271,7 @@ RefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin > NSData *data = [NSPropertyListSerialization dataWithPropertyList:properties.get() format:NSPropertyListBinaryFormat_v1_0 options:0 error:nullptr]; > ASSERT(data); > >- RefPtr<NetscapePluginInstanceProxy> instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame); >+ auto instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame); > uint32_t requestID = instance->nextRequestID(); > kern_return_t kr = _WKPHInstantiatePlugin(hostProxy->port(), requestID, static_cast<uint8_t*>(const_cast<void*>([data bytes])), [data length], instance->pluginID()); > if (kr == MACH_SEND_INVALID_DEST) { >@@ -299,7 +299,7 @@ RefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin > instance->setRenderContextID(reply->m_renderContextID); > instance->setRendererType(reply->m_rendererType); > >- return instance; >+ return WTFMove(instance); > } > > void NetscapePluginHostManager::createPropertyListFile(const String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier) >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >index 883b9207207e248dd47a30bc0c7621e7068b7c32..abca6bbe330535a982e642d4c2a188a7b8a8b7d5 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >@@ -719,8 +719,8 @@ void NetscapePluginInstanceProxy::evaluateJavaScript(PluginRequest* pluginReques > // Don't call NPP_NewStream and other stream methods if there is no JS result to deliver. This is what Mozilla does. > NSData *JSData = [result dataUsingEncoding:NSUTF8StringEncoding]; > >- RefPtr<HostedNetscapePluginStream> stream = HostedNetscapePluginStream::create(this, pluginRequest->requestID(), pluginRequest->request()); >- m_streams.add(stream->streamID(), stream); >+ auto stream = HostedNetscapePluginStream::create(this, pluginRequest->requestID(), pluginRequest->request()); >+ m_streams.add(stream->streamID(), stream.copyRef()); > > RetainPtr<NSURLResponse> response = adoptNS([[NSURLResponse alloc] initWithURL:URL > MIMEType:@"text/plain" >@@ -799,10 +799,10 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch > m_pluginRequests.append(WTFMove(pluginRequest)); > m_requestTimer.startOneShot(0_s); > } else { >- RefPtr<HostedNetscapePluginStream> stream = HostedNetscapePluginStream::create(this, requestID, request); >+ auto stream = HostedNetscapePluginStream::create(this, requestID, request); > > ASSERT(!m_streams.contains(requestID)); >- m_streams.add(requestID, stream); >+ m_streams.add(requestID, stream.copyRef()); > stream->start(); > } > >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >index 9a745d9383f7447f542df5045e2445b3853e0880..1d1e8aef6752361f3ecc046505d4657c2546b4c0 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >@@ -1517,7 +1517,7 @@ - (void)evaluateJavaScriptPluginRequest:(WebPluginRequest *)JSPluginRequest > // Don't call NPP_NewStream and other stream methods if there is no JS result to deliver. This is what Mozilla does. > NSData *JSData = [result dataUsingEncoding:NSUTF8StringEncoding]; > >- RefPtr<WebNetscapePluginStream> stream = WebNetscapePluginStream::create([NSURLRequest requestWithURL:URL], plugin, [JSPluginRequest sendNotification], [JSPluginRequest notifyData]); >+ auto stream = WebNetscapePluginStream::create([NSURLRequest requestWithURL:URL], plugin, [JSPluginRequest sendNotification], [JSPluginRequest notifyData]); > > RetainPtr<NSURLResponse> response = adoptNS([[NSURLResponse alloc] initWithURL:URL > MIMEType:@"text/plain" >@@ -1678,9 +1678,9 @@ - (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTa > [self performSelector:@selector(loadPluginRequest:) withObject:pluginRequest afterDelay:0]; > [pluginRequest release]; > } else { >- RefPtr<WebNetscapePluginStream> stream = WebNetscapePluginStream::create(request, plugin, sendNotification, notifyData); >+ auto stream = WebNetscapePluginStream::create(request, plugin, sendNotification, notifyData); > >- streams.add(stream.get()); >+ streams.add(stream.copyRef()); > stream->start(); > } > >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >index 96ef921fd606ecf080eed131d4b8d912d51f3ffb..234781b0be86a4bda50c0ce5648422388b42beca 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >@@ -207,8 +207,8 @@ RetainPtr<NSImage> WebContextMenuClient::imageForCurrentSharingServicePickerItem > return nil; > > VisibleSelection oldSelection = frameView->frame().selection().selection(); >- RefPtr<Range> range = Range::create(node->document(), Position(node, Position::PositionIsBeforeAnchor), Position(node, Position::PositionIsAfterAnchor)); >- frameView->frame().selection().setSelection(VisibleSelection(*range), FrameSelection::DoNotSetFocus); >+ auto range = Range::create(node->document(), Position(node, Position::PositionIsBeforeAnchor), Position(node, Position::PositionIsAfterAnchor)); >+ frameView->frame().selection().setSelection(VisibleSelection(range.get()), FrameSelection::DoNotSetFocus); > > OptionSet<PaintBehavior> oldPaintBehavior = frameView->paintBehavior(); > frameView->setPaintBehavior(PaintBehavior::SelectionOnly); >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >index ec8e58cf207bbcb04822ed2b15dead06762a567d..8460b03f50c7c2b13a17efe4c838fb7b92190ef2 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >@@ -1465,7 +1465,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage() > if (isMainFrame && coreFrame->view()) > coreFrame->view()->setParentVisible(false); > coreFrame->setView(nullptr); >- RefPtr<FrameView> coreView = FrameView::create(*coreFrame); >+ auto coreView = FrameView::create(*coreFrame); > coreFrame->setView(coreView.copyRef()); > > [m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen]; >diff --git a/Source/WebKitLegacy/mac/WebView/WebFrame.mm b/Source/WebKitLegacy/mac/WebView/WebFrame.mm >index 7b9bb89908ae5c1a652e36cc889be04e5654c946..a93def61399a5cc54ef61cae9c0379905890cd7c 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebFrame.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebFrame.mm >@@ -1746,8 +1746,8 @@ - (void)getDictationResultRanges:(NSArray **)outRanges andMetadatas:(NSArray **) > if (!metadata) > continue; > >- RefPtr<Range> range = Range::create(*document, node, marker->startOffset(), node, marker->endOffset()); >- DOMRange *domRange = kit(range.get()); >+ auto range = Range::create(*document, node, marker->startOffset(), node, marker->endOffset()); >+ DOMRange *domRange = kit(range.ptr()); > > if (metadata != previousMetadata) { > [metadatas addObject:metadata]; >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index 9c3c2bb99cc0c6cd3053798ddb6644c9e7db8142..4a86c79455fb36d0c5bebfb390ce8463feb24277 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -1348,7 +1348,7 @@ - (void)_writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPast > { > // Put HTML on the pasteboard. > if ([types containsObject:WebArchivePboardType]) { >- if (RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::createFromSelection(core([self _frame]))) { >+ if (auto coreArchive = LegacyWebArchive::createFromSelection(core([self _frame]))) { > if (RetainPtr<CFDataRef> data = coreArchive ? coreArchive->rawDataRepresentation() : 0) > [pasteboard setData:(__bridge NSData *)data.get() forType:WebArchivePboardType]; > } >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index 5eb9575282c1b653dcbc9aa6a47ed70c05e7d5ef..4f90f63939741269768d63036cb0d3b0d30c91fd 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -4729,8 +4729,6 @@ + (void)_addUserScriptToGroup:(NSString *)groupName world:(WebScriptWorld *)worl > return; > > auto viewGroup = WebViewGroup::getOrCreate(groupName, String()); >- if (!viewGroup) >- return; > > if (!world) > return; >@@ -4754,8 +4752,6 @@ + (void)_addUserStyleSheetToGroup:(NSString *)groupName world:(WebScriptWorld *) > return; > > auto viewGroup = WebViewGroup::getOrCreate(groupName, String()); >- if (!viewGroup) >- return; > > if (!world) > return; >diff --git a/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp b/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >index 5c0771211eaed649073e103e904a5ec9049b463f..bc79d89bd446c56ea1ba9d57c75ae399aa8f04cf 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >+++ b/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >@@ -141,7 +141,7 @@ bool PluginDatabase::refresh() > remove(oldPackage.get()); > } > >- RefPtr<PluginPackage> package = PluginPackage::createPackage(*it, lastModified); >+ auto package = PluginPackage::createPackage(*it, lastModified); > if (package && add(package.releaseNonNull())) > pluginSetChanged = true; > } >diff --git a/Source/WebKitLegacy/win/Plugins/PluginView.cpp b/Source/WebKitLegacy/win/Plugins/PluginView.cpp >index f855dd263f79cdfd41b646595022a8c44cca2f45..ef0a2e20b4137660f27be5ba4faccbfb0f624ab3 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginView.cpp >+++ b/Source/WebKitLegacy/win/Plugins/PluginView.cpp >@@ -272,7 +272,7 @@ void PluginView::mediaCanStart(Document&) > { > ASSERT(!m_isStarted); > if (!start()) >- static_cast<WebFrameLoaderClient&>(parentFrame()->loader().client()).dispatchDidFailToStartPlugin(this); >+ static_cast<WebFrameLoaderClient&>(parentFrame()->loader().client()).dispatchDidFailToStartPlugin(*this); > } > > PluginView::~PluginView() >@@ -410,8 +410,8 @@ void PluginView::performRequest(PluginRequest* request) > // if this is not a targeted request, create a stream for it. otherwise, > // just pass it off to the loader > if (targetFrameName.isEmpty()) { >- RefPtr<PluginStream> stream = PluginStream::create(this, m_parentFrame.get(), request->frameLoadRequest().resourceRequest(), request->sendNotification(), request->notifyData(), plugin()->pluginFuncs(), instance(), m_plugin->quirks()); >- m_streams.add(stream); >+ auto stream = PluginStream::create(this, m_parentFrame.get(), request->frameLoadRequest().resourceRequest(), request->sendNotification(), request->notifyData(), plugin()->pluginFuncs(), instance(), m_plugin->quirks()); >+ m_streams.add(stream.copyRef()); > stream->start(); > } else { > // If the target frame is our frame, we could destroy the >@@ -454,8 +454,8 @@ void PluginView::performRequest(PluginRequest* request) > cstr = resultString.utf8(); > } > >- RefPtr<PluginStream> stream = PluginStream::create(this, m_parentFrame.get(), request->frameLoadRequest().resourceRequest(), request->sendNotification(), request->notifyData(), plugin()->pluginFuncs(), instance(), m_plugin->quirks()); >- m_streams.add(stream); >+ auto stream = PluginStream::create(this, m_parentFrame.get(), request->frameLoadRequest().resourceRequest(), request->sendNotification(), request->notifyData(), plugin()->pluginFuncs(), instance(), m_plugin->quirks()); >+ m_streams.add(stream.copyRef()); > stream->sendJavaScriptStream(requestURL, cstr); > } > } >@@ -690,11 +690,11 @@ RefPtr<JSC::Bindings::Instance> PluginView::bindingInstance() > } > > auto root = m_parentFrame->script().createRootObject(this); >- RefPtr<JSC::Bindings::Instance> instance = JSC::Bindings::CInstance::create(object, WTFMove(root)); >+ auto instance = JSC::Bindings::CInstance::create(object, WTFMove(root)); > > _NPN_ReleaseObject(object); > >- return instance; >+ return WTFMove(instance); > #else > return nullptr; > #endif >diff --git a/Source/WebKitLegacy/win/Plugins/PluginView.h b/Source/WebKitLegacy/win/Plugins/PluginView.h >index 7cfc7a9a82e72c912f5db999cfb37bf9cf1a9f4e..b5b60a80991d60710b87063024021d65090632da 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginView.h >+++ b/Source/WebKitLegacy/win/Plugins/PluginView.h >@@ -317,7 +317,7 @@ namespace WebCore { > > Vector<bool, 4> m_popupStateStack; > >- HashSet<RefPtr<PluginStream> > m_streams; >+ HashSet<RefPtr<PluginStream>> m_streams; > Vector<std::unique_ptr<PluginRequest>> m_requests; > > bool m_isWindowed; >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >index 193e02b05018ef58fe416fcbfb675ede3fc5896c..50acf779dd6b54484848ecc25c18648b996ab7d6 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -1061,7 +1061,7 @@ ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const > return WebCore::ObjectContentType::None; > } > >-void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView* pluginView) const >+void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView& pluginView) const > { > WebView* webView = m_webFrame->webView(); > >@@ -1072,23 +1072,23 @@ void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView* plugin > RetainPtr<CFMutableDictionaryRef> userInfo = adoptCF(CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > > Frame* frame = core(m_webFrame); >- ASSERT(frame == pluginView->parentFrame()); >+ ASSERT(frame == pluginView.parentFrame()); > >- if (!pluginView->pluginsPage().isNull()) { >- URL pluginPageURL = frame->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(pluginView->pluginsPage())); >+ if (!pluginView.pluginsPage().isNull()) { >+ URL pluginPageURL = frame->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(pluginView.pluginsPage())); > if (pluginPageURL.protocolIsInHTTPFamily()) { > static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInPageURLStringKey); > CFDictionarySetValue(userInfo.get(), key, pluginPageURL.string().createCFString().get()); > } > } > >- if (!pluginView->mimeType().isNull()) { >+ if (!pluginView.mimeType().isNull()) { > static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorMIMETypeKey); >- CFDictionarySetValue(userInfo.get(), key, pluginView->mimeType().createCFString().get()); >+ CFDictionarySetValue(userInfo.get(), key, pluginView.mimeType().createCFString().get()); > } > >- if (pluginView->plugin()) { >- String pluginName = pluginView->plugin()->name(); >+ if (pluginView.plugin()) { >+ String pluginName = pluginView.plugin()->name(); > if (!pluginName.isNull()) { > static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInNameKey); > CFDictionarySetValue(userInfo.get(), key, pluginName.createCFString().get()); >@@ -1100,7 +1100,7 @@ void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView* plugin > > int errorCode = 0; > String description; >- switch (pluginView->status()) { >+ switch (pluginView.status()) { > case PluginStatusCanNotFindPlugin: > errorCode = WebKitErrorCannotFindPlugIn; > description = WEB_UI_STRING("The plug-in can\xE2\x80\x99t be found", "WebKitErrorCannotFindPlugin description"); >@@ -1113,7 +1113,7 @@ void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView* plugin > ASSERT_NOT_REACHED(); > } > >- ResourceError resourceError(String(WebKitErrorDomain), errorCode, pluginView->url(), String()); >+ ResourceError resourceError(String(WebKitErrorDomain), errorCode, pluginView.url(), String()); > COMPtr<IWebError> error(AdoptCOM, WebError::createInstance(resourceError, userInfoBag.get())); > > resourceLoadDelegate->plugInFailedWithError(webView, error.get(), getWebDataSource(frame->loader().documentLoader())); >@@ -1158,7 +1158,7 @@ RefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, HTM > > #if ENABLE(NETSCAPE_PLUGIN_API) > Frame* frame = core(m_webFrame); >- RefPtr<PluginView> pluginView = PluginView::create(frame, pluginSize, &element, url, paramNames, paramValues, mimeType, loadManually); >+ auto pluginView = PluginView::create(frame, pluginSize, &element, url, paramNames, paramValues, mimeType, loadManually); > > if (pluginView->status() == PluginStatusLoadedSuccessfully) > return pluginView; >@@ -1180,7 +1180,7 @@ void WebFrameLoaderClient::redirectDataToPlugin(Widget& pluginWidget) > RefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement& element, const URL& /*baseURL*/, const Vector<String>& paramNames, const Vector<String>& paramValues) > { > #if ENABLE(NETSCAPE_PLUGIN_API) >- RefPtr<PluginView> pluginView = PluginView::create(core(m_webFrame), pluginSize, &element, URL(), paramNames, paramValues, "application/x-java-applet", false); >+ auto pluginView = PluginView::create(core(m_webFrame), pluginSize, &element, URL(), paramNames, paramValues, "application/x-java-applet", false); > > // Check if the plugin can be loaded successfully > if (pluginView->plugin() && pluginView->plugin()->load()) >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >index f8d74885f06c54a43387693338c0e06324d98acb..2fbab79c70d0214e84f07e8dbe8ad4718c1c7937 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >@@ -49,7 +49,7 @@ class WebFrameLoaderClient : public WebCore::FrameLoaderClient, public WebCore:: > void setWebFrame(WebFrame* webFrame) { m_webFrame = webFrame; } > WebFrame* webFrame() const { return m_webFrame; } > >- void dispatchDidFailToStartPlugin(const WebCore::PluginView*) const; >+ void dispatchDidFailToStartPlugin(const WebCore::PluginView&) const; > > std::optional<uint64_t> pageID() const final; > std::optional<uint64_t> frameID() const final; >diff --git a/Source/WebKitLegacy/win/WebFrame.cpp b/Source/WebKitLegacy/win/WebFrame.cpp >index c03242c7d6b62d8fc635d9a0d7bd6e5d7c259fed..45e4a57b5a8bac2da7b44e4dfbf821caef0ab8bd 100644 >--- a/Source/WebKitLegacy/win/WebFrame.cpp >+++ b/Source/WebKitLegacy/win/WebFrame.cpp >@@ -564,7 +564,7 @@ HRESULT WebFrame::loadRequest(_In_opt_ IWebURLRequest* request) > return S_OK; > } > >-void WebFrame::loadData(RefPtr<WebCore::SharedBuffer>&& data, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL) >+void WebFrame::loadData(Ref<WebCore::SharedBuffer>&& data, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL) > { > String mimeTypeString(mimeType, SysStringLen(mimeType)); > if (!mimeType) >@@ -610,7 +610,7 @@ HRESULT WebFrame::loadData(_In_opt_ IStream* data, _In_ BSTR mimeType, _In_ BSTR > > HRESULT WebFrame::loadPlainTextString(_In_ BSTR plainText, _In_ BSTR url) > { >- RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<char*>(plainText), sizeof(UChar) * SysStringLen(plainText)); >+ auto sharedBuffer = SharedBuffer::create(reinterpret_cast<char*>(plainText), sizeof(UChar) * SysStringLen(plainText)); > BString plainTextMimeType(TEXT("text/plain"), 10); > BString utf16Encoding(TEXT("utf-16"), 6); > loadData(WTFMove(sharedBuffer), plainTextMimeType, utf16Encoding, url, nullptr); >@@ -619,7 +619,7 @@ HRESULT WebFrame::loadPlainTextString(_In_ BSTR plainText, _In_ BSTR url) > > void WebFrame::loadHTMLString(_In_ BSTR htmlString, _In_ BSTR baseURL, _In_ BSTR unreachableURL) > { >- RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<char*>(htmlString), sizeof(UChar) * SysStringLen(htmlString)); >+ auto sharedBuffer = SharedBuffer::create(reinterpret_cast<char*>(htmlString), sizeof(UChar) * SysStringLen(htmlString)); > BString utf16Encoding(TEXT("utf-16"), 6); > loadData(WTFMove(sharedBuffer), 0, utf16Encoding, baseURL, unreachableURL); > } >diff --git a/Source/WebKitLegacy/win/WebFrame.h b/Source/WebKitLegacy/win/WebFrame.h >index 1badd01c3a7640ccf11304a435a7b1e245115fde..502ca89df6b90d0a277d79b1bb59871b5d11426e 100644 >--- a/Source/WebKitLegacy/win/WebFrame.h >+++ b/Source/WebKitLegacy/win/WebFrame.h >@@ -199,7 +199,7 @@ class DECLSPEC_UUID("{A3676398-4485-4a9d-87DC-CB5A40E6351D}") WebFrame final : p > > protected: > void loadHTMLString(_In_ BSTR string, _In_ BSTR baseURL, _In_ BSTR unreachableURL); >- void loadData(RefPtr<WebCore::SharedBuffer>&&, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL); >+ void loadData(Ref<WebCore::SharedBuffer>&&, BSTR mimeType, BSTR textEncodingName, BSTR baseURL, BSTR failingURL); > const Vector<WebCore::IntRect>& computePageRects(HDC printDC); > void setPrinting(bool printing, const WebCore::FloatSize& pageSize, const WebCore::FloatSize& originalPageSize, float maximumShrinkRatio, WebCore::AdjustViewSizeOrNot); > void headerAndFooterHeights(float*, float*); >diff --git a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.cpp b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.cpp >index 94077912a99164117d0c681cccc06686e04c4de0..f9ab83b51ca323ebe71f55026792dbf63534336c 100644 >--- a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.cpp >+++ b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.cpp >@@ -187,9 +187,9 @@ CAView::~CAView() > messageWindow = nullptr; > } > >-RefPtr<CAView> CAView::create(DrawingDestination destination) >+Ref<CAView> CAView::create(DrawingDestination destination) > { >- return adoptRef(new CAView(destination)); >+ return adoptRef(*new CAView(destination)); > } > > void CAView::setContextDidChangeCallback(ContextDidChangeCallbackFunction function, void* info) >diff --git a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.h b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.h >index 45b64ec0152e51d424f42e339c5e06fb5448046c..72963be3dbbc4328f5579a6da570c62c5f48907c 100644 >--- a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.h >+++ b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.h >@@ -48,7 +48,7 @@ class CAView : public RefCounted<CAView>, private CVDisplayLinkClient { > > class Handle; > >- static RefPtr<CAView> create(DrawingDestination); >+ static Ref<CAView> create(DrawingDestination); > ~CAView(); > > typedef void (*ContextDidChangeCallbackFunction)(CAView*, void* info); >diff --git a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.cpp b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.cpp >index b154824ce4483c7dd9e631bad1b1398457f49fc5..aabd198b1115ed7e65ad8308541619cd415840e7 100644 >--- a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.cpp >+++ b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.cpp >@@ -44,9 +44,9 @@ CVDisplayLink::~CVDisplayLink() > ::CloseHandle(m_wakeupEvent); > } > >-RefPtr<CVDisplayLink> CVDisplayLink::create(CVDisplayLinkClient* client) >+Ref<CVDisplayLink> CVDisplayLink::create(CVDisplayLinkClient* client) > { >- return adoptRef(new CVDisplayLink(client)); >+ return adoptRef(*new CVDisplayLink(client)); > } > > void CVDisplayLink::start() >diff --git a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.h b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.h >index 0ae02f169ec828912661efa738c84fb7c4442283..ca026afeac415d7187478e87375a271099f40ccb 100644 >--- a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.h >+++ b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.h >@@ -36,7 +36,7 @@ class CVDisplayLinkClient; > // FIXME 8769181: Replace this with CVDisplayLinkRef > class CVDisplayLink : public ThreadSafeRefCounted<CVDisplayLink> { > public: >- static RefPtr<CVDisplayLink> create(CVDisplayLinkClient*); >+ static Ref<CVDisplayLink> create(CVDisplayLinkClient*); > ~CVDisplayLink(); > > void start(); >diff --git a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/ImageConversion.cpp b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/ImageConversion.cpp >index dc6670d433ff09e0d11665dc0553b216dfb2600c..cf92185a10db946d06bb4bd480c69fdec3460444 100644 >--- a/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/ImageConversion.cpp >+++ b/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/ImageConversion.cpp >@@ -97,7 +97,7 @@ static HRESULT getImageCopy(IDirect3DSurface9* systemMemorySurface, RefPtr<Image > > CSize surfaceSize(desc.Width, desc.Height); > >- RefPtr<Image> image = Image::create(surfaceSize); >+ auto image = Image::create(surfaceSize); > if (!image) > return E_FAIL; > >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index e8bddebf2626f5ccad8d4aced5733e72722aeeb7..fbc04de6597898b05d22a4e573a24ed561979837 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -6912,8 +6912,6 @@ HRESULT WebView::addUserScriptToGroup(_In_ BSTR groupName, _In_opt_ IWebScriptWo > return E_FAIL; > > auto viewGroup = WebViewGroup::getOrCreate(group, String()); >- if (!viewGroup) >- return E_FAIL; > > if (!iWorld) > return E_POINTER; >@@ -6941,8 +6939,6 @@ HRESULT WebView::addUserStyleSheetToGroup(_In_ BSTR groupName, _In_opt_ IWebScri > return E_FAIL; > > auto viewGroup = WebViewGroup::getOrCreate(group, String()); >- if (!viewGroup) >- return E_FAIL; > > if (!iWorld) > return E_POINTER;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192808
:
357549
|
357552
|
357553
|
357554
|
357555
|
357556
|
357557
|
357560
|
357561
|
357562
|
357563
|
357564
|
357569
|
357584
|
357665
|
357796
|
357802
|
357812