Use Ref<> as much as possible
authoryusukesuzuki@slowstart.org <yusukesuzuki@slowstart.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Dec 2018 06:37:39 +0000 (06:37 +0000)
committeryusukesuzuki@slowstart.org <yusukesuzuki@slowstart.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Dec 2018 06:37:39 +0000 (06:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192808

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* API/JSTypedArray.cpp:
(JSObjectMakeTypedArrayWithBytesNoCopy):
* API/JSWeakObjectMapRefPrivate.cpp:
* bytecompiler/StaticPropertyAnalyzer.h:
(JSC::StaticPropertyAnalyzer::newObject):
* 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):

Source/WebCore:

* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::bodyAsFormData const):
* 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):

Source/WebKit:

* 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):

Source/WebKitLegacy:

* 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:

Source/WebKitLegacy/ios:

* WebCoreSupport/SearchPopupMenuIOS.cpp:
(SearchPopupMenuIOS::SearchPopupMenuIOS):
(SearchPopupMenuIOS::popupMenu):
* WebCoreSupport/SearchPopupMenuIOS.h:
* WebCoreSupport/WebVisiblePosition.mm:
(-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]):
(-[WebVisiblePosition enclosingRangeWithCorrectionIndicator]):
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):

Source/WebKitLegacy/mac:

* 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:]):

Source/WebKitLegacy/win:

* 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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239535 268f45cc-cd09-0410-ab3c-d52691b4dbfc

