Remove RefPtr::release() and change calls sites to use WTFMove()
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Jun 2016 20:52:45 +0000 (20:52 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Jun 2016 20:52:45 +0000 (20:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158369

Reviewed by Chris Dumez.

RefPtr::release() releases its managed pointer awkwardly. It's more
direct and clearer to use WTFMove to transfer ownership of the managed
pointer.

As part of this cleanup, also change a lot of explicit data types to
'auto'.

Source/JavaScriptCore:

* API/JSObjectRef.cpp:
(JSClassCreate):
* API/JSScriptRef.cpp:
* API/JSValueRef.cpp:
(JSValueToStringCopy):
* bytecompiler/StaticPropertyAnalyzer.h:
(JSC::StaticPropertyAnalyzer::newObject):
(JSC::StaticPropertyAnalyzer::mov):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::invalidate):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* inspector/InspectorValues.cpp:
(Inspector::InspectorValue::parseJSON):
* inspector/agents/InspectorAgent.cpp:
(Inspector::InspectorAgent::activateExtraDomain):
(Inspector::InspectorAgent::activateExtraDomains):
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::breakpointActionProbe):
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::receivedSetupMessage):
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* runtime/GenericTypedArrayViewInlines.h:
(JSC::GenericTypedArrayView<Adaptor>::create):
(JSC::GenericTypedArrayView<Adaptor>::createUninitialized):
* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
* runtime/PropertyNameArray.h:
(JSC::PropertyNameArray::releaseData):
* runtime/Structure.cpp:
(JSC::Structure::toStructureShape):
* runtime/TypeSet.cpp:
(JSC::StructureShape::merge):
* tools/FunctionOverrides.cpp:
(JSC::initializeOverrideInfo):

Source/WebCore:

No new tests: there's no new functionality, just a refactoring of
existing code.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
(WebCore::SourceBuffer::provideMediaData):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start):
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::clear):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::createScriptInstanceForWidget):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::copyPropertiesInSet):
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertShapeValue):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::copyPropertiesInSet):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::loadPendingImages):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::clearSheet):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::removeChildrenInRange):
(WebCore::CompositeEditCommand::removeNodeAndPruneAncestors):
(WebCore::CompositeEditCommand::prune):
(WebCore::CompositeEditCommand::replaceSelectedTextInNode):
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
* editing/CreateLinkCommand.cpp:
(WebCore::CreateLinkCommand::doApply):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::mergeStyle):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
* editing/Editor.cpp:
(WebCore::ClearTextCommand::CreateAndApply):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
* editing/EditorCommand.cpp:
(WebCore::executeInsertNode):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::performOverwrite):
(WebCore::InsertTextCommand::insertTab):
* editing/RemoveNodePreservingChildrenCommand.cpp:
(WebCore::RemoveNodePreservingChildrenCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::removeNodePreservingChildren):
(WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
* html/HTMLFontElement.cpp:
(WebCore::HTMLFontElement::collectStyleForPresentationAttribute):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareForSubmission):
* html/HTMLTableElement.cpp:
(WebCore::leakBorderStyle):
(WebCore::leakGroupBorderStyle):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::addDataCue):
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::newCuesParsed):
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed):
* html/track/TextTrackCueList.cpp:
(WebCore::TextTrackCueList::add):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getInlineStylesForNode):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::loadResource):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadPostRequest):
* loader/ProgressTracker.cpp:
(WebCore::ProgressTracker::finalProgressComplete):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::disassociateDocumentLoader):
(WebCore::ApplicationCacheGroup::didFinishLoading):
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCacheGroup):
(WebCore::ApplicationCacheStorage::cacheGroupForURL):
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::loadCache):
* loader/archive/ArchiveResourceCollection.cpp:
(WebCore::ArchiveResourceCollection::popSubframeArchive):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::extract):
(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::createImage):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::setIconDataForIconURL):
(WebCore::IconDatabase::getOrCreateIconRecord):
(WebCore::IconDatabase::readFromDatabase):
(WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
* page/EventHandler.cpp:
(WebCore::EventHandler::updateDragAndDrop):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::createOverlayIfNeeded):
(WebCore::ServicesOverlayController::determineActiveHighlight):
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::releaseScrollingTree):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::cloneAndReset):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
* platform/audio/HRTFElevation.cpp:
(WebCore::getConcatenatedImpulseResponsesForSubject):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForSystemFallback):
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::asUnmultipliedImage):
(WebCore::FilterEffect::asPremultipliedImage):
* platform/graphics/mac/ImageMac.mm:
(WebCore::Image::loadPlatformResource):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::createForCurrentGLContext):
(WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURLForSlice):
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::create):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::formCreate):
* platform/text/BidiContext.cpp:
(WebCore::BidiContext::copyStackRemovingUnicodeEmbeddingContexts):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderMenuList.cpp:
(RenderMenuList::createScrollbar):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::createScrollbar):
* replay/ReplayController.cpp:
(WebCore::ReplayController::unloadSegment):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::internalAbort):
* xml/XPathStep.cpp:
(WebCore::XPath::Step::nodesInAxis):

Source/WebKit:

* Storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::setItem):
(WebCore::StorageAreaImpl::removeItem):

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::instantiatePlugin):
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::create):
(WebKit::NetscapePluginInstanceProxy::loadRequest):
(WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
* WebCoreSupport/WebFrameLoaderClient.mm:
(-[WebFramePolicyListener receivedPolicyDecision:]):
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin initWithURL:]):
* WebView/WebArchive.mm:
(-[WebArchive initWithMainResource:subresources:subframeArchives:]):
(-[WebArchive initWithData:]):
* WebView/WebDataSource.mm:
(-[WebDataSource mainResource]):
* WebView/WebFrame.mm:
(-[WebFrame _documentFragmentWithNodesAsParagraphs:]):

Source/WebKit2:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::createDatabaseToWebProcessConnection):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::allocate):
(WebKit::SharedMemory::create):
(WebKit::SharedMemory::map):
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::createWebProcessConnection):
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeToObjectStream):
* Shared/API/c/WKImage.cpp:
(WKImageCreate):
* Shared/API/c/WKNumber.cpp:
(WKBooleanCreate):
(WKDoubleCreate):
(WKUInt64Create):
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCreate):
* Shared/API/c/WKSerializedScriptValue.cpp:
(WKSerializedScriptValueCreate):
(WKSerializedScriptValueCreateWithInternalRepresentation):
* Shared/API/c/cairo/WKImageCairo.cpp:
(WKImageCreateFromCairoSurface):
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateFromCGImage):
* Shared/API/c/mac/WKCertificateInfoMac.mm:
(WKCertificateInfoCreateWithCertficateChain):
* Shared/API/c/mac/WKObjCTypeWrapperRef.mm:
(WKObjCTypeWrapperCreate):
* Shared/API/c/mac/WKWebArchive.cpp:
(WKWebArchiveCreate):
(WKWebArchiveCreateWithData):
(WKWebArchiveCreateFromRange):
(WKWebArchiveCopyMainResource):
(WKWebArchiveCopySubresources):
(WKWebArchiveCopySubframeArchives):
* Shared/API/c/mac/WKWebArchiveResource.cpp:
(WKWebArchiveResourceCreate):
* Shared/APIWebArchive.mm:
(API::WebArchive::WebArchive):
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::getOrCreate):
* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::create):
* Shared/ShareableResource.cpp:
(WebKit::ShareableResource::map):
* Shared/gtk/ArgumentCodersGtk.cpp:
(IPC::ArgumentCoder<DragData>::decode):
* UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
(WKViewCreate):
* UIProcess/API/C/WKBatteryStatus.cpp:
(WKBatteryStatusCreate):
* UIProcess/API/C/WKGeolocationPosition.cpp:
(WKGeolocationPositionCreate_b):
* UIProcess/API/C/WKGrammarDetail.cpp:
(WKGrammarDetailCreate):
* UIProcess/API/C/WKPage.cpp:
(WKPageCopySessionState):
* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupCreateWithIdentifier):
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesCreate):
(WKPreferencesCreateWithIdentifier):
(WKPreferencesCreateCopy):
* UIProcess/API/C/WKSessionRef.cpp:
(WKSessionCreate):
* UIProcess/API/C/WKSessionStateRef.cpp:
(WKSessionStateCopyData):
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextCopyPlugInInfoForBundleIdentifier):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView loadRequest:]):
(-[WKWebView loadFileURL:allowingReadAccessToURL:]):
(-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
(-[WKWebView goToBackForwardListItem:]):
(-[WKWebView goBack]):
(-[WKWebView goForward]):
(-[WKWebView reload]):
(-[WKWebView reloadFromOrigin]):
(-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
(-[WKWebView _reloadWithoutContentBlockers]):
(-[WKWebView _sessionStateData]):
(-[WKWebView _restoreSessionState:andNavigate:]):
* UIProcess/API/efl/ewk_database_manager.cpp:
(EwkDatabaseManager::createOriginList):
* UIProcess/API/efl/ewk_storage_manager.cpp:
(EwkStorageManager::createOriginList):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewCreateNewPage):
(webkitWebViewPrintFrame):
(getContentsAsMHTMLDataCallback):
* UIProcess/Cocoa/SessionStateCoding.mm:
(WebKit::encodeSessionState):
* UIProcess/GenericCallback.h:
(WebKit::CallbackMap::take):
* UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
(WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
* UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
(WebKit::NotificationPermissionRequestManagerProxy::createRequest):
* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::getOrCreatePluginProcess):
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::setItem):
(WebKit::StorageManager::StorageArea::removeItem):
(WebKit::StorageManager::createLocalStorageMap):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::addItem):
(WebKit::WebBackForwardList::clear):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::installViewStateChangeCompletionHandler):
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::createWithLegacyDefaults):
(WebKit::WebPreferences::copy):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::~WebProcessPool):
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::recordSnapshot):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _webHitTestResult]):
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _askPageToComputePageRects]):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setDragImage):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(-[WKWebProcessPlugInFrame hitTest:]):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
(-[WKWebProcessPlugInHitTestResult nodeHandle]):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]):
(-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
(+[WKWebProcessPlugInScriptWorld world]):
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundlePostSynchronousMessage):
* WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
(WKBundleDOMWindowExtensionCreate):
* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
(WKBundleHitTestResultCopyNodeHandle):
(WKBundleHitTestResultCopyURLElementHandle):
* WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
(WKBundleNavigationActionCopyHitTestResult):
(WKBundleNavigationActionCopyFormElement):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleCreate):
(WKBundleNodeHandleCopyDocument):
(WKBundleNodeHandleCopySnapshotWithOptions):
(WKBundleNodeHandleCopyVisibleRange):
(WKBundleNodeHandleCopyHTMLTableCellElementCellAbove):
(WKBundleNodeHandleCopyDocumentFrame):
(WKBundleNodeHandleCopyHTMLFrameElementContentFrame):
(WKBundleNodeHandleCopyHTMLIFrameElementContentFrame):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCreateSnapshotWithOptions):
(WKBundlePageCreateSnapshotInViewCoordinates):
(WKBundlePageCreateSnapshotInDocumentCoordinates):
(WKBundlePageCreateScaledSnapshotInDocumentCoordinates):
(WKBundlePagePostSynchronousMessageForTesting):
* WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
(WKBundleRangeHandleCreate):
(WKBundleRangeHandleCopySnapshotWithOptions):
* WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
(WKBundleScriptWorldCreateWorld):
* WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
(-[WKDOMNode _copyBundleNodeHandleRef]):
* WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
(-[WKDOMRange _copyBundleRangeHandleRef]):
* WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
(WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
(WebKit::InjectedBundleNodeHandle::renderedImage):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::getOrCreate):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::create):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::loadURL):
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::createScrollbar):
* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::applyChange):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFormData):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createPlugin):
(WebKit::WebFrameLoaderClient::recreatePlugin):
(WebKit::WebFrameLoaderClient::createJavaAppletWidget):
(WebKit::WebFrameLoaderClient::createNetworkingContext):
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::highlight):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::getOrCreate):
(WebKit::VisitedLinkTableController::setVisitedLinkTable):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame):
(WebKit::WebFrame::createSubframe):
(WebKit::WebFrame::create):
(WebKit::WebFrame::createSelectionSnapshot):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
(WebKit::WebPage::snapshotAtSize):
(WebKit::WebPage::snapshotNode):
(WebKit::WebPage::willPerformLoadDragDestinationAction):
(WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad):
(WebKit::WebPage::SandboxExtensionTracker::didCommitProvisionalLoad):
(WebKit::WebPage::drawRectToImage):
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::create):
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::Properties::decode):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::create):
(WebKit::PlatformCALayerRemote::clone):
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::create):
(WebKit::PlatformCALayerRemoteCustom::clone):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor):

Tools:

* DumpRenderTree/mac/PixelDumpSupportMac.mm:
(createBitmapContextFromWebView):
(createPagedBitmapContext):
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::setMockGeolocationPosition):
* TestWebKitAPI/Tests/WTF/HashCountedSet.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):

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

205 files changed:
Source/JavaScriptCore/API/JSObjectRef.cpp
Source/JavaScriptCore/API/JSScriptRef.cpp
Source/JavaScriptCore/API/JSValueRef.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/StaticPropertyAnalyzer.h
Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
Source/JavaScriptCore/inspector/InspectorValues.cpp
Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
Source/JavaScriptCore/jit/Repatch.cpp
Source/JavaScriptCore/runtime/GenericTypedArrayViewInlines.h
Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp
Source/JavaScriptCore/runtime/PropertyNameArray.h
Source/JavaScriptCore/runtime/Structure.cpp
Source/JavaScriptCore/runtime/TypeSet.cpp
Source/JavaScriptCore/tools/FunctionOverrides.cpp
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/webdatabase/SQLCallbackWrapper.h
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSHistoryCustom.cpp
Source/WebCore/bindings/js/JSMessagePortCustom.h
Source/WebCore/bindings/js/ScriptControllerMac.mm
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/SVGCSSParser.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/StyleProperties.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/dom/InlineStyleSheetOwner.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/CreateLinkCommand.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/InsertTextCommand.cpp
Source/WebCore/editing/RemoveNodePreservingChildrenCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/HTMLFontElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/parser/HTMLDocumentParser.cpp
Source/WebCore/html/track/InbandDataTextTrack.cpp
Source/WebCore/html/track/InbandGenericTextTrack.cpp
Source/WebCore/html/track/InbandWebVTTTextTrack.cpp
Source/WebCore/html/track/TextTrackCueList.cpp
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebCore/inspector/InspectorNetworkAgent.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/loader/FormSubmission.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/ProgressTracker.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
Source/WebCore/loader/archive/ArchiveResourceCollection.cpp
Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/icon/IconDatabase.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/animation/CompositeAnimation.cpp
Source/WebCore/page/csp/ContentSecurityPolicy.cpp
Source/WebCore/page/mac/ServicesOverlayController.mm
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingStateNode.cpp
Source/WebCore/page/scrolling/ScrollingStateTree.cpp
Source/WebCore/platform/audio/HRTFElevation.cpp
Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp
Source/WebCore/platform/graphics/FontCascadeFonts.cpp
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp
Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp
Source/WebCore/platform/graphics/filters/FilterEffect.cpp
Source/WebCore/platform/graphics/mac/ImageMac.mm
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp
Source/WebCore/platform/network/BlobRegistryImpl.cpp
Source/WebCore/platform/network/ResourceHandle.cpp
Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
Source/WebCore/platform/text/BidiContext.cpp
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderSearchField.cpp
Source/WebCore/replay/ReplayController.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/properties/SVGListProperty.h
Source/WebCore/workers/WorkerThread.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XPathStep.cpp
Source/WebKit/ChangeLog
Source/WebKit/Storage/StorageAreaImpl.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm
Source/WebKit/mac/WebView/WebArchive.mm
Source/WebKit/mac/WebView/WebDataSource.mm
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/NetworkProcess/NetworkProcess.cpp
Source/WebKit2/NetworkProcess/NetworkResourceLoadParameters.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.cpp
Source/WebKit2/Platform/mac/SharedMemoryMac.cpp
Source/WebKit2/PluginProcess/PluginProcess.cpp
Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm
Source/WebKit2/Shared/API/c/WKImage.cpp
Source/WebKit2/Shared/API/c/WKNumber.cpp
Source/WebKit2/Shared/API/c/WKSecurityOriginRef.cpp
Source/WebKit2/Shared/API/c/WKSerializedScriptValue.cpp
Source/WebKit2/Shared/API/c/cairo/WKImageCairo.cpp
Source/WebKit2/Shared/API/c/cg/WKImageCG.cpp
Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm
Source/WebKit2/Shared/API/c/mac/WKObjCTypeWrapperRef.mm
Source/WebKit2/Shared/API/c/mac/WKWebArchive.cpp
Source/WebKit2/Shared/API/c/mac/WKWebArchiveResource.cpp
Source/WebKit2/Shared/APIWebArchive.mm
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp
Source/WebKit2/Shared/ShareableBitmap.cpp
Source/WebKit2/Shared/ShareableResource.cpp
Source/WebKit2/Shared/gtk/ArgumentCodersGtk.cpp
Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp
Source/WebKit2/UIProcess/API/C/WKBatteryStatus.cpp
Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp
Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKSessionRef.cpp
Source/WebKit2/UIProcess/API/C/WKSessionStateRef.cpp
Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/efl/ewk_database_manager.cpp
Source/WebKit2/UIProcess/API/efl/ewk_storage_manager.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Source/WebKit2/UIProcess/Cocoa/SessionStateCoding.mm
Source/WebKit2/UIProcess/GenericCallback.h
Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp
Source/WebKit2/UIProcess/Storage/StorageManager.cpp
Source/WebKit2/UIProcess/WebBackForwardList.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPreferences.cpp
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm
Source/WebKit2/UIProcess/mac/WKPrintingView.mm
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm
Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp
Source/WebKit2/WebProcess/WebCoreSupport/SessionStateConversion.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
Source/WebKit2/WebProcess/WebPage/FindController.cpp
Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm
Tools/DumpRenderTree/mac/TestRunnerMac.mm
Tools/TestWebKitAPI/Tests/WTF/HashCountedSet.cpp
Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp

index 37cd657..c1ddc32 100644 (file)
@@ -66,11 +66,11 @@ using namespace JSC;
 JSClassRef JSClassCreate(const JSClassDefinition* definition)
 {
     initializeThreading();
-    RefPtr<OpaqueJSClass> jsClass = (definition->attributes & kJSClassAttributeNoAutomaticPrototype)
+    auto jsClass = (definition->attributes & kJSClassAttributeNoAutomaticPrototype)
         ? OpaqueJSClass::createNoAutomaticPrototype(definition)
         : OpaqueJSClass::create(definition);
     
-    return jsClass.release().leakRef();
+    return &jsClass.leakRef();
 }
 
 JSClassRef JSClassRetain(JSClassRef jsClass)
index 60bde60..83d1fe6 100644 (file)
@@ -93,7 +93,7 @@ JSScriptRef JSScriptCreateReferencingImmortalASCIIText(JSContextGroupRef context
 
     startingLineNumber = std::max(1, startingLineNumber);
 
-    RefPtr<OpaqueJSScript> result = OpaqueJSScript::create(vm, url ? url->string() : String(), startingLineNumber, String(StringImpl::createFromLiteral(source, length)));
+    auto result = OpaqueJSScript::create(vm, url ? url->string() : String(), startingLineNumber, String(StringImpl::createFromLiteral(source, length)));
 
     ParserError error;
     if (!parseScript(vm, SourceCode(result), error)) {
@@ -104,7 +104,7 @@ JSScriptRef JSScriptCreateReferencingImmortalASCIIText(JSContextGroupRef context
         return nullptr;
     }
 
-    return result.release().leakRef();
+    return result.leakRef();
 }
 
 JSScriptRef JSScriptCreateFromString(JSContextGroupRef contextGroup, JSStringRef url, int startingLineNumber, JSStringRef source, JSStringRef* errorMessage, int* errorLine)
@@ -114,7 +114,7 @@ JSScriptRef JSScriptCreateFromString(JSContextGroupRef contextGroup, JSStringRef
 
     startingLineNumber = std::max(1, startingLineNumber);
 
-    RefPtr<OpaqueJSScript> result = OpaqueJSScript::create(vm, url ? url->string() : String(), startingLineNumber, source->string());
+    auto result = OpaqueJSScript::create(vm, url ? url->string() : String(), startingLineNumber, source->string());
 
     ParserError error;
     if (!parseScript(vm, SourceCode(result), error)) {
@@ -125,7 +125,7 @@ JSScriptRef JSScriptCreateFromString(JSContextGroupRef contextGroup, JSStringRef
         return nullptr;
     }
 
-    return result.release().leakRef();
+    return result.leakRef();
 }
 
 void JSScriptRetain(JSScriptRef script)
index 0d3bef0..4284350 100644 (file)
@@ -401,10 +401,10 @@ JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef*
 
     JSValue jsValue = toJS(exec, value);
     
-    RefPtr<OpaqueJSString> stringRef(OpaqueJSString::create(jsValue.toString(exec)->value(exec)));
+    auto stringRef(OpaqueJSString::create(jsValue.toString(exec)->value(exec)));
     if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
         stringRef = nullptr;
-    return stringRef.release().leakRef();
+    return stringRef.leakRef();
 }
 
 JSObjectRef JSValueToObject(JSContextRef ctx, JSValueRef value, JSValueRef* exception)
index 2567847..f9316c8 100644 (file)
@@ -1,3 +1,55 @@
+2016-06-20  Keith Rollin  <krollin@apple.com>
+
+        Remove RefPtr::release() and change calls sites to use WTFMove()
+        https://bugs.webkit.org/show_bug.cgi?id=158369
+
+        Reviewed by Chris Dumez.
+
+        RefPtr::release() releases its managed pointer awkwardly. It's more
+        direct and clearer to use WTFMove to transfer ownership of the managed
+        pointer.
+
+        As part of this cleanup, also change a lot of explicit data types to
+        'auto'.
+
+        * API/JSObjectRef.cpp:
+        (JSClassCreate):
+        * API/JSScriptRef.cpp:
+        * API/JSValueRef.cpp:
+        (JSValueToStringCopy):
+        * bytecompiler/StaticPropertyAnalyzer.h:
+        (JSC::StaticPropertyAnalyzer::newObject):
+        (JSC::StaticPropertyAnalyzer::mov):
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::invalidate):
+        * dfg/DFGJITCompiler.cpp:
+        (JSC::DFG::JITCompiler::compile):
+        (JSC::DFG::JITCompiler::compileFunction):
+        * inspector/InspectorValues.cpp:
+        (Inspector::InspectorValue::parseJSON):
+        * inspector/agents/InspectorAgent.cpp:
+        (Inspector::InspectorAgent::activateExtraDomain):
+        (Inspector::InspectorAgent::activateExtraDomains):
+        * inspector/agents/InspectorDebuggerAgent.cpp:
+        (Inspector::InspectorDebuggerAgent::breakpointActionProbe):
+        * inspector/remote/RemoteInspector.mm:
+        (Inspector::RemoteInspector::receivedSetupMessage):
+        * jit/Repatch.cpp:
+        (JSC::linkPolymorphicCall):
+        * runtime/GenericTypedArrayViewInlines.h:
+        (JSC::GenericTypedArrayView<Adaptor>::create):
+        (JSC::GenericTypedArrayView<Adaptor>::createUninitialized):
+        * runtime/JSArrayBufferConstructor.cpp:
+        (JSC::constructArrayBuffer):
+        * runtime/PropertyNameArray.h:
+        (JSC::PropertyNameArray::releaseData):
+        * runtime/Structure.cpp:
+        (JSC::Structure::toStructureShape):
+        * runtime/TypeSet.cpp:
+        (JSC::StructureShape::merge):
+        * tools/FunctionOverrides.cpp:
+        (JSC::initializeOverrideInfo):
+
 2016-06-20  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: console.profile should use the new Sampling Profiler
index e63fef8..1ec129e 100644 (file)
@@ -72,7 +72,7 @@ inline void StaticPropertyAnalyzer::newObject(int dst, unsigned offsetOfInlineCa
     AnalysisMap::AddResult addResult = m_analyses.add(dst, analysis);
     if (!addResult.isNewEntry) {
         kill(addResult.iterator->value.get());
-        addResult.iterator->value = analysis.release();
+        addResult.iterator->value = WTFMove(analysis);
     }
 }
 
@@ -95,7 +95,7 @@ inline void StaticPropertyAnalyzer::mov(int dst, int src)
     AnalysisMap::AddResult addResult = m_analyses.add(dst, analysis);
     if (!addResult.isNewEntry) {
         kill(addResult.iterator->value.get());
-        addResult.iterator->value = analysis.release();
+        addResult.iterator->value = WTFMove(analysis);
     }
 }
 
index a8c557c..fb86368 100644 (file)
@@ -278,7 +278,7 @@ void DebuggerCallFrame::invalidate()
             frame->m_scope->invalidateChain();
             frame->m_scope.clear();
         }
-        frame = frame->m_caller.release();
+        frame = WTFMove(frame->m_caller);
     }
 }
 
index 4c89650..c37d5ef 100644 (file)
@@ -390,7 +390,7 @@ void JITCompiler::compile()
     disassemble(*linkBuffer);
     
     m_graph.m_plan.finalizer = std::make_unique<JITFinalizer>(
-        m_graph.m_plan, m_jitCode.release(), WTFMove(linkBuffer));
+        m_graph.m_plan, WTFMove(m_jitCode), WTFMove(linkBuffer));
 }
 
 void JITCompiler::compileFunction()
@@ -487,7 +487,7 @@ void JITCompiler::compileFunction()
     MacroAssemblerCodePtr withArityCheck = linkBuffer->locationOf(m_arityCheck);
 
     m_graph.m_plan.finalizer = std::make_unique<JITFinalizer>(
-        m_graph.m_plan, m_jitCode.release(), WTFMove(linkBuffer), withArityCheck);
+        m_graph.m_plan, WTFMove(m_jitCode), WTFMove(linkBuffer), withArityCheck);
 }
 
 void JITCompiler::disassemble(LinkBuffer& linkBuffer)
index c5c1163..56948fa 100644 (file)
@@ -459,7 +459,7 @@ RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UC
         return nullptr;
     }
     *valueTokenEnd = tokenEnd;
-    return result.release();
+    return result;
 }
 
 inline bool escapeChar(UChar c, StringBuilder& dst)
@@ -551,11 +551,11 @@ bool InspectorValue::parseJSON(const String& jsonInput, RefPtr<InspectorValue>&
     const UChar* start = characters;
     const UChar* end = start + jsonInput.length();
     const UChar* tokenEnd;
-    RefPtr<InspectorValue> result = buildValue(start, end, &tokenEnd, 0);
+    auto result = buildValue(start, end, &tokenEnd, 0);
     if (!result || tokenEnd != end)
         return false;
 
-    output = result.release();
+    output = WTFMove(result);
     return true;
 }
 
index 312e5d9..f64baf3 100644 (file)
@@ -121,7 +121,7 @@ void InspectorAgent::activateExtraDomain(const String& domainName)
         return;
     }
 