285 files changed:
Source/JavaScriptCore/API/JSTypedArray.cpp
Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/StaticPropertyAnalyzer.h
Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.cpp
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/IsoCellSet.cpp
Source/JavaScriptCore/heap/IsoCellSet.h
Source/JavaScriptCore/heap/IsoCellSetInlines.h
Source/JavaScriptCore/heap/Subspace.cpp
Source/JavaScriptCore/heap/Subspace.h
Source/JavaScriptCore/heap/SubspaceInlines.h
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/ArrayBuffer.cpp
Source/JavaScriptCore/runtime/ArrayBuffer.h
Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp
Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.h
Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp
Source/WebCore/ChangeLog
Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp
Source/WebCore/Modules/fetch/FetchBody.cpp
Source/WebCore/Modules/geolocation/Geolocation.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.h
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.h
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.h
Source/WebCore/Modules/indexeddb/client/TransactionOperation.h
Source/WebCore/Modules/mediastream/MediaDevices.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/Modules/webaudio/AudioParam.cpp
Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp
Source/WebCore/Modules/webdatabase/SQLStatement.cpp
Source/WebCore/Modules/webgpu/WebGPU.cpp
Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp
Source/WebCore/Modules/webgpu/WebGPUAdapter.h
Source/WebCore/Modules/webgpu/WebGPUBuffer.cpp
Source/WebCore/Modules/webgpu/WebGPUBuffer.h
Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp
Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h
Source/WebCore/Modules/webgpu/WebGPUDevice.cpp
Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp
Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h
Source/WebCore/Modules/webgpu/WebGPURenderPipeline.cpp
Source/WebCore/Modules/webgpu/WebGPURenderPipeline.h
Source/WebCore/Modules/webgpu/WebGPUShaderModule.cpp
Source/WebCore/Modules/webgpu/WebGPUShaderModule.h
Source/WebCore/Modules/webgpu/WebGPUTexture.cpp
Source/WebCore/Modules/webgpu/WebGPUTextureView.cpp
Source/WebCore/Modules/webgpu/WebGPUTextureView.h
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp
Source/WebCore/bindings/js/ScriptControllerMac.mm
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/bridge/objc/objc_instance.h
Source/WebCore/bridge/objc/objc_instance.mm
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.h
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/css/FontFace.cpp
Source/WebCore/css/InspectorCSSOMWrappers.cpp
Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleRule.cpp
Source/WebCore/css/StyleRule.h
Source/WebCore/dom/ChildListMutationScope.cpp
Source/WebCore/dom/ChildListMutationScope.h
Source/WebCore/dom/DocumentMarkerController.cpp
Source/WebCore/dom/InlineStyleSheetOwner.cpp
Source/WebCore/dom/PointerEvent.h
Source/WebCore/dom/UserGestureIndicator.h
Source/WebCore/editing/AlternativeTextController.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/DeleteSelectionCommand.cpp
Source/WebCore/editing/Editing.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/FormatBlockCommand.cpp
Source/WebCore/editing/RemoveFormatCommand.cpp
Source/WebCore/editing/ReplaceRangeWithTextCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/editing/SpellingCorrectionCommand.cpp
Source/WebCore/editing/TextCheckingHelper.cpp
Source/WebCore/editing/TypingCommand.cpp
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/editing/cocoa/EditorCocoa.mm
Source/WebCore/editing/ios/DictationCommandIOS.cpp
Source/WebCore/editing/ios/EditorIOS.mm
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/editing/markup.cpp
Source/WebCore/fileapi/FileReaderLoader.cpp
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTableElement.h
Source/WebCore/html/URLUtils.h
Source/WebCore/html/parser/HTMLConstructionSite.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/track/WebVTTParser.cpp
Source/WebCore/inspector/DOMPatchSupport.cpp
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp
Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/WorkerThreadableLoader.cpp
Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/page/mac/ServicesOverlayController.mm
Source/WebCore/platform/SharedBuffer.cpp
Source/WebCore/platform/audio/HRTFElevation.cpp
Source/WebCore/platform/audio/SincResampler.cpp
Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp
Source/WebCore/platform/graphics/Icon.h
Source/WebCore/platform/graphics/InbandTextTrackPrivate.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/ca/TileController.cpp
Source/WebCore/platform/graphics/ca/TileController.h
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp
Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
Source/WebCore/platform/graphics/transforms/TransformOperations.cpp
Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
Source/WebCore/platform/mock/mediasource/MockBox.cpp
Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp
Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h
Source/WebCore/platform/mock/mediasource/MockTracks.h
Source/WebCore/platform/network/FormData.h
Source/WebCore/platform/network/cocoa/CookieStorageObserver.h
Source/WebCore/platform/network/cocoa/CookieStorageObserver.mm
Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp
Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp
Source/WebCore/platform/win/SearchPopupMenuWin.cpp
Source/WebCore/platform/win/SearchPopupMenuWin.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
Source/WebCore/storage/Storage.cpp
Source/WebCore/storage/Storage.h
Source/WebCore/storage/StorageNamespace.h
Source/WebCore/storage/StorageNamespaceProvider.cpp
Source/WebCore/storage/StorageNamespaceProvider.h
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGFEBlendElement.cpp
Source/WebCore/svg/SVGFEColorMatrixElement.cpp
Source/WebCore/svg/SVGFEComponentTransferElement.cpp
Source/WebCore/svg/SVGFECompositeElement.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFEDisplacementMapElement.cpp
Source/WebCore/svg/SVGFEDropShadowElement.cpp
Source/WebCore/svg/SVGFEGaussianBlurElement.cpp
Source/WebCore/svg/SVGFEMergeElement.cpp
Source/WebCore/svg/SVGFEMorphologyElement.cpp
Source/WebCore/svg/SVGFEOffsetElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/SVGFETileElement.cpp
Source/WebCore/testing/GCObservation.h
Source/WebCore/xml/XSLTProcessor.cpp
Source/WebCore/xml/parser/XMLDocumentParser.cpp
Source/WebKit/ChangeLog
Source/WebKit/PluginProcess/WebProcessConnection.cpp
Source/WebKit/PluginProcess/WebProcessConnection.h
Source/WebKit/UIProcess/API/Cocoa/WKConnection.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp
Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp
Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm
Source/WebKit/UIProcess/BackingStore.cpp
Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h
Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm
Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h
Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp
Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h
Source/WebKit/UIProcess/gstreamer/WebPageProxyGStreamer.cpp
Source/WebKit/UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp
Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp
Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm
Source/WebKit/UIProcess/mac/PageClientImplMac.mm
Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp
Source/WebKit/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm
Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp
Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp
Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit/WebProcess/Plugins/PluginProcessConnectionManager.cpp
Source/WebKit/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit/WebProcess/Plugins/PluginView.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp
Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit/WebProcess/WebPage/FindController.cpp
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm
Source/WebKit/WebProcess/WebPage/WebFrame.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp
Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.h
Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp
Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h
Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm
Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/Storage/StorageNamespaceImpl.cpp
Source/WebKitLegacy/Storage/StorageNamespaceImpl.h
Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.cpp
Source/WebKitLegacy/Storage/WebStorageNamespaceProvider.h
Source/WebKitLegacy/WebCoreSupport/WebViewGroup.cpp
Source/WebKitLegacy/WebCoreSupport/WebViewGroup.h
Source/WebKitLegacy/ios/ChangeLog
Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.cpp
Source/WebKitLegacy/ios/WebCoreSupport/SearchPopupMenuIOS.h
Source/WebKitLegacy/ios/WebCoreSupport/WebVisiblePosition.mm
Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/DOM.mm
Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm
Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/mac/WebView/WebFrame.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp
Source/WebKitLegacy/win/Plugins/PluginView.cpp
Source/WebKitLegacy/win/Plugins/PluginView.h
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKitLegacy/win/WebFrame.cpp
Source/WebKitLegacy/win/WebFrame.h
Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.cpp
Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.h
Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.cpp
Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CVDisplayLink.h
Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/ImageConversion.cpp
Source/WebKitLegacy/win/WebView.cpp

index 4adc769..993bf2c 100644 (file)
@@ -185,7 +185,7 @@ JSObjectRef JSObjectMakeTypedArrayWithBytesNoCopy(JSContextRef ctx, JSTypedArray
 
     unsigned elementByteSize = elementSize(toTypedArrayType(arrayType));
 
-    RefPtr<ArrayBuffer> buffer = ArrayBuffer::createFromBytes(bytes, length, [=](void* p) {
+    auto buffer = ArrayBuffer::createFromBytes(bytes, length, [=](void* p) {
         if (destructor)
             destructor(p, destructorContext);
     });
index 78332d7..d128836 100644 (file)
@@ -46,9 +46,9 @@ JSWeakObjectMapRef JSWeakObjectMapCreate(JSContextRef context, void* privateData
     ExecState* exec = toJS(context);
     VM& vm = exec->vm();
     JSLockHolder locker(vm);
-    RefPtr<OpaqueJSWeakObjectMap> map = OpaqueJSWeakObjectMap::create(vm, privateData, callback);
-    exec->lexicalGlobalObject()->registerWeakMap(map.get());
-    return map.get();
+    auto map = OpaqueJSWeakObjectMap::create(vm, privateData, callback);
+    exec->lexicalGlobalObject()->registerWeakMap(map.ptr());
+    return map.ptr();
 }
 
 void JSWeakObjectMapSet(JSContextRef ctx, JSWeakObjectMapRef map, void* key, JSObjectRef object)
index 2e882b9..2d8fdba 100644 (file)
@@ -1,3 +1,45 @@
+2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
+
+        Use Ref<> as much as possible
+        https://bugs.webkit.org/show_bug.cgi?id=192808
+
+        Reviewed by Alex Christensen.
+
+        * API/JSTypedArray.cpp:
+        (JSObjectMakeTypedArrayWithBytesNoCopy):
+        * API/JSWeakObjectMapRefPrivate.cpp:
+        * bytecompiler/StaticPropertyAnalyzer.h:
+        (JSC::StaticPropertyAnalyzer::newObject):
+        * 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-21  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Crashes seen under Inspector::ScriptCallFrame::~ScriptCallFrame
index 01e0769..5f9e738 100644 (file)
@@ -59,8 +59,8 @@ inline void StaticPropertyAnalyzer::createThis(RegisterID* dst, InstructionStrea
 
 inline void StaticPropertyAnalyzer::newObject(RegisterID* dst, InstructionStream::MutableRef instructionRef)
 {
-    RefPtr<StaticPropertyAnalysis> analysis = StaticPropertyAnalysis::create(WTFMove(instructionRef));
-    AnalysisMap::AddResult addResult = m_analyses.add(dst->index(), analysis);
+    auto analysis = StaticPropertyAnalysis::create(WTFMove(instructionRef));
+    AnalysisMap::AddResult addResult = m_analyses.add(dst->index(), analysis.copyRef());
     if (!addResult.isNewEntry) {
         kill(addResult.iterator->value.get());
         addResult.iterator->value = WTFMove(analysis);
index 173d03e..0d7942a 100644 (file)
@@ -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
index 16c9923..8b0d1a2 100644 (file)
@@ -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)
index db23004..af0f004 100644 (file)
@@ -629,8 +629,8 @@ private:
     
     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;
     
index 620dd15..b8e4301 100644 (file)
@@ -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)
index 16c9cbb..dada672 100644 (file)
@@ -51,7 +51,7 @@ public:
     
     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 @@ public:
     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&);
index ac412a7..ce7de8e 100644 (file)
@@ -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>
index d377f9a..e14a374 100644 (file)
@@ -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(),
index ba3a14c..83ef4d7 100644 (file)
@@ -70,7 +70,7 @@ public:
     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 @@ public:
     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 @@ public:
     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&);
index e83b382..167127f 100644 (file)
@@ -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>
index 5896616..add5a4e 100644 (file)
@@ -1777,7 +1777,7 @@ EncodedJSValue JSC_HOST_CALL functionDollarAgentReceiveBroadcast(ExecState* exec
         message = Worker::current().dequeue();
     }
     
-    RefPtr<ArrayBuffer> nativeBuffer = ArrayBuffer::create(message->releaseContents());
+    auto nativeBuffer = ArrayBuffer::create(message->releaseContents());
     ArrayBufferSharingMode sharingMode = nativeBuffer->sharingMode();
     JSArrayBuffer* jsBuffer = JSArrayBuffer::create(vm, exec->lexicalGlobalObject()->arrayBufferStructure(sharingMode), WTFMove(nativeBuffer));
     
index 4e5ef15..6c56d59 100644 (file)
@@ -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);
+    auto result = ArrayBuffer::create(static_cast<const char*>(data()) + begin, size);
     result->setSharingMode(sharingMode());
     return result;
 }