-    Ref<Inspector::Protocol::Array<String>> domainNames = Inspector::Protocol::Array<String>::create();
+    auto domainNames = Inspector::Protocol::Array<String>::create();
     domainNames->addItem(domainName);
     m_frontendDispatcher->activateExtraDomains(WTFMove(domainNames));
 }
@@ -131,14 +131,14 @@ void InspectorAgent::activateExtraDomains(const Vector<String>& extraDomains)
     if (extraDomains.isEmpty())
         return;
 
-    RefPtr<Inspector::Protocol::Array<String>> domainNames = Inspector::Protocol::Array<String>::create();
+    auto domainNames = Inspector::Protocol::Array<String>::create();
     for (auto domainName : extraDomains)
         domainNames->addItem(domainName);
 
     if (!m_enabled)
-        m_pendingExtraDomainsData = domainNames.release();
+        m_pendingExtraDomainsData = WTFMove(domainNames);
     else
-        m_frontendDispatcher->activateExtraDomains(domainNames.release());
+        m_frontendDispatcher->activateExtraDomains(WTFMove(domainNames));
 }
 #endif
 
index 363b438..2c9a8d2 100644 (file)
@@ -755,7 +755,7 @@ void InspectorDebuggerAgent::breakpointActionProbe(JSC::ExecState& scriptState,
         .setBatchId(batchId)
         .setSampleId(sampleId)
         .setTimestamp(m_injectedScriptManager.inspectorEnvironment().executionStopwatch()->elapsedTime())
-        .setPayload(payload.release())
+        .setPayload(WTFMove(payload))
         .release();
     m_frontendDispatcher->didSampleProbe(WTFMove(result));
 }
index 72bfc6e..f3aee1c 100644 (file)
@@ -629,7 +629,7 @@ void RemoteInspector::receivedSetupMessage(NSDictionary *userInfo)
 
     // Attempt to create a connection. This may fail if the page already has an inspector or if it disallows inspection.
     RemoteControllableTarget* target = findResult->value;
-    RefPtr<RemoteConnectionToTarget> connectionToTarget = adoptRef(new RemoteConnectionToTarget(target, connectionIdentifier, sender));
+    auto connectionToTarget = adoptRef(*new RemoteConnectionToTarget(target, connectionIdentifier, sender));
 
     if (is<RemoteInspectionTarget>(target)) {
         bool isAutomaticInspection = m_automaticInspectionCandidateTargetIdentifier == target->targetIdentifier();
@@ -639,14 +639,14 @@ void RemoteInspector::receivedSetupMessage(NSDictionary *userInfo)
             connectionToTarget->close();
             return;
         }
-        m_targetConnectionMap.set(targetIdentifier, connectionToTarget.release());
+        m_targetConnectionMap.set(targetIdentifier, WTFMove(connectionToTarget));
         updateHasActiveDebugSession();
     } else if (is<RemoteAutomationTarget>(target)) {
         if (!connectionToTarget->setup()) {
             connectionToTarget->close();
             return;
         }
-        m_targetConnectionMap.set(targetIdentifier, connectionToTarget.release());
+        m_targetConnectionMap.set(targetIdentifier, WTFMove(connectionToTarget));
         updateHasActiveDebugSession();
     } else
         ASSERT_NOT_REACHED();
index 131663d..a029c8a 100644 (file)
@@ -865,7 +865,7 @@ void linkPolymorphicCall(
         patchBuffer.link(done, callLinkInfo.hotPathOther().labelAtOffset(0));
     patchBuffer.link(slow, CodeLocationLabel(vm->getCTIStub(linkPolymorphicCallThunkGenerator).code()));
     
-    RefPtr<PolymorphicCallStubRoutine> stubRoutine = adoptRef(new PolymorphicCallStubRoutine(
+    auto stubRoutine = adoptRef(*new PolymorphicCallStubRoutine(
         FINALIZE_CODE_FOR(
             callerCodeBlock, patchBuffer,
             ("Polymorphic call stub for %s, return point %p, targets %s",
@@ -884,7 +884,7 @@ void linkPolymorphicCall(
     
     // If there had been a previous stub routine, that one will die as soon as the GC runs and sees
     // that it's no longer on stack.
-    callLinkInfo.setStub(stubRoutine.release());
+    callLinkInfo.setStub(WTFMove(stubRoutine));
     
     // The call link info no longer has a call cache apart from the jump to the polymorphic call
     // stub.
index a8737ee..1429d05 100644 (file)
@@ -45,7 +45,7 @@ RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(un
     auto buffer = ArrayBuffer::tryCreate(length, sizeof(typename Adaptor::Type));
     if (!buffer)
         return nullptr;
-    return create(buffer.release(), 0, length);
+    return create(WTFMove(buffer), 0, length);
 }
 
 template<typename Adaptor>
@@ -67,7 +67,7 @@ RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
         return nullptr;
     }
     
-    return adoptRef(new GenericTypedArrayView(buffer.release(), byteOffset, length));
+    return adoptRef(new GenericTypedArrayView(WTFMove(buffer), byteOffset, length));
 }
 
 template<typename Adaptor>
@@ -78,7 +78,7 @@ GenericTypedArrayView<Adaptor>::createUninitialized(unsigned length)
         ArrayBuffer::tryCreateUninitialized(length, sizeof(typename Adaptor::Type));
     if (!buffer)
         return nullptr;
-    return create(buffer.release(), 0, length);
+    return create(WTFMove(buffer), 0, length);
 }
 
 template<typename Adaptor>
index 2be03f8..6bc8e43 100644 (file)
@@ -99,7 +99,7 @@ static EncodedJSValue JSC_HOST_CALL constructArrayBuffer(ExecState* exec)
     Structure* arrayBufferStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), constructor->globalObject()->arrayBufferStructure());
     if (exec->hadException())
         return JSValue::encode(JSValue());
-    JSArrayBuffer* result = JSArrayBuffer::create(exec->vm(), arrayBufferStructure, buffer.release());
+    JSArrayBuffer* result = JSArrayBuffer::create(exec->vm(), arrayBufferStructure, WTFMove(buffer));
     
     return JSValue::encode(result);
 }
index a804b9e..04c1ed1 100644 (file)
@@ -76,7 +76,7 @@ public:
 
     void setData(PassRefPtr<PropertyNameArrayData> data) { m_data = data; }
     PropertyNameArrayData* data() { return m_data.get(); }
-    PassRefPtr<PropertyNameArrayData> releaseData() { return m_data.release(); }
+    PassRefPtr<PropertyNameArrayData> releaseData() { return WTFMove(m_data); }
 
     // FIXME: Remove these functions.
     bool canAddKnownUniqueForStructure() const { return m_data->propertyNameVector().isEmpty(); }
index 6d7fb81..27ffa51 100644 (file)
@@ -1197,16 +1197,16 @@ PassRefPtr<StructureShape> Structure::toStructureShape(JSValue value)
         curShape->markAsFinal();
 
         if (curStructure->storedPrototypeStructure()) {
-            RefPtr<StructureShape> newShape = StructureShape::create();
-            curShape->setProto(newShape);
-            curShape = newShape.release();
+            auto newShape = StructureShape::create();
+            curShape->setProto(newShape.ptr());
+            curShape = WTFMove(newShape);
             curValue = curStructure->storedPrototype();
         }
 
         curStructure = curStructure->storedPrototypeStructure();
     }
     
-    return baseShape.release();
+    return WTFMove(baseShape);
 }
 
 bool Structure::canUseForAllocationsOf(Structure* other)
index 067f126..58ce2c3 100644 (file)
@@ -548,7 +548,7 @@ PassRefPtr<StructureShape> StructureShape::merge(const PassRefPtr<StructureShape
     RefPtr<StructureShape> b = prpB;
     ASSERT(a->hasSamePrototypeChain(b));
 
-    RefPtr<StructureShape> merged = StructureShape::create();
+    auto merged = StructureShape::create();
     for (auto field : a->m_fields) {
         if (b->m_fields.contains(field))
             merged->m_fields.add(field);
@@ -578,7 +578,7 @@ PassRefPtr<StructureShape> StructureShape::merge(const PassRefPtr<StructureShape
 
     merged->markAsFinal();
 
-    return merged.release();
+    return WTFMove(merged);
 }
 
 void StructureShape::enterDictionaryMode()
index 2e328c1..9ae3a87 100644 (file)
@@ -116,7 +116,7 @@ static void initializeOverrideInfo(const SourceCode& origCode, const String& new
     newProviderStr.append(origHeader);
     newProviderStr.append(newBody);
 
-    RefPtr<SourceProvider> newProvider = StringSourceProvider::create(newProviderStr, "<overridden>");
+    auto newProvider = StringSourceProvider::create(newProviderStr, "<overridden>");
 
     info.firstLine = 1;
     info.lineCount = 1; // Faking it. This doesn't really matter for now.
@@ -127,7 +127,7 @@ static void initializeOverrideInfo(const SourceCode& origCode, const String& new
     info.typeProfilingEndOffset = newProviderStr.length() - 1;
 
     info.sourceCode =
-        SourceCode(newProvider.release(), info.typeProfilingStartOffset, info.typeProfilingEndOffset + 1, 1, 1);
+        SourceCode(WTFMove(newProvider), info.typeProfilingStartOffset, info.typeProfilingEndOffset + 1, 1, 1);
 }
     
 bool FunctionOverrides::initializeOverrideFor(const SourceCode& origCode, FunctionOverrides::OverrideInfo& result)
index d985439..4aca0ca 100644 (file)
@@ -1,3 +1,218 @@
+2016-06-20  Keith Rollin  <krollin@apple.com>
+
+        Remove RefPtr::release() and change calls sites to use WTFMove()
+        https://bugs.webkit.org/show_bug.cgi?id=158369
+
+        Reviewed by Chris Dumez.
+
+        RefPtr::release() releases its managed pointer awkwardly. It's more
+        direct and clearer to use WTFMove to transfer ownership of the managed
+        pointer.
+
+        As part of this cleanup, also change a lot of explicit data types to
+        'auto'.
+
+        No new tests: there's no new functionality, just a refactoring of
+        existing code.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::removeSamplesFromTrackBuffer):
+        (WebCore::SourceBuffer::provideMediaData):
+        * Modules/mediastream/UserMediaRequest.cpp:
+        (WebCore::UserMediaRequest::start):
+        * Modules/webdatabase/SQLCallbackWrapper.h:
+        (WebCore::SQLCallbackWrapper::clear):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::handlePostMessage):
+        * bindings/js/JSHistoryCustom.cpp:
+        (WebCore::JSHistory::pushState):
+        (WebCore::JSHistory::replaceState):
+        * bindings/js/JSMessagePortCustom.h:
+        (WebCore::handlePostMessage):
+        * bindings/js/ScriptControllerMac.mm:
+        (WebCore::ScriptController::createScriptInstanceForWidget):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneDeserializer::readTerminal):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
+        * css/SVGCSSParser.cpp:
+        (WebCore::CSSParser::parseSVGValue):
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertShapeValue):
+        * css/StyleProperties.cpp:
+        (WebCore::StyleProperties::copyPropertiesInSet):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::loadPendingImages):
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::InlineStyleSheetOwner::clearSheet):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::removeChildrenInRange):
+        (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors):
+        (WebCore::CompositeEditCommand::prune):
+        (WebCore::CompositeEditCommand::replaceSelectedTextInNode):
+        (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
+        * editing/CreateLinkCommand.cpp:
+        (WebCore::CreateLinkCommand::doApply):
+        * editing/EditingStyle.cpp:
+        (WebCore::EditingStyle::mergeStyle):
+        (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
+        * editing/Editor.cpp:
+        (WebCore::ClearTextCommand::CreateAndApply):
+        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+        * editing/EditorCommand.cpp:
+        (WebCore::executeInsertNode):
+        * editing/InsertTextCommand.cpp:
+        (WebCore::InsertTextCommand::performOverwrite):
+        (WebCore::InsertTextCommand::insertTab):
+        * editing/RemoveNodePreservingChildrenCommand.cpp:
+        (WebCore::RemoveNodePreservingChildrenCommand::doApply):
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplacementFragment::removeNodePreservingChildren):
+        (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
+        * html/FTPDirectoryDocument.cpp:
+        (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
+        * html/HTMLFontElement.cpp:
+        (WebCore::HTMLFontElement::collectStyleForPresentationAttribute):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::prepareForSubmission):
+        * html/HTMLTableElement.cpp:
+        (WebCore::leakBorderStyle):
+        (WebCore::leakGroupBorderStyle):
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
+        * html/track/InbandDataTextTrack.cpp:
+        (WebCore::InbandDataTextTrack::addDataCue):
+        * html/track/InbandGenericTextTrack.cpp:
+        (WebCore::InbandGenericTextTrack::newCuesParsed):
+        * html/track/InbandWebVTTTextTrack.cpp:
+        (WebCore::InbandWebVTTTextTrack::newCuesParsed):
+        * html/track/TextTrackCueList.cpp:
+        (WebCore::TextTrackCueList::add):
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::getInlineStylesForNode):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
+        * inspector/InspectorIndexedDBAgent.cpp:
+        * inspector/InspectorNetworkAgent.cpp:
+        (WebCore::InspectorNetworkAgent::loadResource):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
+        * loader/FormSubmission.cpp:
+        (WebCore::FormSubmission::create):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadURLIntoChildFrame):
+        (WebCore::FrameLoader::loadURL):
+        (WebCore::FrameLoader::loadPostRequest):
+        * loader/ProgressTracker.cpp:
+        (WebCore::ProgressTracker::finalProgressComplete):
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::ApplicationCacheGroup::disassociateDocumentLoader):
+        (WebCore::ApplicationCacheGroup::didFinishLoading):
+        (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
+        * loader/appcache/ApplicationCacheStorage.cpp:
+        (WebCore::ApplicationCacheStorage::loadCacheGroup):
+        (WebCore::ApplicationCacheStorage::cacheGroupForURL):
+        (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
+        (WebCore::ApplicationCacheStorage::loadCache):
+        * loader/archive/ArchiveResourceCollection.cpp:
+        (WebCore::ArchiveResourceCollection::popSubframeArchive):
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        (WebCore::LegacyWebArchive::extract):
+        (WebCore::LegacyWebArchive::create):
+        (WebCore::LegacyWebArchive::createFromSelection):
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::createImage):
+        * loader/icon/IconDatabase.cpp:
+        (WebCore::IconDatabase::setIconDataForIconURL):
+        (WebCore::IconDatabase::getOrCreateIconRecord):
+        (WebCore::IconDatabase::readFromDatabase):
+        (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::sessionStorage):
+        (WebCore::DOMWindow::localStorage):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::updateDragAndDrop):
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::updateTransitions):
+        * page/csp/ContentSecurityPolicy.cpp:
+        (WebCore::ContentSecurityPolicy::reportViolation):
+        * page/mac/ServicesOverlayController.mm:
+        (WebCore::ServicesOverlayController::createOverlayIfNeeded):
+        (WebCore::ServicesOverlayController::determineActiveHighlight):
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        (WebCore::AsyncScrollingCoordinator::releaseScrollingTree):
+        * page/scrolling/ScrollingStateNode.cpp:
+        (WebCore::ScrollingStateNode::cloneAndReset):
+        * page/scrolling/ScrollingStateTree.cpp:
+        (WebCore::ScrollingStateTree::attachNode):
+        * platform/audio/HRTFElevation.cpp:
+        (WebCore::getConcatenatedImpulseResponsesForSubject):
+        * platform/graphics/DisplayRefreshMonitorManager.cpp:
+        (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
+        * platform/graphics/FontCascadeFonts.cpp:
+        (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
+        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+        (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
+        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
+        (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        * platform/graphics/ca/PlatformCALayer.cpp:
+        (WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):
+        * platform/graphics/cg/ImageBufferDataCG.cpp:
+        (WebCore::ImageBufferData::getData):
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::asUnmultipliedImage):
+        (WebCore::FilterEffect::asPremultipliedImage):
+        * platform/graphics/mac/ImageMac.mm:
+        (WebCore::Image::loadPlatformResource):
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        (WebCore::GraphicsContext3D::createForCurrentGLContext):
+        (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
+        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
+        (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
+        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
+        (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
+        (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::registerBlobURL):
+        (WebCore::BlobRegistryImpl::registerBlobURLForSlice):
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::create):
+        * platform/network/cf/FormDataStreamCFNet.cpp:
+        (WebCore::formCreate):
+        * platform/text/BidiContext.cpp:
+        (WebCore::BidiContext::copyStackRemovingUnicodeEmbeddingContexts):
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRenderer::build):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::createScrollbar):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::createScrollbar):
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::createScrollbar):
+        * rendering/RenderSearchField.cpp:
+        (WebCore::RenderSearchField::createScrollbar):
+        * replay/ReplayController.cpp:
+        (WebCore::ReplayController::unloadSegment):
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::build):
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::build):
+        * svg/properties/SVGListProperty.h:
+        (WebCore::SVGListProperty::getItemValuesAndWrappers):
+        (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
+        (WebCore::SVGListProperty::removeItemValuesAndWrappers):
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThread::workerThread):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::internalAbort):
+        * xml/XPathStep.cpp:
+        (WebCore::XPath::Step::nodesInAxis):
+
 2016-06-20  Eric Carlson  <eric.carlson@apple.com>
 
         Crash in PlatformMediaSession::clientWillPausePlayback
index eb5247a..db3b954 100644 (file)
@@ -663,7 +663,7 @@ static PassRefPtr<TimeRanges> removeSamplesFromTrackBuffer(const DecodeOrderSamp
     UNUSED_PARAM(buffer);
 #endif
 
-    RefPtr<TimeRanges> erasedRanges = TimeRanges::create();
+    auto erasedRanges = TimeRanges::create();
     MediaTime microsecond(1, 1000000);
     for (auto sampleIt : samples) {
         const DecodeOrderSampleMap::KeyType& decodeKey = sampleIt.first;
@@ -698,7 +698,7 @@ static PassRefPtr<TimeRanges> removeSamplesFromTrackBuffer(const DecodeOrderSamp
         LOG(MediaSource, "SourceBuffer::%s(%p) removed %zu bytes, start(%lf), end(%lf)", logPrefix, buffer, bytesRemoved, earliestSample, latestSample);
 #endif
 
-    return erasedRanges.release();
+    return WTFMove(erasedRanges);
 }
 
 void SourceBuffer::removeCodedFrames(const MediaTime& start, const MediaTime& end)
@@ -1751,7 +1751,7 @@ void SourceBuffer::provideMediaData(TrackBuffer& trackBuffer, AtomicString track
         // FIXME(rdar://problem/20635969): Remove this re-entrancy protection when the aforementioned radar is resolved; protecting
         // against re-entrancy introduces a small inefficency when removing appended samples from the decode queue one at a time
         // rather than when all samples have been enqueued.
-        RefPtr<MediaSample> sample = trackBuffer.decodeQueue.begin()->second;
+        auto sample = trackBuffer.decodeQueue.begin()->second;
         trackBuffer.decodeQueue.erase(trackBuffer.decodeQueue.begin());
 
         // Do not enqueue samples spanning a significant unbuffered gap.
@@ -1767,7 +1767,7 @@ void SourceBuffer::provideMediaData(TrackBuffer& trackBuffer, AtomicString track
 
         trackBuffer.lastEnqueuedPresentationTime = sample->presentationTime();
         trackBuffer.lastEnqueuedDecodeEndTime = sample->decodeTime() + sample->duration();
-        m_private->enqueueSample(sample.release(), trackID);
+        m_private->enqueueSample(WTFMove(sample), trackID);
 #if !LOG_DISABLED
         ++enqueuedSamples;
 #endif
index 9e5a9c2..b96b7a0 100644 (file)
@@ -80,15 +80,15 @@ void UserMediaRequest::start(Document* document, const Dictionary& options, Medi
         return;
     }
 
-    RefPtr<MediaConstraints> audioConstraints = parseOptions(options, AtomicString("audio", AtomicString::ConstructFromLiteral));
-    RefPtr<MediaConstraints> videoConstraints = parseOptions(options, AtomicString("video", AtomicString::ConstructFromLiteral));
+    auto audioConstraints = parseOptions(options, AtomicString("audio", AtomicString::ConstructFromLiteral));
+    auto videoConstraints = parseOptions(options, AtomicString("video", AtomicString::ConstructFromLiteral));
 
     if (!audioConstraints && !videoConstraints) {
         ec = NOT_SUPPORTED_ERR;
         return;
     }
 
-    Ref<UserMediaRequest> request = adoptRef(*new UserMediaRequest(document, userMedia, audioConstraints.release(), videoConstraints.release(), WTFMove(promise)));
+    auto request = adoptRef(*new UserMediaRequest(document, userMedia, WTFMove(audioConstraints), WTFMove(videoConstraints), WTFMove(promise)));
     request->start();
 }
 
index ca66581..b645482 100644 (file)
@@ -68,8 +68,8 @@ public:
                 m_scriptExecutionContext = nullptr;
                 return;
             }
-            scriptExecutionContextPtr = m_scriptExecutionContext.release().leakRef();
-            callback = m_callback.release().leakRef();
+            scriptExecutionContextPtr = m_scriptExecutionContext.leakRef();
+            callback = m_callback.leakRef();
         }
         scriptExecutionContextPtr->postTask({
             ScriptExecutionContext::Task::CleanupTask,
index 8fb4e99..330d6b2 100644 (file)
@@ -539,9 +539,7 @@ static JSValue handlePostMessage(DOMWindow& impl, ExecState& state)
     if (state.hadException())
         return jsUndefined();
 
-    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(&state, state.argument(0),
-                                                                         &messagePorts,
-                                                                         &arrayBuffers);
+    auto message = SerializedScriptValue::create(&state, state.argument(0), &messagePorts, &arrayBuffers);
 
     if (state.hadException())
         return jsUndefined();
@@ -551,7 +549,7 @@ static JSValue handlePostMessage(DOMWindow& impl, ExecState& state)
         return jsUndefined();
 
     ExceptionCode ec = 0;
-    impl.postMessage(message.release(), &messagePorts, targetOrigin, callerDOMWindow(&state), ec);
+    impl.postMessage(WTFMove(message), &messagePorts, targetOrigin, callerDOMWindow(&state), ec);
     setDOMException(&state, ec);
 
     return jsUndefined();
index f497965..7a4e86e 100644 (file)
@@ -55,7 +55,7 @@ JSValue JSHistory::state(ExecState& state) const
 
 JSValue JSHistory::pushState(ExecState& state)
 {
-    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(&state, state.argument(0), 0, 0);
+    auto historyState = SerializedScriptValue::create(&state, state.argument(0), 0, 0);
     if (state.hadException())
         return jsUndefined();
 
@@ -71,7 +71,7 @@ JSValue JSHistory::pushState(ExecState& state)
     }
 
     ExceptionCodeWithMessage ec;
-    wrapped().stateObjectAdded(historyState.release(), title, url, History::StateObjectType::Push, ec);
+    wrapped().stateObjectAdded(WTFMove(historyState), title, url, History::StateObjectType::Push, ec);
     setDOMException(&state, ec);
 
     m_state.clear();
@@ -81,7 +81,7 @@ JSValue JSHistory::pushState(ExecState& state)
 
 JSValue JSHistory::replaceState(ExecState& state)
 {
-    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(&state, state.argument(0), 0, 0);
+    auto historyState = SerializedScriptValue::create(&state, state.argument(0), 0, 0);
     if (state.hadException())
         return jsUndefined();
 
@@ -97,7 +97,7 @@ JSValue JSHistory::replaceState(ExecState& state)
     }
 
     ExceptionCodeWithMessage ec;
-    wrapped().stateObjectAdded(historyState.release(), title, url, History::StateObjectType::Replace, ec);
+    wrapped().stateObjectAdded(WTFMove(historyState), title, url, History::StateObjectType::Replace, ec);
     setDOMException(&state, ec);
 
     m_state.clear();
index fca7a40..062946b 100644 (file)
@@ -56,12 +56,12 @@ namespace WebCore {
         MessagePortArray portArray;
         ArrayBufferArray arrayBufferArray;
         fillMessagePortArray(state, state.argument(1), portArray, arrayBufferArray);
-        RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(&state, state.uncheckedArgument(0), &portArray, &arrayBufferArray);
+        auto message = SerializedScriptValue::create(&state, state.uncheckedArgument(0), &portArray, &arrayBufferArray);
         if (state.hadException())
             return JSC::jsUndefined();
 
         ExceptionCode ec = 0;
-        impl->postMessage(message.release(), &portArray, ec);
+        impl->postMessage(WTFMove(message), &portArray, ec);
         setDOMException(&state, ec);
         return JSC::jsUndefined();
     }
index 5fc72df..a847452 100644 (file)
@@ -66,10 +66,10 @@ RefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(
     if (!widgetView)
         return nullptr;
 
-    RefPtr<RootObject> rootObject = createRootObject(widgetView);
+    auto rootObject = createRootObject(widgetView);
 
     if ([widgetView respondsToSelector:@selector(createPluginBindingsInstance:)])
-        return [widgetView createPluginBindingsInstance:rootObject.release()];
+        return [widgetView createPluginBindingsInstance:WTFMove(rootObject)];
         
     if ([widgetView respondsToSelector:@selector(objectForWebScript)]) {
         id objectForWebScript = [widgetView objectForWebScript];
index 682cc62..869b6ea 100644 (file)
@@ -2354,7 +2354,7 @@ private:
                 fail();
                 return JSValue();
             }
-            JSValue result = JSArrayBuffer::create(m_exec->vm(), m_globalObject->arrayBufferStructure(), arrayBuffer.release());
+            JSValue result = JSArrayBuffer::create(m_exec->vm(), m_globalObject->arrayBufferStructure(), WTFMove(arrayBuffer));
             m_gcBuffer.append(result);
             return result;
         }
index b7d2691..88750de 100644 (file)
@@ -4056,9 +4056,9 @@ Ref<MutableStyleProperties> ComputedStyleExtractor::copyPropertiesInSet(const CS
     Vector<CSSProperty, 256> list;
     list.reserveInitialCapacity(length);
     for (unsigned i = 0; i < length; ++i) {
-        RefPtr<CSSValue> value = propertyValue(set[i]);
+        auto value = propertyValue(set[i]);
         if (value)
-            list.append(CSSProperty(set[i], value.release(), false));
+            list.append(CSSProperty(set[i], WTFMove(value), false));
     }
     return MutableStyleProperties::create(list.data(), list.size());
 }
index f0c4854..9cb4793 100644 (file)
@@ -272,9 +272,9 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
         if (id == CSSValueNone)
             valid_primitive = true;
         else {
-            RefPtr<CSSValueList> shadowValueList = parseShadow(*m_valueList, propId);
+            auto shadowValueList = parseShadow(*m_valueList, propId);
             if (shadowValueList) {
-                addProperty(propId, shadowValueList.release(), important);
+                addProperty(propId, WTFMove(shadowValueList), important);
                 m_valueList->next();
                 return true;
             }
@@ -336,7 +336,7 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
     if (!parsedValue || (m_valueList->current() && !inShorthand()))
         return false;
 
-    addProperty(propId, parsedValue.release(), important);
+    addProperty(propId, WTFMove(parsedValue), important);
     return true;
 }
 
index 77ac65f..af45713 100644 (file)
@@ -762,7 +762,7 @@ inline PassRefPtr<ShapeValue> StyleBuilderConverter::convertShapeValue(StyleReso
     }
 
     if (shape)
-        return ShapeValue::createShapeValue(shape.release(), referenceBox);
+        return ShapeValue::createShapeValue(WTFMove(shape), referenceBox);
 
     if (referenceBox != BoxMissing)
         return ShapeValue::createBoxShapeValue(referenceBox);
index bfcbfa7..f7bc730 100644 (file)
@@ -1313,9 +1313,9 @@ Ref<MutableStyleProperties> StyleProperties::copyPropertiesInSet(const CSSProper
     Vector<CSSProperty, 256> list;
     list.reserveInitialCapacity(length);
     for (unsigned i = 0; i < length; ++i) {
-        RefPtr<CSSValue> value = getPropertyCSSValueInternal(set[i]);
+        auto value = getPropertyCSSValueInternal(set[i]);
         if (value)
-            list.append(CSSProperty(set[i], value.release(), false));
+            list.append(CSSProperty(set[i], WTFMove(value), false));
     }
     return MutableStyleProperties::create(list.data(), list.size());
 }
index c17aafa..ab6df27 100644 (file)
@@ -2193,8 +2193,8 @@ void StyleResolver::loadPendingImages()
                 if (is<ImageContentData>(*contentData)) {
                     auto& styleImage = downcast<ImageContentData>(*contentData).image();
                     if (is<StylePendingImage>(styleImage)) {
-                        if (RefPtr<StyleImage> loadedImage = loadPendingImage(downcast<StylePendingImage>(styleImage)))
-                            downcast<ImageContentData>(*contentData).setImage(loadedImage.release());
+                        if (auto loadedImage = loadPendingImage(downcast<StylePendingImage>(styleImage)))
+                            downcast<ImageContentData>(*contentData).setImage(WTFMove(loadedImage));
                     }
                 }
             }
@@ -2228,8 +2228,8 @@ void StyleResolver::loadPendingImages()
                 const NinePieceImage& maskImage = reflection->mask();
                 auto* styleImage = maskImage.image();
                 if (is<StylePendingImage>(styleImage)) {
-                    RefPtr<StyleImage> loadedImage = loadPendingImage(downcast<StylePendingImage>(*styleImage));
-                    reflection->setMask(NinePieceImage(loadedImage.release(), maskImage.imageSlices(), maskImage.fill(), maskImage.borderSlices(), maskImage.outset(), maskImage.horizontalRule(), maskImage.verticalRule()));
+                    auto loadedImage = loadPendingImage(downcast<StylePendingImage>(*styleImage));
+                    reflection->setMask(NinePieceImage(WTFMove(loadedImage), maskImage.imageSlices(), maskImage.fill(), maskImage.borderSlices(), maskImage.outset(), maskImage.horizontalRule(), maskImage.verticalRule()));
                 }
             }
             break;
index 9fc426d..e006b81 100644 (file)
@@ -109,7 +109,8 @@ void InlineStyleSheetOwner::createSheetFromTextContents(Element& element)
 void InlineStyleSheetOwner::clearSheet()
 {
     ASSERT(m_sheet);
-    m_sheet.release()->clearOwnerNode();
+    auto sheet = WTFMove(m_sheet);
+    sheet->clearOwnerNode();
 }
 
 inline bool isValidCSSContentType(Element& element, const AtomicString& type)
index a0599de..267f950 100644 (file)
@@ -840,7 +840,7 @@ void ApplyStyleCommand::applyInlineStyleToNodeRange(EditingStyle* style, PassRef
         if (run.dummyElement)
             removeNode(run.dummyElement);
         if (run.startAndEndAreStillInDocument())
-            applyInlineStyleChange(run.start.release(), run.end.release(), run.change, AddStyledElement);
+            applyInlineStyleChange(WTFMove(run.start), WTFMove(run.end), run.change, AddStyledElement);
     }
 }
 