index f699c94..30fba6a 100644 (file)
@@ -128,8 +128,8 @@ public:
 
     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 @@ private:
     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);
 
index d1a6c2b..64fff4a 100644 (file)
@@ -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
index 9a6f71a..e5d6d09 100644 (file)
@@ -44,14 +44,14 @@ public:
     
     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
index 6c0b971..1d32cf3 100644 (file)
@@ -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));
+    auto newBuffer = thisObject->impl()->slice(begin, end);
     
     Structure* structure = callee->globalObject(vm)->arrayBufferStructure(newBuffer->sharingMode());
     
index 58702b9..b04fa0e 100644 (file)
@@ -1,3 +1,396 @@
+2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
+
+        Use Ref<> as much as possible
+        https://bugs.webkit.org/show_bug.cgi?id=192808
+
+        Reviewed by Alex Christensen.
+
+        * Modules/encryptedmedia/NavigatorEME.cpp:
+        (WebCore::NavigatorEME::requestMediaKeySystemAccess):
+        * Modules/fetch/FetchBody.cpp:
+        (WebCore::FetchBody::bodyAsFormData const):
+        * 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-21  Chris Dumez  <cdumez@apple.com>
 
         navigator.userAgent in service workers does not reflect customUserAgent set by client
index b751eea..df1f4df 100644 (file)
@@ -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));
     });
 }
index 4898ccc..da6d4d3 100644 (file)
@@ -241,9 +241,9 @@ RefPtr<FormData> FetchBody::bodyAsFormData(ScriptExecutionContext& context) cons
     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;
+        return WTFMove(body);
     }
     if (isArrayBuffer())
         return FormData::create(arrayBufferBody().data(), arrayBufferBody().byteLength());
@@ -251,9 +251,9 @@ 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());
+        auto body = makeRef(const_cast<FormData&>(formDataBody()));
         body->generateFiles(&downcast<Document>(context));
-        return body;
+        return WTFMove(body);
     }
     if (auto* data = m_consumer.data())
         return FormData::create(data->data(), data->size());
index 2b333e5..5536894 100644 (file)
@@ -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;
 }
 
index 258d89a..1847439 100644 (file)
@@ -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();
index a383166..fc3e12b 100644 (file)
@@ -54,7 +54,7 @@ public:
     // IDBDatabase IDL
     const String name() const;
     uint64_t version() const;
-    RefPtr<DOMStringList> objectStoreNames() const;
+    Ref<DOMStringList> objectStoreNames() const;
 
     struct ObjectStoreParameters {
         Optional<IDBKeyPath> keyPath;
index 4bbde2b..66cec0c 100644 (file)
@@ -122,11 +122,11 @@ const 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())
index 6fdd3f3..cfc7df7 100644 (file)
@@ -64,7 +64,7 @@ public:
     const String& name() const;
     ExceptionOr<void> setName(const String&);
     const Optional<IDBKeyPath>& keyPath() const;
-    RefPtr<DOMStringList> indexNames() const;
+    Ref<DOMStringList> indexNames() const;
     IDBTransaction& transaction();
     bool autoIncrement() const;
 
index bdffe68..b82b66a 100644 (file)
@@ -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();
index 5b84986..1f76753 100644 (file)
@@ -162,7 +162,7 @@ private:
     void finishAbortOrCommit();
     void abortInProgressOperations(const IDBError&);
 
-    void scheduleOperation(RefPtr<IDBClient::TransactionOperation>&&);
+    void scheduleOperation(Ref<IDBClient::TransactionOperation>&&);
     void pendingOperationTimerFired();
     void completedOperationTimerFired();
 
index e855125..8ddb56e 100644 (file)
@@ -181,40 +181,37 @@ public:
     }
 };
 
-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
index 14bb977..3aa43a9 100644 (file)
@@ -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 { };
 }
index e10b96b..a1cb74b 100644 (file)
@@ -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;
 }
index de51fd9..6de7e5c 100644 (file)
@@ -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();
index 0ff0e20..75068e1 100644 (file)
@@ -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) {
index 88ae04a..b9cc20c 100644 (file)
@@ -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);
index 091a30a..7e13d06 100644 (file)
@@ -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;
 }
 
index 3d154ac..0dc411a 100644 (file)
@@ -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
index eeec4df..77f9f49 100644 (file)
 
 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)
index 4b8eff5..8d04e54 100644 (file)
@@ -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();
 
index 34941d0..909a5c7 100644 (file)
@@ -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)
index e276425..51aebf2 100644 (file)
@@ -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(); }
 
index dbb803b..b6ecaaa 100644 (file)
@@ -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
index 72df312..98ee40c 100644 (file)
@@ -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(); }
 
index 73a1aa6..f656acf 100644 (file)
@@ -49,8 +49,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)
@@ -63,8 +64,9 @@ 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;
 }
 
 Ref<WebGPUBindGroupLayout> WebGPUDevice::createBindGroupLayout(WebGPUBindGroupLayoutDescriptor&& descriptor) const