index b9042fa..91797a1 100644 (file)
@@ -522,7 +522,7 @@ void CompositeEditCommand::removeChildrenInRange(PassRefPtr<Node> node, unsigned
         children.append(child);
 
     for (auto& child : children)
-        removeNode(child.release());
+        removeNode(WTFMove(child));
 }
 
 void CompositeEditCommand::removeNode(PassRefPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
@@ -541,7 +541,7 @@ void CompositeEditCommand::removeNodeAndPruneAncestors(PassRefPtr<Node> node)
 {
     RefPtr<ContainerNode> parent = node->parentNode();
     removeNode(node);
-    prune(parent.release());
+    prune(WTFMove(parent));
 }
 
 void CompositeEditCommand::moveRemainingSiblingsToNewParent(Node* node, Node* pastLastNodeToMove, PassRefPtr<Element> prpNewParent)
@@ -583,7 +583,7 @@ HTMLElement* CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAt
 void CompositeEditCommand::prune(PassRefPtr<Node> node)
 {
     if (RefPtr<Node> highestNodeToRemove = highestNodeToRemoveInPruning(node.get()))
-        removeNode(highestNodeToRemove.release());
+        removeNode(WTFMove(highestNodeToRemove));
 }
 
 void CompositeEditCommand::splitTextNode(PassRefPtr<Text> node, unsigned offset)
@@ -688,7 +688,7 @@ Position CompositeEditCommand::replaceSelectedTextInNode(const String& text)
     RefPtr<Text> textNode = start.containerText();
     replaceTextInNode(textNode, start.offsetInContainerNode(), end.offsetInContainerNode() - start.offsetInContainerNode(), text);
 
-    return Position(textNode.release(), start.offsetInContainerNode() + text.length());
+    return Position(WTFMove(textNode), start.offsetInContainerNode() + text.length());
 }
 
 static Vector<RenderedDocumentMarker> copyMarkers(const Vector<RenderedDocumentMarker*>& markerPointers)
@@ -872,7 +872,7 @@ void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(PassRefPtr<Text> p
                                                              isEndOfParagraph(visibleDownstreamPos) || (unsigned)downstream == text.length());
     
     if (string != rebalancedString)
-        replaceTextInNodePreservingMarkers(textNode.release(), upstream, length, rebalancedString);
+        replaceTextInNodePreservingMarkers(WTFMove(textNode), upstream, length, rebalancedString);
 }
 
 void CompositeEditCommand::prepareWhitespaceAtPositionForSplit(Position& position)
index a3ee7e5..3a05208 100644 (file)
@@ -43,16 +43,16 @@ void CreateLinkCommand::doApply()
     if (endingSelection().isNone())
         return;
         
-    RefPtr<HTMLAnchorElement> anchorElement = HTMLAnchorElement::create(document());
+    auto anchorElement = HTMLAnchorElement::create(document());
     anchorElement->setHref(m_url);
     
     if (endingSelection().isRange())
-        applyStyledElement(anchorElement.release());
+        applyStyledElement(WTFMove(anchorElement));
     else {
-        insertNodeAt(anchorElement.get(), endingSelection().start());
-        RefPtr<Text> textNode = Text::create(document(), m_url);
-        appendNode(textNode.release(), anchorElement.get());
-        setEndingSelection(VisibleSelection(positionInParentBeforeNode(anchorElement.get()), positionInParentAfterNode(anchorElement.get()), DOWNSTREAM, endingSelection().isDirectional()));
+        insertNodeAt(anchorElement.ptr(), endingSelection().start());
+        auto textNode = Text::create(document(), m_url);
+        appendNode(WTFMove(textNode), anchorElement.ptr());
+        setEndingSelection(VisibleSelection(positionInParentBeforeNode(anchorElement.ptr()), positionInParentAfterNode(anchorElement.ptr()), DOWNSTREAM, endingSelection().isDirectional()));
     }
 }
 
index 2914f62..ec7e7eb 100644 (file)
@@ -1248,9 +1248,9 @@ void EditingStyle::mergeStyle(const StyleProperties* style, CSSPropertyOverrideM
         if ((property.id() == CSSPropertyTextDecoration || property.id() == CSSPropertyWebkitTextDecorationsInEffect)
             && is<CSSValueList>(*property.value()) && value) {
             if (is<CSSValueList>(*value)) {
-                RefPtr<CSSValueList> newValue = downcast<CSSValueList>(*value).copy();
-                mergeTextDecorationValues(*newValue, downcast<CSSValueList>(*property.value()));
-                m_mutableStyle->setProperty(property.id(), newValue.release(), property.isImportant());
+                auto newValue = downcast<CSSValueList>(*value).copy();
+                mergeTextDecorationValues(newValue, downcast<CSSValueList>(*property.value()));
+                m_mutableStyle->setProperty(property.id(), WTFMove(newValue), property.isImportant());
                 continue;
             }
             value = nullptr; // text-decoration: none is equivalent to not having the property.
@@ -1307,8 +1307,8 @@ void EditingStyle::mergeStyleFromRulesForSerialization(StyledElement* element)
             if (!is<CSSPrimitiveValue>(*value))
                 continue;
             if (downcast<CSSPrimitiveValue>(*value).isPercentage()) {
-                if (RefPtr<CSSValue> computedPropertyValue = computedStyle.propertyValue(property.id()))
-                    fromComputedStyle->addParsedProperty(CSSProperty(property.id(), computedPropertyValue.release()));
+                if (auto computedPropertyValue = computedStyle.propertyValue(property.id()))
+                    fromComputedStyle->addParsedProperty(CSSProperty(property.id(), WTFMove(computedPropertyValue)));
             }
         }
     }
index 34cdce9..f666330 100644 (file)
@@ -136,9 +136,9 @@ void ClearTextCommand::CreateAndApply(const RefPtr<Frame> frame)
     
     const VisibleSelection oldSelection = frame->selection().selection();
     frame->selection().selectAll();
-    RefPtr<ClearTextCommand> clearCommand = adoptRef(new ClearTextCommand(*frame->document()));
+    auto clearCommand = adoptRef(*new ClearTextCommand(*frame->document()));
     clearCommand->setStartingSelection(oldSelection);
-    applyCommand(clearCommand.release());
+    applyCommand(WTFMove(clearCommand));
 }
 
 using namespace HTMLNames;
@@ -2433,16 +2433,16 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeMask textC
     bool asynchronous = m_frame.settings().asynchronousSpellCheckingEnabled() && !shouldShowCorrectionPanel;
 
     // In asynchronous mode, we intentionally check paragraph-wide sentence.
-    RefPtr<SpellCheckRequest> request = SpellCheckRequest::create(resolveTextCheckingTypeMask(textCheckingOptions), TextCheckingProcessIncremental, asynchronous ? paragraphRange : rangeToCheck, paragraphRange);
+    auto request = SpellCheckRequest::create(resolveTextCheckingTypeMask(textCheckingOptions), TextCheckingProcessIncremental, asynchronous ? paragraphRange : rangeToCheck, paragraphRange);
 
     if (asynchronous) {
-        m_spellChecker->requestCheckingFor(request.release());
+        m_spellChecker->requestCheckingFor(WTFMove(request));
         return;
     }
 
     Vector<TextCheckingResult> results;
     checkTextOfParagraph(*textChecker(), paragraphToCheck.text(), resolveTextCheckingTypeMask(textCheckingOptions), results, m_frame.selection().selection());
-    markAndReplaceFor(request.release(), results);
+    markAndReplaceFor(WTFMove(request), results);
 }
 
 static bool isAutomaticTextReplacementType(TextCheckingType type)
index a93580e..ddf194c 100644 (file)
@@ -165,12 +165,12 @@ static bool executeInsertFragment(Frame& frame, PassRefPtr<DocumentFragment> fra
 
 static bool executeInsertNode(Frame& frame, Ref<Node>&& content)
 {
-    RefPtr<DocumentFragment> fragment = DocumentFragment::create(*frame.document());
+    auto fragment = DocumentFragment::create(*frame.document());
     ExceptionCode ec = 0;
     fragment->appendChild(content, ec);
     if (ec)
         return false;
-    return executeInsertFragment(frame, fragment.release());
+    return executeInsertFragment(frame, WTFMove(fragment));
 }
 
 static bool expandSelectionToGranularity(Frame& frame, TextGranularity granularity)
index 9b9448c..103987a 100644 (file)
@@ -120,7 +120,7 @@ bool InsertTextCommand::performOverwrite(const String& text, bool selectInserted
 
     replaceTextInNode(textNode, start.offsetInContainerNode(), count, text);
 
-    Position endPosition = Position(textNode.release(), start.offsetInContainerNode() + text.length());
+    Position endPosition = Position(WTFMove(textNode), start.offsetInContainerNode() + text.length());
     setEndingSelectionWithoutValidation(start, endPosition);
     if (!selectInsertedText)
         setEndingSelection(VisibleSelection(endingSelection().visibleEnd(), endingSelection().isDirectional()));
@@ -245,7 +245,7 @@ Position InsertTextCommand::insertTab(const Position& pos)
     if (isTabSpanTextNode(node)) {
         RefPtr<Text> textNode = downcast<Text>(node);
         insertTextIntoNode(textNode, offset, "\t");
-        return Position(textNode.release(), offset + 1);
+        return Position(WTFMove(textNode), offset + 1);
     }
     
     // create new tab span
index b61e2ff..16f0f63 100644 (file)
@@ -47,9 +47,9 @@ void RemoveNodePreservingChildrenCommand::doApply()
 
     size_t size = children.size();
     for (size_t i = 0; i < size; ++i) {
-        RefPtr<Node> child = WTFMove(children[i]);
+        auto child = WTFMove(children[i]);
         removeNode(child, m_shouldAssumeContentIsAlwaysEditable);
-        insertNodeBefore(child.release(), m_node, m_shouldAssumeContentIsAlwaysEditable);
+        insertNodeBefore(WTFMove(child), m_node, m_shouldAssumeContentIsAlwaysEditable);
     }
     removeNode(m_node, m_shouldAssumeContentIsAlwaysEditable);
 }
index ede87db..494405e 100644 (file)
@@ -229,9 +229,9 @@ void ReplacementFragment::removeNodePreservingChildren(PassRefPtr<Node> node)
 
     while (RefPtr<Node> n = node->firstChild()) {
         removeNode(n);
-        insertNodeBefore(n.release(), node.get());
+        insertNodeBefore(WTFMove(n), node.get());
     }
-    removeNode(node);
+    removeNode(WTFMove(node));
 }
 
 void ReplacementFragment::removeNode(PassRefPtr<Node> node)
@@ -678,7 +678,7 @@ void ReplaceSelectionCommand::moveNodeOutOfAncestor(PassRefPtr<Node> prpNode, Pa
     }
     if (!ancestor->firstChild()) {
         insertedNodes.willRemoveNode(ancestor.get());
-        removeNode(ancestor.release());
+        removeNode(WTFMove(ancestor));
     }
 }
 
index 47e1aa7..7de3d80 100644 (file)
@@ -280,7 +280,7 @@ static inline RefPtr<SharedBuffer> createTemplateDocumentData(Settings* settings
     
 bool FTPDirectoryDocumentParser::loadDocumentTemplate()
 {
-    static SharedBuffer* templateDocumentData = createTemplateDocumentData(document()->settings()).release().leakRef();
+    static SharedBuffer* templateDocumentData = createTemplateDocumentData(document()->settings()).leakRef();
     // FIXME: Instead of storing the data, it would be more efficient if we could parse the template data into the
     // template Document once, store that document, then "copy" it whenever we get an FTP directory listing.
     
index 398d145..aab4d94 100644 (file)
@@ -194,8 +194,8 @@ void HTMLFontElement::collectStyleForPresentationAttribute(const QualifiedName&
     } else if (name == colorAttr)
         addHTMLColorToStyle(style, CSSPropertyColor, value);
     else if (name == faceAttr) {
-        if (RefPtr<CSSValueList> fontFaceValue = CSSValuePool::singleton().createFontFaceValue(value))
-            style.setProperty(CSSProperty(CSSPropertyFontFamily, fontFaceValue.release()));
+        if (auto fontFaceValue = CSSValuePool::singleton().createFontFaceValue(value))
+            style.setProperty(CSSProperty(CSSPropertyFontFamily, WTFMove(fontFaceValue)));
     } else
         HTMLElement::collectStyleForPresentationAttribute(name, value, style);
 }
index ac92728..613ff2d 100644 (file)
@@ -284,8 +284,8 @@ void HTMLFormElement::prepareForSubmission(Event* event)
 
     StringPairVector controlNamesAndValues;
     getTextFieldValues(controlNamesAndValues);
-    RefPtr<FormState> formState = FormState::create(this, controlNamesAndValues, &document(), NotSubmittedByJavaScript);
-    frame->loader().client().dispatchWillSendSubmitEvent(formState.release());
+    auto formState = FormState::create(this, controlNamesAndValues, &document(), NotSubmittedByJavaScript);
+    frame->loader().client().dispatchWillSendSubmitEvent(WTFMove(formState));
 
     Ref<HTMLFormElement> protectedThis(*this);
     // Event handling can result in m_shouldSubmit becoming true, regardless of dispatchEvent() return value.
index 1f524fd..87f2b76 100644 (file)
@@ -435,12 +435,12 @@ void HTMLTableElement::parseAttribute(const QualifiedName& name, const AtomicStr
 
 static StyleProperties* leakBorderStyle(CSSValueID value)
 {
-    RefPtr<MutableStyleProperties> style = MutableStyleProperties::create();
+    auto style = MutableStyleProperties::create();
     style->setProperty(CSSPropertyBorderTopStyle, value);
     style->setProperty(CSSPropertyBorderBottomStyle, value);
     style->setProperty(CSSPropertyBorderLeftStyle, value);
     style->setProperty(CSSPropertyBorderRightStyle, value);
-    return style.release().leakRef();
+    return &style.leakRef();
 }
 
 const StyleProperties* HTMLTableElement::additionalPresentationAttributeStyle() const
@@ -539,7 +539,7 @@ const StyleProperties* HTMLTableElement::additionalCellStyle()
 
 static StyleProperties* leakGroupBorderStyle(int rows)
 {
-    RefPtr<MutableStyleProperties> style = MutableStyleProperties::create();
+    auto style = MutableStyleProperties::create();
     if (rows) {
         style->setProperty(CSSPropertyBorderTopWidth, CSSValueThin);
         style->setProperty(CSSPropertyBorderBottomWidth, CSSValueThin);
@@ -551,7 +551,7 @@ static StyleProperties* leakGroupBorderStyle(int rows)
         style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid);
         style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid);
     }
-    return style.release().leakRef();
+    return &style.leakRef();
 }
 
 const StyleProperties* HTMLTableElement::additionalGroupStyle(bool rows)
index 3aad9b6..e622d0d 100644 (file)
@@ -210,7 +210,7 @@ void HTMLDocumentParser::runScriptsForPausedTreeBuilder()
         ASSERT(!m_treeBuilder->hasParserBlockingScriptWork());
         // We will not have a scriptRunner when parsing a DocumentFragment.
         if (m_scriptRunner)
-            m_scriptRunner->execute(scriptElement.release(), scriptStartPosition);
+            m_scriptRunner->execute(WTFMove(scriptElement), scriptStartPosition);
     }
 }
 
index 13acad1..7bf27ae 100644 (file)
@@ -54,8 +54,8 @@ InbandDataTextTrack::~InbandDataTextTrack()
 
 void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, const void* data, unsigned length)
 {
-    RefPtr<DataCue> cue = DataCue::create(*scriptExecutionContext(), start, end, data, length);
-    addCue(cue.release(), ASSERT_NO_EXCEPTION);
+    auto cue = DataCue::create(*scriptExecutionContext(), start, end, data, length);
+    addCue(WTFMove(cue), ASSERT_NO_EXCEPTION);
 }
 
 #if ENABLE(DATACUE_VALUE)
index 249f1cc..7dc027c 100644 (file)
@@ -221,13 +221,13 @@ void InbandGenericTextTrack::newCuesParsed()
     parser().getNewCues(cues);
 
     for (auto& cueData : cues) {
-        RefPtr<VTTCue> vttCue = VTTCue::create(*scriptExecutionContext(), *cueData);
+        auto vttCue = VTTCue::create(*scriptExecutionContext(), *cueData);
 
-        if (hasCue(vttCue.get(), TextTrackCue::IgnoreDuration)) {
+        if (hasCue(vttCue.ptr(), TextTrackCue::IgnoreDuration)) {
             LOG(Media, "InbandGenericTextTrack::newCuesParsed ignoring already added cue: start=%.2f, end=%.2f, content=\"%s\"\n", vttCue->startTime(), vttCue->endTime(), vttCue->text().utf8().data());
             return;
         }
-        addCue(vttCue.release(), ASSERT_NO_EXCEPTION);
+        addCue(WTFMove(vttCue), ASSERT_NO_EXCEPTION);
     }
 }
 
index 09aeed4..99b4945 100644 (file)
@@ -76,13 +76,13 @@ void InbandWebVTTTextTrack::newCuesParsed()
     parser().getNewCues(cues);
 
     for (auto& cueData : cues) {
-        RefPtr<VTTCue> vttCue = VTTCue::create(*scriptExecutionContext(), *cueData);
+        auto vttCue = VTTCue::create(*scriptExecutionContext(), *cueData);
 
-        if (hasCue(vttCue.get(), TextTrackCue::IgnoreDuration)) {
+        if (hasCue(vttCue.ptr(), TextTrackCue::IgnoreDuration)) {
             LOG(Media, "InbandWebVTTTextTrack::newCuesParsed ignoring already added cue: start=%.2f, end=%.2f, content=\"%s\"\n", vttCue->startTime(), vttCue->endTime(), vttCue->text().utf8().data());
             return;
         }
-        addCue(vttCue.release(), ASSERT_NO_EXCEPTION);
+        addCue(WTFMove(vttCue), ASSERT_NO_EXCEPTION);
     }
 }
     
index 6b39299..ffd8eae 100644 (file)
@@ -101,9 +101,9 @@ bool TextTrackCueList::add(PassRefPtr<TextTrackCue> prpCue, size_t start, size_t
 
     size_t index = (start + end) / 2;
     if (cue->isOrderedBefore(m_list[index].get()))
-        return add(cue.release(), start, index);
+        return add(WTFMove(cue), start, index);
 
-    return add(cue.release(), index + 1, end);
+    return add(WTFMove(cue), index + 1, end);
 }
 
 bool TextTrackCueList::remove(TextTrackCue* cue)
index 05480ca..c7c6d6f 100644 (file)
@@ -631,8 +631,10 @@ void InspectorCSSAgent::getInlineStylesForNode(ErrorString& errorString, int nod
         return;
 
     inlineStyle = styleSheet->buildObjectForStyle(element->cssomStyle());
-    RefPtr<Inspector::Protocol::CSS::CSSStyle> attributes = buildObjectForAttributesStyle(element);
-    attributesStyle = attributes ? attributes.release() : nullptr;
+    if (auto attributes = buildObjectForAttributesStyle(element))
+        attributesStyle = WTFMove(attributes);
+    else
+        attributesStyle = nullptr;
 }
 
 void InspectorCSSAgent::getComputedStyleForNode(ErrorString& errorString, int nodeId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSComputedStyleProperty>>& style)
index d0c3da1..87d02ac 100644 (file)
@@ -462,8 +462,8 @@ void InspectorDOMAgent::pushChildNodesToFrontend(int nodeId, int depth)
         return;
     }
 
-    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> children = buildArrayForContainerChildren(node, depth, nodeMap);
-    m_frontendDispatcher->setChildNodes(nodeId, children.release());
+    auto children = buildArrayForContainerChildren(node, depth, nodeMap);
+    m_frontendDispatcher->setChildNodes(nodeId, WTFMove(children));
 }
 
 void InspectorDOMAgent::discardBindings()
index ebede9d..3370546 100644 (file)
@@ -330,7 +330,7 @@ static RefPtr<IDBKey> idbKeyFromInspectorObject(InspectorObject* key)
     } else
         return nullptr;
 
-    return idbKey.release();
+    return idbKey;
 }
 
 static RefPtr<IDBKeyRange> idbKeyRangeFromKeyRange(const InspectorObject* keyRange)