@@ -86,8 +88,9 @@ Ref<WebGPUPipelineLayout> WebGPUDevice::createPipelineLayout(WebGPUPipelineLayou
 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 Optional<GPUPipelineStageDescriptor> validateAndConvertPipelineStage(const WebGPUPipelineStageDescriptor& descriptor)
@@ -108,14 +111,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()
index 1a1c52c..daf1b08 100644 (file)
@@ -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)
index 31296e3..87a7eaf 100644 (file)
@@ -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>&&);
index 3ccf3c0..106c576 100644 (file)
@@ -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)
index 2c8b866..3917fad 100644 (file)
@@ -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(); }
 
index e823b04..994c2ec 100644 (file)
@@ -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)
index 4202994..64660b3 100644 (file)
@@ -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(); }
 
index c6780ef..9d9d7f9 100644 (file)
@@ -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
index 0459a53..7265945 100644 (file)
@@ -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)
index 40fd814..fbeb8bc 100644 (file)
@@ -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:
index e296946..8090411 100644 (file)
@@ -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)
index 6ff644c..f7cd3aa 100644 (file)
@@ -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());
index a6e963d..bc16e4b 100644 (file)
@@ -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)
index 18c9e9b..da402da 100644 (file)
@@ -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) {
index 8c7b1cf..7fb62f8 100644 (file)
@@ -2401,12 +2401,12 @@ static void AXAttributedStringAppendText(NSMutableAttributedString* attrString,
     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);
 }
 
index 9fc306c..3545d5d 100644 (file)
@@ -78,8 +78,8 @@ private:
 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();
     };
 }
index 60b8c52..c74334e 100644 (file)
@@ -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();
     });
 
index 380ad5b..d831604 100644 (file)
@@ -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();
     });
 
index ca4f871..df9476a 100644 (file)
@@ -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
     }
 
index 72ff7ca..a52dec9 100644 (file)
@@ -2823,7 +2823,7 @@ private:
             }
             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 @@ private:
             }
             
             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());
index 5f285e9..1b7896b 100644 (file)
@@ -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.
index 0aec0ce..051daca 100644 (file)
@@ -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() 
index 1d09c8a..9ebc3ab 100644 (file)
@@ -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;
 }
 
index 9383879..ecbf04f 100644 (file)
@@ -87,14 +87,14 @@ private:
     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;
index 33a8589..09527f1 100644 (file)
@@ -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
index 67c30e4..aebe97d 100644 (file)
@@ -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)
index a24a536..e349171 100644 (file)
@@ -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();
index fdb8e3a..bdefec4 100644 (file)
@@ -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)
index 331e836..b3e4b9a 100644 (file)
@@ -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);
index d5ee934..bfcc624 100644 (file)
@@ -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;
         }
 
index 0dc1098..1eefeb8 100644 (file)
@@ -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()
index 6807141..7180523 100644 (file)
@@ -84,8 +84,8 @@ public:
     }
 
     // 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 @@ protected:
 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.
index 0fee84c..814d46b 100644 (file)
@@ -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)
index 9b94371..2966767 100644 (file)
@@ -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&);
index d55c56f..5b08630 100644 (file)
@@ -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);
 
index 0d8b6bc..150a78d 100644 (file)
@@ -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());
 
index cf09143..df2ae8b 100644 (file)
@@ -49,7 +49,7 @@ public:
         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)));
     }
index 0112720..5a1cb9e 100644 (file)
@@ -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();
index 582be0d..516d76e 100644 (file)
@@ -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());
+    auto 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);
     }
index c3d814a..7a3a160 100644 (file)
@@ -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
index c0e5c9c..d7f6775 100644 (file)
@@ -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
index 1bc9b40..a6d1760 100644 (file)
@@ -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
index cca4ede..86d021d 100644 (file)
@@ -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 };
 }
index 64216c9..b38c150 100644 (file)
@@ -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();
index ef1fd24..a5e8584 100644 (file)
@@ -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);
         }
     }
 