index 43154b3..918686e 100644 (file)
@@ -682,7 +682,7 @@ void InspectorNetworkAgent::loadResource(ErrorString& errorString, const String&
     // InspectorThreadableLoaderClient deletes itself when the load completes.
     InspectorThreadableLoaderClient* inspectorThreadableLoaderClient = new InspectorThreadableLoaderClient(callback.copyRef());
 
-    RefPtr<DocumentThreadableLoader> loader = DocumentThreadableLoader::create(*document, *inspectorThreadableLoaderClient, request, options);
+    auto loader = DocumentThreadableLoader::create(*document, *inspectorThreadableLoaderClient, request, options);
     if (!loader) {
         inspectorThreadableLoaderClient->didFailLoaderCreation();
         return;
@@ -692,7 +692,7 @@ void InspectorNetworkAgent::loadResource(ErrorString& errorString, const String&
     if (!callback->isActive())
         return;
 
-    inspectorThreadableLoaderClient->setLoader(loader.release());
+    inspectorThreadableLoaderClient->setLoader(WTFMove(loader));
 }
 
 static Ref<Inspector::Protocol::Page::SearchResult> buildObjectForSearchResult(const String& requestId, const String& frameId, const String& url, int matchesCount)
index 6d573ce..7de98aa 100644 (file)
@@ -925,7 +925,7 @@ Ref<Inspector::Protocol::CSS::SelectorList> InspectorStyleSheet::buildObjectForS
             selectors->addItem(buildObjectForSelector(selector, element));
     }
     auto result = Inspector::Protocol::CSS::SelectorList::create()
-        .setSelectors(selectors.release())
+        .setSelectors(WTFMove(selectors))
         .setText(selectorText)
         .release();
     if (sourceData)
index bec1223..4120609 100644 (file)
@@ -238,8 +238,8 @@ Ref<FormSubmission> FormSubmission::create(HTMLFormElement* form, const Attribut
     formData->setIdentifier(generateFormDataIdentifier());
     formData->setContainsPasswordData(containsPasswordData);
     String targetOrBaseTarget = copiedAttributes.target().isEmpty() ? document.baseTarget() : copiedAttributes.target();
-    RefPtr<FormState> formState = FormState::create(form, formValues, &document, trigger);
-    return adoptRef(*new FormSubmission(copiedAttributes.method(), actionURL, targetOrBaseTarget, encodingType, formState.release(), formData.release(), boundary, lockHistory, event));
+    auto formState = FormState::create(form, formValues, &document, trigger);
+    return adoptRef(*new FormSubmission(copiedAttributes.method(), actionURL, targetOrBaseTarget, encodingType, WTFMove(formState), WTFMove(formData), boundary, lockHistory, event));
 }
 
 URL FormSubmission::requestURL() const
index 532e021..cb308bc 100644 (file)
@@ -874,9 +874,9 @@ void FrameLoader::loadURLIntoChildFrame(const URL& url, const String& referer, F
     ASSERT(childFrame);
 
 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
-    RefPtr<Archive> subframeArchive = activeDocumentLoader()->popArchiveForSubframe(childFrame->tree().uniqueName(), url);
+    auto subframeArchive = activeDocumentLoader()->popArchiveForSubframe(childFrame->tree().uniqueName(), url);
     if (subframeArchive) {
-        childFrame->loader().loadArchive(subframeArchive.release());
+        childFrame->loader().loadArchive(WTFMove(subframeArchive));
         return;
     }
 #endif // ENABLE(WEB_ARCHIVE)
@@ -1214,7 +1214,7 @@ void FrameLoader::loadURL(const FrameLoadRequest& frameLoadRequest, const String
     if (targetFrame && targetFrame != &m_frame) {
         FrameLoadRequest newFrameLoadRequest(frameLoadRequest);
         newFrameLoadRequest.setFrameName("_self");
-        targetFrame->loader().loadURL(newFrameLoadRequest, referrer, newLoadType, event, formState.release());
+        targetFrame->loader().loadURL(newFrameLoadRequest, referrer, newLoadType, event, WTFMove(formState));
         return;
     }
 
@@ -1225,7 +1225,7 @@ void FrameLoader::loadURL(const FrameLoadRequest& frameLoadRequest, const String
 
     if (!targetFrame && !frameName.isEmpty()) {
         action = action.copyWithShouldOpenExternalURLsPolicy(shouldOpenExternalURLsPolicyToApply(m_frame, frameLoadRequest.shouldOpenExternalURLsPolicy()));
-        policyChecker().checkNewWindowPolicy(action, request, formState.release(), frameName, [this, allowNavigationToInvalidURL, openerPolicy](const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
+        policyChecker().checkNewWindowPolicy(action, request, WTFMove(formState), frameName, [this, allowNavigationToInvalidURL, openerPolicy](const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
             continueLoadAfterNewWindowPolicy(request, formState, frameName, action, shouldContinue, allowNavigationToInvalidURL, openerPolicy);
         });
         return;
@@ -1244,7 +1244,7 @@ void FrameLoader::loadURL(const FrameLoadRequest& frameLoadRequest, const String
         oldDocumentLoader->setLastCheckedRequest(ResourceRequest());
         policyChecker().stopCheck();
         policyChecker().setLoadType(newLoadType);
-        policyChecker().checkNavigationPolicy(request, false /* didReceiveRedirectResponse */, oldDocumentLoader.get(), formState.release(), [this](const ResourceRequest& request, PassRefPtr<FormState>, bool shouldContinue) {
+        policyChecker().checkNavigationPolicy(request, false /* didReceiveRedirectResponse */, oldDocumentLoader.get(), WTFMove(formState), [this](const ResourceRequest& request, PassRefPtr<FormState>, bool shouldContinue) {
             continueFragmentScrollAfterNavigationPolicy(request, shouldContinue);
         });
         return;
@@ -1252,7 +1252,7 @@ void FrameLoader::loadURL(const FrameLoadRequest& frameLoadRequest, const String
 
     // must grab this now, since this load may stop the previous load and clear this flag
     bool isRedirect = m_quickRedirectComing;
-    loadWithNavigationAction(request, action, lockHistory, newLoadType, formState.release(), allowNavigationToInvalidURL);
+    loadWithNavigationAction(request, action, lockHistory, newLoadType, WTFMove(formState), allowNavigationToInvalidURL);
     if (isRedirect) {
         m_quickRedirectComing = false;
         if (m_provisionalDocumentLoader)
@@ -2698,11 +2698,11 @@ void FrameLoader::loadPostRequest(const FrameLoadRequest& request, const String&
     if (!frameName.isEmpty()) {
         // The search for a target frame is done earlier in the case of form submission.
         if (Frame* targetFrame = formState ? 0 : findFrameForNavigation(frameName)) {
-            targetFrame->loader().loadWithNavigationAction(workingResourceRequest, action, lockHistory, loadType, formState.release(), allowNavigationToInvalidURL);
+            targetFrame->loader().loadWithNavigationAction(workingResourceRequest, action, lockHistory, loadType, WTFMove(formState), allowNavigationToInvalidURL);
             return;
         }
 
-        policyChecker().checkNewWindowPolicy(action, workingResourceRequest, formState.release(), frameName, [this, allowNavigationToInvalidURL, openerPolicy](const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
+        policyChecker().checkNewWindowPolicy(action, workingResourceRequest, WTFMove(formState), frameName, [this, allowNavigationToInvalidURL, openerPolicy](const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
             continueLoadAfterNewWindowPolicy(request, formState, frameName, action, shouldContinue, allowNavigationToInvalidURL, openerPolicy);
         });
         return;
@@ -2710,7 +2710,7 @@ void FrameLoader::loadPostRequest(const FrameLoadRequest& request, const String&
 
     // must grab this now, since this load may stop the previous load and clear this flag
     bool isRedirect = m_quickRedirectComing;
-    loadWithNavigationAction(workingResourceRequest, action, lockHistory, loadType, formState.release(), allowNavigationToInvalidURL);
+    loadWithNavigationAction(workingResourceRequest, action, lockHistory, loadType, WTFMove(formState), allowNavigationToInvalidURL);
     if (isRedirect) {
         m_quickRedirectComing = false;
         if (m_provisionalDocumentLoader)
index 09a86b7..fe0c722 100644 (file)
@@ -168,7 +168,7 @@ void ProgressTracker::finalProgressComplete()
 {
     LOG(Progress, "Final progress complete (%p)", this);
     
-    RefPtr<Frame> frame = m_originatingProgressFrame.release();
+    auto frame = WTFMove(m_originatingProgressFrame);
     
     // Before resetting progress value be sure to send client a least one notification
     // with final progress value.
index 594cce6..37ac75d 100644 (file)
@@ -369,7 +369,7 @@ void ApplicationCacheGroup::disassociateDocumentLoader(DocumentLoader* loader)
 
     // Release our reference to the newest cache. This could cause us to be deleted.
     // Any ongoing updates will be stopped from destructor.
-    m_newestCache.release();
+    m_newestCache = nullptr;
 }
 
 void ApplicationCacheGroup::cacheDestroyed(ApplicationCache* cache)
@@ -594,7 +594,7 @@ void ApplicationCacheGroup::didFinishLoading(ResourceHandle* handle, double fini
     
     ASSERT(m_cacheBeingUpdated);
 
-    m_cacheBeingUpdated->addResource(m_currentResource.release());
+    m_cacheBeingUpdated->addResource(WTFMove(m_currentResource));
     m_currentHandle = nullptr;
 
     // While downloading check to see if we have exceeded the available quota.
@@ -868,7 +868,7 @@ void ApplicationCacheGroup::checkIfLoadIsComplete()
 
         ASSERT(m_cacheBeingUpdated);
         if (m_manifestResource)
-            m_cacheBeingUpdated->setManifestResource(m_manifestResource.release());
+            m_cacheBeingUpdated->setManifestResource(WTFMove(m_manifestResource));
         else {
             // We can get here as a result of retrying the Complete step, following
             // a failure of the cache storage to save the newest cache due to hitting
@@ -888,7 +888,7 @@ void ApplicationCacheGroup::checkIfLoadIsComplete()
             didReachOriginQuota(totalSpaceNeeded);
 
         ApplicationCacheStorage::FailureReason failureReason;
-        setNewestCache(m_cacheBeingUpdated.release());
+        setNewestCache(WTFMove(m_cacheBeingUpdated));
         if (m_storage->storeNewestCache(this, oldNewestCache.get(), failureReason)) {
             // New cache stored, now remove the old cache.
             if (oldNewestCache)
@@ -919,10 +919,10 @@ void ApplicationCacheGroup::checkIfLoadIsComplete()
                 // save the new cache.
 
                 // Save a reference to the new cache.
-                m_cacheBeingUpdated = m_newestCache.release();
+                m_cacheBeingUpdated = WTFMove(m_newestCache);
                 if (oldNewestCache) {
                     // Reinstate the oldNewestCache.
-                    setNewestCache(oldNewestCache.release());
+                    setNewestCache(WTFMove(oldNewestCache));
                 }
                 scheduleReachedMaxAppCacheSizeCallback();
                 return;
@@ -945,7 +945,7 @@ void ApplicationCacheGroup::checkIfLoadIsComplete()
             // Reinstate the oldNewestCache, if there was one.
             if (oldNewestCache) {
                 // This will discard the failed new cache.
-                setNewestCache(oldNewestCache.release());
+                setNewestCache(WTFMove(oldNewestCache));
             } else {
                 // We must have been deleted by the last call to disassociateDocumentLoader().
                 return;
index 504da7f..0dda564 100644 (file)
@@ -121,14 +121,14 @@ ApplicationCacheGroup* ApplicationCacheStorage::loadCacheGroup(const URL& manife
     
     unsigned newestCacheStorageID = static_cast<unsigned>(statement.getColumnInt64(2));
 
-    RefPtr<ApplicationCache> cache = loadCache(newestCacheStorageID);
+    auto cache = loadCache(newestCacheStorageID);
     if (!cache)
         return nullptr;
         
     ApplicationCacheGroup* group = new ApplicationCacheGroup(*this, manifestURL);
       
     group->setStorageID(static_cast<unsigned>(statement.getColumnInt64(0)));
-    group->setNewestCache(cache.release());
+    group->setNewestCache(WTFMove(cache));
 
     return group;
 }    
@@ -239,7 +239,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::cacheGroupForURL(const URL& url)
         // We found a cache group that matches. Now check if the newest cache has a resource with
         // a matching URL.
         unsigned newestCacheID = static_cast<unsigned>(statement.getColumnInt64(2));
-        RefPtr<ApplicationCache> cache = loadCache(newestCacheID);
+        auto cache = loadCache(newestCacheID);
         if (!cache)
             continue;
 
@@ -252,7 +252,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::cacheGroupForURL(const URL& url)
         ApplicationCacheGroup* group = new ApplicationCacheGroup(*this, manifestURL);
         
         group->setStorageID(static_cast<unsigned>(statement.getColumnInt64(0)));
-        group->setNewestCache(cache.release());
+        group->setNewestCache(WTFMove(cache));
         
         m_cachesInMemory.set(group->manifestURL(), group);
         
@@ -309,7 +309,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::fallbackCacheGroupForURL(const U
         // We found a cache group that matches. Now check if the newest cache has a resource with
         // a matching fallback namespace.
         unsigned newestCacheID = static_cast<unsigned>(statement.getColumnInt64(2));
-        RefPtr<ApplicationCache> cache = loadCache(newestCacheID);
+        auto cache = loadCache(newestCacheID);
 
         URL fallbackURL;
         if (cache->isURLInOnlineWhitelist(url))
@@ -322,7 +322,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::fallbackCacheGroupForURL(const U
         ApplicationCacheGroup* group = new ApplicationCacheGroup(*this, manifestURL);
         
         group->setStorageID(static_cast<unsigned>(statement.getColumnInt64(0)));
-        group->setNewestCache(cache.release());
+        group->setNewestCache(WTFMove(cache));
         
         m_cachesInMemory.set(group->manifestURL(), group);
         
@@ -1119,7 +1119,7 @@ PassRefPtr<ApplicationCache> ApplicationCacheStorage::loadCache(unsigned storage
     
     cacheStatement.bindInt64(1, storageID);
 
-    RefPtr<ApplicationCache> cache = ApplicationCache::create();
+    auto cache = ApplicationCache::create();
 
     String flatFileDirectory = pathByAppendingComponent(m_cacheDirectory, m_flatFileSubdirectoryName);
 
@@ -1134,7 +1134,7 @@ PassRefPtr<ApplicationCache> ApplicationCacheStorage::loadCache(unsigned storage
         Vector<char> blob;
         cacheStatement.getColumnBlobAsVector(6, blob);
         
-        RefPtr<SharedBuffer> data = SharedBuffer::adoptVector(blob);
+        auto data = SharedBuffer::adoptVector(blob);
         
         String path = cacheStatement.getColumnText(7);
         long long size = 0;
@@ -1154,12 +1154,12 @@ PassRefPtr<ApplicationCache> ApplicationCacheStorage::loadCache(unsigned storage
         String headers = cacheStatement.getColumnText(5);
         parseHeaders(headers, response);
         
-        RefPtr<ApplicationCacheResource> resource = ApplicationCacheResource::create(url, response, type, data.release(), path);
+        auto resource = ApplicationCacheResource::create(url, response, type, WTFMove(data), path);
 
         if (type & ApplicationCacheResource::Manifest)
-            cache->setManifestResource(resource.release());
+            cache->setManifestResource(WTFMove(resource));
         else
-            cache->addResource(resource.release());
+            cache->addResource(WTFMove(resource));
     }
 
     if (result != SQLITE_DONE)
@@ -1217,7 +1217,7 @@ PassRefPtr<ApplicationCache> ApplicationCacheStorage::loadCache(unsigned storage
     
     cache->setStorageID(storageID);
 
-    return cache.release();
+    return WTFMove(cache);
 }    
     
 void ApplicationCacheStorage::remove(ApplicationCache* cache)
index 7eee783..98f6c1e 100644 (file)
@@ -76,9 +76,9 @@ ArchiveResource* ArchiveResourceCollection::archiveResourceForURL(const URL& url
 
 PassRefPtr<Archive> ArchiveResourceCollection::popSubframeArchive(const String& frameName, const URL& url)
 {
-    RefPtr<Archive> archive = m_subframes.take(frameName);
+    auto archive = m_subframes.take(frameName);
     if (archive)
-        return archive.release();
+        return WTFMove(archive);
 
     return m_subframes.take(url.string());
 }
index 6f5fefe..e049063 100644 (file)
@@ -334,8 +334,8 @@ bool LegacyWebArchive::extract(CFDictionaryRef dictionary)
                 return false;
             }
             
-            if (RefPtr<ArchiveResource> subresource = createResource(subresourceDict))
-                addSubresource(subresource.release());
+            if (auto subresource = createResource(subresourceDict))
+                addSubresource(WTFMove(subresource));
         }
     }
     
@@ -354,9 +354,9 @@ bool LegacyWebArchive::extract(CFDictionaryRef dictionary)
                 return false;
             }
             
-            RefPtr<LegacyWebArchive> subframeArchive = create();
+            auto subframeArchive = create();
             if (subframeArchive->extract(subframeDict))
-                addSubframeArchive(subframeArchive.release());
+                addSubframeArchive(WTFMove(subframeArchive));
             else
                 LOG(Archives, "LegacyWebArchive - Invalid subframe archive skipped");
         }
@@ -547,8 +547,8 @@ RefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString, Fr
         const String& iconURL = iconDatabase().synchronousIconURLForPageURL(responseURL);
         if (!iconURL.isEmpty() && iconDatabase().synchronousIconDataKnownForIconURL(iconURL)) {
             if (Image* iconImage = iconDatabase().synchronousIconForPageURL(responseURL, IntSize(16, 16))) {
-                if (RefPtr<ArchiveResource> resource = ArchiveResource::create(iconImage->data(), URL(ParsedURLString, iconURL), "image/x-icon", "", ""))
-                    subresources.append(resource.release());
+                if (auto resource = ArchiveResource::create(iconImage->data(), URL(ParsedURLString, iconURL), "image/x-icon", "", ""))
+                    subresources.append(WTFMove(resource));
             }
         }
     }
@@ -582,9 +582,9 @@ RefPtr<LegacyWebArchive> LegacyWebArchive::createFromSelection(Frame* frame)
     // Wrap the frameset document in an iframe so it can be pasted into
     // another document (which will have a body or frameset of its own). 
     String iframeMarkup = "<iframe frameborder=\"no\" marginwidth=\"0\" marginheight=\"0\" width=\"98%%\" height=\"98%%\" src=\"" + frame->loader().documentLoader()->response().url().string() + "\"></iframe>";
-    RefPtr<ArchiveResource> iframeResource = ArchiveResource::create(utf8Buffer(iframeMarkup), blankURL(), "text/html", "UTF-8", String());
+    auto iframeResource = ArchiveResource::create(utf8Buffer(iframeMarkup), blankURL(), "text/html", "UTF-8", String());
 
-    return create(iframeResource.release(), Vector<RefPtr<ArchiveResource>>(), Vector<RefPtr<LegacyWebArchive>> { archive });
+    return create(WTFMove(iframeResource), Vector<RefPtr<ArchiveResource>>(), Vector<RefPtr<LegacyWebArchive>> { archive });
 }
 
 }
index 059f35e..272b944 100644 (file)
@@ -334,9 +334,9 @@ inline void CachedImage::createImage()
         m_image = PDFDocumentImage::create(this);
 #endif
     else if (m_response.mimeType() == "image/svg+xml") {
-        RefPtr<SVGImage> svgImage = SVGImage::create(*this, url());
-        m_svgImageCache = std::make_unique<SVGImageCache>(svgImage.get());
-        m_image = svgImage.release();
+        auto svgImage = SVGImage::create(*this, url());
+        m_svgImageCache = std::make_unique<SVGImageCache>(svgImage.ptr());
+        m_image = WTFMove(svgImage);
     } else {
         m_image = BitmapImage::create(this);
         downcast<BitmapImage>(*m_image).setAllowSubsampling(m_loader && m_loader->frameLoader()->frame().settings().imageSubsamplingEnabled());
index e1eda5c..ee437e8 100644 (file)
@@ -558,7 +558,7 @@ void IconDatabase::setIconDataForIconURL(PassRefPtr<SharedBuffer> dataOriginal,
             icon = getOrCreateIconRecord(iconURL);
     
         // Update the data and set the time stamp
-        icon->setImageData(data.release());
+        icon->setImageData(WTFMove(data));
         icon->setTimestamp((int)currentTime());
         
         // Copy the current retaining pageURLs - if any - to notify them of the change
@@ -893,10 +893,10 @@ PassRefPtr<IconRecord> IconDatabase::getOrCreateIconRecord(const String& iconURL
     if (IconRecord* icon = m_iconURLToRecordMap.get(iconURL))
         return icon;
 
-    RefPtr<IconRecord> newIcon = IconRecord::create(iconURL);
-    m_iconURLToRecordMap.set(iconURL, newIcon.get());
+    auto newIcon = IconRecord::create(iconURL);
+    m_iconURLToRecordMap.set(iconURL, newIcon.ptr());
 
-    return newIcon.release();
+    return WTFMove(newIcon);
 }
 
 // This method retrieves the existing PageURLRecord, or creates a new one and marks it as "interested in the import" for later notification
@@ -1493,7 +1493,7 @@ bool IconDatabase::readFromDatabase()
     
     for (unsigned i = 0; i < icons.size(); ++i) {
         didAnyWork = true;
-        RefPtr<SharedBuffer> imageData = getImageDataForIconURLFromSQLDatabase(icons[i]->iconURL());
+        auto imageData = getImageDataForIconURLFromSQLDatabase(icons[i]->iconURL());
 
         // Verify this icon still wants to be read from disk
         {
@@ -1503,7 +1503,7 @@ bool IconDatabase::readFromDatabase()
                 
                 if (m_iconsPendingReading.contains(icons[i])) {
                     // Set the new data
-                    icons[i]->setImageData(imageData.release());
+                    icons[i]->setImageData(WTFMove(imageData));
                     
                     // Remove this icon from the set that needs to be read
                     m_iconsPendingReading.remove(icons[i]);
@@ -1936,7 +1936,7 @@ PassRefPtr<SharedBuffer> IconDatabase::getImageDataForIconURLFromSQLDatabase(con
 
     m_getImageDataForIconURLStatement->reset();
     
-    return imageData.release();
+    return WTFMove(imageData);
 }
 
 void IconDatabase::removeIconFromSQLDatabase(const String& iconURL)
index 119bd46..ea9ad42 100644 (file)
@@ -812,13 +812,13 @@ Storage* DOMWindow::sessionStorage(ExceptionCode& ec) const
     if (!page)
         return 0;
 
-    RefPtr<StorageArea> storageArea = page->sessionStorage()->storageArea(document->securityOrigin());
+    auto storageArea = page->sessionStorage()->storageArea(document->securityOrigin());
     if (!storageArea->canAccessStorage(m_frame)) {
         ec = SECURITY_ERR;
         return 0;
     }
 
-    m_sessionStorage = Storage::create(m_frame, storageArea.release());
+    m_sessionStorage = Storage::create(m_frame, WTFMove(storageArea));
     return m_sessionStorage.get();
 }
 
@@ -858,14 +858,14 @@ Storage* DOMWindow::localStorage(ExceptionCode& ec) const
     if (!page->settings().localStorageEnabled())
         return nullptr;
 
-    RefPtr<StorageArea> storageArea = page->storageNamespaceProvider().localStorageArea(*document);
+    auto storageArea = page->storageNamespaceProvider().localStorageArea(*document);
 
     if (!storageArea->canAccessStorage(m_frame)) {
         ec = SECURITY_ERR;
         return nullptr;
     }
 
-    m_localStorage = Storage::create(m_frame, storageArea.release());
+    m_localStorage = Storage::create(m_frame, WTFMove(storageArea));
     return m_localStorage.get();
 }
 
index 2115531..efdeed1 100644 (file)
@@ -2278,7 +2278,7 @@ bool EventHandler::updateDragAndDrop(const PlatformMouseEvent& event, DataTransf
             m_shouldOnlyFireDragOverEvent = false;
         }
     }
-    m_dragTarget = newTarget.release();
+    m_dragTarget = WTFMove(newTarget);
     return accept;
 }
 
index ed19b61..2f7b1ad 100644 (file)
@@ -168,9 +168,9 @@ void CompositeAnimation::updateTransitions(RenderElement* renderer, const Render
                 // <https://bugs.webkit.org/show_bug.cgi?id=24787>
                 if (!equal && isActiveTransition) {
                     // Add the new transition
-                    RefPtr<ImplicitAnimation> implicitAnimation = ImplicitAnimation::create(animation, prop, renderer, this, modifiedCurrentStyle ? modifiedCurrentStyle.get() : fromStyle);
-                    LOG(Animations, "Created ImplicitAnimation %p on renderer %p for property %s duration %.2f delay %.2f", implicitAnimation.get(), renderer, getPropertyName(prop), animation.duration(), animation.delay());
-                    m_transitions.set(prop, implicitAnimation.release());
+                    auto implicitAnimation = ImplicitAnimation::create(animation, prop, renderer, this, modifiedCurrentStyle ? modifiedCurrentStyle.get() : fromStyle);
+                    LOG(Animations, "Created ImplicitAnimation %p on renderer %p for property %s duration %.2f delay %.2f", implicitAnimation.ptr(), renderer, getPropertyName(prop), animation.duration(), animation.delay());
+                    m_transitions.set(prop, WTFMove(implicitAnimation));
                 }
                 
                 // We only need one pass for the single prop case
index 99c76ab..e98fc74 100644 (file)
@@ -628,7 +628,7 @@ void ContentSecurityPolicy::reportViolation(const String& effectiveViolatedDirec
     // sent explicitly. As for which directive was violated, that's pretty
     // harmless information.
 
-    RefPtr<InspectorObject> cspReport = InspectorObject::create();
+    auto cspReport = InspectorObject::create();
     cspReport->setString(ASCIILiteral("document-uri"), documentURI);
     cspReport->setString(ASCIILiteral("referrer"), referrer);
     cspReport->setString(ASCIILiteral("violated-directive"), violatedDirectiveText);
@@ -643,7 +643,7 @@ void ContentSecurityPolicy::reportViolation(const String& effectiveViolatedDirec
     }
 
     RefPtr<InspectorObject> reportObject = InspectorObject::create();
-    reportObject->setObject(ASCIILiteral("csp-report"), cspReport.release());
+    reportObject->setObject(ASCIILiteral("csp-report"), WTFMove(cspReport));
 
     RefPtr<FormData> report = FormData::create(reportObject->toJSONString().utf8());
     for (const auto& url : reportURIs)
index 2f871ba..9a815b5 100644 (file)
@@ -620,9 +620,9 @@ void ServicesOverlayController::createOverlayIfNeeded()
     if (!m_mainFrame.settings().serviceControlsEnabled())
         return;
 
-    RefPtr<PageOverlay> overlay = PageOverlay::create(*this, PageOverlay::OverlayType::Document);
-    m_servicesOverlay = overlay.get();
-    m_mainFrame.pageOverlayController().installPageOverlay(overlay.release(), PageOverlay::FadeMode::DoNotFade);
+    auto overlay = PageOverlay::create(*this, PageOverlay::OverlayType::Document);
+    m_servicesOverlay = overlay.ptr();
+    m_mainFrame.pageOverlayController().installPageOverlay(WTFMove(overlay), PageOverlay::FadeMode::DoNotFade);
 }
 
 Vector<RefPtr<Range>> ServicesOverlayController::telephoneNumberRangesForFocusedFrame()
@@ -739,7 +739,7 @@ void ServicesOverlayController::determineActiveHighlight(bool& mouseIsOverActive
             return;
         }
 
-        m_activeHighlight = m_nextActiveHighlight.release();
+        m_activeHighlight = WTFMove(m_nextActiveHighlight);
 
         if (m_activeHighlight) {
             m_servicesOverlay->layer().addChild(m_activeHighlight->layer());
index d0968bb..63162ca 100644 (file)
@@ -73,7 +73,7 @@ protected:
 
     ScrollingStateTree* scrollingStateTree() { return m_scrollingStateTree.get(); }
 
-    PassRefPtr<ScrollingTree> releaseScrollingTree() { return m_scrollingTree.release(); }
+    PassRefPtr<ScrollingTree> releaseScrollingTree() { return WTFMove(m_scrollingTree); }
 
     void updateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, bool programmaticScroll, SetOrSyncScrollingLayerPosition);
 
index dfd5285..89aeca0 100644 (file)
@@ -74,13 +74,13 @@ void ScrollingStateNode::setPropertyChanged(unsigned propertyBit)
 
 PassRefPtr<ScrollingStateNode> ScrollingStateNode::cloneAndReset(ScrollingStateTree& adoptiveTree)
 {
-    RefPtr<ScrollingStateNode> clone = this->clone(adoptiveTree);
+    auto clone = this->clone(adoptiveTree);
 
     // Now that this node is cloned, reset our change properties.
     resetChangedProperties();
 
-    cloneAndResetChildren(*clone, adoptiveTree);
-    return clone.release();
+    cloneAndResetChildren(clone.get(), adoptiveTree);
+    return WTFMove(clone);
 }
 
 void ScrollingStateNode::cloneAndResetChildren(ScrollingStateNode& clone, ScrollingStateTree& adoptiveTree)
index 3bec436..11cec5f 100644 (file)
@@ -115,16 +115,16 @@ ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol
             return 0;
 
         if (nodeType == FrameScrollingNode && parentID) {
-            if (RefPtr<ScrollingStateNode> orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
+            if (auto orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
                 newNode = orphanedNode.get();
-                parent->appendChild(orphanedNode.release());
+                parent->appendChild(WTFMove(orphanedNode));
             }
         }
 
         if (!newNode) {
-            RefPtr<ScrollingStateNode> stateNode = createNode(nodeType, newNodeID);
+            auto stateNode = createNode(nodeType, newNodeID);
             newNode = stateNode.get();
-            parent->appendChild(stateNode.release());
+            parent->appendChild(WTFMove(stateNode));
         }
     }
 
index ea33efc..f65cde3 100644 (file)
@@ -74,12 +74,12 @@ static AudioBus* getConcatenatedImpulseResponsesForSubject(const String& subject
     AudioBus* bus;
     AudioBusMap::iterator iterator = audioBusMap.get().find(subjectName);
     if (iterator == audioBusMap.get().end()) {
-        RefPtr<AudioBus> concatenatedImpulseResponses = AudioBus::loadPlatformResource(subjectName.utf8().data(), ResponseSampleRate);
+        auto concatenatedImpulseResponses = AudioBus::loadPlatformResource(subjectName.utf8().data(), ResponseSampleRate);
         ASSERT(concatenatedImpulseResponses);
         if (!concatenatedImpulseResponses)
             return 0;
 
-        bus = concatenatedImpulseResponses.release().leakRef();
+        bus = concatenatedImpulseResponses.leakRef();
         audioBusMap.get().set(subjectName, bus);
     } else
         bus = iterator->value;
index 9782d28..f08aebe 100644 (file)
@@ -54,13 +54,13 @@ DisplayRefreshMonitor* DisplayRefreshMonitorManager::createMonitorForClient(Disp
         return monitor.get();
     }
 
-    RefPtr<DisplayRefreshMonitor> monitor = DisplayRefreshMonitor::create(client);
+    auto monitor = DisplayRefreshMonitor::create(client);
     if (!monitor)
         return nullptr;
 
     monitor->addClient(client);
     DisplayRefreshMonitor* result = monitor.get();
-    m_monitors.append(monitor.release());
+    m_monitors.append(WTFMove(monitor));
     return result;
 }
 
index c3f2326..d36ed09 100644 (file)
@@ -324,7 +324,7 @@ GlyphData FontCascadeFonts::glyphDataForSystemFallback(UChar32 c, const FontCasc
     if (!originalFont)
         originalFont = &primaryRanges.fontForFirstRange();
 
-    RefPtr<Font> systemFallbackFont = originalFont->systemFallbackFontForCharacter(c, description, m_isForPlatformFont);
+    auto systemFallbackFont = originalFont->systemFallbackFontForCharacter(c, description, m_isForPlatformFont);
     if (!systemFallbackFont)
         return GlyphData();
 
@@ -348,7 +348,7 @@ GlyphData FontCascadeFonts::glyphDataForSystemFallback(UChar32 c, const FontCasc
 
     // Keep the system fallback fonts we use alive.
     if (fallbackGlyphData.glyph)
-        m_systemFallbackFontSet.add(systemFallbackFont.release());
+        m_systemFallbackFontSet.add(WTFMove(systemFallbackFont));
 
     return fallbackGlyphData;
 }
index b9b9231..4f2fb5b 100644 (file)
@@ -405,7 +405,7 @@ void InbandTextTrackPrivateAVF::processAttributedStrings(CFArrayRef attributedSt
         
         LOG(Media, "InbandTextTrackPrivateAVF::processCue(%p) - adding cue \"%s\" for time = %.2f, end = %.2f, position =  %.2f, line =  %.2f", this, cueData->content().utf8().data(), cueData->startTime().toDouble(), cueData->endTime().toDouble(), cueData->position(), cueData->line());
 
-        client()->addGenericCue(this, cueData.release());
+        client()->addGenericCue(this, WTFMove(cueData));
     }
 
     m_pendingCueStatus = seeking() ? DeliveredDuringSeek : Valid;
index d136d87..10d2b21 100644 (file)
@@ -129,10 +129,10 @@ void MediaSelectionGroupAVFObjC::updateOptions(const Vector<String>& characteris
     AVMediaSelectionOption* selectedOption = [m_playerItem selectedMediaOptionInMediaSelectionGroup:m_mediaSelectionGroup.get()];
 
     for (AVMediaSelectionOption* addedAVOption in addedAVOptions.get()) {
-        RefPtr<MediaSelectionOptionAVFObjC> addedOption = MediaSelectionOptionAVFObjC::create(*this, addedAVOption);
+        auto addedOption = MediaSelectionOptionAVFObjC::create(*this, addedAVOption);
         if (addedAVOption == selectedOption)
             m_selectedOption = addedOption.get();
-        m_options.set(addedAVOption, addedOption.release());
+        m_options.set(addedAVOption, WTFMove(addedOption));
     }
 
     if (!m_shouldSelectOptionAutomatically)
index f8f6b25..a9d578f 100644 (file)
@@ -696,7 +696,7 @@ bool SourceBufferPrivateAVFObjC::processCodedFrame(int trackID, CMSampleBufferRe
     if (m_client) {
         RefPtr<MediaSample> mediaSample = MediaSampleAVFObjC::create(sampleBuffer, trackID);
         LOG(MediaSourceSamples, "SourceBufferPrivateAVFObjC::processCodedFrame(%p) - sample(%s)", this, toString(*mediaSample).utf8().data());
-        m_client->sourceBufferPrivateDidReceiveSample(this, mediaSample.release());
+        m_client->sourceBufferPrivateDidReceiveSample(this, WTFMove(mediaSample));
     }
 
     return true;
index 4da67f2..88373c8 100644 (file)
@@ -3815,8 +3815,8 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::fetchCloneLayers(GraphicsLayer* rep
 
         for (auto* childLayer : childLayers) {
             GraphicsLayerCA& childLayerCA = downcast<GraphicsLayerCA>(*childLayer);
-            if (RefPtr<PlatformCALayer> platformLayer = childLayerCA.fetchCloneLayers(replicaRoot, replicaState, IntermediateCloneLevel))
-                clonalSublayers.append(platformLayer.release());
+            if (auto platformLayer = childLayerCA.fetchCloneLayers(replicaRoot, replicaState, IntermediateCloneLevel))
+                clonalSublayers.append(WTFMove(platformLayer));
         }
 
         replicaState.pop();
index 4c9d715..00a2573 100644 (file)
@@ -135,13 +135,13 @@ PassRefPtr<PlatformCALayer> PlatformCALayer::createCompatibleLayerOrTakeFromPool
 
     if ((layer = layerPool().takeLayerWithSize(size))) {
         layer->setOwner(client);
-        return layer.release();
+        return WTFMove(layer);
     }
 
     layer = createCompatibleLayer(layerType, client);
     layer->setBounds(FloatRect(FloatPoint(), size));
     
-    return layer.release();
+    return WTFMove(layer);
 }
 
 void PlatformCALayer::moveToLayerPool()
index fa634c8..5f50f9c 100644 (file)
@@ -96,7 +96,7 @@ RefPtr<Uint8ClampedArray> ImageBufferData::getData(const IntRect& rect, const In
     if (area.hasOverflowed())
         return nullptr;
 
-    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(area.unsafeGet());
+    auto result = Uint8ClampedArray::createUninitialized(area.unsafeGet());
     unsigned char* resultData = result->data();
     if (!resultData) {
         WTFLogAlways("ImageBufferData: Unable to create buffer. Requested size was %d x %d = %u\n", rect.width(), rect.height(), area.unsafeGet());
@@ -139,7 +139,7 @@ RefPtr<Uint8ClampedArray> ImageBufferData::getData(const IntRect& rect, const In
     Checked<int> height = endy - originy;
     
     if (width.unsafeGet() <= 0 || height.unsafeGet() <= 0)
-        return result.release();
+        return result;
     
     unsigned destBytesPerRow = 4 * rect.width();
     unsigned char* destRows = resultData + desty * destBytesPerRow + destx * 4;
index cbe5128..5e47a40 100644 (file)
@@ -237,9 +237,9 @@ PassRefPtr<Uint8ClampedArray> FilterEffect::asUnmultipliedImage(const IntRect& r
     IntSize scaledSize(rect.size());
     ASSERT(!ImageBuffer::sizeNeedsClamping(scaledSize));
     scaledSize.scale(m_filter.filterScale());
-    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(scaledSize.width() * scaledSize.height() * 4);
+    auto imageData = Uint8ClampedArray::createUninitialized(scaledSize.width() * scaledSize.height() * 4);
     copyUnmultipliedImage(imageData.get(), rect);
-    return imageData.release();
+    return WTFMove(imageData);
 }
 
 PassRefPtr<Uint8ClampedArray> FilterEffect::asPremultipliedImage(const IntRect& rect)
@@ -247,9 +247,9 @@ PassRefPtr<Uint8ClampedArray> FilterEffect::asPremultipliedImage(const IntRect&
     IntSize scaledSize(rect.size());
     ASSERT(!ImageBuffer::sizeNeedsClamping(scaledSize));
     scaledSize.scale(m_filter.filterScale());
-    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(scaledSize.width() * scaledSize.height() * 4);
+    auto imageData = Uint8ClampedArray::createUninitialized(scaledSize.width() * scaledSize.height() * 4);
     copyPremultipliedImage(imageData.get(), rect);
-    return imageData.release();
+    return WTFMove(imageData);
 }
 
 inline void FilterEffect::copyImageBytes(Uint8ClampedArray* source, Uint8ClampedArray* destination, const IntRect& rect)
index fa011aa..01eb6dd 100644 (file)
@@ -68,9 +68,9 @@ PassRefPtr<Image> Image::loadPlatformResource(const char *name)
     NSString *imagePath = [bundle pathForResource:[NSString stringWithUTF8String:name] ofType:@"png"];
     NSData *namedImageData = [NSData dataWithContentsOfFile:imagePath];
     if (namedImageData) {
-        RefPtr<Image> image = BitmapImage::create();
+        auto image = BitmapImage::create();
         image->setData(SharedBuffer::wrapNSData(namedImageData), true);
-        return image.release();
+        return WTFMove(image);
     }
 
     // We have reports indicating resource loads are failing, but we don't yet know the root cause(s).
index 0489536..a48592a 100644 (file)
@@ -132,8 +132,10 @@ static uint64_t nameHashForShader(const char* name, size_t length)
 
 PassRefPtr<GraphicsContext3D> GraphicsContext3D::createForCurrentGLContext()
 {
-    RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(Attributes(), 0, GraphicsContext3D::RenderToCurrentGLContext));
-    return context->m_private ? context.release() : 0;
+    auto context = adoptRef(*new GraphicsContext3D(Attributes(), 0, GraphicsContext3D::RenderToCurrentGLContext));
+    if (!context->m_private)
+        return nullptr;
+    return WTFMove(context);
 }
 
 void GraphicsContext3D::validateDepthStencil(const char* packedDepthStencilExtension)
@@ -205,7 +207,7 @@ PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData()
     if (m_attrs.premultipliedAlpha)
         return 0;
 
-    RefPtr<ImageData> imageData = ImageData::create(IntSize(m_currentWidth, m_currentHeight));
+    auto imageData = ImageData::create(IntSize(m_currentWidth, m_currentHeight));
     unsigned char* pixels = imageData->data()->data();
     int totalBytes = 4 * m_currentWidth * m_currentHeight;
 
@@ -215,7 +217,7 @@ PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData()
     for (int i = 0; i < totalBytes; i += 4)
         std::swap(pixels[i], pixels[i + 2]);
 
-    return imageData.release();
+    return WTFMove(imageData);
 }
 
 void GraphicsContext3D::prepareTexture()
index dea7a7c..9a1b2d6 100644 (file)
@@ -116,10 +116,10 @@ void RealtimeMediaSourceCenterMac::createMediaStream(PassRefPtr<MediaStreamCreat
         }
         // FIXME: Consider the constraints when choosing among multiple devices. For now just select the first available
         // device of the appropriate type.
-        RefPtr<RealtimeMediaSource> audioSource = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Audio, audioConstraints.get()).at(0);
+        auto audioSource = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Audio, audioConstraints.get()).at(0);
         ASSERT(audioSource);
         
-        audioSources.append(audioSource.release());
+        audioSources.append(WTFMove(audioSource));
     }
     
     if (videoConstraints) {
@@ -131,10 +131,10 @@ void RealtimeMediaSourceCenterMac::createMediaStream(PassRefPtr<MediaStreamCreat
         }
         // FIXME: Consider the constraints when choosing among multiple devices. For now just select the first available
         // device of the appropriate type.
-        RefPtr<RealtimeMediaSource> videoSource = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Video, videoConstraints.get()).at(0);
+        auto videoSource = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Video, videoConstraints.get()).at(0);
         ASSERT(videoSource);
         
-        videoSources.append(videoSource.release());
+        videoSources.append(WTFMove(videoSource));
     }
     
     client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
@@ -147,14 +147,14 @@ void RealtimeMediaSourceCenterMac::createMediaStream(MediaStreamCreationClient*
     Vector<RefPtr<RealtimeMediaSource>> videoSources;
 
     if (!audioDeviceID.isEmpty()) {
-        RefPtr<RealtimeMediaSource> audioSource = AVCaptureDeviceManager::singleton().sourceWithUID(audioDeviceID, RealtimeMediaSource::Audio, nullptr);
+        auto audioSource = AVCaptureDeviceManager::singleton().sourceWithUID(audioDeviceID, RealtimeMediaSource::Audio, nullptr);
         if (audioSource)
-            audioSources.append(audioSource.release());
+            audioSources.append(WTFMove(audioSource));
     }
     if (!videoDeviceID.isEmpty()) {
-        RefPtr<RealtimeMediaSource> videoSource = AVCaptureDeviceManager::singleton().sourceWithUID(videoDeviceID, RealtimeMediaSource::Video, nullptr);
+        auto videoSource = AVCaptureDeviceManager::singleton().sourceWithUID(videoDeviceID, RealtimeMediaSource::Video, nullptr);
         if (videoSource)
-            videoSources.append(videoSource.release());
+            videoSources.append(WTFMove(videoSource));
     }
 
     client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
index aae8083..8cc6f0f 100644 (file)
@@ -81,8 +81,8 @@ void MockRealtimeMediaSourceCenter::validateRequestConstraints(MediaStreamCreati
             return;
         }
 
-        RefPtr<RealtimeMediaSource> audioSource = MockRealtimeAudioSource::create();
-        audioSources.append(audioSource.release());
+        auto audioSource = MockRealtimeAudioSource::create();
+        audioSources.append(WTFMove(audioSource));
     }
 
     if (videoConstraints) {
@@ -92,8 +92,8 @@ void MockRealtimeMediaSourceCenter::validateRequestConstraints(MediaStreamCreati
             return;
         }
 
-        RefPtr<RealtimeMediaSource> videoSource = MockRealtimeVideoSource::create();
-        videoSources.append(videoSource.release());
+        auto videoSource = MockRealtimeVideoSource::create();
+        videoSources.append(WTFMove(videoSource));
     }
 
     client->constraintsValidated(audioSources, videoSources);
@@ -115,8 +115,8 @@ void MockRealtimeMediaSourceCenter::createMediaStream(PassRefPtr<MediaStreamCrea
             return;
         }
 
-        RefPtr<RealtimeMediaSource> audioSource = MockRealtimeAudioSource::create();
-        audioSources.append(audioSource.release());
+        auto audioSource = MockRealtimeAudioSource::create();
+        audioSources.append(WTFMove(audioSource));
     }
 
     if (videoConstraints) {
@@ -126,8 +126,8 @@ void MockRealtimeMediaSourceCenter::createMediaStream(PassRefPtr<MediaStreamCrea
             return;
         }
 
-        RefPtr<RealtimeMediaSource> videoSource = MockRealtimeVideoSource::create();
-        videoSources.append(videoSource.release());
+        auto videoSource = MockRealtimeVideoSource::create();
+        videoSources.append(WTFMove(videoSource));
     }
     
     client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
@@ -140,12 +140,12 @@ void MockRealtimeMediaSourceCenter::createMediaStream(MediaStreamCreationClient*
     Vector<RefPtr<RealtimeMediaSource>> videoSources;
 
     if (!audioDeviceID.isEmpty() && audioDeviceID == MockRealtimeMediaSource::mockAudioSourcePersistentID()) {
-        RefPtr<RealtimeMediaSource> audioSource = MockRealtimeAudioSource::create();
-        audioSources.append(audioSource.release());
+        auto audioSource = MockRealtimeAudioSource::create();
+        audioSources.append(WTFMove(audioSource));
     }
     if (!videoDeviceID.isEmpty() && videoDeviceID == MockRealtimeMediaSource::mockVideoSourcePersistentID()) {
-        RefPtr<RealtimeMediaSource> videoSource = MockRealtimeVideoSource::create();
-        videoSources.append(videoSource.release());
+        auto videoSource = MockRealtimeVideoSource::create();
+        videoSources.append(WTFMove(videoSource));
     }
 
     client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
index 720efc8..6806035 100644 (file)
@@ -125,7 +125,7 @@ void BlobRegistryImpl::registerBlobURL(const URL& url, Vector<BlobPart> blobPart
     ASSERT(isMainThread());
     registerBlobResourceHandleConstructor();
 
-    RefPtr<BlobData> blobData = BlobData::create(contentType);
+    auto blobData = BlobData::create(contentType);
 
     // The blob data is stored in the "canonical" way. That is, it only contains a list of Data and File items.
     // 1) The Data item is denoted by the raw data and the range.
@@ -151,7 +151,7 @@ void BlobRegistryImpl::registerBlobURL(const URL& url, Vector<BlobPart> blobPart
         }
     }
 
-    m_blobs.set(url.string(), blobData.release());
+    m_blobs.set(url.string(), WTFMove(blobData));
 }
 
 void BlobRegistryImpl::registerBlobURL(const URL& url, const URL& srcURL)
@@ -208,11 +208,11 @@ void BlobRegistryImpl::registerBlobURLForSlice(const URL& url, const URL& srcURL
         end = originalSize;
 
     unsigned long long newLength = end - start;
-    RefPtr<BlobData> newData = BlobData::create(originalData->contentType());
+    auto newData = BlobData::create(originalData->contentType());
 
-    appendStorageItems(newData.get(), originalData->items(), start, newLength);
+    appendStorageItems(newData.ptr(), originalData->items(), start, newLength);
 
-    m_blobs.set(url.string(), newData.release());
+    m_blobs.set(url.string(), WTFMove(newData));
 }
 
 void BlobRegistryImpl::unregisterBlobURL(const URL& url)
index bce6ba9..b6c67b7 100644 (file)
@@ -93,13 +93,13 @@ RefPtr<ResourceHandle> ResourceHandle::create(NetworkingContext* context, const
     if (protocolMapItem != builtinResourceHandleConstructorMap().end())
         return protocolMapItem->value(request, client);
 
-    RefPtr<ResourceHandle> newHandle(adoptRef(new ResourceHandle(context, request, client, defersLoading, shouldContentSniff)));
+    auto newHandle = adoptRef(*new ResourceHandle(context, request, client, defersLoading, shouldContentSniff));
 
     if (newHandle->d->m_scheduledFailureType != NoFailure)
-        return newHandle.release();
+        return WTFMove(newHandle);
 
     if (newHandle->start())
-        return newHandle.release();
+        return WTFMove(newHandle);
 
     return nullptr;
 }
index 486133c..40ebf4d 100644 (file)
@@ -200,7 +200,7 @@ static void* formCreate(CFReadStreamRef stream, void* context)
     FormCreationContext* formContext = static_cast<FormCreationContext*>(context);
 
     FormStreamFields* newInfo = new FormStreamFields;
-    newInfo->formData = formContext->formData.release();
+    newInfo->formData = WTFMove(formContext->formData);
     newInfo->currentStream = 0;
     newInfo->currentStreamRangeLength = BlobDataItem::toEndOfFile;
     newInfo->formStream = stream; // Don't retain. That would create a reference cycle.
index e7e6ecf..977dbfd 100644 (file)
@@ -92,7 +92,7 @@ PassRefPtr<BidiContext> BidiContext::copyStackRemovingUnicodeEmbeddingContexts()
     for (int i = contexts.size() - 1; i > 0; --i)
         topContext = copyContextAndRebaselineLevel(contexts[i - 1], topContext.get());
 
-    return topContext.release();
+    return WTFMove(topContext);
 }
 
 bool operator==(const BidiContext& c1, const BidiContext& c2)
index f47b3ba..ba511cc 100644 (file)
@@ -288,7 +288,7 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
                 effect->inputEffects().append(previousEffect);
                 m_effects.append(effect);
             }
-            previousEffect = effect.release();
+            previousEffect = WTFMove(effect);
         }
     }
 
index 6a6f116..929014c 100644 (file)
@@ -3116,7 +3116,7 @@ PassRefPtr<Scrollbar> RenderLayer::createScrollbar(ScrollbarOrientation orientat
         }
     }
     renderer().view().frameView().addChild(widget.get());
-    return widget.release();
+    return WTFMove(widget);
 }
 
 void RenderLayer::destroyScrollbar(ScrollbarOrientation orientation)
index 237c6ea..5daa6f9 100644 (file)
@@ -911,7 +911,7 @@ PassRefPtr<Scrollbar> RenderListBox::createScrollbar()
         }
     }
     view().frameView().addChild(widget.get());
-    return widget.release();
+    return WTFMove(widget);
 }
 
 void RenderListBox::destroyScrollbar()
index 4db33a0..b800949 100644 (file)
@@ -578,7 +578,7 @@ PassRefPtr<Scrollbar> RenderMenuList::createScrollbar(ScrollableArea& scrollable
         widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, &selectElement());
     else
         widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
-    return widget.release();
+    return WTFMove(widget);
 }
 
 int RenderMenuList::clientInsetLeft() const
index 3f5d03d..f5c6259 100644 (file)
@@ -354,7 +354,7 @@ PassRefPtr<Scrollbar> RenderSearchField::createScrollbar(ScrollableArea& scrolla
         widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, &inputElement());
     else
         widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
-    return widget.release();
+    return WTFMove(widget);
 }
 
 LayoutUnit RenderSearchField::computeLogicalHeightLimit() const
index 91a2951..d10501a 100644 (file)
@@ -284,7 +284,7 @@ void ReplayController::unloadSegment(bool suppressNotifications)
     LOG(WebReplay, "%-20s Clearing input cursors for page: %p\n", "ReplayController", &m_page);
 
     m_activeCursor = nullptr;
-    RefPtr<ReplaySessionSegment> unloadedSegment = m_loadedSegment.release();
+    auto unloadedSegment = WTFMove(m_loadedSegment);
     for (Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
         frame->script().globalObject(mainThreadNormalWorld())->setInputCursor(m_emptyCursor.copyRef());
         frame->document()->setInputCursor(m_emptyCursor.copyRef());
index 12fa0bb..1a20720 100644 (file)
@@ -179,7 +179,7 @@ RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filter
     if (!input1)
         return nullptr;
 
-    RefPtr<LightSource> lightSource = SVGFELightElement::findLightSource(this);
+    auto lightSource = SVGFELightElement::findLightSource(this);
     if (!lightSource)
         return nullptr;
 
@@ -190,7 +190,7 @@ RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filter
     Color color = renderer->style().svgStyle().lightingColor();
 
     RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(),
-                                                                kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
+                                                                kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource));
     effect->inputEffects().append(input1);
     return effect;
 }
index 19f5d38..63f86e1 100644 (file)
@@ -190,7 +190,7 @@ RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filte
     if (!input1)
         return nullptr;
 
-    RefPtr<LightSource> lightSource = SVGFELightElement::findLightSource(this);
+    auto lightSource = SVGFELightElement::findLightSource(this);
     if (!lightSource)
         return nullptr;
 
@@ -201,7 +201,7 @@ RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filte
     Color color = renderer->style().svgStyle().lightingColor();
 
     RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(),
-                                          specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
+                                          specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource));
     effect->inputEffects().append(input1);
     return effect;
 }
index 77788e1..5d41e96 100644 (file)
@@ -203,7 +203,7 @@ public:
             m_wrappers->at(index) = wrapper;
         }
 
-        return wrapper.release();
+        return WTFMove(wrapper);
     }
 
     // SVGList::insertItemBefore()
@@ -250,7 +250,7 @@ public:
 
         // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
         if (!processIncomingListItemWrapper(newItem, &index))
-            return newItem.release();
+            return WTFMove(newItem);
 
         // Spec: Inserts a new item into the list at the specified position. The index of the item before which the new item is to be
         // inserted. The first item is number 0. If the index is equal to 0, then the new item is inserted at the front of the list.
@@ -260,7 +260,7 @@ public:
         m_wrappers->insert(index, newItem);
 
         commitChange();
-        return newItem;
+        return WTFMove(newItem);
     }
 
     // SVGList::replaceItem()