index 56ca5bf..9fdac1d 100644 (file)
@@ -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;
 }
 
index 6f53208..e436c7f 100644 (file)
@@ -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()))
index c19b774..4ec0b4e 100644 (file)
@@ -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()));
 }
 
 }
index 502bc04..041f9d1 100644 (file)
@@ -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
index 4804e90..f8239d2 100644 (file)
@@ -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,
index c109db0..7db3f9b 100644 (file)
@@ -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
index 00a257f..e89e870 100644 (file)
@@ -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;
index 79b43ce..67063ee 100644 (file)
@@ -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)
index f4f9d50..17b440e 100644 (file)
@@ -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);
 }
index 5ccf446..5de716f 100644 (file)
@@ -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());
index 75f54a1..2c4b60d 100644 (file)
@@ -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) {
index f37fde7..230f5e3 100644 (file)
@@ -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);
 }
index 4622f86..3fe6f4e 100644 (file)
@@ -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());
index 31e18a5..0e1cc22 100644 (file)
@@ -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 {
index 0434129..897155a 100644 (file)
@@ -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();
index d7e2b75..d78110c 100644 (file)
@@ -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;
index 3442eda..fecfbbc 100644 (file)
@@ -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;
 
index ff96f4f..224807a 100644 (file)
@@ -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()
index 91035f2..a7b7f81 100644 (file)
@@ -86,7 +86,7 @@ private:
 
     CellBorders cellBorders() const;
 
-    RefPtr<StyleProperties> createSharedCellStyle();
+    Ref<StyleProperties> createSharedCellStyle();
 
     HTMLTableSectionElement* lastBody() const;
 
index 656abfb..3a8d541 100644 (file)
@@ -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();
 }
 
index ab89ff9..cf1b53b 100644 (file)
@@ -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) {
index 854ea77..0b14679 100644 (file)
@@ -122,7 +122,7 @@ Optional<ElementStyle> TextControlInnerElement::resolveCustomStyle(const RenderS
         // 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 });
     }
index 11227a7..35c2932 100644 (file)
@@ -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();
 }
index 643fdd7..c8dba02 100644 (file)
@@ -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();
     }
index 52b0bcb..7eb2155 100644 (file)
@@ -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 (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;
 }
index 8e1c482..a0c3887 100644 (file)
@@ -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;
 
index d19f2ac..6871654 100644 (file)
@@ -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();
 }
index fdd5c7e..e38d1a3 100644 (file)
@@ -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));
     }
 }
 
index 58173ac..96bc87e 100644 (file)
@@ -176,14 +176,14 @@ static RefPtr<KeyPath> keyPathFromIDBKeyPath(const Optional<IDBKeyPath>& idbKeyP
         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;
     });
index 2b60c45..5c1ca92 100644 (file)
@@ -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;
index 17aad4d..a28ec68 100644 (file)
@@ -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);
 }
index 2db0ecc..51bb948 100644 (file)
@@ -1350,7 +1350,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)
@@ -3546,7 +3546,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()) {
@@ -3698,7 +3698,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);
 
index e1d60eb..4bad183 100644 (file)
@@ -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);
index 5fd39be..c3b5e3e 100644 (file)
@@ -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.
index ee97b2b..f863135 100644 (file)
@@ -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);
         }
index 5fac87a..19f8f52 100644 (file)
@@ -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;
@@ -1494,7 +1494,7 @@ RefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* element, const String
     if (ruleList->rules().isEmpty())
         return nullptr;
 
-    return ruleList;
+    return WTFMove(ruleList);
 }
 
 RefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const WebKitPoint* p) const
@@ -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 };
 
index 7942a0d..ed3fe93 100644 (file)
@@ -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)
index 63d6e94..296beff 100644 (file)
@@ -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;
 