@@ -385,7 +385,7 @@ public:
         m_values->remove(index);
 
         commitChange();
-        return oldItem.release();
+        return WTFMove(oldItem);
     }
 
     // SVGList::appendItem()
index d6882db..f6f5a4d 100644 (file)
@@ -153,7 +153,7 @@ void WorkerThread::workerThread()
 
     {
         LockHolder lock(m_threadCreationMutex);
-        m_workerGlobalScope = createWorkerGlobalScope(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_contentSecurityPolicyResponseHeaders, m_startupData->m_shouldBypassMainWorldContentSecurityPolicy, m_startupData->m_topOrigin.release());
+        m_workerGlobalScope = createWorkerGlobalScope(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_contentSecurityPolicyResponseHeaders, m_startupData->m_shouldBypassMainWorldContentSecurityPolicy, WTFMove(m_startupData->m_topOrigin));
 
         if (m_runLoop.terminated()) {
             // The worker was terminated before the thread had a chance to run. Since the context didn't exist yet,
index e5ea740..87cdfa7 100644 (file)
@@ -798,7 +798,7 @@ bool XMLHttpRequest::internalAbort()
     // Cancelling m_loader may trigger a window.onload callback which can call open() on the same xhr.
     // This would create internalAbort reentrant call.
     // m_loader is set to null before being cancelled to exit early in any reentrant internalAbort() call.
-    RefPtr<ThreadableLoader> loader = m_loader.release();
+    auto loader = WTFMove(m_loader);
     loader->cancel();
 
     // If window.onload callback calls open() and send() on the same xhr, m_loader is now set to a new value.
index 0ae3403..c557e13 100644 (file)
@@ -343,10 +343,10 @@ void Step::nodesInAxis(Node& context, NodeSet& nodes) const
 
             // Avoid lazily creating attribute nodes for attributes that we do not need anyway.
             if (m_nodeTest.m_kind == NodeTest::NameTest && m_nodeTest.m_data != starAtom) {
-                RefPtr<Attr> attr = contextElement.getAttributeNodeNS(m_nodeTest.m_namespaceURI, m_nodeTest.m_data);
+                auto attr = contextElement.getAttributeNodeNS(m_nodeTest.m_namespaceURI, m_nodeTest.m_data);
                 if (attr && attr->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) { // In XPath land, namespace nodes are not accessible on the attribute axis.
                     if (nodeMatches(*attr, AttributeAxis, m_nodeTest)) // Still need to check merged predicates.
-                        nodes.append(attr.release());
+                        nodes.append(WTFMove(attr));
                 }
                 return;
             }
@@ -355,9 +355,9 @@ void Step::nodesInAxis(Node& context, NodeSet& nodes) const
                 return;
 
             for (const Attribute& attribute : contextElement.attributesIterator()) {
-                RefPtr<Attr> attr = contextElement.ensureAttr(attribute.name());
-                if (nodeMatches(*attr, AttributeAxis, m_nodeTest))
-                    nodes.append(attr.release());
+                auto attr = contextElement.ensureAttr(attribute.name());
+                if (nodeMatches(attr.get(), AttributeAxis, m_nodeTest))
+                    nodes.append(WTFMove(attr));
             }
             return;
         }
index 6282ac0..51b8e89 100644 (file)
@@ -1,3 +1,21 @@
+2016-06-20  Keith Rollin  <krollin@apple.com>
+
+        Remove RefPtr::release() and change calls sites to use WTFMove()
+        https://bugs.webkit.org/show_bug.cgi?id=158369
+
+        Reviewed by Chris Dumez.
+
+        RefPtr::release() releases its managed pointer awkwardly. It's more
+        direct and clearer to use WTFMove to transfer ownership of the managed
+        pointer.
+
+        As part of this cleanup, also change a lot of explicit data types to
+        'auto'.
+
+        * Storage/StorageAreaImpl.cpp:
+        (WebCore::StorageAreaImpl::setItem):
+        (WebCore::StorageAreaImpl::removeItem):
+
 2016-06-13  Alex Christensen  <achristensen@webkit.org>
 
         Add WebSocketProvider stub
index 08ea167..a6550da 100644 (file)
@@ -139,9 +139,9 @@ void StorageAreaImpl::setItem(Frame* sourceFrame, const String& key, const Strin
     blockUntilImportComplete();
 
     String oldValue;
-    RefPtr<StorageMap> newMap = m_storageMap->setItem(key, value, oldValue, quotaException);
+    auto newMap = m_storageMap->setItem(key, value, oldValue, quotaException);
     if (newMap)
-        m_storageMap = newMap.release();
+        m_storageMap = WTFMove(newMap);
 
     if (quotaException)
         return;
@@ -161,9 +161,9 @@ void StorageAreaImpl::removeItem(Frame* sourceFrame, const String& key)
     blockUntilImportComplete();
 
     String oldValue;
-    RefPtr<StorageMap> newMap = m_storageMap->removeItem(key, oldValue);
+    auto newMap = m_storageMap->removeItem(key, oldValue);
     if (newMap)
-        m_storageMap = newMap.release();
+        m_storageMap = WTFMove(newMap);
 
     if (oldValue.isNull())
         return;
index 757d2a0..9f2f1e2 100644 (file)
@@ -1,3 +1,35 @@
+2016-06-20  Keith Rollin  <krollin@apple.com>
+
+        Remove RefPtr::release() and change calls sites to use WTFMove()
+        https://bugs.webkit.org/show_bug.cgi?id=158369
+
+        Reviewed by Chris Dumez.
+
+        RefPtr::release() releases its managed pointer awkwardly. It's more
+        direct and clearer to use WTFMove to transfer ownership of the managed
+        pointer.
+
+        As part of this cleanup, also change a lot of explicit data types to
+        'auto'.
+
+        * Plugins/Hosted/NetscapePluginHostManager.mm:
+        (WebKit::NetscapePluginHostManager::instantiatePlugin):
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::create):
+        (WebKit::NetscapePluginInstanceProxy::loadRequest):
+        (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (-[WebFramePolicyListener receivedPolicyDecision:]):
+        * WebCoreSupport/WebSecurityOrigin.mm:
+        (-[WebSecurityOrigin initWithURL:]):
+        * WebView/WebArchive.mm:
+        (-[WebArchive initWithMainResource:subresources:subframeArchives:]):
+        (-[WebArchive initWithData:]):
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource mainResource]):
+        * WebView/WebFrame.mm:
+        (-[WebFrame _documentFragmentWithNodesAsParagraphs:]):
+
 2016-06-15  Alexey Proskuryakov  <ap@apple.com>
 
         +[WebHTMLRepresentation supportedMIMETypes] leaks
index d49ef6e..e4b7c89 100644 (file)
@@ -272,7 +272,7 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl
     instance->setRenderContextID(reply->m_renderContextID);
     instance->setRendererType(reply->m_rendererType);
 
-    return instance.release();
+    return WTFMove(instance);
 }
 
 void NetscapePluginHostManager::createPropertyListFile(const String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier)
index 984c23d..eed2779 100644 (file)
@@ -248,9 +248,9 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy
 
 PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginInstanceProxy::create(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin)
 {
-    RefPtr<NetscapePluginInstanceProxy> proxy = adoptRef(new NetscapePluginInstanceProxy(pluginHostProxy, pluginView, fullFramePlugin));
-    pluginHostProxy->addPluginInstance(proxy.get());
-    return proxy.release();
+    auto proxy = adoptRef(*new NetscapePluginInstanceProxy(pluginHostProxy, pluginView, fullFramePlugin));
+    pluginHostProxy->addPluginInstance(proxy.ptr());
+    return WTFMove(proxy);
 }
 
 NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy()
@@ -801,8 +801,8 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch
             return NPERR_INVALID_PARAM;
         }
 
-        RefPtr<PluginRequest> pluginRequest = PluginRequest::create(requestID, request, target, allowPopups);
-        m_pluginRequests.append(pluginRequest.release());
+        auto pluginRequest = PluginRequest::create(requestID, request, target, allowPopups);
+        m_pluginRequests.append(WTFMove(pluginRequest));
         m_requestTimer.startOneShot(0);
     } else {
         RefPtr<HostedNetscapePluginStream> stream = HostedNetscapePluginStream::create(this, requestID, request);
@@ -1372,11 +1372,11 @@ bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArr
             if (!frame->script().canExecuteScripts(NotAboutToExecuteScript))
                 return false;
 
-            RefPtr<RootObject> rootObject = frame->script().createRootObject(m_pluginView);
+            auto rootObject = frame->script().createRootObject(m_pluginView);
             if (!rootObject)
                 return false;
             
-            result = ProxyInstance::create(rootObject.release(), this, objectID)->createRuntimeObject(exec);
+            result = ProxyInstance::create(WTFMove(rootObject), this, objectID)->createRuntimeObject(exec);
             return true;
         }
         default:
index ffefc19..89ba07c 100644 (file)
@@ -2348,7 +2348,7 @@ void WebFrameLoaderClient::prefetchDNS(const String& hostname)
 
 - (void)receivedPolicyDecision:(PolicyAction)action
 {
-    RefPtr<Frame> frame = _frame.release();
+    auto frame = WTFMove(_frame);
     if (!frame)
         return;
 
index c6f85de..a3dbf4a 100644 (file)
@@ -54,8 +54,8 @@ using namespace WebCore;
     if (!self)
         return nil;
 
-    RefPtr<SecurityOrigin> origin = SecurityOrigin::create(URL([url absoluteURL]));
-    SecurityOrigin* rawOrigin = origin.release().leakRef();
+    auto origin = SecurityOrigin::create(URL([url absoluteURL]));
+    SecurityOrigin* rawOrigin = &origin.leakRef();
     _private = reinterpret_cast<WebSecurityOriginPrivate *>(rawOrigin);
 
     return self;
index 348e8f0..e96c607 100644 (file)
@@ -175,7 +175,7 @@ static BOOL isArrayOfClass(id object, Class elementClass)
         return nil;
     }
     
-    RefPtr<ArchiveResource> coreMainResource = mainResource ? [mainResource _coreResource] : 0;
+    RefPtr<ArchiveResource> coreMainResource = mainResource ? [mainResource _coreResource] : nullptr;
 
     Vector<RefPtr<ArchiveResource>> coreResources;
     for (WebResource *subresource in subresources)
@@ -185,13 +185,13 @@ static BOOL isArrayOfClass(id object, Class elementClass)
     for (WebArchive *subframeArchive in subframeArchives)
         coreArchives.append([subframeArchive->_private coreArchive]);
 
-    RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::create(coreMainResource.release(), WTFMove(coreResources), WTFMove(coreArchives));
+    auto coreArchive = LegacyWebArchive::create(WTFMove(coreMainResource), WTFMove(coreResources), WTFMove(coreArchives));
     if (!coreArchive) {
         [self release];
         return nil;
     }
 
-    [_private setCoreArchive:coreArchive.release()];
+    [_private setCoreArchive:WTFMove(coreArchive)];
 
     return self;
 }
@@ -209,13 +209,13 @@ static BOOL isArrayOfClass(id object, Class elementClass)
 #endif
 
     _private = [[WebArchivePrivate alloc] init];
-    RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::create(SharedBuffer::wrapNSData(data));
+    auto coreArchive = LegacyWebArchive::create(SharedBuffer::wrapNSData(data));
     if (!coreArchive) {
         [self release];
         return nil;
     }
         
-    [_private setCoreArchive:coreArchive.release()];
+    [_private setCoreArchive:WTFMove(coreArchive)];
         
 #if !LOG_DISABLED
     CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
index 803d3a8..6064722 100644 (file)
@@ -518,8 +518,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
 - (WebResource *)mainResource
 {
-    RefPtr<ArchiveResource> coreResource = toPrivate(_private)->loader->mainResource();
-    return [[[WebResource alloc] _initWithCoreResource:coreResource.release()] autorelease];
+    auto coreResource = toPrivate(_private)->loader->mainResource();
+    return [[[WebResource alloc] _initWithCoreResource:WTFMove(coreResource)] autorelease];
 }
 
 - (NSArray *)subresources
index b0dcd9a..9cbf309 100644 (file)
@@ -911,7 +911,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     while ((node = [nodeEnum nextObject]))
         nodesVector.append(core(node));
 
-    RefPtr<DocumentFragment> fragment = document->createDocumentFragment();
+    auto fragment = document->createDocumentFragment();
 
     for (auto* node : nodesVector) {
         auto element = createDefaultParagraphElement(*document);
@@ -919,7 +919,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
         fragment->appendChild(element);
     }
 
-    return kit(fragment.release().get());
+    return kit(fragment.ptr());
 }
 
 - (void)_replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
index 8c00ab7..d6fb532 100644 (file)
@@ -1,3 +1,251 @@
+2016-06-20  Keith Rollin  <krollin@apple.com>
+
+        Remove RefPtr::release() and change calls sites to use WTFMove()
+        https://bugs.webkit.org/show_bug.cgi?id=158369
+
+        Reviewed by Chris Dumez.
+
+        RefPtr::release() releases its managed pointer awkwardly. It's more
+        direct and clearer to use WTFMove to transfer ownership of the managed
+        pointer.
+
+        As part of this cleanup, also change a lot of explicit data types to
+        'auto'.
+
+        * DatabaseProcess/DatabaseProcess.cpp:
+        (WebKit::DatabaseProcess::createDatabaseToWebProcessConnection):
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
+        * NetworkProcess/NetworkResourceLoadParameters.cpp:
+        (WebKit::NetworkResourceLoadParameters::decode):
+        * NetworkProcess/cache/NetworkCacheEntry.cpp:
+        (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
+        * Platform/mac/SharedMemoryMac.cpp:
+        (WebKit::SharedMemory::allocate):
+        (WebKit::SharedMemory::create):
+        (WebKit::SharedMemory::map):
+        * PluginProcess/PluginProcess.cpp:
+        (WebKit::PluginProcess::createWebProcessConnection):
+        * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
+        (encodeToObjectStream):
+        * Shared/API/c/WKImage.cpp:
+        (WKImageCreate):
+        * Shared/API/c/WKNumber.cpp:
+        (WKBooleanCreate):
+        (WKDoubleCreate):
+        (WKUInt64Create):
+        * Shared/API/c/WKSecurityOriginRef.cpp:
+        (WKSecurityOriginCreate):
+        * Shared/API/c/WKSerializedScriptValue.cpp:
+        (WKSerializedScriptValueCreate):
+        (WKSerializedScriptValueCreateWithInternalRepresentation):
+        * Shared/API/c/cairo/WKImageCairo.cpp:
+        (WKImageCreateFromCairoSurface):
+        * Shared/API/c/cg/WKImageCG.cpp:
+        (WKImageCreateFromCGImage):
+        * Shared/API/c/mac/WKCertificateInfoMac.mm:
+        (WKCertificateInfoCreateWithCertficateChain):
+        * Shared/API/c/mac/WKObjCTypeWrapperRef.mm:
+        (WKObjCTypeWrapperCreate):
+        * Shared/API/c/mac/WKWebArchive.cpp:
+        (WKWebArchiveCreate):
+        (WKWebArchiveCreateWithData):
+        (WKWebArchiveCreateFromRange):
+        (WKWebArchiveCopyMainResource):
+        (WKWebArchiveCopySubresources):
+        (WKWebArchiveCopySubframeArchives):
+        * Shared/API/c/mac/WKWebArchiveResource.cpp:
+        (WKWebArchiveResourceCreate):
+        * Shared/APIWebArchive.mm:
+        (API::WebArchive::WebArchive):
+        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
+        (WebKit::NetscapePluginModule::getOrCreate):
+        * Shared/ShareableBitmap.cpp:
+        (WebKit::ShareableBitmap::create):
+        * Shared/ShareableResource.cpp:
+        (WebKit::ShareableResource::map):
+        * Shared/gtk/ArgumentCodersGtk.cpp:
+        (IPC::ArgumentCoder<DragData>::decode):
+        * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
+        (WKViewCreate):
+        * UIProcess/API/C/WKBatteryStatus.cpp:
+        (WKBatteryStatusCreate):
+        * UIProcess/API/C/WKGeolocationPosition.cpp:
+        (WKGeolocationPositionCreate_b):
+        * UIProcess/API/C/WKGrammarDetail.cpp:
+        (WKGrammarDetailCreate):
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageCopySessionState):
+        * UIProcess/API/C/WKPageGroup.cpp:
+        (WKPageGroupCreateWithIdentifier):
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesCreate):
+        (WKPreferencesCreateWithIdentifier):
+        (WKPreferencesCreateCopy):
+        * UIProcess/API/C/WKSessionRef.cpp:
+        (WKSessionCreate):
+        * UIProcess/API/C/WKSessionStateRef.cpp:
+        (WKSessionStateCopyData):
+        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
+        (WKContextCopyPlugInInfoForBundleIdentifier):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView loadRequest:]):
+        (-[WKWebView loadFileURL:allowingReadAccessToURL:]):
+        (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
+        (-[WKWebView goToBackForwardListItem:]):
+        (-[WKWebView goBack]):
+        (-[WKWebView goForward]):
+        (-[WKWebView reload]):
+        (-[WKWebView reloadFromOrigin]):
+        (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
+        (-[WKWebView _reloadWithoutContentBlockers]):
+        (-[WKWebView _sessionStateData]):
+        (-[WKWebView _restoreSessionState:andNavigate:]):
+        * UIProcess/API/efl/ewk_database_manager.cpp:
+        (EwkDatabaseManager::createOriginList):
+        * UIProcess/API/efl/ewk_storage_manager.cpp:
+        (EwkStorageManager::createOriginList):
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkitWebViewCreateNewPage):
+        (webkitWebViewPrintFrame):
+        (getContentsAsMHTMLDataCallback):
+        * UIProcess/Cocoa/SessionStateCoding.mm:
+        (WebKit::encodeSessionState):
+        * UIProcess/GenericCallback.h:
+        (WebKit::CallbackMap::take):
+        * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
+        (WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
+        * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
+        (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
+        * UIProcess/Plugins/PluginProcessManager.cpp:
+        (WebKit::PluginProcessManager::getOrCreatePluginProcess):
+        * UIProcess/Storage/StorageManager.cpp:
+        (WebKit::StorageManager::StorageArea::setItem):
+        (WebKit::StorageManager::StorageArea::removeItem):
+        (WebKit::StorageManager::createLocalStorageMap):
+        * UIProcess/WebBackForwardList.cpp:
+        (WebKit::WebBackForwardList::addItem):
+        (WebKit::WebBackForwardList::clear):
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
+        (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::installViewStateChangeCompletionHandler):
+        * UIProcess/WebPreferences.cpp:
+        (WebKit::WebPreferences::createWithLegacyDefaults):
+        (WebKit::WebPreferences::copy):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::~WebProcessPool):
+        * UIProcess/mac/ViewSnapshotStore.mm:
+        (WebKit::ViewSnapshotStore::recordSnapshot):
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController _webHitTestResult]):
+        * UIProcess/mac/WKPrintingView.mm:
+        (-[WKPrintingView _askPageToComputePageRects]):
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::setDragImage):
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
+        (-[WKWebProcessPlugInFrame hitTest:]):
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
+        (-[WKWebProcessPlugInHitTestResult nodeHandle]):
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
+        (+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]):
+        (-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]):
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
+        (+[WKWebProcessPlugInScriptWorld world]):
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundlePostSynchronousMessage):
+        * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
+        (WKBundleDOMWindowExtensionCreate):
+        * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
+        (WKBundleHitTestResultCopyNodeHandle):
+        (WKBundleHitTestResultCopyURLElementHandle):
+        * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
+        (WKBundleNavigationActionCopyHitTestResult):
+        (WKBundleNavigationActionCopyFormElement):
+        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
+        (WKBundleNodeHandleCreate):
+        (WKBundleNodeHandleCopyDocument):
+        (WKBundleNodeHandleCopySnapshotWithOptions):
+        (WKBundleNodeHandleCopyVisibleRange):
+        (WKBundleNodeHandleCopyHTMLTableCellElementCellAbove):
+        (WKBundleNodeHandleCopyDocumentFrame):
+        (WKBundleNodeHandleCopyHTMLFrameElementContentFrame):
+        (WKBundleNodeHandleCopyHTMLIFrameElementContentFrame):
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageCreateSnapshotWithOptions):
+        (WKBundlePageCreateSnapshotInViewCoordinates):
+        (WKBundlePageCreateSnapshotInDocumentCoordinates):
+        (WKBundlePageCreateScaledSnapshotInDocumentCoordinates):
+        (WKBundlePagePostSynchronousMessageForTesting):
+        * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
+        (WKBundleRangeHandleCreate):
+        (WKBundleRangeHandleCopySnapshotWithOptions):
+        * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
+        (WKBundleScriptWorldCreateWorld):
+        * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
+        (-[WKDOMNode _copyBundleNodeHandleRef]):
+        * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
+        (-[WKDOMRange _copyBundleRangeHandleRef]):
+        * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
+        (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
+        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+        (WebKit::imageForRect):
+        (WebKit::InjectedBundleNodeHandle::renderedImage):
+        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
+        (WebKit::InjectedBundleRangeHandle::getOrCreate):
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::create):
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::loadURL):
+        * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
+        (WebKit::PDFPlugin::createScrollbar):
+        * WebProcess/Storage/StorageAreaMap.cpp:
+        (WebKit::StorageAreaMap::applyChange):
+        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
+        (WebKit::toFormData):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createPlugin):
+        (WebKit::WebFrameLoaderClient::recreatePlugin):
+        (WebKit::WebFrameLoaderClient::createJavaAppletWidget):
+        (WebKit::WebFrameLoaderClient::createNetworkingContext):
+        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
+        (WebKit::WebInspectorClient::highlight):
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::convertImageToBitmap):
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindUIAfterPageScroll):
+        * WebProcess/WebPage/VisitedLinkTableController.cpp:
+        (WebKit::VisitedLinkTableController::getOrCreate):
+        (WebKit::VisitedLinkTableController::setVisitedLinkTable):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::createWithCoreMainFrame):
+        (WebKit::WebFrame::createSubframe):
+        (WebKit::WebFrame::create):
+        (WebKit::WebFrame::createSelectionSnapshot):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::createPlugin):
+        (WebKit::WebPage::snapshotAtSize):
+        (WebKit::WebPage::snapshotNode):
+        (WebKit::WebPage::willPerformLoadDragDestinationAction):
+        (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad):
+        (WebKit::WebPage::SandboxExtensionTracker::didCommitProvisionalLoad):
+        (WebKit::WebPage::drawRectToImage):
+        * WebProcess/WebPage/WebPageGroupProxy.cpp:
+        (WebKit::WebPageGroupProxy::create):
+        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
+        (WebKit::PlatformCAAnimationRemote::Properties::decode):
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::create):
+        (WebKit::PlatformCALayerRemote::clone):
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
+        (WebKit::PlatformCALayerRemoteCustom::create):
+        (WebKit::PlatformCALayerRemoteCustom::clone):
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor):
+
 2016-06-20  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r202179.
index af86ad8..3ee6247 100644 (file)
@@ -182,8 +182,8 @@ void DatabaseProcess::createDatabaseToWebProcessConnection()
     mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
 
     // Create a listening connection.
-    RefPtr<DatabaseToWebProcessConnection> connection = DatabaseToWebProcessConnection::create(IPC::Connection::Identifier(listeningPort));
-    m_databaseToWebProcessConnections.append(connection.release());
+    auto connection = DatabaseToWebProcessConnection::create(IPC::Connection::Identifier(listeningPort));
+    m_databaseToWebProcessConnections.append(WTFMove(connection));
 
     IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
     parentProcessConnection()->send(Messages::DatabaseProcessProxy::DidCreateDatabaseToWebProcessConnection(clientPort), 0);
index 2fcef8a..b4288f5 100644 (file)
@@ -254,8 +254,8 @@ void NetworkProcess::createNetworkConnectionToWebProcess()
 #if USE(UNIX_DOMAIN_SOCKETS)
     IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection();
 
-    RefPtr<NetworkConnectionToWebProcess> connection = NetworkConnectionToWebProcess::create(socketPair.server);
-    m_webProcessConnections.append(connection.release());
+    auto connection = NetworkConnectionToWebProcess::create(socketPair.server);
+    m_webProcessConnections.append(WTFMove(connection));
 
     IPC::Attachment clientSocket(socketPair.client);
     parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCreateNetworkConnectionToWebProcess(clientSocket), 0);
@@ -265,8 +265,8 @@ void NetworkProcess::createNetworkConnectionToWebProcess()
     mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
 
     // Create a listening connection.
-    RefPtr<NetworkConnectionToWebProcess> connection = NetworkConnectionToWebProcess::create(IPC::Connection::Identifier(listeningPort));
-    m_webProcessConnections.append(connection.release());
+    auto connection = NetworkConnectionToWebProcess::create(IPC::Connection::Identifier(listeningPort));
+    m_webProcessConnections.append(WTFMove(connection));
 
     IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
     parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCreateNetworkConnectionToWebProcess(clientPort), 0);
index a41d0ab..0f16df4 100644 (file)
@@ -127,8 +127,8 @@ bool NetworkResourceLoadParameters::decode(IPC::ArgumentDecoder& decoder, Networ
         if (!decoder.decode(requestBodySandboxExtensionHandles))
             return false;
         for (size_t i = 0; i < requestBodySandboxExtensionHandles.size(); ++i) {
-            if (RefPtr<SandboxExtension> extension = SandboxExtension::create(requestBodySandboxExtensionHandles[i]))
-                result.requestBodySandboxExtensions.append(extension.release());
+            if (auto extension = SandboxExtension::create(requestBodySandboxExtensionHandles[i]))
+                result.requestBodySandboxExtensions.append(WTFMove(extension));
         }
     }
 
index 47ff0fa..803835c 100644 (file)
@@ -145,12 +145,11 @@ std::unique_ptr<Entry> Entry::decodeStorageRecord(const Storage::Record& storage
 #if ENABLE(SHAREABLE_RESOURCE)
 void Entry::initializeShareableResourceHandleFromStorageRecord() const
 {
-    RefPtr<SharedMemory> sharedMemory = m_sourceStorageRecord.body.tryCreateSharedMemory();
+    auto sharedMemory = m_sourceStorageRecord.body.tryCreateSharedMemory();
     if (!sharedMemory)
         return;
 
-    RefPtr<ShareableResource> shareableResource = ShareableResource::create(sharedMemory.release(), 0, m_sourceStorageRecord.body.size());
-    ASSERT(shareableResource);
+    auto shareableResource = ShareableResource::create(WTFMove(sharedMemory), 0, m_sourceStorageRecord.body.size());
     shareableResource->createHandle(m_shareableResourceHandle);
 }
 #endif
index caf4fb4..080c528 100644 (file)
@@ -110,13 +110,13 @@ RefPtr<SharedMemory> SharedMemory::allocate(size_t size)
         return nullptr;
     }
 
-    RefPtr<SharedMemory> sharedMemory = adoptRef(*new SharedMemory);
+    auto sharedMemory = adoptRef(*new SharedMemory);
     sharedMemory->m_size = size;
     sharedMemory->m_data = toPointer(address);
     sharedMemory->m_port = MACH_PORT_NULL;
     sharedMemory->m_protection = Protection::ReadWrite;
 
-    return sharedMemory;
+    return WTFMove(sharedMemory);
 }
 
 static inline vm_prot_t machProtection(SharedMemory::Protection protection)
@@ -156,13 +156,13 @@ RefPtr<SharedMemory> SharedMemory::create(void* data, size_t size, Protection pr
     if (!sendRight)
         return nullptr;
 
-    RefPtr<SharedMemory> sharedMemory(adoptRef(new SharedMemory));
+    auto sharedMemory(adoptRef(*new SharedMemory));
     sharedMemory->m_size = size;
     sharedMemory->m_data = nullptr;
     sharedMemory->m_port = sendRight.leakSendRight();
     sharedMemory->m_protection = protection;
 
-    return sharedMemory.release();
+    return WTFMove(sharedMemory);
 }
 
 RefPtr<SharedMemory> SharedMemory::map(const Handle& handle, Protection protection)
@@ -178,13 +178,13 @@ RefPtr<SharedMemory> SharedMemory::map(const Handle& handle, Protection protecti
     if (kr != KERN_SUCCESS)
         return nullptr;
 
-    RefPtr<SharedMemory> sharedMemory(adoptRef(new SharedMemory));
+    auto sharedMemory(adoptRef(*new SharedMemory));
     sharedMemory->m_size = handle.m_size;
     sharedMemory->m_data = toPointer(mappedAddress);
     sharedMemory->m_port = MACH_PORT_NULL;
     sharedMemory->m_protection = protection;
 
-    return sharedMemory;
+    return WTFMove(sharedMemory);
 }
 
 SharedMemory::~SharedMemory()
index 2700ca2..7555702 100644 (file)
@@ -151,8 +151,8 @@ void PluginProcess::createWebProcessConnection()
 #if USE(UNIX_DOMAIN_SOCKETS)
     IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection();
 
-    RefPtr<WebProcessConnection> connection = WebProcessConnection::create(socketPair.server);
-    m_webProcessConnections.append(connection.release());
+    auto connection = WebProcessConnection::create(socketPair.server);
+    m_webProcessConnections.append(WTFMove(connection));
 
     IPC::Attachment clientSocket(socketPair.client);
     parentProcessConnection()->send(Messages::PluginProcessProxy::DidCreateWebProcessConnection(clientSocket, m_supportsAsynchronousPluginInitialization), 0);
@@ -162,7 +162,7 @@ void PluginProcess::createWebProcessConnection()
     mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
 
     // Create a listening connection.