index 9005516..c571af0 100644 (file)
@@ -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;
index 583cfd3..05c85c6 100644 (file)
@@ -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);
index f3409fa..c96bed1 100644 (file)
@@ -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];
 }
 
index 9f19cfe..46fc811 100644 (file)
@@ -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;
index f65cde3..9e71ae9 100644 (file)
@@ -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
index e79d6c1..8977f39 100644 (file)
@@ -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);
index b912077..cde30a8 100644 (file)
@@ -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));
index 2af518b..dc14411 100644 (file)
@@ -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
index 1fdfecd..1628112 100644 (file)
@@ -51,7 +51,7 @@ public:
     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)
index 38b5191..13f1878 100644 (file)
@@ -39,7 +39,7 @@ public:
         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; }
index b8cb850..af0a7cc 100644 (file)
@@ -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,8 +1908,8 @@ bool AVFWrapper::shouldWaitForLoadingOfResource(AVCFAssetResourceLoadingRequestR
     }
 #endif
 
-    RefPtr<WebCoreAVCFResourceLoader> resourceLoader = WebCoreAVCFResourceLoader::create(m_owner, avRequest);
-    m_owner->m_resourceLoaderMap.add(avRequest, resourceLoader);
+    auto resourceLoader = WebCoreAVCFResourceLoader::create(m_owner, avRequest);
+    m_owner->m_resourceLoaderMap.add(avRequest, resourceLoader.copyRef());
     resourceLoader->startLoading();
     return true;
 }
index 2128721..1a4b181 100644 (file)
@@ -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;
index cf7dc0c..c1f38e3 100644 (file)
@@ -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;
 }
index 0c04af9..1681275 100644 (file)
@@ -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; }
index e084c90..2b37ec7 100644 (file)
@@ -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;
index 53dff22..7980d54 100644 (file)
@@ -79,7 +79,7 @@ public:
 
 class SourceBufferPrivateAVFObjC final : public SourceBufferPrivate {
 public:
-    static RefPtr<SourceBufferPrivateAVFObjC> create(MediaSourcePrivateAVFObjC*);
+    static Ref<SourceBufferPrivateAVFObjC> create(MediaSourcePrivateAVFObjC*);
     virtual ~SourceBufferPrivateAVFObjC();
 
     void clearMediaSource() { m_mediaSource = nullptr; }
index 65cfb24..0ecf755 100644 (file)
@@ -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);
         }
index f456f0a..5dd7e62 100644 (file)
@@ -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;
index 8d1f1b4..432f0b8 100644 (file)
@@ -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());
index 562d8bb..5797e86 100644 (file)
@@ -134,7 +134,7 @@ public:
 
     void updateTileCoverageMap();
 
-    RefPtr<PlatformCALayer> createTileLayer(const IntRect&, TileGrid&);
+    Ref<PlatformCALayer> createTileLayer(const IntRect&, TileGrid&);
 
     const TileGrid& tileGrid() const { return *m_tileGrid; }
 
index 2a9d91a..1aba46f 100644 (file)
@@ -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;
index 406e085..fcc276d 100644 (file)
@@ -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()
index e027247..0f05eb9 100644 (file)
@@ -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());
 
index 897f292..3563513 100644 (file)
@@ -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;
 
index d67ef25..57a1b5c 100644 (file)
@@ -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()
index 7cbf54e..6e4b64f 100644 (file)
@@ -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);
index 57a5694..2c94f4d 100644 (file)
@@ -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);
index 667f230..01a2742 100644 (file)
@@ -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));
         }
     }
 
index c66e463..8cc58d6 100644 (file)
@@ -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);
 }
 
index f944f07..b1452fe 100644 (file)
@@ -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));
         }
     }
 
index 719032f..1870bb1 100644 (file)
@@ -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)
index e54ba37..100912b 100644 (file)
@@ -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);
     }
index 1be1ae5..9fbac00 100644 (file)
@@ -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 @@ protected:
     MockTrackBox m_box;
 };
&n