-    RefPtr<WebProcessConnection> connection = WebProcessConnection::create(IPC::Connection::Identifier(listeningPort));
+    auto connection = WebProcessConnection::create(IPC::Connection::Identifier(listeningPort));
 
     if (m_audioHardwareListener) {
         if (m_audioHardwareListener->hardwareActivity() == WebCore::AudioHardwareActivityType::IsActive)
@@ -171,7 +171,7 @@ void PluginProcess::createWebProcessConnection()
             connection->audioHardwareDidBecomeInactive();
     }
 
-    m_webProcessConnections.append(connection.release());
+    m_webProcessConnections.append(WTFMove(connection));
 
     IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
     parentProcessConnection()->send(Messages::PluginProcessProxy::DidCreateWebProcessConnection(clientPort, m_supportsAsynchronousPluginInitialization), 0);
index 2a29738..9df2ab0 100644 (file)
@@ -108,9 +108,9 @@ static void encodeToObjectStream(WKRemoteObjectEncoder *encoder, id value)
     size_t position = encoder->_objectStream->size();
     encoder->_objectStream->elements().append(nullptr);
 
-    RefPtr<API::Dictionary> encodedObject = createEncodedObject(encoder, value);
+    auto encodedObject = createEncodedObject(encoder, value);
     ASSERT(!encoder->_objectStream->elements()[position]);
-    encoder->_objectStream->elements()[position] = encodedObject.release();
+    encoder->_objectStream->elements()[position] = WTFMove(encodedObject);
 }
 
 static void encodeInvocationArguments(WKRemoteObjectEncoder *encoder, NSInvocation *invocation, NSUInteger firstArgument)
index 23278b3..2741199 100644 (file)
@@ -38,8 +38,8 @@ WKTypeID WKImageGetTypeID()
 
 WKImageRef WKImageCreate(WKSize size, WKImageOptions options)
 {
-    RefPtr<WebImage> webImage = WebImage::create(toIntSize(size), toImageOptions(options));
-    return toAPI(webImage.release().leakRef());
+    auto webImage = WebImage::create(toIntSize(size), toImageOptions(options));
+    return toAPI(webImage.leakRef());
 }
 
 WKSize WKImageGetSize(WKImageRef imageRef)
index 1130063..418e029 100644 (file)
@@ -38,8 +38,8 @@ WKTypeID WKBooleanGetTypeID()
 
 WKBooleanRef WKBooleanCreate(bool value)
 {
-    RefPtr<API::Boolean> booleanObject = API::Boolean::create(value);
-    return toAPI(booleanObject.release().leakRef());
+    auto booleanObject = API::Boolean::create(value);
+    return toAPI(&booleanObject.leakRef());
 }
 
 bool WKBooleanGetValue(WKBooleanRef booleanRef)
@@ -54,8 +54,8 @@ WKTypeID WKDoubleGetTypeID()
 
 WKDoubleRef WKDoubleCreate(double value)
 {
-    RefPtr<API::Double> doubleObject = API::Double::create(value);
-    return toAPI(doubleObject.release().leakRef());
+    auto doubleObject = API::Double::create(value);
+    return toAPI(&doubleObject.leakRef());
 }
 
 double WKDoubleGetValue(WKDoubleRef doubleRef)
@@ -70,8 +70,8 @@ WKTypeID WKUInt64GetTypeID()
 
 WKUInt64Ref WKUInt64Create(uint64_t value)
 {
-    RefPtr<API::UInt64> uint64Object = API::UInt64::create(value);
-    return toAPI(uint64Object.release().leakRef());
+    auto uint64Object = API::UInt64::create(value);
+    return toAPI(&uint64Object.leakRef());
 }
 
 uint64_t WKUInt64GetValue(WKUInt64Ref uint64Ref)
index 882867f..48cc0b2 100644 (file)
@@ -48,8 +48,8 @@ WKSecurityOriginRef WKSecurityOriginCreateFromDatabaseIdentifier(WKStringRef ide
 
 WKSecurityOriginRef WKSecurityOriginCreate(WKStringRef protocol, WKStringRef host, int port)
 {
-    RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(toImpl(protocol)->string(), toImpl(host)->string(), port);
-    return toAPI(securityOrigin.release().leakRef());
+    auto securityOrigin = API::SecurityOrigin::create(toImpl(protocol)->string(), toImpl(host)->string(), port);
+    return toAPI(securityOrigin.leakRef());
 }
 
 WKStringRef WKSecurityOriginCopyDatabaseIdentifier(WKSecurityOriginRef securityOrigin)
index ec2ad96..862fd7f 100644 (file)
@@ -39,14 +39,14 @@ WKTypeID WKSerializedScriptValueGetTypeID()
 
 WKSerializedScriptValueRef WKSerializedScriptValueCreate(JSContextRef context, JSValueRef value, JSValueRef* exception)
 {
-    RefPtr<API::SerializedScriptValue> serializedValue = API::SerializedScriptValue::create(context, value, exception);
-    return toAPI(serializedValue.release().leakRef());
+    auto serializedValue = API::SerializedScriptValue::create(context, value, exception);
+    return toAPI(serializedValue.leakRef());
 }
 
 WKSerializedScriptValueRef WKSerializedScriptValueCreateWithInternalRepresentation(void* internalRepresentation)
 {
-    RefPtr<API::SerializedScriptValue> serializedValue = API::SerializedScriptValue::create(static_cast<WebCore::SerializedScriptValue*>(internalRepresentation));
-    return toAPI(serializedValue.release().leakRef());
+    auto serializedValue = API::SerializedScriptValue::create(static_cast<WebCore::SerializedScriptValue*>(internalRepresentation));
+    return toAPI(&serializedValue.leakRef());
 }
 
 JSValueRef WKSerializedScriptValueDeserialize(WKSerializedScriptValueRef scriptValueRef, JSContextRef contextRef, JSValueRef* exception)
index afb4993..85b9938 100644 (file)
@@ -45,7 +45,7 @@ cairo_surface_t* WKImageCreateCairoSurface(WKImageRef imageRef)
 WKImageRef WKImageCreateFromCairoSurface(cairo_surface_t* surface, WKImageOptions options)
 {
     IntSize imageSize(cairo_image_surface_get_width(surface), cairo_image_surface_get_height(surface));
-    RefPtr<WebImage> webImage = WebImage::create(imageSize, toImageOptions(options));
+    auto webImage = WebImage::create(imageSize, toImageOptions(options));
     auto graphicsContext = webImage->bitmap()->createGraphicsContext();
 
     cairo_t* cr = graphicsContext->platformContext()->cr();
@@ -54,5 +54,5 @@ WKImageRef WKImageCreateFromCairoSurface(cairo_surface_t* surface, WKImageOption
     cairo_rectangle(cr, 0, 0, imageSize.width(), imageSize.height());
     cairo_fill(cr);
 
-    return toAPI(webImage.release().leakRef());
+    return toAPI(webImage.leakRef());
 }
index bcab60b..c62343d 100644 (file)
@@ -50,7 +50,7 @@ WKImageRef WKImageCreateFromCGImage(CGImageRef imageRef, WKImageOptions options)
         return 0;
     
     IntSize imageSize(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef));
-    RefPtr<WebImage> webImage = WebImage::create(imageSize, toImageOptions(options));
+    auto webImage = WebImage::create(imageSize, toImageOptions(options));
     if (!webImage->bitmap())
         return 0;
 
@@ -58,5 +58,5 @@ WKImageRef WKImageCreateFromCGImage(CGImageRef imageRef, WKImageOptions options)
     FloatRect rect(FloatPoint(0, 0), imageSize);
     graphicsContext->clearRect(rect);
     graphicsContext->drawNativeImage(imageRef, imageSize, rect, rect);
-    return toAPI(webImage.release().leakRef());
+    return toAPI(webImage.leakRef());
 }
index c440b46..a883b7d 100644 (file)
@@ -35,7 +35,7 @@ using namespace WebKit;
 WKCertificateInfoRef WKCertificateInfoCreateWithCertficateChain(CFArrayRef certificateChain)
 {
     RefPtr<WebCertificateInfo> certificateInfo = WebCertificateInfo::create(CertificateInfo(certificateChain));
-    return toAPI(certificateInfo.release().leakRef());
+    return toAPI(certificateInfo.leakRef());
 }
 
 CFArrayRef WKCertificateInfoGetCertificateChain(WKCertificateInfoRef certificateInfoRef)
index ee0125b..cfcb902 100644 (file)
@@ -38,8 +38,8 @@ WKTypeID WKObjCTypeWrapperGetTypeID()
 
 WKObjCTypeWrapperRef WKObjCTypeWrapperCreate(id object)
 {
-    RefPtr<ObjCObjectGraph> objectWrapper = ObjCObjectGraph::create(object);
-    return toAPI(objectWrapper.release().leakRef());
+    auto objectWrapper = ObjCObjectGraph::create(object);
+    return toAPI(&objectWrapper.leakRef());
 }
 
 id WKObjCTypeWrapperGetObject(WKObjCTypeWrapperRef wrapperRef)
index 8676cc6..e6aa24e 100644 (file)
@@ -43,38 +43,38 @@ WKTypeID WKWebArchiveGetTypeID()
 
 WKWebArchiveRef WKWebArchiveCreate(WKWebArchiveResourceRef mainResourceRef, WKArrayRef subresourcesRef, WKArrayRef subframeArchivesRef)
 {
-    RefPtr<API::WebArchive> webArchive = API::WebArchive::create(toImpl(mainResourceRef), toImpl(subresourcesRef), toImpl(subframeArchivesRef));
-    return toAPI(webArchive.release().leakRef());
+    auto webArchive = API::WebArchive::create(toImpl(mainResourceRef), toImpl(subresourcesRef), toImpl(subframeArchivesRef));
+    return toAPI(&webArchive.leakRef());
 }
 
 WKWebArchiveRef WKWebArchiveCreateWithData(WKDataRef dataRef)
 {
-    RefPtr<API::WebArchive> webArchive = API::WebArchive::create(toImpl(dataRef));
-    return toAPI(webArchive.release().leakRef());
+    auto webArchive = API::WebArchive::create(toImpl(dataRef));
+    return toAPI(&webArchive.leakRef());
 }
 
 WKWebArchiveRef WKWebArchiveCreateFromRange(WKBundleRangeHandleRef rangeHandleRef)
 {
-    RefPtr<API::WebArchive> webArchive = API::WebArchive::create(toImpl(rangeHandleRef)->coreRange());
-    return toAPI(webArchive.release().leakRef());
+    auto webArchive = API::WebArchive::create(toImpl(rangeHandleRef)->coreRange());
+    return toAPI(&webArchive.leakRef());
 }
 
 WKWebArchiveResourceRef WKWebArchiveCopyMainResource(WKWebArchiveRef webArchiveRef)
 {
     RefPtr<API::WebArchiveResource> mainResource = toImpl(webArchiveRef)->mainResource();
-    return toAPI(mainResource.release().leakRef());
+    return toAPI(mainResource.leakRef());
 }
 
 WKArrayRef WKWebArchiveCopySubresources(WKWebArchiveRef webArchiveRef)
 {
     RefPtr<API::Array> subresources = toImpl(webArchiveRef)->subresources();
-    return toAPI(subresources.release().leakRef());
+    return toAPI(subresources.leakRef());
 }
 
 WKArrayRef WKWebArchiveCopySubframeArchives(WKWebArchiveRef webArchiveRef)
 {
     RefPtr<API::Array> subframeArchives = toImpl(webArchiveRef)->subframeArchives();
-    return toAPI(subframeArchives.release().leakRef());
+    return toAPI(subframeArchives.leakRef());
 }
 
 WKDataRef WKWebArchiveCopyData(WKWebArchiveRef webArchiveRef)
index 8432d9e..c819c02 100644 (file)
@@ -39,8 +39,8 @@ WKTypeID WKWebArchiveResourceGetTypeID()
 
 WKWebArchiveResourceRef WKWebArchiveResourceCreate(WKDataRef dataRef, WKURLRef URLRef, WKStringRef MIMETypeRef, WKStringRef textEncodingRef)
 {
-    RefPtr<API::WebArchiveResource> webArchiveResource = API::WebArchiveResource::create(toImpl(dataRef), toWTFString(URLRef), toWTFString(MIMETypeRef), toWTFString(textEncodingRef));
-    return toAPI(webArchiveResource.release().leakRef());
+    auto webArchiveResource = API::WebArchiveResource::create(toImpl(dataRef), toWTFString(URLRef), toWTFString(MIMETypeRef), toWTFString(textEncodingRef));
+    return toAPI(&webArchiveResource.leakRef());
 }
 
 WKDataRef WKWebArchiveResourceCopyData(WKWebArchiveResourceRef webArchiveResourceRef)
index 8e17e5b..92903b3 100644 (file)
@@ -82,7 +82,7 @@ WebArchive::WebArchive(WebArchiveResource* mainResource, PassRefPtr<API::Array>
         coreSubframeLegacyWebArchives.uncheckedAppend(subframeWebArchive->coreLegacyWebArchive());
     }
 
-    m_legacyWebArchive = LegacyWebArchive::create(coreMainResource.release(), WTFMove(coreArchiveResources), WTFMove(coreSubframeLegacyWebArchives));
+    m_legacyWebArchive = LegacyWebArchive::create(WTFMove(coreMainResource), WTFMove(coreArchiveResources), WTFMove(coreSubframeLegacyWebArchives));
 }
 
 WebArchive::WebArchive(API::Data* data)
index ebf9741..ad7063b 100644 (file)
@@ -145,13 +145,13 @@ PassRefPtr<NetscapePluginModule> NetscapePluginModule::getOrCreate(const String&
             return pluginModule;
     }
 
-    RefPtr<NetscapePluginModule> pluginModule(adoptRef(new NetscapePluginModule(pluginPath)));
+    auto pluginModule(adoptRef(*new NetscapePluginModule(pluginPath)));
     
     // Try to load and initialize the plug-in module.
     if (!pluginModule->load())
-        return 0;
+        return nullptr;
     
-    return pluginModule.release();
+    return WTFMove(pluginModule);
 }
 
 void NetscapePluginModule::incrementLoadCount()
index 4eecbcc..7e0dcb6 100644 (file)
@@ -99,11 +99,11 @@ RefPtr<ShareableBitmap> ShareableBitmap::create(const IntSize& size, Flags flags
 RefPtr<ShareableBitmap> ShareableBitmap::create(const Handle& handle, SharedMemory::Protection protection)
 {
     // Create the shared memory.
-    RefPtr<SharedMemory> sharedMemory = SharedMemory::map(handle.m_handle, protection);
+    auto sharedMemory = SharedMemory::map(handle.m_handle, protection);
     if (!sharedMemory)
         return nullptr;
 
-    return create(handle.m_size, handle.m_flags, sharedMemory.release());
+    return create(handle.m_size, handle.m_flags, WTFMove(sharedMemory));
 }
 
 bool ShareableBitmap::createHandle(Handle& handle, SharedMemory::Protection protection)
index 7f91273..74afd4c 100644 (file)
@@ -114,11 +114,11 @@ Ref<ShareableResource> ShareableResource::create(PassRefPtr<SharedMemory> shared
 
 PassRefPtr<ShareableResource> ShareableResource::map(const Handle& handle)
 {
-    RefPtr<SharedMemory> sharedMemory = SharedMemory::map(handle.m_handle, SharedMemory::Protection::ReadOnly);
+    auto sharedMemory = SharedMemory::map(handle.m_handle, SharedMemory::Protection::ReadOnly);
     if (!sharedMemory)
         return 0;
 
-    return create(sharedMemory.release(), handle.m_offset, handle.m_size);
+    return create(WTFMove(sharedMemory), handle.m_offset, handle.m_size);
 }
 
 ShareableResource::ShareableResource(PassRefPtr<SharedMemory> sharedMemory, unsigned offset, unsigned size)
index 501d6f1..7a2d6c4 100644 (file)
@@ -229,7 +229,7 @@ bool ArgumentCoder<DragData>::decode(ArgumentDecoder& decoder, DragData& dragDat
             return false;
     }
 
-    dragData = DragData(platformData.release().leakRef(), clientPosition, globalPosition, static_cast<DragOperation>(sourceOperationMask),
+    dragData = DragData(platformData.leakRef(), clientPosition, globalPosition, static_cast<DragOperation>(sourceOperationMask),
                         static_cast<DragApplicationFlags>(flags));
 
     return true;
index c1ab22f..85e79aa 100644 (file)
@@ -32,8 +32,8 @@ using namespace WebKit;
 
 WKViewRef WKViewCreate(WKPageConfigurationRef pageConfiguration)
 {
-    RefPtr<WebView> webView = WebView::create(*toImpl(pageConfiguration));
-    return toAPI(webView.release().leakRef());
+    auto webView = WebView::create(*toImpl(pageConfiguration));
+    return toAPI(&webView.leakRef());
 }
 
 WKSize WKViewGetSize(WKViewRef viewRef)
index 953850d..09f8cc7 100644 (file)
@@ -46,8 +46,8 @@ WKTypeID WKBatteryStatusGetTypeID()
 WKBatteryStatusRef WKBatteryStatusCreate(bool isCharging, double chargingTime, double dischargingTime, double level)
 {
 #if ENABLE(BATTERY_STATUS)
-    RefPtr<WebBatteryStatus> status = WebBatteryStatus::create(isCharging, chargingTime, dischargingTime, level);
-    return toAPI(status.release().leakRef());
+    auto status = WebBatteryStatus::create(isCharging, chargingTime, dischargingTime, level);
+    return toAPI(&status.leakRef());
 #else
     UNUSED_PARAM(isCharging);
     UNUSED_PARAM(chargingTime);
index 5d94f3e..8b4c5b6 100644 (file)
@@ -43,6 +43,6 @@ WKGeolocationPositionRef WKGeolocationPositionCreate(double timestamp, double la
 
 WKGeolocationPositionRef WKGeolocationPositionCreate_b(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
 {
-    RefPtr<WebGeolocationPosition> position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed);
-    return toAPI(position.release().leakRef());
+    auto position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed);
+    return toAPI(position.leakRef());
 }
index 065f99b..afd9895 100644 (file)
@@ -40,8 +40,8 @@ WKTypeID WKGrammarDetailGetTypeID()
 
 WKGrammarDetailRef WKGrammarDetailCreate(int location, int length, WKArrayRef guesses, WKStringRef userDescription)
 {
-    RefPtr<WebGrammarDetail> detail = WebGrammarDetail::create(location, length, toImpl(guesses), toWTFString(userDescription));
-    return toAPI(detail.release().leakRef());
+    auto detail = WebGrammarDetail::create(location, length, toImpl(guesses), toWTFString(userDescription));
+    return toAPI(detail.leakRef());
 }
 
 int WKGrammarDetailGetLocation(WKGrammarDetailRef grammarDetailRef)
index 8e3033e..10d0882 100644 (file)
@@ -439,7 +439,7 @@ WKTypeRef WKPageCopySessionState(WKPageRef pageRef, void* context, WKPageSession
     });
 
     if (shouldReturnData)
-        return toAPI(encodeLegacySessionState(sessionState).release().leakRef());
+        return toAPI(encodeLegacySessionState(sessionState).leakRef());
 
     return toAPI(&API::SessionState::create(WTFMove(sessionState)).leakRef());
 }
index 3cc6095..4e21771 100644 (file)
@@ -41,8 +41,8 @@ WKTypeID WKPageGroupGetTypeID()
 
 WKPageGroupRef WKPageGroupCreateWithIdentifier(WKStringRef identifier)
 {
-    RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(toWTFString(identifier));
-    return toAPI(pageGroup.release().leakRef());
+    auto pageGroup = WebPageGroup::create(toWTFString(identifier));
+    return toAPI(pageGroup.leakRef());
 }
 
 WKStringRef WKPageGroupCopyIdentifier(WKPageGroupRef pageGroupRef)
index 605324d..e9d0f14 100644 (file)
@@ -46,20 +46,20 @@ WKTypeID WKPreferencesGetTypeID()
 
 WKPreferencesRef WKPreferencesCreate()
 {
-    RefPtr<WebPreferences> preferences = WebPreferences::createWithLegacyDefaults(String(), "WebKit2.", "WebKit2.");
-    return toAPI(preferences.release().leakRef());
+    auto preferences = WebPreferences::createWithLegacyDefaults(String(), "WebKit2.", "WebKit2.");
+    return toAPI(preferences.leakRef());
 }
 
 WKPreferencesRef WKPreferencesCreateWithIdentifier(WKStringRef identifierRef)
 {
-    RefPtr<WebPreferences> preferences = WebPreferences::createWithLegacyDefaults(toWTFString(identifierRef), "WebKit2.", "WebKit2.");
-    return toAPI(preferences.release().leakRef());
+    auto preferences = WebPreferences::createWithLegacyDefaults(toWTFString(identifierRef), "WebKit2.", "WebKit2.");
+    return toAPI(preferences.leakRef());
 }
 
 WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef preferencesRef)
 {
-    RefPtr<WebPreferences> preferences = toImpl(preferencesRef)->copy();
-    return toAPI(preferences.release().leakRef());
+    auto preferences = toImpl(preferencesRef)->copy();
+    return toAPI(preferences.leakRef());
 }
 
 void WKPreferencesEnableAllExperimentalFeatures(WKPreferencesRef preferencesRef)
index a935790..fedc0e8 100644 (file)
@@ -37,8 +37,8 @@ WKSessionRef WKSessionCreate(bool isEphemeral)
     if (!isEphemeral)
         return nullptr;
 
-    RefPtr<API::Session> session = API::Session::createEphemeral();
-    return toAPI(session.release().leakRef());
+    auto session = API::Session::createEphemeral();
+    return toAPI(&session.leakRef());
 }
 
 WKTypeID WKSessionGetTypeID()
index 98e7175..c938f51 100644 (file)
@@ -48,5 +48,5 @@ WKSessionStateRef WKSessionStateCreateFromData(WKDataRef data)
 
 WKDataRef WKSessionStateCopyData(WKSessionStateRef sessionState)
 {
-    return WebKit::toAPI(WebKit::encodeLegacySessionState(WebKit::toImpl(sessionState)->sessionState()).release().leakRef());
+    return WebKit::toAPI(WebKit::encodeLegacySessionState(WebKit::toImpl(sessionState)->sessionState()).leakRef());
 }
index 4c192b6..a589104 100644 (file)
@@ -73,8 +73,8 @@ WKDictionaryRef WKContextCopyPlugInInfoForBundleIdentifier(WKContextRef contextR
     if (plugin.path.isNull())
         return 0;
 
-    RefPtr<API::Dictionary> dictionary = createPluginInformationDictionary(plugin);
-    return toAPI(dictionary.release().leakRef());
+    auto dictionary = createPluginInformationDictionary(plugin);
+    return toAPI(&dictionary.leakRef());
 #else
     return 0;
 #endif
index d6baf85..e4a3a4d 100644 (file)
@@ -662,7 +662,7 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (WKNavigation *)loadFileURL:(NSURL *)URL allowingReadAccessToURL:(NSURL *)readAccessURL
@@ -677,7 +677,7 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (WKNavigation *)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
@@ -693,7 +693,7 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (WKNavigation *)goToBackForwardListItem:(WKBackForwardListItem *)item
@@ -702,7 +702,7 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (NSString *)title
@@ -759,7 +759,7 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     if (!navigation)
         return nil;
  
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (WKNavigation *)goForward
@@ -768,7 +768,7 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (WKNavigation *)reload
@@ -779,7 +779,7 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (WKNavigation *)reloadFromOrigin
@@ -790,7 +790,7 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (void)stopLoading
@@ -3178,7 +3178,7 @@ WEBCORE_COMMAND(yankAndSelect)
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (NSArray *)_certificateChain
@@ -3259,7 +3259,7 @@ WEBCORE_COMMAND(yankAndSelect)
     if (!navigation)
         return nil;
     
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (void)_killWebContentProcessAndResetState
@@ -3340,7 +3340,7 @@ static int32_t activeOrientation(WKWebView *webView)
     WebKit::SessionState sessionState = _page->sessionState();
 
     // FIXME: This should not use the legacy session state encoder.
-    return [wrapper(*WebKit::encodeLegacySessionState(sessionState).release().leakRef()) autorelease];
+    return [wrapper(*WebKit::encodeLegacySessionState(sessionState).leakRef()) autorelease];
 }
 
 - (_WKSessionState *)_sessionState
@@ -3364,7 +3364,7 @@ static int32_t activeOrientation(WKWebView *webView)
     if (!navigation)
         return nil;
 
-    return [wrapper(*navigation.release().leakRef()) autorelease];
+    return [wrapper(*navigation.leakRef()) autorelease];
 }
 
 - (void)_close
index dacf78f..76fcd19 100644 (file)
@@ -75,7 +75,7 @@ Eina_List* EwkDatabaseManager::createOriginList(WKArrayRef origins) const
             origin = EwkSecurityOrigin::create(wkOriginRef);
             m_wrapperCache.set(wkOriginRef, origin);
         }
-        originList = eina_list_append(originList, origin.release().leakRef());
+        originList = eina_list_append(originList, origin.leakRef());
     }
 
     return originList;
index 5d3edb0..281b9ce 100644 (file)
@@ -58,7 +58,7 @@ Eina_List* EwkStorageManager::createOriginList(WKArrayRef origins) const
             origin = EwkSecurityOrigin::create(wkOriginRef);
             m_wrapperCache.set(wkOriginRef, origin);
         }
-        originList = eina_list_append(originList, origin.release().leakRef());
+        originList = eina_list_append(originList, origin.leakRef());
     }
 
     return originList;
index 96fe1fc..414806c 100644 (file)
@@ -1837,7 +1837,7 @@ WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView* webView, const WindowFea
     webkitWindowPropertiesUpdateFromWebWindowFeatures(newWebView->priv->windowProperties.get(), windowFeatures);
 
     RefPtr<WebPageProxy> newPage = getPage(newWebView);
-    return newPage.release().leakRef();
+    return newPage.leakRef();
 }
 
 void webkitWebViewReadyToShowPage(WebKitWebView* webView)
@@ -1925,7 +1925,7 @@ void webkitWebViewMouseTargetChanged(WebKitWebView* webView, const WebHitTestRes
 
 void webkitWebViewPrintFrame(WebKitWebView* webView, WebFrameProxy* frame)
 {
-    GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(webkit_print_operation_new(webView));
+    auto printOperation = adoptGRef(webkit_print_operation_new(webView));
     webkitPrintOperationSetPrintMode(printOperation.get(), PrintInfo::PrintModeSync);
     gboolean returnValue;
     g_signal_emit(webView, signals[PRINT], 0, printOperation.get(), &returnValue);
@@ -3204,7 +3204,7 @@ static void fileReplaceContentsCallback(GObject* object, GAsyncResult* result, g
 
 static void getContentsAsMHTMLDataCallback(API::Data* wkData, GTask* taskPtr)
 {
-    GRefPtr<GTask> task = adoptGRef(taskPtr);
+    auto task = adoptGRef(taskPtr);
     if (g_task_return_error_if_cancelled(task.get()))
         return;
 
index 3ed419d..623ba46 100644 (file)
@@ -34,7 +34,7 @@ namespace WebKit {
 RetainPtr<NSData> encodeSessionState(const SessionState& sessionState)
 {
 #if WK_API_ENABLED
-    return [wrapper(*WebKit::encodeLegacySessionState(sessionState).release().leakRef()) autorelease];
+    return [wrapper(*WebKit::encodeLegacySessionState(sessionState).leakRef()) autorelease];
 #else
     return nullptr;
 #endif
index 1d20539..1b67e93 100644 (file)
@@ -200,11 +200,11 @@ public:
     template<class T>
     RefPtr<T> take(uint64_t callbackID)
     {
-        RefPtr<CallbackBase> base = m_map.take(callbackID);
+        auto base = m_map.take(callbackID);
         if (!base)
             return nullptr;
 
-        return adoptRef(base.release().leakRef()->as<T>());
+        return adoptRef(base.leakRef()->as<T>());
     }
 
     void invalidate(CallbackBase::Error error)
index 205a0f0..0cf7045 100644 (file)
@@ -47,9 +47,9 @@ void GeolocationPermissionRequestManagerProxy::invalidateRequests()
 
 PassRefPtr<GeolocationPermissionRequestProxy> GeolocationPermissionRequestManagerProxy::createRequest(uint64_t geolocationID)
 {
-    RefPtr<GeolocationPermissionRequestProxy> request = GeolocationPermissionRequestProxy::create(this, geolocationID);
-    m_pendingRequests.add(geolocationID, request.get());
-    return request.release();
+    auto request = GeolocationPermissionRequestProxy::create(this, geolocationID);
+    m_pendingRequests.add(geolocationID, request.ptr());
+    return WTFMove(request);
 }
 
 void GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
index b42660f..d7d3509 100644 (file)
@@ -249,8 +249,8 @@ void NetworkProcessProxy::didReceiveAuthenticationChallenge(uint64_t pageID, uin
     WebPageProxy* page = WebProcessProxy::webPage(pageID);
     MESSAGE_CHECK(page);
 
-    RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, connection());
-    page->didReceiveAuthenticationChallengeProxy(frameID, authenticationChallenge.release());
+    auto authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, connection());
+    page->didReceiveAuthenticationChallengeProxy(frameID, WTFMove(authenticationChallenge));
 }
 
 void NetworkProcessProxy::didFetchWebsiteData(uint64_t callbackID, const WebsiteData& websiteData)
index 0b2a632..818a525 100644 (file)
@@ -48,9 +48,9 @@ void NotificationPermissionRequestManagerProxy::invalidateRequests()
 
 PassRefPtr<NotificationPermissionRequest> NotificationPermissionRequestManagerProxy::createRequest(uint64_t notificationID)
 {
-    RefPtr<NotificationPermissionRequest> request = NotificationPermissionRequest::create(this, notificationID);
-    m_pendingRequests.add(notificationID, request.get());
-    return request.release();
+    auto request = NotificationPermissionRequest::create(this, notificationID);
+    m_pendingRequests.add(notificationID, request.ptr());
+    return WTFMove(request);
 }
 
 void NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allow)
index bd00bdc..ffa0a7e 100644 (file)
@@ -125,10 +125,10 @@ PluginProcessProxy* PluginProcessManager::getOrCreatePluginProcess(uint64_t plug
     for (size_t i = 0; i < m_pluginProcessTokens.size(); ++i) {
         auto& attributesAndToken = m_pluginProcessTokens[i];
         if (attributesAndToken.second == pluginProcessToken) {
-            RefPtr<PluginProcessProxy> pluginProcess = PluginProcessProxy::create(this, attributesAndToken.first, attributesAndToken.second);
-            PluginProcessProxy* pluginProcessPtr = pluginProcess.get();
+            auto pluginProcess = PluginProcessProxy::create(this, attributesAndToken.first, attributesAndToken.second);
+            PluginProcessProxy* pluginProcessPtr = pluginProcess.ptr();
 
-            m_pluginProcesses.append(pluginProcess.release());
+            m_pluginProcesses.append(WTFMove(pluginProcess));
             return pluginProcessPtr;
         }
     }
index b4ca534..15c98ea 100644 (file)
@@ -219,9 +219,9 @@ void StorageManager::StorageArea::setItem(IPC::Connection* sourceConnection, uin
 
     String oldValue;
 
-    RefPtr<StorageMap> newStorageMap = m_storageMap->setItem(key, value, oldValue, quotaException);
+    auto newStorageMap = m_storageMap->setItem(key, value, oldValue, quotaException);
     if (newStorageMap)
-        m_storageMap = newStorageMap.release();
+        m_storageMap = WTFMove(newStorageMap);
 
     if (quotaException)
         return;
@@ -237,9 +237,9 @@ void StorageManager::StorageArea::removeItem(IPC::Connection* sourceConnection,
     openDatabaseAndImportItemsIfNeeded();
 
     String oldValue;
-    RefPtr<StorageMap> newStorageMap = m_storageMap->removeItem(key, oldValue);
+    auto newStorageMap = m_storageMap->removeItem(key, oldValue);
     if (newStorageMap)
-        m_storageMap = newStorageMap.release();
+        m_storageMap = WTFMove(newStorageMap);
 
     if (oldValue.isNull())
         return;
@@ -686,10 +686,10 @@ void StorageManager::createLocalStorageMap(IPC::Connection& connection, uint64_t
     // FIXME: This should be a message check.
     ASSERT(localStorageNamespace);
 
-    RefPtr<StorageArea> storageArea = localStorageNamespace->getOrCreateStorageArea(securityOriginData.securityOrigin());
+    auto storageArea = localStorageNamespace->getOrCreateStorageArea(securityOriginData.securityOrigin());
     storageArea->addListener(connection, storageMapID);
 
-    result.iterator->value = storageArea.release();
+    result.iterator->value = WTFMove(storageArea);
 }
 
 void StorageManager::createTransientLocalStorageMap(IPC::Connection& connection, uint64_t storageMapID, uint64_t storageNamespaceID, const SecurityOriginData& topLevelOriginData, const SecurityOriginData& securityOriginData)
index 2734312..0f713a9 100644 (file)
@@ -100,7 +100,7 @@ void WebBackForwardList::addItem(WebBackForwardListItem* newItem)
         removedItems.reserveCapacity(m_entries.size() - targetSize);
         while (m_entries.size() > targetSize) {
             didRemoveItem(*m_entries.last());
-            removedItems.append(m_entries.last().release());
+            removedItems.append(WTFMove(m_entries.last()));
             m_entries.removeLast();
         }
 
@@ -108,7 +108,7 @@ void WebBackForwardList::addItem(WebBackForwardListItem* newItem)
         // (or even if we are, if we only want 1 entry).
         if (m_entries.size() == m_capacity && (m_currentIndex || m_capacity == 1)) {
             didRemoveItem(*m_entries[0]);
-            removedItems.append(m_entries[0].release());
+            removedItems.append(WTFMove(m_entries[0]));
             m_entries.remove(0);
 
             if (m_entries.isEmpty())
@@ -127,7 +127,7 @@ void WebBackForwardList::addItem(WebBackForwardListItem* newItem)
             if (!m_entries[i])
                 continue;
             didRemoveItem(*m_entries[i]);
-            removedItems.append(m_entries[i].release());
+            removedItems.append(WTFMove(m_entries[i]));
         }
         m_entries.clear();
     }
@@ -357,7 +357,7 @@ void WebBackForwardList::clear()
                 continue;
 
             didRemoveItem(*m_entries[i]);
-            removedItems.append(m_entries[i].release());
+            removedItems.append(WTFMove(m_entries[i]));
         }
 
         m_entries.clear();
@@ -376,14 +376,14 @@ void WebBackForwardList::clear()
     removedItems.reserveCapacity(size - 1);
     for (size_t i = 0; i < size; ++i) {
         if (i != m_currentIndex && m_hasCurrentIndex && m_entries[i])
-            removedItems.append(m_entries[i].release());
+            removedItems.append(WTFMove(m_entries[i]));
     }
 
     m_currentIndex = 0;
 
     if (currentItem) {
         m_entries.shrink(1);
-        m_entries[0] = currentItem.release();
+        m_entries[0] = WTFMove(currentItem);
     } else {
         m_entries.clear();
         m_hasCurrentIndex = false;
index 2c30d64..c6ff936 100644 (file)
@@ -95,9 +95,9 @@ void WebCookieManagerProxy::derefWebContextSupplement()
 
 void WebCookieManagerProxy::getHostnamesWithCookies(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<ArrayCallback> callback = ArrayCallback::create(WTFMove(callbackFunction));
+    auto callback = ArrayCallback::create(WTFMove(callbackFunction));
     uint64_t callbackID = callback->callbackID();
-    m_arrayCallbacks.set(callbackID, callback.release());
+    m_arrayCallbacks.set(callbackID, WTFMove(callback));
 
     processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHostnamesWithCookies(callbackID));
 }
@@ -167,10 +167,10 @@ void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy pol
 
 void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(std::function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<HTTPCookieAcceptPolicyCallback> callback = HTTPCookieAcceptPolicyCallback::create(WTFMove(callbackFunction));
+    auto callback = HTTPCookieAcceptPolicyCallback::create(WTFMove(callbackFunction));
 
     uint64_t callbackID = callback->callbackID();
-    m_httpCookieAcceptPolicyCallbacks.set(callbackID, callback.release());
+    m_httpCookieAcceptPolicyCallbacks.set(callbackID, WTFMove(callback));
 
     processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(callbackID));
 }
index 26b70cb..c43429d 100644 (file)
@@ -6169,11 +6169,11 @@ void WebPageProxy::installViewStateChangeCompletionHandler(void (^completionHand
     }
 
     auto copiedCompletionHandler = Block_copy(completionHandler);
-    RefPtr<VoidCallback> voidCallback = VoidCallback::create([copiedCompletionHandler] (CallbackBase::Error) {
+    auto voidCallback = VoidCallback::create([copiedCompletionHandler] (CallbackBase::Error) {
         copiedCompletionHandler();
         Block_release(copiedCompletionHandler);
     }, m_process->throttler().backgroundActivityToken());
-    uint64_t callbackID = m_callbacks.put(voidCallback.release());
+    uint64_t callbackID = m_callbacks.put(WTFMove(voidCallback));
     m_nextViewStateChangeCallbacks.append(callbackID);
 }
 
index 44b3633..809aa83 100644 (file)
@@ -45,14 +45,14 @@ Ref<WebPreferences> WebPreferences::create(const String& identifier, const Strin
 
 PassRefPtr<WebPreferences> WebPreferences::createWithLegacyDefaults(const String& identifier, const String& keyPrefix, const String& globalDebugKeyPrefix)
 {
-    RefPtr<WebPreferences> preferences = adoptRef(new WebPreferences(identifier, keyPrefix, globalDebugKeyPrefix));
+    auto preferences = WebPreferences::create(identifier, keyPrefix, globalDebugKeyPrefix);
     // FIXME: The registerDefault...ValueForKey machinery is unnecessarily heavyweight and complicated.
     // We can just compute different defaults for modern and legacy APIs in WebPreferencesDefinitions.h macros.
     preferences->registerDefaultBoolValueForKey(WebPreferencesKey::javaEnabledKey(), true);
     preferences->registerDefaultBoolValueForKey(WebPreferencesKey::javaEnabledForLocalFilesKey(), true);
     preferences->registerDefaultBoolValueForKey(WebPreferencesKey::pluginsEnabledKey(), true);
     preferences->registerDefaultUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey(), WebCore::SecurityOrigin::AllowAllStorage);
-    return preferences.release();
+    return WTFMove(preferences);
 }
 
 WebPreferences::WebPreferences(const String& identifier, const String& keyPrefix, const String& globalDebugKeyPrefix)
@@ -78,7 +78,7 @@ WebPreferences::~WebPreferences()
 
 PassRefPtr<WebPreferences> WebPreferences::copy() const
 {
-    return adoptRef(new WebPreferences(*this));
+    return adoptRef(*new WebPreferences(*this));
 }
 
 void WebPreferences::addPage(WebPageProxy& webPageProxy)
index 8c62053..a7e0346 100644 (file)
@@ -238,7 +238,7 @@ WebProcessPool::~WebProcessPool()
 
     m_iconDatabase->invalidate();
     m_iconDatabase->clearProcessPool();
-    WebIconDatabase* rawIconDatabase = m_iconDatabase.release().leakRef();
+    WebIconDatabase* rawIconDatabase = m_iconDatabase.leakRef();
     rawIconDatabase->derefWhenAppropriate();
 
     invalidateCallbackMap(m_dictionaryCallbacks, CallbackBase::Error::OwnerWasInvalidated);
index 34ffbc5..2c9aeac 100644 (file)
@@ -114,7 +114,7 @@ void ViewSnapshotStore::recordSnapshot(WebPageProxy& webPageProxy, WebBackForwar
 
     webPageProxy.willRecordNavigationSnapshot(item);
 
-    RefPtr<ViewSnapshot> snapshot = webPageProxy.takeViewSnapshot();
+    auto snapshot = webPageProxy.takeViewSnapshot();
     if (!snapshot)
         return;
 
@@ -122,7 +122,7 @@ void ViewSnapshotStore::recordSnapshot(WebPageProxy& webPageProxy, WebBackForwar
     snapshot->setDeviceScaleFactor(webPageProxy.deviceScaleFactor());
     snapshot->setBackgroundColor(webPageProxy.pageExtendedBackgroundColor());
 
-    item.setSnapshot(snapshot.release());
+    item.setSnapshot(WTFMove(snapshot));
 }
 
 void ViewSnapshotStore::discardSnapshotImages()
index faa1543..f2d7a92 100644 (file)
@@ -263,7 +263,7 @@ using namespace WebKit;
     else
         hitTestResult = _page->lastMouseMoveHitTestResult();
 
-    return hitTestResult.release();
+    return WTFMove(hitTestResult);
 }
 
 #pragma mark Immediate actions
index 7b9d889..3b10ce7 100644 (file)
@@ -340,7 +340,7 @@ static void pageDidComputePageRects(const Vector<WebCore::IntRect>& pageRects, d
     ASSERT(!_expectedComputedPagesCallback);
 
     IPCCallbackContext* context = new IPCCallbackContext;
-    RefPtr<ComputedPagesCallback> callback = ComputedPagesCallback::create([context](const Vector<WebCore::IntRect>& pageRects, double totalScaleFactorForPrinting, WebKit::CallbackBase::Error) {
+    auto callback = ComputedPagesCallback::create([context](const Vector<WebCore::IntRect>& pageRects, double totalScaleFactorForPrinting, WebKit::CallbackBase::Error) {
         std::unique_ptr<IPCCallbackContext> contextDeleter(context);
         pageDidComputePageRects(pageRects, totalScaleFactorForPrinting, context);
     });
@@ -348,7 +348,7 @@ static void pageDidComputePageRects(const Vector<WebCore::IntRect>& pageRects, d
     context->view = self;
     context->callbackID = _expectedComputedPagesCallback;
 
-    _webFrame->page()->computePagesForPrinting(_webFrame.get(), PrintInfo([_printOperation printInfo]), callback.release());
+    _webFrame->page()->computePagesForPrinting(_webFrame.get(), PrintInfo([_printOperation printInfo]), WTFMove(callback));
     return YES;
 }
 
index 43fa6f2..95d03c9 100644 (file)
@@ -271,8 +271,8 @@ void WebPageProxy::replaceSelectionWithPasteboardData(const Vector<String>& type
 #if ENABLE(DRAG_SUPPORT)
 void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag)
 {
-    if (RefPtr<ShareableBitmap> dragImage = ShareableBitmap::create(dragImageHandle))
-        m_pageClient.setDragImage(clientPosition, dragImage.release(), isLinkDrag);
+    if (auto dragImage = ShareableBitmap::create(dragImageHandle))
+        m_pageClient.setDragImage(clientPosition, WTFMove(dragImage), isLinkDrag);
 
     process().send(Messages::WebPage::DidStartDrag(), m_pageID);
 }
index fdaf675..32d8dc7 100644 (file)
@@ -71,8 +71,8 @@ using namespace WebKit;
 
 - (WKWebProcessPlugInHitTestResult *)hitTest:(CGPoint)point
 {
-    RefPtr<InjectedBundleHitTestResult> hitTestResult = _frame->hitTest(WebCore::IntPoint(point));
-    return [wrapper(*hitTestResult.release().leakRef()) autorelease];
+    auto hitTestResult = _frame->hitTest(WebCore::IntPoint(point));
+    return [wrapper(*hitTestResult.leakRef()) autorelease];
 }
 
 - (JSValue *)jsNodeForNodeHandle:(WKWebProcessPlugInNodeHandle *)nodeHandle inWorld:(WKWebProcessPlugInScriptWorld *)world
index 51deea8..7ea86c9 100644 (file)
@@ -44,8 +44,8 @@ using namespace WebKit;
 
 - (WKWebProcessPlugInNodeHandle *)nodeHandle
 {
-    RefPtr<InjectedBundleNodeHandle> nodeHandle = _hitTestResult->nodeHandle();
-    return nodeHandle ? [wrapper(*nodeHandle.release().leakRef()) autorelease] : nil;
+    auto nodeHandle = _hitTestResult->nodeHandle();
+    return nodeHandle ? [wrapper(*nodeHandle.leakRef()) autorelease] : nil;
 }
 
 #pragma mark WKObject protocol implementation
index 0b1dfdf..7b287fc 100644 (file)
@@ -48,20 +48,20 @@ using namespace WebKit;
 {
     JSContextRef contextRef = [context JSGlobalContextRef];
     JSObjectRef objectRef = JSValueToObject(contextRef, [value JSValueRef], 0);
-    RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(contextRef, objectRef);
+    auto nodeHandle = InjectedBundleNodeHandle::getOrCreate(contextRef, objectRef);
     if (!nodeHandle)
         return nil;
 
-    return [wrapper(*nodeHandle.release().leakRef()) autorelease];
+    return [wrapper(*nodeHandle.leakRef()) autorelease];
 }
 
 - (WKWebProcessPlugInFrame *)htmlIFrameElementContentFrame
 {
-    RefPtr<WebFrame> frame = _nodeHandle->htmlIFrameElementContentFrame();
+    auto frame = _nodeHandle->htmlIFrameElementContentFrame();
     if (!frame)
         return nil;
 
-    return [wrapper(*frame.release().leakRef()) autorelease];
+    return [wrapper(*frame.leakRef()) autorelease];
 }
 
 #if PLATFORM(IOS)
index 6c1061d..1aec0b9 100644 (file)
@@ -36,8 +36,8 @@ using namespace WebKit;
 
 + (WKWebProcessPlugInScriptWorld *)world
 {
-    RefPtr<InjectedBundleScriptWorld> scriptWorld = InjectedBundleScriptWorld::create();
-    return [wrapper(*scriptWorld.release().leakRef()) autorelease];
+    auto scriptWorld = InjectedBundleScriptWorld::create();
+    return [wrapper(scriptWorld.leakRef()) autorelease];
 }
 
 + (WKWebProcessPlugInScriptWorld *)normalWorld
index 85b8f92..e8853db 100644 (file)
@@ -62,7 +62,7 @@ void WKBundlePostSynchronousMessage(WKBundleRef bundleRef, WKStringRef messageNa
     RefPtr<API::Object> returnData;
     toImpl(bundleRef)->postSynchronousMessage(toWTFString(messageNameRef), toImpl(messageBodyRef), returnData);
     if (returnDataRef)
-        *returnDataRef = toAPI(returnData.release().leakRef());
+        *returnDataRef = toAPI(returnData.leakRef());
 }
 
 WKConnectionRef WKBundleGetApplicationConnection(WKBundleRef bundleRef)
index b660e81..fc381f4 100644 (file)
@@ -41,7 +41,7 @@ WKTypeID WKBundleDOMWindowExtensionGetTypeID()
 WKBundleDOMWindowExtensionRef WKBundleDOMWindowExtensionCreate(WKBundleFrameRef frame, WKBundleScriptWorldRef world)
 {
     RefPtr<InjectedBundleDOMWindowExtension> extension = InjectedBundleDOMWindowExtension::create(toImpl(frame), toImpl(world));
-    return toAPI(extension.release().leakRef());
+    return toAPI(extension.leakRef());
 }
 
 WKBundleFrameRef WKBundleDOMWindowExtensionGetFrame(WKBundleDOMWindowExtensionRef extension)
index 46f6999..2e4a7b6 100644 (file)
@@ -42,13 +42,13 @@ WKTypeID WKBundleHitTestResultGetTypeID()
 WKBundleNodeHandleRef WKBundleHitTestResultCopyNodeHandle(WKBundleHitTestResultRef hitTestResultRef)
 {
     RefPtr<InjectedBundleNodeHandle> nodeHandle = toImpl(hitTestResultRef)->nodeHandle();
-    return toAPI(nodeHandle.release().leakRef());
+    return toAPI(nodeHandle.leakRef());
 }
 
 WKBundleNodeHandleRef WKBundleHitTestResultCopyURLElementHandle(WKBundleHitTestResultRef hitTestResultRef)
 {
     RefPtr<InjectedBundleNodeHandle> urlElementNodeHandle = toImpl(hitTestResultRef)->urlElementHandle();
-    return toAPI(urlElementNodeHandle.release().leakRef());
+    return toAPI(urlElementNodeHandle.leakRef());
 }
 
 WKBundleFrameRef WKBundleHitTestResultGetFrame(WKBundleHitTestResultRef hitTestResultRef)
index ee89827..a3c363e 100644 (file)
@@ -58,13 +58,13 @@ WKEventMouseButton WKBundleNavigationActionGetEventMouseButton(WKBundleNavigatio
 WKBundleHitTestResultRef WKBundleNavigationActionCopyHitTestResult(WKBundleNavigationActionRef navigationActionRef)
 {
     RefPtr<InjectedBundleHitTestResult> hitTestResult = toImpl(navigationActionRef)->hitTestResult();
-    return toAPI(hitTestResult.release().leakRef());
+    return toAPI(hitTestResult.leakRef());
 }
 
 WKBundleNodeHandleRef WKBundleNavigationActionCopyFormElement(WKBundleNavigationActionRef navigationActionRef)
 {
     RefPtr<InjectedBundleNodeHandle> formElement = toImpl(navigationActionRef)->formElement();
-    return toAPI(formElement.release().leakRef());
+    return toAPI(formElement.leakRef());
 }
 
 bool WKBundleNavigationActionGetShouldOpenExternalURLs(WKBundleNavigationActionRef navigationActionRef)
index ee4f362..46cfa34 100644 (file)
@@ -59,13 +59,13 @@ WKTypeID WKBundleNodeHandleGetTypeID()
 WKBundleNodeHandleRef WKBundleNodeHandleCreate(JSContextRef contextRef, JSObjectRef objectRef)
 {
     RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(contextRef, objectRef);
-    return toAPI(nodeHandle.release().leakRef());
+    return toAPI(nodeHandle.leakRef());
 }
 
 WKBundleNodeHandleRef WKBundleNodeHandleCopyDocument(WKBundleNodeHandleRef nodeHandleRef)
 {
     RefPtr<InjectedBundleNodeHandle> nodeHandle = toImpl(nodeHandleRef)->document();
-    return toAPI(nodeHandle.release().leakRef());
+    return toAPI(nodeHandle.leakRef());
 }
 
 WKRect WKBundleNodeHandleGetRenderRect(WKBundleNodeHandleRef nodeHandleRef, bool* isReplaced)
@@ -76,13 +76,13 @@ WKRect WKBundleNodeHandleGetRenderRect(WKBundleNodeHandleRef nodeHandleRef, bool
 WKImageRef WKBundleNodeHandleCopySnapshotWithOptions(WKBundleNodeHandleRef nodeHandleRef, WKSnapshotOptions options)
 {
     RefPtr<WebImage> image = toImpl(nodeHandleRef)->renderedImage(toSnapshotOptions(options));
-    return toAPI(image.release().leakRef());
+    return toAPI(image.leakRef());
 }
 
 WKBundleRangeHandleRef WKBundleNodeHandleCopyVisibleRange(WKBundleNodeHandleRef nodeHandleRef)
 {
     RefPtr<InjectedBundleRangeHandle> rangeHandle = toImpl(nodeHandleRef)->visibleRange();
-    return toAPI(rangeHandle.release().leakRef());
+    return toAPI(rangeHandle.leakRef());
 }
 
 WKRect WKBundleNodeHandleGetElementBounds(WKBundleNodeHandleRef elementHandleRef)
@@ -138,25 +138,25 @@ bool WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit(WKBundleNodeH
 WKBundleNodeHandleRef WKBundleNodeHandleCopyHTMLTableCellElementCellAbove(WKBundleNodeHandleRef htmlTableCellElementHandleRef)
 {
     RefPtr<InjectedBundleNodeHandle> nodeHandle = toImpl(htmlTableCellElementHandleRef)->htmlTableCellElementCellAbove();
-    return toAPI(nodeHandle.release().leakRef());
+    return toAPI(nodeHandle.leakRef());
 }
 
 WKBundleFrameRef WKBundleNodeHandleCopyDocumentFrame(WKBundleNodeHandleRef documentHandleRef)
 {
     RefPtr<WebFrame> frame = toImpl(documentHandleRef)->documentFrame();
-    return toAPI(frame.release().leakRef());
+    return toAPI(frame.leakRef());
 }
 
 WKBundleFrameRef WKBundleNodeHandleCopyHTMLFrameElementContentFrame(WKBundleNodeHandleRef htmlFrameElementHandleRef)
 {
     RefPtr<WebFrame> frame = toImpl(htmlFrameElementHandleRef)->htmlFrameElementContentFrame();
-    return toAPI(frame.release().leakRef());
+    return toAPI(frame.leakRef());
 }
 
 WKBundleFrameRef WKBundleNodeHandleCopyHTMLIFrameElementContentFrame(WKBundleNodeHandleRef htmlIFrameElementHandleRef)
 {
     RefPtr<WebFrame> frame = toImpl(htmlIFrameElementHandleRef)->htmlIFrameElementContentFrame();
-    return toAPI(frame.release().leakRef());
+    return toAPI(frame.leakRef());
 }
 
 // Deprecated - use WKBundleNodeHandleGetHTMLInputElementAutoFilled(WKBundleNodeHandleRef).
index 17e21af..e18da91 100644 (file)
@@ -434,7 +434,7 @@ bool WKBundlePageFindString(WKBundlePageRef pageRef, WKStringRef target, WKFindO
 WKImageRef WKBundlePageCreateSnapshotWithOptions(WKBundlePageRef pageRef, WKRect rect, WKSnapshotOptions options)
 {
     RefPtr<WebImage> webImage = toImpl(pageRef)->scaledSnapshotWithOptions(toIntRect(rect), 1, toSnapshotOptions(options));
-    return toAPI(webImage.release().leakRef());
+    return toAPI(webImage.leakRef());
 }
 
 WKImageRef WKBundlePageCreateSnapshotInViewCoordinates(WKBundlePageRef pageRef, WKRect rect, WKImageOptions options)
@@