Stop using PassRefPtr in platform/graphics
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 May 2017 23:40:14 +0000 (23:40 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 May 2017 23:40:14 +0000 (23:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171977

Reviewed by Alex Christensen.

Source/WebCore:

Stop using PassRefPtr in platform/graphics.

* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::image):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::brokenImage):
(WebCore::CachedImage::image):
(WebCore::CachedImage::imageForRenderer):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::addImageToResources):
* platform/ScrollView.cpp:
(WebCore::ScrollView::paintPanScrollIcon):
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::drawCrossfade):
* platform/graphics/FontPlatformData.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
(WebCore::Image::nullImage):
* platform/graphics/Image.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::createResourceLoader):
* platform/graphics/MediaPlayer.h:
* platform/graphics/Pattern.cpp:
(WebCore::Pattern::create):
(WebCore::Pattern::Pattern):
* platform/graphics/Pattern.h:
* platform/graphics/PlatformTextTrack.h:
(WebCore::PlatformTextTrack::create):
(WebCore::PlatformTextTrack::createOutOfBand):
(WebCore::PlatformTextTrack::captionMenuOffItem):
(WebCore::PlatformTextTrack::captionMenuAutomaticItem):
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
(WebCore::InbandMetadataTextTrackPrivateAVF::create):
(WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionOptionAVFObjC::create):
(WebCore::MediaSelectionGroupAVFObjC::create):
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
(WebCore::InbandTextTrackPrivateAVCF::create):
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
(WebCore::InbandTextTrackPrivateLegacyAVCF::create):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::create):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
(WebCore::InbandTextTrackPrivateAVFObjC::create):
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h:
(WebCore::InbandTextTrackPrivateLegacyAVFObjC::create):
* platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
(WebCore::OutOfBandTextTrackPrivateAVF::create):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::create):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createPlatformCALayer):
(WebCore::GraphicsLayerCA::createPlatformCAAnimation):
(WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
(WebCore::GraphicsLayerCA::replicatedLayerRoot):
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createBasicAnimation):
(WebCore::GraphicsLayerCA::createKeyframeAnimation):
(WebCore::GraphicsLayerCA::createSpringAnimation):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h:
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(PlatformCAAnimationCocoa::create):
(PlatformCAAnimationCocoa::copy):
* platform/graphics/ca/win/AbstractCACFLayerTreeHost.h:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::create):
(WebCore::CACFLayerTreeHost::addPendingAnimatedLayer):
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
(PlatformCAAnimationWin::create):
(PlatformCAAnimationWin::copy):
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::addAnimationForKey):
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
(WebCore::WKCACFViewLayerTreeHost::create):
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
* platform/graphics/cairo/PatternCairo.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::clipForPatternFilling):
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/cg/PatternCG.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/filters/FEDiffuseLighting.cpp:
(WebCore::FEDiffuseLighting::FEDiffuseLighting):
(WebCore::FEDiffuseLighting::create):
(WebCore::FEDiffuseLighting::lightSource):
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::FELighting):
(WebCore::FELighting::drawLighting):
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FESpecularLighting.cpp:
(WebCore::FESpecularLighting::FESpecularLighting):
(WebCore::FESpecularLighting::create):
(WebCore::FESpecularLighting::lightSource):
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::asUnmultipliedImage):
(WebCore::FilterEffect::asPremultipliedImage):
* platform/graphics/filters/FilterEffect.h:
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::ReferenceFilterOperation::setFilterEffect):
(WebCore::BasicColorMatrixFilterOperation::blend):
(WebCore::BasicComponentTransferFilterOperation::blend):
(WebCore::BlurFilterOperation::blend):
(WebCore::DropShadowFilterOperation::blend):
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::blend):
(WebCore::PassthroughFilterOperation::create):
(WebCore::ReferenceFilterOperation::create):
* platform/graphics/gpu/Texture.cpp:
(WebCore::Texture::create):
* platform/graphics/gpu/Texture.h:
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/ImageGStreamer.h:
(WebCore::ImageGStreamer::createImage):
(WebCore::ImageGStreamer::image):
* platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
(WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
(WebCore::InbandMetadataTextTrackPrivateGStreamer::addGenericCue):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
(WebCore::InbandTextTrackPrivateGStreamer::create):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::enqueueSample):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::loadImageFromGResource):
(WebCore::loadResourceSharedBuffer):
(WebCore::loadMissingImageIconFromTheme):
(WebCore::Image::loadPlatformResource):
* platform/graphics/harfbuzz/HarfBuzzFace.cpp:
(WebCore::FaceCacheEntry::create):
* platform/graphics/harfbuzz/HarfBuzzFace.h:
(WebCore::HarfBuzzFace::create):
* platform/graphics/mac/ImageMac.mm:
(WebCore::Image::loadPlatformResource):
* platform/graphics/opentype/OpenTypeMathData.h:
(WebCore::OpenTypeMathData::create):
* platform/graphics/texmap/BitmapTexture.h:
(WebCore::BitmapTexture::applyFilters):
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::applyFilters):
* platform/graphics/texmap/BitmapTextureGL.h:
(WebCore::BitmapTextureGL::FilterInfo::FilterInfo):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::acquireTextureFromPool):
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::createTexture):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintIntoSurface):
(WebCore::commitSurface):
(WebCore::TextureMapperLayer::paintWithIntermediateSurface):
(WebCore::TextureMapperLayer::setBackingStore):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:
(WebCore::TextureMapperTiledBackingStore::create):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::syncImageBacking):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
(WebCore::CoordinatedImageBacking::create):
(WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
* platform/graphics/win/ImageWin.cpp:
(WebCore::Image::loadPlatformResource):
* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
(WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer):
* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h:
* platform/graphics/win/PatternDirect2D.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/win/SharedGDIObject.h:
(WebCore::SharedGDIObject::create):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::image):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::drawPlatformResizerImage):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::buildPattern):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
(WebCore::SVGFESpecularLightingElement::build):
* svg/graphics/SVGImageCache.cpp:
(WebCore::SVGImageCache::imageForRenderer):

Source/WebKit/win:

Build fix.

* FullscreenVideoController.cpp:
(FullscreenVideoController::enterFullscreen):
* WebKitDLL.cpp:
(loadResourceIntoBuffer):

Source/WebKit2:

Build fix.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
(WebKit::CoordinatedGraphicsScene::removeBackingStoreIfNeeded):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Cursor>::decode):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::createImageBackingIfNeeded):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::createPlatformCALayer):
(WebKit::GraphicsLayerCARemote::createPlatformCAAnimation):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::copy):

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

121 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSCrossfadeValue.cpp
Source/WebCore/css/CSSFilterImageValue.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp
Source/WebCore/platform/graphics/FontPlatformData.h
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/Pattern.cpp
Source/WebCore/platform/graphics/Pattern.h
Source/WebCore/platform/graphics/PlatformTextTrack.h
Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h
Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h
Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp
Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h
Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h
Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm
Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h
Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm
Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h
Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h
Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h
Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h
Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm
Source/WebCore/platform/graphics/ca/win/AbstractCACFLayerTreeHost.h
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.h
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h
Source/WebCore/platform/graphics/cairo/PatternCairo.cpp
Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
Source/WebCore/platform/graphics/cg/PatternCG.cpp
Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp
Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h
Source/WebCore/platform/graphics/filters/FELighting.cpp
Source/WebCore/platform/graphics/filters/FELighting.h
Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp
Source/WebCore/platform/graphics/filters/FESpecularLighting.h
Source/WebCore/platform/graphics/filters/FETile.cpp
Source/WebCore/platform/graphics/filters/FilterEffect.cpp
Source/WebCore/platform/graphics/filters/FilterEffect.h
Source/WebCore/platform/graphics/filters/FilterOperation.cpp
Source/WebCore/platform/graphics/filters/FilterOperation.h
Source/WebCore/platform/graphics/gpu/Texture.cpp
Source/WebCore/platform/graphics/gpu/Texture.h
Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.cpp
Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.h
Source/WebCore/platform/graphics/gtk/ImageGtk.cpp
Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFace.cpp
Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFace.h
Source/WebCore/platform/graphics/mac/ImageMac.mm
Source/WebCore/platform/graphics/opentype/OpenTypeMathData.h
Source/WebCore/platform/graphics/texmap/BitmapTexture.h
Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp
Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h
Source/WebCore/platform/graphics/win/ImageWin.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h
Source/WebCore/platform/graphics/win/PatternDirect2D.cpp
Source/WebCore/platform/graphics/win/SharedGDIObject.h
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/RenderImageResource.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/graphics/SVGImageCache.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/FullscreenVideoController.cpp
Source/WebKit/win/WebKitDLL.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h
Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h
Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm

index 2d42a10..6d218e7 100644 (file)
@@ -1,3 +1,236 @@
+2017-05-11  Chris Dumez  <cdumez@apple.com>
+
+        Stop using PassRefPtr in platform/graphics
+        https://bugs.webkit.org/show_bug.cgi?id=171977
+
+        Reviewed by Alex Christensen.
+
+        Stop using PassRefPtr in platform/graphics.
+
+        * css/CSSCrossfadeValue.cpp:
+        (WebCore::CSSCrossfadeValue::image):
+        * css/CSSFilterImageValue.cpp:
+        (WebCore::CSSFilterImageValue::image):
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::brokenImage):
+        (WebCore::CachedImage::image):
+        (WebCore::CachedImage::imageForRenderer):
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::addImageToResources):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::paintPanScrollIcon):
+        * platform/graphics/CrossfadeGeneratedImage.cpp:
+        (WebCore::CrossfadeGeneratedImage::drawCrossfade):
+        * platform/graphics/FontPlatformData.h:
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::nullImage):
+        * platform/graphics/Image.h:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::createResourceLoader):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/Pattern.cpp:
+        (WebCore::Pattern::create):
+        (WebCore::Pattern::Pattern):
+        * platform/graphics/Pattern.h:
+        * platform/graphics/PlatformTextTrack.h:
+        (WebCore::PlatformTextTrack::create):
+        (WebCore::PlatformTextTrack::createOutOfBand):
+        (WebCore::PlatformTextTrack::captionMenuOffItem):
+        (WebCore::PlatformTextTrack::captionMenuAutomaticItem):
+        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
+        (WebCore::InbandMetadataTextTrackPrivateAVF::create):
+        (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
+        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
+        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+        (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
+        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
+        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
+        (WebCore::MediaSelectionOptionAVFObjC::create):
+        (WebCore::MediaSelectionGroupAVFObjC::create):
+        (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
+        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
+        (WebCore::InbandTextTrackPrivateAVCF::create):
+        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
+        (WebCore::InbandTextTrackPrivateLegacyAVCF::create):
+        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
+        (WebCore::WebCoreAVCFResourceLoader::create):
+        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
+        (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
+        (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
+        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
+        (WebCore::InbandTextTrackPrivateAVFObjC::create):
+        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h:
+        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::create):
+        * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
+        (WebCore::OutOfBandTextTrackPrivateAVF::create):
+        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
+        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
+        (WebCore::WebCoreAVFResourceLoader::create):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::createPlatformCALayer):
+        (WebCore::GraphicsLayerCA::createPlatformCAAnimation):
+        (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
+        (WebCore::GraphicsLayerCA::replicatedLayerRoot):
+        (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
+        (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
+        (WebCore::GraphicsLayerCA::createBasicAnimation):
+        (WebCore::GraphicsLayerCA::createKeyframeAnimation):
+        (WebCore::GraphicsLayerCA::createSpringAnimation):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
+        * platform/graphics/ca/PlatformCAAnimation.h:
+        * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h:
+        * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
+        (PlatformCAAnimationCocoa::create):
+        (PlatformCAAnimationCocoa::copy):
+        * platform/graphics/ca/win/AbstractCACFLayerTreeHost.h:
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::CACFLayerTreeHost::create):
+        (WebCore::CACFLayerTreeHost::addPendingAnimatedLayer):
+        * platform/graphics/ca/win/CACFLayerTreeHost.h:
+        * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
+        (PlatformCAAnimationWin::create):
+        (PlatformCAAnimationWin::copy):
+        * platform/graphics/ca/win/PlatformCAAnimationWin.h:
+        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+        (PlatformCALayerWin::addAnimationForKey):
+        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
+        (WebCore::WKCACFViewLayerTreeHost::create):
+        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
+        * platform/graphics/cairo/PatternCairo.cpp:
+        (WebCore::Pattern::createPlatformPattern):
+        * platform/graphics/cairo/PlatformContextCairo.cpp:
+        (WebCore::PlatformContextCairo::clipForPatternFilling):
+        * platform/graphics/cg/PDFDocumentImage.h:
+        * platform/graphics/cg/PatternCG.cpp:
+        (WebCore::Pattern::createPlatformPattern):
+        * platform/graphics/filters/FEDiffuseLighting.cpp:
+        (WebCore::FEDiffuseLighting::FEDiffuseLighting):
+        (WebCore::FEDiffuseLighting::create):
+        (WebCore::FEDiffuseLighting::lightSource):
+        * platform/graphics/filters/FEDiffuseLighting.h:
+        * platform/graphics/filters/FELighting.cpp:
+        (WebCore::FELighting::FELighting):
+        (WebCore::FELighting::drawLighting):
+        * platform/graphics/filters/FELighting.h:
+        * platform/graphics/filters/FESpecularLighting.cpp:
+        (WebCore::FESpecularLighting::FESpecularLighting):
+        (WebCore::FESpecularLighting::create):
+        (WebCore::FESpecularLighting::lightSource):
+        * platform/graphics/filters/FESpecularLighting.h:
+        * platform/graphics/filters/FETile.cpp:
+        (WebCore::FETile::platformApplySoftware):
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::asUnmultipliedImage):
+        (WebCore::FilterEffect::asPremultipliedImage):
+        * platform/graphics/filters/FilterEffect.h:
+        * platform/graphics/filters/FilterOperation.cpp:
+        (WebCore::ReferenceFilterOperation::setFilterEffect):
+        (WebCore::BasicColorMatrixFilterOperation::blend):
+        (WebCore::BasicComponentTransferFilterOperation::blend):
+        (WebCore::BlurFilterOperation::blend):
+        (WebCore::DropShadowFilterOperation::blend):
+        * platform/graphics/filters/FilterOperation.h:
+        (WebCore::FilterOperation::blend):
+        (WebCore::PassthroughFilterOperation::create):
+        (WebCore::ReferenceFilterOperation::create):
+        * platform/graphics/gpu/Texture.cpp:
+        (WebCore::Texture::create):
+        * platform/graphics/gpu/Texture.h:
+        * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
+        * platform/graphics/gstreamer/ImageGStreamer.h:
+        (WebCore::ImageGStreamer::createImage):
+        (WebCore::ImageGStreamer::image):
+        * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
+        (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
+        (WebCore::InbandMetadataTextTrackPrivateGStreamer::addGenericCue):
+        * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
+        (WebCore::InbandTextTrackPrivateGStreamer::create):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::paint):
+        * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
+        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
+        (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
+        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
+        * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp:
+        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
+        (WebCore::PlaybackPipeline::enqueueSample):
+        * platform/graphics/gstreamer/mse/PlaybackPipeline.h:
+        * platform/graphics/gtk/ImageGtk.cpp:
+        (WebCore::loadImageFromGResource):
+        (WebCore::loadResourceSharedBuffer):
+        (WebCore::loadMissingImageIconFromTheme):
+        (WebCore::Image::loadPlatformResource):
+        * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
+        (WebCore::FaceCacheEntry::create):
+        * platform/graphics/harfbuzz/HarfBuzzFace.h:
+        (WebCore::HarfBuzzFace::create):
+        * platform/graphics/mac/ImageMac.mm:
+        (WebCore::Image::loadPlatformResource):
+        * platform/graphics/opentype/OpenTypeMathData.h:
+        (WebCore::OpenTypeMathData::create):
+        * platform/graphics/texmap/BitmapTexture.h:
+        (WebCore::BitmapTexture::applyFilters):
+        * platform/graphics/texmap/BitmapTextureGL.cpp:
+        (WebCore::BitmapTextureGL::applyFilters):
+        * platform/graphics/texmap/BitmapTextureGL.h:
+        (WebCore::BitmapTextureGL::FilterInfo::FilterInfo):
+        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+        (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
+        * platform/graphics/texmap/TextureMapper.cpp:
+        (WebCore::TextureMapper::acquireTextureFromPool):
+        * platform/graphics/texmap/TextureMapper.h:
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGL::createTexture):
+        * platform/graphics/texmap/TextureMapperGL.h:
+        * platform/graphics/texmap/TextureMapperLayer.cpp:
+        (WebCore::TextureMapperLayer::paintIntoSurface):
+        (WebCore::commitSurface):
+        (WebCore::TextureMapperLayer::paintWithIntermediateSurface):
+        (WebCore::TextureMapperLayer::setBackingStore):
+        * platform/graphics/texmap/TextureMapperLayer.h:
+        * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
+        (WebCore::TextureMapperTiledBackingStore::create):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::syncImageBacking):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
+        (WebCore::CoordinatedImageBacking::create):
+        (WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
+        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
+        * platform/graphics/win/ImageWin.cpp:
+        (WebCore::Image::loadPlatformResource):
+        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
+        (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer):
+        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h:
+        * platform/graphics/win/PatternDirect2D.cpp:
+        (WebCore::Pattern::createPlatformPattern):
+        * platform/graphics/win/SharedGDIObject.h:
+        (WebCore::SharedGDIObject::create):
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRenderer::build):
+        * rendering/RenderImageResource.cpp:
+        (WebCore::RenderImageResource::image):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::drawPlatformResizerImage):
+        * rendering/svg/RenderSVGResourcePattern.cpp:
+        (WebCore::RenderSVGResourcePattern::buildPattern):
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
+        (WebCore::SVGFEDiffuseLightingElement::build):
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
+        (WebCore::SVGFESpecularLightingElement::build):
+        * svg/graphics/SVGImageCache.cpp:
+        (WebCore::SVGImageCache::imageForRenderer):
+
 2017-05-11  Joseph Pecoraro  <pecoraro@apple.com>
 
         Remove Vibration API
index c324dc1..f90f7d9 100644 (file)
@@ -186,13 +186,13 @@ Image* CSSCrossfadeValue::image(RenderElement& renderer, const FloatSize& size)
     auto* cachedToImage = cachedImageForCSSValue(m_toValue, cachedResourceLoader, options);
 
     if (!cachedFromImage || !cachedToImage)
-        return Image::nullImage();
+        return &Image::nullImage();
 
     auto* fromImage = cachedFromImage->imageForRenderer(&renderer);
     auto* toImage = cachedToImage->imageForRenderer(&renderer);
 
     if (!fromImage || !toImage)
-        return Image::nullImage();
+        return &Image::nullImage();
 
     m_generatedImage = CrossfadeGeneratedImage::create(*fromImage, *toImage, m_percentageValue->floatValue(), fixedSize(renderer), size);
     return m_generatedImage.get();
index 15c3caf..7356ce5 100644 (file)
@@ -120,17 +120,17 @@ RefPtr<Image> CSSFilterImageValue::image(RenderElement* renderer, const FloatSiz
     ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
     auto* cachedImage = cachedImageForCSSValue(m_imageValue, renderer->document().cachedResourceLoader(), options);
     if (!cachedImage)
-        return Image::nullImage();
+        return &Image::nullImage();
 
     auto* image = cachedImage->imageForRenderer(renderer);
     if (!image)
-        return Image::nullImage();
+        return &Image::nullImage();
 
     // Transform Image into ImageBuffer.
     // FIXME (149424): This buffer should not be unconditionally unaccelerated.
     auto texture = ImageBuffer::create(size, Unaccelerated);
     if (!texture)
-        return Image::nullImage();
+        return &Image::nullImage();
 
     auto imageRect = FloatRect { { }, size };
     texture->context().drawImage(*image, imageRect);
@@ -140,7 +140,7 @@ RefPtr<Image> CSSFilterImageValue::image(RenderElement* renderer, const FloatSiz
     filterRenderer->setSourceImageRect(imageRect);
     filterRenderer->setFilterRegion(imageRect);
     if (!filterRenderer->build(*renderer, m_filterOperations, FilterFunction))
-        return Image::nullImage();
+        return &Image::nullImage();
     filterRenderer->apply();
 
     return filterRenderer->output()->copyImage();
index b0adf05..79b8086 100644 (file)
@@ -167,16 +167,16 @@ void CachedImage::allClientsRemoved()
 std::pair<Image*, float> CachedImage::brokenImage(float deviceScaleFactor) const
 {
     if (deviceScaleFactor >= 3) {
-        static NeverDestroyed<Image*> brokenImageVeryHiRes(Image::loadPlatformResource("missingImage@3x").leakRef());
+        static NeverDestroyed<Image*> brokenImageVeryHiRes(&Image::loadPlatformResource("missingImage@3x").leakRef());
         return std::make_pair(brokenImageVeryHiRes, 3);
     }
 
     if (deviceScaleFactor >= 2) {
-        static NeverDestroyed<Image*> brokenImageHiRes(Image::loadPlatformResource("missingImage@2x").leakRef());
+        static NeverDestroyed<Image*> brokenImageHiRes(&Image::loadPlatformResource("missingImage@2x").leakRef());
         return std::make_pair(brokenImageHiRes, 2);
     }
 
-    static NeverDestroyed<Image*> brokenImageLoRes(Image::loadPlatformResource("missingImage").leakRef());
+    static NeverDestroyed<Image*> brokenImageLoRes(&Image::loadPlatformResource("missingImage").leakRef());
     return std::make_pair(brokenImageLoRes, 1);
 }
 
@@ -197,7 +197,7 @@ Image* CachedImage::image()
     if (m_image)
         return m_image.get();
 
-    return Image::nullImage();
+    return &Image::nullImage();
 }
 
 Image* CachedImage::imageForRenderer(const RenderObject* renderer)
@@ -210,11 +210,11 @@ Image* CachedImage::imageForRenderer(const RenderObject* renderer)
     }
 
     if (!m_image)
-        return Image::nullImage();
+        return &Image::nullImage();
 
     if (m_image->isSVGImage()) {
         Image* image = m_svgImageCache->imageForRenderer(renderer);
-        if (image != Image::nullImage())
+        if (image != &Image::nullImage())
             return image;
     }
     return m_image.get();
index 93d3777..ec10cd5 100644 (file)
@@ -276,7 +276,7 @@ void PageSerializer::addImageToResources(CachedImage* image, RenderElement* imag
     if (!url.isValid() || m_resourceURLs.contains(url))
         return;
 
-    if (!image || image->image() == Image::nullImage())
+    if (!image || image->image() == &Image::nullImage())
         return;
 
     RefPtr<SharedBuffer> data = imageRenderer ? image->imageForRenderer(imageRenderer)->data() : 0;
index b198a7c..7ddb753 100644 (file)
@@ -1157,13 +1157,11 @@ void ScrollView::paintScrollbars(GraphicsContext& context, const IntRect& rect)
 
 void ScrollView::paintPanScrollIcon(GraphicsContext& context)
 {
-    static Image* panScrollIcon = Image::loadPlatformResource("panIcon").leakRef();
-    if (!panScrollIcon)
-        return;
+    static Image& panScrollIcon = Image::loadPlatformResource("panIcon").leakRef();
     IntPoint iconGCPoint = m_panScrollIconPoint;
     if (parent())
         iconGCPoint = parent()->windowToContents(iconGCPoint);
-    context.drawImage(*panScrollIcon, iconGCPoint);
+    context.drawImage(panScrollIcon, iconGCPoint);
 }
 
 void ScrollView::paint(GraphicsContext& context, const IntRect& rect, SecurityOriginPaintPolicy securityOriginPaintPolicy)
index 3cc770c..3d05264 100644 (file)
@@ -72,7 +72,7 @@ static void drawCrossfadeSubimage(GraphicsContext& context, Image& image, Compos
 void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext& context)
 {
     // Draw nothing if either of the images hasn't loaded yet.
-    if (m_fromImage.ptr() == Image::nullImage() || m_toImage.ptr() == Image::nullImage())
+    if (m_fromImage.ptr() == &Image::nullImage() || m_toImage.ptr() == &Image::nullImage())
         return;
 
     GraphicsContextStateSaver stateSaver(context);
index b154b65..d4771a9 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "TextFlags.h"
 #include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/text/StringImpl.h>
index b20bc12..c470746 100644 (file)
@@ -507,7 +507,6 @@ public:
     HDC hdc() const;
 #if PLATFORM(WIN)
 #if USE(WINGDI)
-    void setBitmap(PassRefPtr<SharedBitmap>);
     const AffineTransform& affineTransform() const;
     AffineTransform& affineTransform();
     void resetAffineTransform();
index 53a22aa..e853bfe 100644 (file)
@@ -54,11 +54,11 @@ Image::~Image()
 {
 }
 
-Image* Image::nullImage()
+Image& Image::nullImage()
 {
     ASSERT(isMainThread());
     static Image& nullImage = BitmapImage::create().leakRef();
-    return &nullImage;
+    return nullImage;
 }
 
 bool Image::supportsType(const String& type)
index df9f042..7064303 100644 (file)
@@ -36,7 +36,6 @@
 #include "ImageTypes.h"
 #include "NativeImage.h"
 #include <wtf/Optional.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/RetainPtr.h>
@@ -79,8 +78,7 @@ class Image : public RefCounted<Image> {
 public:
     virtual ~Image();
     
-    static PassRefPtr<Image> create(ImageObserver* = nullptr);
-    WEBCORE_EXPORT static PassRefPtr<Image> loadPlatformResource(const char* name);
+    WEBCORE_EXPORT static Ref<Image> loadPlatformResource(const char* name);
     WEBCORE_EXPORT static bool supportsType(const String&);
 
     virtual bool isBitmapImage() const { return false; }
@@ -98,7 +96,7 @@ public:
     // the image contains only resources from its own security origin.
     virtual bool hasSingleSecurityOrigin() const { return false; }
 
-    WEBCORE_EXPORT static Image* nullImage();
+    WEBCORE_EXPORT static Image& nullImage();
     bool isNull() const { return size().isEmpty(); }
 
     virtual void setContainerSize(const FloatSize&) { }
index 649b686..5503d7a 100644 (file)
@@ -1251,7 +1251,7 @@ CachedResourceLoader* MediaPlayer::cachedResourceLoader()
     return client().mediaPlayerCachedResourceLoader();
 }
 
-PassRefPtr<PlatformMediaResourceLoader> MediaPlayer::createResourceLoader()
+RefPtr<PlatformMediaResourceLoader> MediaPlayer::createResourceLoader()
 {
     return client().mediaPlayerCreateResourceLoader();
 }
index 5466e22..472d756 100644 (file)
@@ -528,7 +528,7 @@ public:
     long platformErrorCode() const;
 
     CachedResourceLoader* cachedResourceLoader();
-    PassRefPtr<PlatformMediaResourceLoader> createResourceLoader();
+    RefPtr<PlatformMediaResourceLoader> createResourceLoader();
 
 #if ENABLE(VIDEO_TRACK)
     void addAudioTrack(AudioTrackPrivate&);
index a9accc2..251e076 100644 (file)
 
 namespace WebCore {
 
-Ref<Pattern> Pattern::create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY)
+Ref<Pattern> Pattern::create(Ref<Image>&& tileImage, bool repeatX, bool repeatY)
 {
-    return adoptRef(*new Pattern(tileImage, repeatX, repeatY));
+    return adoptRef(*new Pattern(WTFMove(tileImage), repeatX, repeatY));
 }
 
-Pattern::Pattern(PassRefPtr<Image> image, bool repeatX, bool repeatY)
-    : m_tileImage(image)
+Pattern::Pattern(Ref<Image>&& image, bool repeatX, bool repeatY)
+    : m_tileImage(WTFMove(image))
     , m_repeatX(repeatX)
     , m_repeatY(repeatY)
 {
-    ASSERT(m_tileImage);
 }
 
 Pattern::~Pattern()
index 256fa2d..48386fa 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "AffineTransform.h"
 
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
@@ -55,10 +55,10 @@ class Image;
 
 class Pattern final : public RefCounted<Pattern> {
 public:
-    static Ref<Pattern> create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY);
+    static Ref<Pattern> create(Ref<Image>&& tileImage, bool repeatX, bool repeatY);
     ~Pattern();
 
-    Image* tileImage() const { return m_tileImage.get(); }
+    Image& tileImage() const { return m_tileImage.get(); }
 
     void platformDestroy();
 
@@ -76,9 +76,9 @@ public:
     bool repeatY() const { return m_repeatY; }
 
 private:
-    Pattern(PassRefPtr<Image>, bool repeatX, bool repeatY);
+    Pattern(Ref<Image>&&, bool repeatX, bool repeatY);
 
-    RefPtr<Image> m_tileImage;
+    Ref<Image> m_tileImage;
     bool m_repeatX;
     bool m_repeatY;
     AffineTransform m_patternSpaceTransformation;
index 20be3d1..95f6553 100644 (file)
@@ -65,14 +65,14 @@ public:
         Showing
     };
     
-    static PassRefPtr<PlatformTextTrack> create(PlatformTextTrackClient* client, const String& label, const String& language, TrackMode mode, TrackKind kind, TrackType type, int uniqueId)
+    static Ref<PlatformTextTrack> create(PlatformTextTrackClient* client, const String& label, const String& language, TrackMode mode, TrackKind kind, TrackType type, int uniqueId)
     {
-        return adoptRef(new PlatformTextTrack(client, label, language, String(), mode, kind, type, uniqueId, false));
+        return adoptRef(*new PlatformTextTrack(client, label, language, String(), mode, kind, type, uniqueId, false));
     }
 
-    static PassRefPtr<PlatformTextTrack> createOutOfBand(const String& label, const String& language, const String& url, TrackMode mode, TrackKind kind, int uniqueId, bool isDefault)
+    static Ref<PlatformTextTrack> createOutOfBand(const String& label, const String& language, const String& url, TrackMode mode, TrackKind kind, int uniqueId, bool isDefault)
     {
-        return adoptRef(new PlatformTextTrack(nullptr, label, language, url, mode, kind, OutOfBand, uniqueId, isDefault));
+        return adoptRef(*new PlatformTextTrack(nullptr, label, language, url, mode, kind, OutOfBand, uniqueId, isDefault));
     }
 
     virtual ~PlatformTextTrack() { }
@@ -87,15 +87,15 @@ public:
     int uniqueId() const { return m_uniqueId; }
     bool isDefault() const { return m_isDefault; }
 
-    static PlatformTextTrack* captionMenuOffItem()
+    static PlatformTextTrack& captionMenuOffItem()
     {
-        static PlatformTextTrack* off = PlatformTextTrack::create(nullptr, "off menu item", "", Showing, Subtitle, InBand, 0).leakRef();
+        static PlatformTextTrack& off = PlatformTextTrack::create(nullptr, "off menu item", "", Showing, Subtitle, InBand, 0).leakRef();
         return off;
     }
 
-    static PlatformTextTrack* captionMenuAutomaticItem()
+    static PlatformTextTrack& captionMenuAutomaticItem()
     {
-        static PlatformTextTrack* automatic = PlatformTextTrack::create(nullptr, "automatic menu item", "", Showing, Subtitle, InBand, 0).leakRef();
+        static PlatformTextTrack& automatic = PlatformTextTrack::create(nullptr, "automatic menu item", "", Showing, Subtitle, InBand, 0).leakRef();
         return automatic;
     }
 
index b49bd1e..2c93520 100644 (file)
@@ -37,9 +37,9 @@
 
 namespace WebCore {
 
-PassRefPtr<InbandMetadataTextTrackPrivateAVF> InbandMetadataTextTrackPrivateAVF::create(InbandTextTrackPrivate::Kind kind, InbandTextTrackPrivate::CueFormat cueFormat, const AtomicString& id)
+Ref<InbandMetadataTextTrackPrivateAVF> InbandMetadataTextTrackPrivateAVF::create(InbandTextTrackPrivate::Kind kind, InbandTextTrackPrivate::CueFormat cueFormat, const AtomicString& id)
 {
-    return adoptRef(new InbandMetadataTextTrackPrivateAVF(kind, cueFormat, id));
+    return adoptRef(*new InbandMetadataTextTrackPrivateAVF(kind, cueFormat, id));
 }
 
 InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF(InbandTextTrackPrivate::Kind kind, InbandTextTrackPrivate::CueFormat cueFormat, const AtomicString& id)
@@ -55,7 +55,7 @@ InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF()
 
 #if ENABLE(DATACUE_VALUE)
 
-void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation> prpCueData, const String& type)
+void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&& cueData, const String& type)
 {
     ASSERT(cueFormat() == Data);
     ASSERT(start >= MediaTime::zeroTime());
@@ -63,11 +63,10 @@ void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime& start, const
     if (!client())
         return;
 
-    RefPtr<SerializedPlatformRepresentation> cueData = prpCueData;
     m_currentCueStartTime = start;
     if (end.isPositiveInfinite())
-        m_incompleteCues.append(IncompleteMetaDataCue { cueData.get(), start });
-    client()->addDataCue(start, end, cueData.releaseNonNull(), type);
+        m_incompleteCues.append(IncompleteMetaDataCue { cueData.ptr(), start });
+    client()->addDataCue(start, end, WTFMove(cueData), type);
 }
 
 void InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes(const MediaTime& time)
index ff42fa2..52fd9a6 100644 (file)
@@ -41,7 +41,7 @@ struct IncompleteMetaDataCue {
 
 class InbandMetadataTextTrackPrivateAVF : public InbandTextTrackPrivate {
 public:
-    static PassRefPtr<InbandMetadataTextTrackPrivateAVF> create(Kind, CueFormat, const AtomicString& id = emptyAtom);
+    static Ref<InbandMetadataTextTrackPrivateAVF> create(Kind, CueFormat, const AtomicString& id = emptyAtom);
 
     ~InbandMetadataTextTrackPrivateAVF();
 
@@ -51,7 +51,7 @@ public:
     void setInBandMetadataTrackDispatchType(const AtomicString& value) { m_inBandMetadataTrackDispatchType = value; }
 
 #if ENABLE(DATACUE_VALUE)
-    void addDataCue(const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation>, const String&);
+    void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&);
     void updatePendingCueEndTimes(const MediaTime&);
 #endif
 
index 9596f8c..a7caa6e 100644 (file)
@@ -397,7 +397,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(WTFMove(cueData));
+        client()->addGenericCue(cueData);
     }
 
     m_pendingCueStatus = seeking() ? DeliveredDuringSeek : Valid;
index 9645337..7863541 100644 (file)
@@ -31,7 +31,7 @@
 #include "Timer.h"
 #include <wtf/HashMap.h>
 #include <wtf/IteratorRange.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/RetainPtr.h>
@@ -47,7 +47,7 @@ class MediaSelectionGroupAVFObjC;
 
 class MediaSelectionOptionAVFObjC : public RefCounted<MediaSelectionOptionAVFObjC> {
 public:
-    static PassRefPtr<MediaSelectionOptionAVFObjC> create(MediaSelectionGroupAVFObjC&, AVMediaSelectionOption *);
+    static Ref<MediaSelectionOptionAVFObjC> create(MediaSelectionGroupAVFObjC&, AVMediaSelectionOption *);
 
     void setSelected(bool);
     bool selected() const;
@@ -68,7 +68,7 @@ private:
 
 class MediaSelectionGroupAVFObjC : public RefCounted<MediaSelectionGroupAVFObjC> {
 public:
-    static PassRefPtr<MediaSelectionGroupAVFObjC> create(AVPlayerItem*, AVMediaSelectionGroup*, const Vector<String>& characteristics);
+    static Ref<MediaSelectionGroupAVFObjC> create(AVPlayerItem*, AVMediaSelectionGroup*, const Vector<String>& characteristics);
     ~MediaSelectionGroupAVFObjC();
 
     void setSelectedOption(MediaSelectionOptionAVFObjC*);
index 8dee09c..30f81ad 100644 (file)
@@ -48,9 +48,9 @@ SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionOption)
 
 namespace WebCore {
 
-PassRefPtr<MediaSelectionOptionAVFObjC> MediaSelectionOptionAVFObjC::create(MediaSelectionGroupAVFObjC& group, AVMediaSelectionOption *option)
+Ref<MediaSelectionOptionAVFObjC> MediaSelectionOptionAVFObjC::create(MediaSelectionGroupAVFObjC& group, AVMediaSelectionOption *option)
 {
-    return adoptRef(new MediaSelectionOptionAVFObjC(group, option));
+    return adoptRef(*new MediaSelectionOptionAVFObjC(group, option));
 }
 
 MediaSelectionOptionAVFObjC::MediaSelectionOptionAVFObjC(MediaSelectionGroupAVFObjC& group, AVMediaSelectionOption *option)
@@ -85,9 +85,9 @@ int MediaSelectionOptionAVFObjC::index() const
     return [[m_group->avMediaSelectionGroup() options] indexOfObject:m_mediaSelectionOption.get()];
 }
 
-PassRefPtr<MediaSelectionGroupAVFObjC> MediaSelectionGroupAVFObjC::create(AVPlayerItem *item, AVMediaSelectionGroup *group, const Vector<String>& characteristics)
+Ref<MediaSelectionGroupAVFObjC> MediaSelectionGroupAVFObjC::create(AVPlayerItem *item, AVMediaSelectionGroup *group, const Vector<String>& characteristics)
 {
-    return adoptRef(new MediaSelectionGroupAVFObjC(item, group, characteristics));
+    return adoptRef(*new MediaSelectionGroupAVFObjC(item, group, characteristics));
 }
 
 MediaSelectionGroupAVFObjC::MediaSelectionGroupAVFObjC(AVPlayerItem *item, AVMediaSelectionGroup *group, const Vector<String>& characteristics)
@@ -130,7 +130,7 @@ void MediaSelectionGroupAVFObjC::updateOptions(const Vector<String>& characteris
     for (AVMediaSelectionOption* addedAVOption in addedAVOptions.get()) {
         auto addedOption = MediaSelectionOptionAVFObjC::create(*this, addedAVOption);
         if (addedAVOption == selectedOption)
-            m_selectedOption = addedOption.get();
+            m_selectedOption = addedOption.ptr();
         m_options.set(addedAVOption, WTFMove(addedOption));
     }
 
index 90a1861..1a3df91 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
 
 class InbandTextTrackPrivateAVCF : public InbandTextTrackPrivateAVF {
 public:
-    static PassRefPtr<InbandTextTrackPrivateAVCF> create(AVFInbandTrackParent* player,  AVCFMediaSelectionOptionRef selection, InbandTextTrackPrivate::CueFormat format)
+    static Ref<InbandTextTrackPrivateAVCF> create(AVFInbandTrackParent* player,  AVCFMediaSelectionOptionRef selection, InbandTextTrackPrivate::CueFormat format)
     {
-        return adoptRef(new InbandTextTrackPrivateAVCF(player, selection, format));
+        return adoptRef(*new InbandTextTrackPrivateAVCF(player, selection, format));
     }
 
     ~InbandTextTrackPrivateAVCF() { }
index 0c9c332..c3a0e88 100644 (file)
@@ -38,9 +38,9 @@ class MediaPlayerPrivateAVFoundationCF;
 
 class InbandTextTrackPrivateLegacyAVCF : public InbandTextTrackPrivateAVF {
 public:
-    static PassRefPtr<InbandTextTrackPrivateLegacyAVCF> create(MediaPlayerPrivateAVFoundationCF* player, AVCFPlayerItemTrackRef track)
+    static Ref<InbandTextTrackPrivateLegacyAVCF> create(MediaPlayerPrivateAVFoundationCF* player, AVCFPlayerItemTrackRef track)
     {
-        return adoptRef(new InbandTextTrackPrivateLegacyAVCF(player, track));
+        return adoptRef(*new InbandTextTrackPrivateLegacyAVCF(player, track));
     }
 
     ~InbandTextTrackPrivateLegacyAVCF() { }
index 05fd026..29c47a0 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<WebCoreAVCFResourceLoader> WebCoreAVCFResourceLoader::create(MediaPlayerPrivateAVFoundationCF* parent, AVCFAssetResourceLoadingRequestRef avRequest)
+Ref<WebCoreAVCFResourceLoader> WebCoreAVCFResourceLoader::create(MediaPlayerPrivateAVFoundationCF* parent, AVCFAssetResourceLoadingRequestRef avRequest)
 {
     ASSERT(avRequest);
     ASSERT(parent);
-    return adoptRef(new WebCoreAVCFResourceLoader(parent, avRequest));
+    return adoptRef(*new WebCoreAVCFResourceLoader(parent, avRequest));
 }
 
 WebCoreAVCFResourceLoader::WebCoreAVCFResourceLoader(MediaPlayerPrivateAVFoundationCF* parent, AVCFAssetResourceLoadingRequestRef avRequest)
index a0f0dd8..dae06e1 100644 (file)
@@ -30,7 +30,7 @@
 #include "CachedRawResourceClient.h"
 #include "CachedResourceHandle.h"
 #include <wtf/Noncopyable.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RetainPtr.h>
 
@@ -45,7 +45,7 @@ class MediaPlayerPrivateAVFoundationCF;
 class WebCoreAVCFResourceLoader : public RefCounted<WebCoreAVCFResourceLoader>, CachedRawResourceClient {
     WTF_MAKE_NONCOPYABLE(WebCoreAVCFResourceLoader); WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<WebCoreAVCFResourceLoader> create(MediaPlayerPrivateAVFoundationCF* parent, AVCFAssetResourceLoadingRequestRef);
+    static Ref<WebCoreAVCFResourceLoader> create(MediaPlayerPrivateAVFoundationCF* parent, AVCFAssetResourceLoadingRequestRef);
     virtual ~WebCoreAVCFResourceLoader();
 
     void startLoading();
index 71e712e..0da2ad0 100644 (file)
@@ -60,7 +60,7 @@ public:
     void didProvideContentKeyRequest(AVContentKeyRequest *);
 
 protected:
-    PassRefPtr<Uint8Array> generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode);
+    RefPtr<Uint8Array> generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode);
 
     bool hasContentKeySession() const { return m_contentKeySession; }
     AVContentKeySession* contentKeySession();
index 5513f3d..c224347 100644 (file)
@@ -309,7 +309,7 @@ void CDMSessionAVContentKeySession::removeParser(AVStreamDataParser* parser)
     [contentKeySession() removeStreamDataParser:parser];
 }
 
-PassRefPtr<Uint8Array> CDMSessionAVContentKeySession::generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode)
+RefPtr<Uint8Array> CDMSessionAVContentKeySession::generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode)
 {
     ASSERT(m_mode == KeyRelease);
     m_certificate = m_initData;
index b8c7d9b..b0b53e8 100644 (file)
@@ -58,7 +58,7 @@ public:
     void setStreamSession(AVStreamSession*);
 
 protected:
-    PassRefPtr<Uint8Array> generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode);
+    RefPtr<Uint8Array> generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode);
 
     WeakPtrFactory<CDMSessionAVStreamSession> m_weakPtrFactory;
     RetainPtr<AVStreamSession> m_streamSession;
index e8519e2..6eac698 100644 (file)
@@ -307,7 +307,7 @@ void CDMSessionAVStreamSession::removeParser(AVStreamDataParser* parser)
         [m_streamSession removeStreamDataParser:parser];
 }
 
-PassRefPtr<Uint8Array> CDMSessionAVStreamSession::generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode)
+RefPtr<Uint8Array> CDMSessionAVStreamSession::generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode)
 {
     ASSERT(m_mode == KeyRelease);
     m_certificate = m_initData;
index 88a922a..18a94ad 100644 (file)
@@ -38,9 +38,9 @@ namespace WebCore {
 
 class InbandTextTrackPrivateAVFObjC : public InbandTextTrackPrivateAVF {
 public:
-    static PassRefPtr<InbandTextTrackPrivateAVFObjC> create(AVFInbandTrackParent* player,  AVMediaSelectionOption *selection, InbandTextTrackPrivate::CueFormat format)
+    static Ref<InbandTextTrackPrivateAVFObjC> create(AVFInbandTrackParent* player,  AVMediaSelectionOption *selection, InbandTextTrackPrivate::CueFormat format)
     {
-        return adoptRef(new InbandTextTrackPrivateAVFObjC(player, selection, format));
+        return adoptRef(*new InbandTextTrackPrivateAVFObjC(player, selection, format));
     }
 
     ~InbandTextTrackPrivateAVFObjC() { }
index f385a3f..b84154c 100644 (file)
@@ -39,9 +39,9 @@ class MediaPlayerPrivateAVFoundationObjC;
 
 class InbandTextTrackPrivateLegacyAVFObjC : public InbandTextTrackPrivateAVF {
 public:
-    static PassRefPtr<InbandTextTrackPrivateLegacyAVFObjC> create(MediaPlayerPrivateAVFoundationObjC* player, AVPlayerItemTrack *track)
+    static Ref<InbandTextTrackPrivateLegacyAVFObjC> create(MediaPlayerPrivateAVFoundationObjC* player, AVPlayerItemTrack *track)
     {
-        return adoptRef(new InbandTextTrackPrivateLegacyAVFObjC(player, track));
+        return adoptRef(*new InbandTextTrackPrivateLegacyAVFObjC(player, track));
     }
 
     ~InbandTextTrackPrivateLegacyAVFObjC() { }
index a14c41e..b7a24b6 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
     
 class OutOfBandTextTrackPrivateAVF : public InbandTextTrackPrivateAVF {
 public:
-    static PassRefPtr<OutOfBandTextTrackPrivateAVF> create(AVFInbandTrackParent* player,  AVMediaSelectionOption* selection)
+    static Ref<OutOfBandTextTrackPrivateAVF> create(AVFInbandTrackParent* player,  AVMediaSelectionOption* selection)
     {
-        return adoptRef(new OutOfBandTextTrackPrivateAVF(player, selection));
+        return adoptRef(*new OutOfBandTextTrackPrivateAVF(player, selection));
     }
     
     void processCue(CFArrayRef, CFArrayRef, const MediaTime&) override { }
index 7d7f773..f5e3740 100644 (file)
@@ -30,7 +30,7 @@
 #include "CachedRawResourceClient.h"
 #include "CachedResourceHandle.h"
 #include <wtf/Noncopyable.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RetainPtr.h>
 
@@ -45,7 +45,7 @@ class MediaPlayerPrivateAVFoundationObjC;
 class WebCoreAVFResourceLoader : public RefCounted<WebCoreAVFResourceLoader>, CachedRawResourceClient {
     WTF_MAKE_NONCOPYABLE(WebCoreAVFResourceLoader); WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<WebCoreAVFResourceLoader> create(MediaPlayerPrivateAVFoundationObjC* parent, AVAssetResourceLoadingRequest *);
+    static Ref<WebCoreAVFResourceLoader> create(MediaPlayerPrivateAVFoundationObjC* parent, AVAssetResourceLoadingRequest *);
     virtual ~WebCoreAVFResourceLoader();
 
     void startLoading();
index 76030d2..4f7d41d 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<WebCoreAVFResourceLoader> WebCoreAVFResourceLoader::create(MediaPlayerPrivateAVFoundationObjC* parent, AVAssetResourceLoadingRequest *avRequest)
+Ref<WebCoreAVFResourceLoader> WebCoreAVFResourceLoader::create(MediaPlayerPrivateAVFoundationObjC* parent, AVAssetResourceLoadingRequest *avRequest)
 {
     ASSERT(avRequest);
     ASSERT(parent);
-    return adoptRef(new WebCoreAVFResourceLoader(parent, avRequest));
+    return adoptRef(*new WebCoreAVFResourceLoader(parent, avRequest));
 }
 
 WebCoreAVFResourceLoader::WebCoreAVFResourceLoader(MediaPlayerPrivateAVFoundationObjC* parent, AVAssetResourceLoadingRequest *avRequest)
index f91dd3e..65113b0 100644 (file)
@@ -348,7 +348,7 @@ bool GraphicsLayerCA::filtersCanBeComposited(const FilterOperations& filters)
 #endif
 }
 
-PassRefPtr<PlatformCALayer> GraphicsLayerCA::createPlatformCALayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* owner)
+Ref<PlatformCALayer> GraphicsLayerCA::createPlatformCALayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* owner)
 {
 #if PLATFORM(COCOA)
     auto result = PlatformCALayerCocoa::create(layerType, owner);
@@ -356,13 +356,13 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::createPlatformCALayer(PlatformCALay
     if (result->canHaveBackingStore())
         result->setWantsDeepColorBackingStore(screenSupportsExtendedColor());
     
-    return WTFMove(result);
+    return result;
 #elif PLATFORM(WIN)
     return PlatformCALayerWin::create(layerType, owner);
 #endif
 }
     
-PassRefPtr<PlatformCALayer> GraphicsLayerCA::createPlatformCALayer(PlatformLayer* platformLayer, PlatformCALayerClient* owner)
+Ref<PlatformCALayer> GraphicsLayerCA::createPlatformCALayer(PlatformLayer* platformLayer, PlatformCALayerClient* owner)
 {
 #if PLATFORM(COCOA)
     return PlatformCALayerCocoa::create(platformLayer, owner);
@@ -371,7 +371,7 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::createPlatformCALayer(PlatformLayer
 #endif
 }
 
-PassRefPtr<PlatformCAAnimation> GraphicsLayerCA::createPlatformCAAnimation(PlatformCAAnimation::AnimationType type, const String& keyPath)
+Ref<PlatformCAAnimation> GraphicsLayerCA::createPlatformCAAnimation(PlatformCAAnimation::AnimationType type, const String& keyPath)
 {
 #if PLATFORM(COCOA)
     return PlatformCAAnimationCocoa::create(type, keyPath);
@@ -1131,7 +1131,7 @@ void GraphicsLayerCA::setContentsToPlatformLayer(PlatformLayer* platformLayer, C
     // the creator of the raw layer is using it for some other purpose.
     // For now we don't support such a case.
     PlatformCALayer* platformCALayer = PlatformCALayer::platformCALayer(platformLayer);
-    m_contentsLayer = platformLayer ? (platformCALayer ? platformCALayer : createPlatformCALayer(platformLayer, this)) : nullptr;
+    m_contentsLayer = platformLayer ? (platformCALayer ? platformCALayer : createPlatformCALayer(platformLayer, this).ptr()) : nullptr;
     m_contentsLayerPurpose = platformLayer ? purpose : NoContentsLayer;
 
     if (m_contentsClippingLayer && m_contentsLayer)
@@ -2685,7 +2685,7 @@ GraphicsLayerCA::CloneID GraphicsLayerCA::ReplicaState::cloneID() const
     return String::adopt(WTFMove(result));
 }
 
-PassRefPtr<PlatformCALayer> GraphicsLayerCA::replicatedLayerRoot(ReplicaState& replicaState)
+RefPtr<PlatformCALayer> GraphicsLayerCA::replicatedLayerRoot(ReplicaState& replicaState)
 {
     // Limit replica nesting, to avoid 2^N explosion of replica layers.
     if (!m_replicatedLayer || replicaState.replicaDepth() == ReplicaState::maxReplicaDepth)
@@ -2907,7 +2907,7 @@ bool GraphicsLayerCA::createAnimationFromKeyframes(const KeyframeValueList& valu
     if (!valuesOK)
         return false;
 
-    m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation, animationName, valueList.property(), animationIndex, 0, timeOffset));
+    m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation.releaseNonNull(), animationName, valueList.property(), animationIndex, 0, timeOffset));
 
     return true;
 }
@@ -2934,7 +2934,7 @@ bool GraphicsLayerCA::appendToUncommittedAnimations(const KeyframeValueList& val
     if (!validMatrices)
         return false;
 
-    m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation, animationName, valueList.property(), animationIndex, 0, timeOffset));
+    m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation.releaseNonNull(), animationName, valueList.property(), animationIndex, 0, timeOffset));
     return true;
 }
 
@@ -3015,7 +3015,7 @@ bool GraphicsLayerCA::appendToUncommittedAnimations(const KeyframeValueList& val
         
         ASSERT(valuesOK);
 
-        m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation, animationName, valueList.property(), animationIndex, internalFilterPropertyIndex, timeOffset));
+        m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation.releaseNonNull(), animationName, valueList.property(), animationIndex, internalFilterPropertyIndex, timeOffset));
     }
 
     return true;
@@ -3054,24 +3054,24 @@ bool GraphicsLayerCA::createFilterAnimationsFromKeyframes(const KeyframeValueLis
     return true;
 }
 
-PassRefPtr<PlatformCAAnimation> GraphicsLayerCA::createBasicAnimation(const Animation* anim, const String& keyPath, bool additive)
+Ref<PlatformCAAnimation> GraphicsLayerCA::createBasicAnimation(const Animation* anim, const String& keyPath, bool additive)
 {
-    RefPtr<PlatformCAAnimation> basicAnim = createPlatformCAAnimation(PlatformCAAnimation::Basic, keyPath);
-    setupAnimation(basicAnim.get(), anim, additive);
+    auto basicAnim = createPlatformCAAnimation(PlatformCAAnimation::Basic, keyPath);
+    setupAnimation(basicAnim.ptr(), anim, additive);
     return basicAnim;
 }
 
-PassRefPtr<PlatformCAAnimation> GraphicsLayerCA::createKeyframeAnimation(const Animation* anim, const String& keyPath, bool additive)
+Ref<PlatformCAAnimation> GraphicsLayerCA::createKeyframeAnimation(const Animation* anim, const String& keyPath, bool additive)
 {
-    RefPtr<PlatformCAAnimation> keyframeAnim = createPlatformCAAnimation(PlatformCAAnimation::Keyframe, keyPath);
-    setupAnimation(keyframeAnim.get(), anim, additive);
+    auto keyframeAnim = createPlatformCAAnimation(PlatformCAAnimation::Keyframe, keyPath);
+    setupAnimation(keyframeAnim.ptr(), anim, additive);
     return keyframeAnim;
 }
 
-RefPtr<PlatformCAAnimation> GraphicsLayerCA::createSpringAnimation(const Animation* anim, const String& keyPath, bool additive)
+Ref<PlatformCAAnimation> GraphicsLayerCA::createSpringAnimation(const Animation* anim, const String& keyPath, bool additive)
 {
     auto basicAnim = createPlatformCAAnimation(PlatformCAAnimation::Spring, keyPath);
-    setupAnimation(basicAnim.get(), anim, additive);
+    setupAnimation(basicAnim.ptr(), anim, additive);
     return basicAnim;
 }
 
@@ -3740,7 +3740,7 @@ void GraphicsLayerCA::setupContentsLayer(PlatformCALayer* contentsLayer)
     setLayerDebugBorder(*contentsLayer, contentsLayerDebugBorderColor(isShowingDebugBorder()), contentsLayerBorderWidth);
 }
 
-PassRefPtr<PlatformCALayer> GraphicsLayerCA::findOrMakeClone(CloneID cloneID, PlatformCALayer *sourceLayer, LayerMap* clones, CloneLevel cloneLevel)
+RefPtr<PlatformCALayer> GraphicsLayerCA::findOrMakeClone(CloneID cloneID, PlatformCALayer *sourceLayer, LayerMap* clones, CloneLevel cloneLevel)
 {
     if (!sourceLayer)
         return nullptr;
@@ -3853,7 +3853,7 @@ void GraphicsLayerCA::propagateLayerChangeToReplicas(ScheduleFlushOrNot schedule
     }
 }
 
-PassRefPtr<PlatformCALayer> GraphicsLayerCA::fetchCloneLayers(GraphicsLayer* replicaRoot, ReplicaState& replicaState, CloneLevel cloneLevel)
+RefPtr<PlatformCALayer> GraphicsLayerCA::fetchCloneLayers(GraphicsLayer* replicaRoot, ReplicaState& replicaState, CloneLevel cloneLevel)
 {
     RefPtr<PlatformCALayer> primaryLayer;
     RefPtr<PlatformCALayer> structuralLayer;
@@ -3967,16 +3967,16 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::fetchCloneLayers(GraphicsLayer* rep
     return result;
 }
 
-PassRefPtr<PlatformCALayer> GraphicsLayerCA::cloneLayer(PlatformCALayer *layer, CloneLevel cloneLevel)
+Ref<PlatformCALayer> GraphicsLayerCA::cloneLayer(PlatformCALayer *layer, CloneLevel cloneLevel)
 {
-    RefPtr<PlatformCALayer> newLayer = layer->clone(this);
+    auto newLayer = layer->clone(this);
 
     if (cloneLevel == IntermediateCloneLevel) {
         newLayer->setOpacity(layer->opacity());
-        copyAnimations(layer, newLayer.get());
+        copyAnimations(layer, newLayer.ptr());
     }
 
-    setLayerDebugBorder(*newLayer, cloneLayerDebugBorderColor(isShowingDebugBorder()), cloneLayerBorderWidth);
+    setLayerDebugBorder(newLayer, cloneLayerDebugBorderColor(isShowingDebugBorder()), cloneLayerBorderWidth);
 
     return newLayer;
 }
index b9b1842..5139faf 100644 (file)
@@ -219,9 +219,9 @@ private:
 
     WEBCORE_EXPORT void layerDidDisplay(PlatformCALayer*);
 
-    virtual PassRefPtr<PlatformCALayer> createPlatformCALayer(PlatformCALayer::LayerType, PlatformCALayerClient* owner);
-    virtual PassRefPtr<PlatformCALayer> createPlatformCALayer(PlatformLayer*, PlatformCALayerClient* owner);
-    virtual PassRefPtr<PlatformCAAnimation> createPlatformCAAnimation(PlatformCAAnimation::AnimationType, const String& keyPath);
+    virtual Ref<PlatformCALayer> createPlatformCALayer(PlatformCALayer::LayerType, PlatformCALayerClient* owner);
+    virtual Ref<PlatformCALayer> createPlatformCALayer(PlatformLayer*, PlatformCALayerClient* owner);
+    virtual Ref<PlatformCAAnimation> createPlatformCAAnimation(PlatformCAAnimation::AnimationType, const String& keyPath);
 
     PlatformCALayer* primaryLayer() const { return m_structuralLayer.get() ? m_structuralLayer.get() : m_layer.get(); }
     PlatformCALayer* hostLayerForSublayers() const;
@@ -240,9 +240,9 @@ private:
     bool createFilterAnimationsFromKeyframes(const KeyframeValueList&, const Animation*, const String& animationName, double timeOffset);
 
     // Return autoreleased animation (use RetainPtr?)
-    PassRefPtr<PlatformCAAnimation> createBasicAnimation(const Animation*, const String& keyPath, bool additive);
-    PassRefPtr<PlatformCAAnimation> createKeyframeAnimation(const Animation*, const String&, bool additive);
-    RefPtr<PlatformCAAnimation> createSpringAnimation(const Animation*, const String&, bool additive);
+    Ref<PlatformCAAnimation> createBasicAnimation(const Animation*, const String& keyPath, bool additive);
+    Ref<PlatformCAAnimation> createKeyframeAnimation(const Animation*, const String&, bool additive);
+    Ref<PlatformCAAnimation> createSpringAnimation(const Animation*, const String&, bool additive);
     void setupAnimation(PlatformCAAnimation*, const Animation*, bool additive);
     
     const TimingFunction& timingFunctionForAnimationValue(const AnimationValue&, const Animation&);
@@ -366,13 +366,13 @@ private:
         Vector<ReplicaBranchType> m_replicaBranches;
         size_t m_replicaDepth;
     };
-    PassRefPtr<PlatformCALayer>replicatedLayerRoot(ReplicaState&);
+    RefPtr<PlatformCALayer>replicatedLayerRoot(ReplicaState&);
 
     enum CloneLevel { RootCloneLevel, IntermediateCloneLevel };
-    PassRefPtr<PlatformCALayer> fetchCloneLayers(GraphicsLayer* replicaRoot, ReplicaState&, CloneLevel);
+    RefPtr<PlatformCALayer> fetchCloneLayers(GraphicsLayer* replicaRoot, ReplicaState&, CloneLevel);
     
-    PassRefPtr<PlatformCALayer> cloneLayer(PlatformCALayer *, CloneLevel);
-    PassRefPtr<PlatformCALayer> findOrMakeClone(CloneID, PlatformCALayer *, LayerMap*, CloneLevel);
+    Ref<PlatformCALayer> cloneLayer(PlatformCALayer *, CloneLevel);
+    RefPtr<PlatformCALayer> findOrMakeClone(CloneID, PlatformCALayer *, LayerMap*, CloneLevel);
 
     void ensureCloneLayers(CloneID, RefPtr<PlatformCALayer>& primaryLayer, RefPtr<PlatformCALayer>& structuralLayer,
         RefPtr<PlatformCALayer>& contentsLayer, RefPtr<PlatformCALayer>& contentsClippingLayer, RefPtr<PlatformCALayer>& contentsShapeMaskLayer,
@@ -560,8 +560,8 @@ private:
     // This represents the animation of a single property. There may be multiple transform animations for
     // a single transition or keyframe animation, so index is used to distinguish these.
     struct LayerPropertyAnimation {
-        LayerPropertyAnimation(PassRefPtr<PlatformCAAnimation> caAnimation, const String& animationName, AnimatedPropertyID property, int index, int subIndex, double timeOffset)
-            : m_animation(caAnimation)
+        LayerPropertyAnimation(Ref<PlatformCAAnimation>&& caAnimation, const String& animationName, AnimatedPropertyID property, int index, int subIndex, double timeOffset)
+            : m_animation(WTFMove(caAnimation))
             , m_name(animationName)
             , m_property(property)
             , m_index(index)
index cc8d83f..a02b315 100644 (file)
@@ -51,7 +51,7 @@ public:
     virtual bool isPlatformCAAnimationWin() const { return false; }
     virtual bool isPlatformCAAnimationRemote() const { return false; }
     
-    virtual PassRefPtr<PlatformCAAnimation> copy() const = 0;
+    virtual Ref<PlatformCAAnimation> copy() const = 0;
     
     AnimationType animationType() const { return m_type; }
     virtual String keyPath() const = 0;
index be43a99..51ea833 100644 (file)
@@ -48,14 +48,14 @@ void setHasExplicitBeginTime(CAAnimation *, bool);
 
 class PlatformCAAnimationCocoa final : public PlatformCAAnimation {
 public:
-    static PassRefPtr<PlatformCAAnimation> create(AnimationType, const String& keyPath);
-    WEBCORE_EXPORT static PassRefPtr<PlatformCAAnimation> create(PlatformAnimationRef);
+    static Ref<PlatformCAAnimation> create(AnimationType, const String& keyPath);
+    WEBCORE_EXPORT static Ref<PlatformCAAnimation> create(PlatformAnimationRef);
 
     virtual ~PlatformCAAnimationCocoa();
 
     bool isPlatformCAAnimationCocoa() const override { return true; }
 
-    PassRefPtr<PlatformCAAnimation> copy() const override;
+    Ref<PlatformCAAnimation> copy() const override;
 
     PlatformAnimationRef platformAnimation() const;
     
index 3526d63..661cd41 100644 (file)
@@ -149,14 +149,14 @@ CAMediaTimingFunction* WebCore::toCAMediaTimingFunction(const TimingFunction* ti
     return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
 }
 
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationCocoa::create(AnimationType type, const String& keyPath)
+Ref<PlatformCAAnimation> PlatformCAAnimationCocoa::create(AnimationType type, const String& keyPath)
 {
-    return adoptRef(new PlatformCAAnimationCocoa(type, keyPath));
+    return adoptRef(*new PlatformCAAnimationCocoa(type, keyPath));
 }
 
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationCocoa::create(PlatformAnimationRef animation)
+Ref<PlatformCAAnimation> PlatformCAAnimationCocoa::create(PlatformAnimationRef animation)
 {
-    return adoptRef(new PlatformCAAnimationCocoa(animation));
+    return adoptRef(*new PlatformCAAnimationCocoa(animation));
 }
 
 PlatformCAAnimationCocoa::PlatformCAAnimationCocoa(AnimationType type, const String& keyPath)
@@ -196,9 +196,9 @@ PlatformCAAnimationCocoa::~PlatformCAAnimationCocoa()
 {
 }
 
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationCocoa::copy() const
+Ref<PlatformCAAnimation> PlatformCAAnimationCocoa::copy() const
 {
-    RefPtr<PlatformCAAnimation> animation = create(animationType(), keyPath());
+    auto animation = create(animationType(), keyPath());
     
     animation->setBeginTime(beginTime());
     animation->setDuration(duration());
@@ -212,7 +212,7 @@ PassRefPtr<PlatformCAAnimation> PlatformCAAnimationCocoa::copy() const
     animation->copyTimingFunctionFrom(*this);
     animation->setValueFunction(valueFunction());
 
-    setHasExplicitBeginTime(downcast<PlatformCAAnimationCocoa>(*animation).platformAnimation(), hasExplicitBeginTime(platformAnimation()));
+    setHasExplicitBeginTime(downcast<PlatformCAAnimationCocoa>(animation.get()).platformAnimation(), hasExplicitBeginTime(platformAnimation()));
     
     // Copy the specific Basic or Keyframe values.
     if (animationType() == Keyframe) {
index 39fc8b0..0ab58e7 100644 (file)
@@ -35,7 +35,7 @@ class PlatformCALayer;
 class AbstractCACFLayerTreeHost {
 public:
     virtual PlatformCALayer* rootLayer() const = 0;
-    virtual void addPendingAnimatedLayer(PassRefPtr<PlatformCALayer>) = 0;
+    virtual void addPendingAnimatedLayer(PlatformCALayer&) = 0;
     virtual void layerTreeDidChange() = 0;
     virtual void flushPendingLayerChangesNow() = 0;
 
index 4aeb140..4a8f597 100644 (file)
@@ -121,7 +121,7 @@ bool CACFLayerTreeHost::acceleratedCompositingAvailable()
     return available;
 }
 
-PassRefPtr<CACFLayerTreeHost> CACFLayerTreeHost::create()
+RefPtr<CACFLayerTreeHost> CACFLayerTreeHost::create()
 {
     if (!acceleratedCompositingAvailable())
         return nullptr;
@@ -208,9 +208,9 @@ PlatformCALayer* CACFLayerTreeHost::rootLayer() const
     return m_rootLayer.get();
 }
 
-void CACFLayerTreeHost::addPendingAnimatedLayer(PassRefPtr<PlatformCALayer> layer)
+void CACFLayerTreeHost::addPendingAnimatedLayer(PlatformCALayer& layer)
 {
-    m_pendingAnimatedLayers.add(layer);
+    m_pendingAnimatedLayers.add(&layer);
 }
 
 void CACFLayerTreeHost::setRootChildLayer(PlatformCALayer* layer)
index 9e4ed82..5424b00 100644 (file)
@@ -32,7 +32,6 @@
 #include "Timer.h"
 
 #include <wtf/HashSet.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/RetainPtr.h>
@@ -57,7 +56,7 @@ class TiledBacking;
 
 class CACFLayerTreeHost : public RefCounted<CACFLayerTreeHost>, private AbstractCACFLayerTreeHost {
 public:
-    static PassRefPtr<CACFLayerTreeHost> create();
+    static RefPtr<CACFLayerTreeHost> create();
     virtual ~CACFLayerTreeHost();
 
     static bool acceleratedCompositingAvailable();
@@ -103,7 +102,7 @@ private:
     void initialize();
 
     // AbstractCACFLayerTreeHost
-    virtual void addPendingAnimatedLayer(PassRefPtr<PlatformCALayer>);
+    virtual void addPendingAnimatedLayer(PlatformCALayer&);
     virtual void layerTreeDidChange();
 
 
index 27de2b5..90a83f0 100644 (file)
@@ -142,14 +142,14 @@ static RetainPtr<CACFTimingFunctionRef> toCACFTimingFunction(const TimingFunctio
     return CACFTimingFunctionGetFunctionWithName(kCACFTimingFunctionLinear);
 }
 
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationWin::create(AnimationType type, const String& keyPath)
+Ref<PlatformCAAnimation> PlatformCAAnimationWin::create(AnimationType type, const String& keyPath)
 {
-    return adoptRef(new PlatformCAAnimationWin(type, keyPath));
+    return adoptRef(*new PlatformCAAnimationWin(type, keyPath));
 }
 
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationWin::create(PlatformAnimationRef animation)
+Ref<PlatformCAAnimation> PlatformCAAnimationWin::create(PlatformAnimationRef animation)
 {
-    return adoptRef(new PlatformCAAnimationWin(animation));
+    return adoptRef(*new PlatformCAAnimationWin(animation));
 }
 
 PlatformCAAnimationWin::PlatformCAAnimationWin(AnimationType type, const String& keyPath)
@@ -177,9 +177,9 @@ PlatformCAAnimationWin::PlatformCAAnimationWin(PlatformAnimationRef animation)
     m_animation = animation;
 }
 
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationWin::copy() const
+Ref<PlatformCAAnimation> PlatformCAAnimationWin::copy() const
 {
-    RefPtr<PlatformCAAnimation> animation = create(animationType(), keyPath());
+    auto animation = create(animationType(), keyPath());
     
     animation->setBeginTime(beginTime());
     animation->setDuration(duration());
index efc6dba..162d626 100644 (file)
@@ -38,14 +38,14 @@ namespace WebCore {
 
 class PlatformCAAnimationWin final : public PlatformCAAnimation {
 public:
-    static PassRefPtr<PlatformCAAnimation> create(AnimationType, const String& keyPath);
-    static PassRefPtr<PlatformCAAnimation> create(PlatformAnimationRef);
+    static Ref<PlatformCAAnimation> create(AnimationType, const String& keyPath);
+    static Ref<PlatformCAAnimation> create(PlatformAnimationRef);
 
     virtual ~PlatformCAAnimationWin();
 
     bool isPlatformCAAnimationWin() const override { return true; }
     
-    PassRefPtr<PlatformCAAnimation> copy() const override;
+    Ref<PlatformCAAnimation> copy() const override;
 
     PlatformAnimationRef platformAnimation() const;
     
index d37f241..5e149fd 100644 (file)
@@ -336,7 +336,7 @@ void PlatformCALayerWin::addAnimationForKey(const String& key, PlatformCAAnimati
     // Tell the host about it so we can fire the start animation event
     AbstractCACFLayerTreeHost* host = layerTreeHostForLayer(this);
     if (host)
-        host->addPendingAnimatedLayer(this);
+        host->addPendingAnimatedLayer(*this);
 }
 
 void PlatformCALayerWin::removeAnimationForKey(const String& key)
index 2f134a0..825a8d0 100644 (file)
@@ -66,10 +66,10 @@ SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewSetContextUserData, void, __cdecl
 SOFT_LINK_OPTIONAL(WebKitQuartzCoreAdditions, WKCACFViewSetShouldInvertColors, void, _cdecl, (WKCACFViewRef view, bool shouldInvertColors))
 SOFT_LINK_OPTIONAL(WebKitQuartzCoreAdditions, WKCACFViewGetD3DDevice9, IDirect3DDevice9*, _cdecl, (WKCACFViewRef view))
 
-PassRefPtr<WKCACFViewLayerTreeHost> WKCACFViewLayerTreeHost::create()
+RefPtr<WKCACFViewLayerTreeHost> WKCACFViewLayerTreeHost::create()
 {
     if (!WebKitQuartzCoreAdditionsLibrary())
-        return 0;
+        return nullptr;
 
     return adoptRef(new WKCACFViewLayerTreeHost);
 }
index e4db2c4..37ca073 100644 (file)
@@ -34,7 +34,7 @@ namespace WebCore {
 
 class WKCACFViewLayerTreeHost : public CACFLayerTreeHost {
 public:
-    static PassRefPtr<WKCACFViewLayerTreeHost> create();
+    static RefPtr<WKCACFViewLayerTreeHost> create();
 
     virtual bool createRenderer();
 
index 81bc7ce..7e5df04 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
 
 cairo_pattern_t* Pattern::createPlatformPattern(const AffineTransform&) const
 {
-    RefPtr<cairo_surface_t> surface = tileImage()->nativeImageForCurrentFrame();
+    RefPtr<cairo_surface_t> surface = tileImage().nativeImageForCurrentFrame();
     if (!surface)
-        return 0;
+        return nullptr;
 
     cairo_pattern_t* pattern = cairo_pattern_create_for_surface(surface.get());
 
index a0e7ff8..8763480 100644 (file)
@@ -314,10 +314,9 @@ void PlatformContextCairo::clipForPatternFilling(const GraphicsContextState& sta
     cairo_clip_extents(m_cr.get(), &x1, &y1, &x2, &y2);
     FloatRect clipRect(x1, y1, x2 - x1, y2 - y1);
 
-    Image* patternImage = state.fillPattern->tileImage();
-    ASSERT(patternImage);
+    auto& patternImage = state.fillPattern->tileImage();
     const AffineTransform& patternTransform = state.fillPattern->getPatternSpaceTransform();
-    FloatRect patternRect = patternTransform.mapRect(FloatRect(0, 0, patternImage->width(), patternImage->height()));
+    FloatRect patternRect = patternTransform.mapRect(FloatRect(0, 0, patternImage.width(), patternImage.height()));
 
     bool repeatX = state.fillPattern->repeatX();
     bool repeatY = state.fillPattern->repeatY();
index f3c1ae4..96eb83c 100644 (file)
@@ -48,9 +48,9 @@ class ImageBuffer;
 
 class PDFDocumentImage final : public Image {
 public:
-    static PassRefPtr<PDFDocumentImage> create(ImageObserver* observer)
+    static Ref<PDFDocumentImage> create(ImageObserver* observer)
     {
-        return adoptRef(new PDFDocumentImage(observer));
+        return adoptRef(*new PDFDocumentImage(observer));
     }
 
     void setPdfImageCachingPolicy(PDFImageCachingPolicy);
index 7186009..98e69de 100644 (file)
@@ -65,7 +65,7 @@ static void patternReleaseCallback(void* info)
 
 CGPatternRef Pattern::createPlatformPattern(const AffineTransform& userSpaceTransformation) const
 {
-    FloatRect tileRect = tileImage()->rect();
+    FloatRect tileRect = tileImage().rect();
 
     AffineTransform patternTransform = userSpaceTransformation * m_patternSpaceTransformation;
     patternTransform.scaleNonUniform(1, -1);
@@ -74,7 +74,7 @@ CGPatternRef Pattern::createPlatformPattern(const AffineTransform& userSpaceTran
     // If we're repeating in both directions, we can use image-backed patterns
     // instead of custom patterns, and avoid tiling-edge pixel cracks.
     if (m_repeatX && m_repeatY)
-        return wkCGPatternCreateWithImageAndTransform(tileImage()->nativeImage().get(), patternTransform, wkPatternTilingConstantSpacing);
+        return wkCGPatternCreateWithImageAndTransform(tileImage().nativeImage().get(), patternTransform, wkPatternTilingConstantSpacing);
 
     // If FLT_MAX should also be used for xStep or yStep, nothing is rendered. Using fractions of FLT_MAX also
     // result in nothing being rendered.
@@ -85,7 +85,7 @@ CGPatternRef Pattern::createPlatformPattern(const AffineTransform& userSpaceTran
     CGFloat yStep = m_repeatY ? tileRect.height() : (1 << 22);
 
     // The pattern will release the CGImageRef when it's done rendering in patternReleaseCallback
-    CGImageRef platformImage = tileImage()->nativeImage().leakRef();
+    CGImageRef platformImage = tileImage().nativeImage().leakRef();
 
     const CGPatternCallbacks patternCallbacks = { 0, patternCallback, patternReleaseCallback };
     return CGPatternCreate(platformImage, tileRect, patternTransform, xStep, yStep, kCGPatternTilingConstantSpacing, TRUE, &patternCallbacks);
index 1b4303c..6b9ae9e 100644 (file)
 
 namespace WebCore {
 
-FEDiffuseLighting::FEDiffuseLighting(Filter& filter, const Color& lightingColor, float surfaceScale,
-    float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-    : FELighting(filter, DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+FEDiffuseLighting::FEDiffuseLighting(Filter& filter, const Color& lightingColor, float surfaceScale, float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, Ref<LightSource>&& lightSource)
+    : FELighting(filter, DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource))
 {
 }
 
-Ref<FEDiffuseLighting> FEDiffuseLighting::create(Filter& filter, const Color& lightingColor,
-    float surfaceScale, float diffuseConstant, float kernelUnitLengthX,
-    float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+Ref<FEDiffuseLighting> FEDiffuseLighting::create(Filter& filter, const Color& lightingColor, float surfaceScale, float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, Ref<LightSource>&& lightSource)
 {
-    return adoptRef(*new FEDiffuseLighting(filter, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
+    return adoptRef(*new FEDiffuseLighting(filter, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource)));
 }
 
 FEDiffuseLighting::~FEDiffuseLighting()
@@ -109,16 +106,11 @@ bool FEDiffuseLighting::setKernelUnitLengthY(float kernelUnitLengthY)
     return true;
 }
 
-const LightSource* FEDiffuseLighting::lightSource() const
+const LightSource& FEDiffuseLighting::lightSource() const
 {
     return m_lightSource.get();
 }
 
-void FEDiffuseLighting::setLightSource(PassRefPtr<LightSource> lightSource)
-{    
-    m_lightSource = lightSource;
-}
-
 void FEDiffuseLighting::dump()
 {
 }
index 5fe2be9..7037c33 100644 (file)
@@ -30,8 +30,7 @@ class LightSource;
 
 class FEDiffuseLighting : public FELighting {
 public:
-    static Ref<FEDiffuseLighting> create(Filter&, const Color&, float, float,
-        float, float, PassRefPtr<LightSource>);
+    static Ref<FEDiffuseLighting> create(Filter&, const Color&, float, float, float, float, Ref<LightSource>&&);
     virtual ~FEDiffuseLighting();
 
     const Color& lightingColor() const;
@@ -49,15 +48,14 @@ public:
     float kernelUnitLengthY() const;
     bool setKernelUnitLengthY(float);
 
-    const LightSource* lightSource() const;
-    void setLightSource(PassRefPtr<LightSource>);
+    const LightSource& lightSource() const;
 
     void dump() override;
 
     TextStream& externalRepresentation(TextStream&, int indention) const override;
 
 private:
-    FEDiffuseLighting(Filter&, const Color&, float, float, float, float, PassRefPtr<LightSource>);
+    FEDiffuseLighting(Filter&, const Color&, float, float, float, float, Ref<LightSource>&&);
 };
 
 } // namespace WebCore
index 2925b0e..fa0f28a 100644 (file)
 
 namespace WebCore {
 
-FELighting::FELighting(Filter& filter, LightingType lightingType, const Color& lightingColor, float surfaceScale,
-    float diffuseConstant, float specularConstant, float specularExponent,
-    float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+FELighting::FELighting(Filter& filter, LightingType lightingType, const Color& lightingColor, float surfaceScale, float diffuseConstant, float specularConstant, float specularExponent, float kernelUnitLengthX, float kernelUnitLengthY, Ref<LightSource>&& lightSource)
     : FilterEffect(filter)
     , m_lightingType(lightingType)
-    , m_lightSource(lightSource)
+    , m_lightSource(WTFMove(lightSource))
     , m_lightingColor(lightingColor)
     , m_surfaceScale(surfaceScale)
     , m_diffuseConstant(diffuseConstant)
@@ -294,9 +292,6 @@ bool FELighting::drawLighting(Uint8ClampedArray* pixels, int width, int height)
     LightSource::PaintingData paintingData;
     LightingData data;
 
-    if (!m_lightSource)
-        return false;
-
     // FIXME: do something if width or height (or both) is 1 pixel.
     // The W3 spec does not define this case. Now the filter just returns.
     if (width <= 2 || height <= 2)
index bafbf47..3920298 100644 (file)
@@ -88,7 +88,7 @@ protected:
     static void platformApplyGenericWorker(PlatformApplyGenericParameters*);
     static void platformApplyNeonWorker(FELightingPaintingDataForNeon*);
 
-    FELighting(Filter&, LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
+    FELighting(Filter&, LightingType, const Color&, float, float, float, float, float, float, Ref<LightSource>&&);
 
     bool drawLighting(Uint8ClampedArray*, int, int);
     inline void inlineSetPixel(int offset, LightingData&, LightSource::PaintingData&,
@@ -107,7 +107,7 @@ protected:
     inline void platformApplyNeon(LightingData&, LightSource::PaintingData&);
 
     LightingType m_lightingType;
-    RefPtr<LightSource> m_lightSource;
+    Ref<LightSource> m_lightSource;
 
     Color m_lightingColor;
     float m_surfaceScale;
index e2e834f..8c14083 100644 (file)
 
 namespace WebCore {
 
-FESpecularLighting::FESpecularLighting(Filter& filter, const Color& lightingColor, float surfaceScale,
-    float specularConstant, float specularExponent, float kernelUnitLengthX,
-    float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-    : FELighting(filter, SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+FESpecularLighting::FESpecularLighting(Filter& filter, const Color& lightingColor, float surfaceScale, float specularConstant, float specularExponent, float kernelUnitLengthX, float kernelUnitLengthY, Ref<LightSource>&& lightSource)
+    : FELighting(filter, SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource))
 {
 }
 
-Ref<FESpecularLighting> FESpecularLighting::create(Filter& filter, const Color& lightingColor,
-    float surfaceScale, float specularConstant, float specularExponent,
-    float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+Ref<FESpecularLighting> FESpecularLighting::create(Filter& filter, const Color& lightingColor, float surfaceScale, float specularConstant, float specularExponent, float kernelUnitLengthX, float kernelUnitLengthY, Ref<LightSource>&& lightSource)
 {
-    return adoptRef(*new FESpecularLighting(filter, lightingColor, surfaceScale, specularConstant, specularExponent,
-        kernelUnitLengthX, kernelUnitLengthY, lightSource));
+    return adoptRef(*new FESpecularLighting(filter, lightingColor, surfaceScale, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource)));
 }
 
 FESpecularLighting::~FESpecularLighting()
@@ -124,16 +119,11 @@ bool FESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY)
     return true;
 }
 
-const LightSource* FESpecularLighting::lightSource() const
+const LightSource& FESpecularLighting::lightSource() const
 {
     return m_lightSource.get();
 }
 
-void FESpecularLighting::setLightSource(PassRefPtr<LightSource> lightSource)
-{
-    m_lightSource = lightSource;
-}
-
 void FESpecularLighting::dump()
 {
 }
index e04f443..9f927f2 100644 (file)
@@ -28,8 +28,7 @@ namespace WebCore {
 
 class FESpecularLighting : public FELighting {
 public:
-    static Ref<FESpecularLighting> create(Filter&, const Color&, float, float,
-        float, float, float, PassRefPtr<LightSource>);
+    static Ref<FESpecularLighting> create(Filter&, const Color&, float, float, float, float, float, Ref<LightSource>&&);
     virtual ~FESpecularLighting();
 
     const Color& lightingColor() const;
@@ -50,15 +49,14 @@ public:
     float kernelUnitLengthY() const;
     bool setKernelUnitLengthY(float);
 
-    const LightSource* lightSource() const;
-    void setLightSource(PassRefPtr<LightSource>);
+    const LightSource& lightSource() const;
 
     void dump() override;
 
     TextStream& externalRepresentation(TextStream&, int indention) const override;
 
 private:
-    FESpecularLighting(Filter&, const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
+    FESpecularLighting(Filter&, const Color&, float, float, float, float, float, Ref<LightSource>&&);
 };
 
 } // namespace WebCore
index a0e2e1b..78920ec 100644 (file)
@@ -76,7 +76,7 @@ void FETile::platformApplySoftware()
     if (!tileImageCopy)
         return;
 
-    auto pattern = Pattern::create(WTFMove(tileImageCopy), true, true);
+    auto pattern = Pattern::create(tileImageCopy.releaseNonNull(), true, true);
 
     AffineTransform patternTransform;
     patternTransform.translate(inMaxEffectLocation.x() - maxEffectLocation.x(), inMaxEffectLocation.y() - maxEffectLocation.y());
index 2f742ca..98b86d0 100644 (file)
@@ -232,24 +232,24 @@ ImageBuffer* FilterEffect::asImageBuffer()
     return m_imageBufferResult.get();
 }
 
-PassRefPtr<Uint8ClampedArray> FilterEffect::asUnmultipliedImage(const IntRect& rect)
+RefPtr<Uint8ClampedArray> FilterEffect::asUnmultipliedImage(const IntRect& rect)
 {
     IntSize scaledSize(rect.size());
     ASSERT(!ImageBuffer::sizeNeedsClamping(scaledSize));
     scaledSize.scale(m_filter.filterScale());
     auto imageData = Uint8ClampedArray::createUninitialized((scaledSize.area() * 4).unsafeGet());
     copyUnmultipliedImage(imageData.get(), rect);
-    return WTFMove(imageData);
+    return imageData;
 }
 
-PassRefPtr<Uint8ClampedArray> FilterEffect::asPremultipliedImage(const IntRect& rect)
+RefPtr<Uint8ClampedArray> FilterEffect::asPremultipliedImage(const IntRect& rect)
 {
     IntSize scaledSize(rect.size());
     ASSERT(!ImageBuffer::sizeNeedsClamping(scaledSize));
     scaledSize.scale(m_filter.filterScale());
     auto imageData = Uint8ClampedArray::createUninitialized((scaledSize.area() * 4).unsafeGet());
     copyPremultipliedImage(imageData.get(), rect);
-    return WTFMove(imageData);
+    return imageData;
 }
 
 inline void FilterEffect::copyImageBytes(Uint8ClampedArray* source, Uint8ClampedArray* destination, const IntRect& rect)
index ea4ec77..6d317ca 100644 (file)
@@ -55,8 +55,8 @@ public:
     void clearResultsRecursive();
 
     ImageBuffer* asImageBuffer();
-    PassRefPtr<Uint8ClampedArray> asUnmultipliedImage(const IntRect&);
-    PassRefPtr<Uint8ClampedArray> asPremultipliedImage(const IntRect&);
+    RefPtr<Uint8ClampedArray> asUnmultipliedImage(const IntRect&);
+    RefPtr<Uint8ClampedArray> asPremultipliedImage(const IntRect&);
     void copyUnmultipliedImage(Uint8ClampedArray* destination, const IntRect&);
     void copyPremultipliedImage(Uint8ClampedArray* destination, const IntRect&);
 
index 035e45b..d79b8b2 100644 (file)
@@ -72,12 +72,12 @@ void ReferenceFilterOperation::loadExternalDocumentIfNeeded(CachedResourceLoader
     m_cachedSVGDocumentReference->load(cachedResourceLoader, options);
 }
 
-void ReferenceFilterOperation::setFilterEffect(PassRefPtr<FilterEffect> filterEffect)
+void ReferenceFilterOperation::setFilterEffect(RefPtr<FilterEffect>&& filterEffect)
 {
-    m_filterEffect = filterEffect;
+    m_filterEffect = WTFMove(filterEffect);
 }
 
-PassRefPtr<FilterOperation> BasicColorMatrixFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
+RefPtr<FilterOperation> BasicColorMatrixFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
 {
     if (from && !from->isSameType(*this))
         return this;
@@ -113,7 +113,7 @@ double BasicColorMatrixFilterOperation::passthroughAmount() const
     }
 }
 
-PassRefPtr<FilterOperation> BasicComponentTransferFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
+RefPtr<FilterOperation> BasicComponentTransferFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
 {
     if (from && !from->isSameType(*this))
         return this;
@@ -159,7 +159,7 @@ bool BlurFilterOperation::operator==(const FilterOperation& operation) const
     return m_stdDeviation == downcast<BlurFilterOperation>(operation).stdDeviation();
 }
     
-PassRefPtr<FilterOperation> BlurFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
+RefPtr<FilterOperation> BlurFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
 {
     if (from && !from->isSameType(*this))
         return this;
@@ -182,7 +182,7 @@ bool DropShadowFilterOperation::operator==(const FilterOperation& operation) con
     return m_location == other.m_location && m_stdDeviation == other.m_stdDeviation && m_color == other.m_color;
 }
     
-PassRefPtr<FilterOperation> DropShadowFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
+RefPtr<FilterOperation> DropShadowFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
 {
     if (from && !from->isSameType(*this))
         return this;
index 4caeb49..a5ad6d8 100644 (file)
@@ -68,21 +68,21 @@ public:
 
     virtual ~FilterOperation() { }
 
-    virtual PassRefPtr<FilterOperation> clone() const = 0;
+    virtual Ref<FilterOperation> clone() const = 0;
 
     virtual bool operator==(const FilterOperation&) const = 0;
     bool operator!=(const FilterOperation& o) const { return !(*this == o); }
 
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* /*from*/, double /*progress*/, bool /*blendToPassthrough*/ = false)
+    virtual RefPtr<FilterOperation> blend(const FilterOperation* /*from*/, double /*progress*/, bool /*blendToPassthrough*/ = false)
     {
         ASSERT(!blendingNeedsRendererSize());
-        return 0;
+        return nullptr;
     }
 
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* /*from*/, double /*progress*/, const LayoutSize&, bool /*blendToPassthrough*/ = false)
+    virtual RefPtr<FilterOperation> blend(const FilterOperation* /*from*/, double /*progress*/, const LayoutSize&, bool /*blendToPassthrough*/ = false)
     {
         ASSERT(blendingNeedsRendererSize());
-        return 0;
+        return nullptr;
     }
 
     OperationType type() const { return m_type; }
@@ -119,14 +119,14 @@ protected:
 
 class WEBCORE_EXPORT DefaultFilterOperation : public FilterOperation {
 public:
-    static PassRefPtr<DefaultFilterOperation> create(OperationType representedType)
+    static Ref<DefaultFilterOperation> create(OperationType representedType)
     {
-        return adoptRef(new DefaultFilterOperation(representedType));
+        return adoptRef(*new DefaultFilterOperation(representedType));
     }
 
-    PassRefPtr<FilterOperation> clone() const override
+    Ref<FilterOperation> clone() const override
     {
-        return adoptRef(new DefaultFilterOperation(representedType()));
+        return adoptRef(*new DefaultFilterOperation(representedType()));
     }
 
     OperationType representedType() const { return m_representedType; }
@@ -145,14 +145,14 @@ private:
 
 class PassthroughFilterOperation : public FilterOperation {
 public:
-    static PassRefPtr<PassthroughFilterOperation> create()
+    static Ref<PassthroughFilterOperation> create()
     {
-        return adoptRef(new PassthroughFilterOperation());
+        return adoptRef(*new PassthroughFilterOperation());
     }
 
-    PassRefPtr<FilterOperation> clone() const override
+    Ref<FilterOperation> clone() const override
     {
-        return adoptRef(new PassthroughFilterOperation());
+        return adoptRef(*new PassthroughFilterOperation());
     }
 
 private:
@@ -169,17 +169,17 @@ private:
 
 class ReferenceFilterOperation : public FilterOperation {
 public:
-    static PassRefPtr<ReferenceFilterOperation> create(const String& url, const String& fragment)
+    static Ref<ReferenceFilterOperation> create(const String& url, const String& fragment)
     {
-        return adoptRef(new ReferenceFilterOperation(url, fragment));
+        return adoptRef(*new ReferenceFilterOperation(url, fragment));
     }
     virtual ~ReferenceFilterOperation();
 
-    PassRefPtr<FilterOperation> clone() const override
+    Ref<FilterOperation> clone() const override
     {
         // Reference filters cannot be cloned.
-        ASSERT_NOT_REACHED();
-        return nullptr;
+        RELEASE_ASSERT_NOT_REACHED();
+        return *static_cast<FilterOperation*>(nullptr);
     }
 
     bool affectsOpacity() const override { return true; }
@@ -196,7 +196,7 @@ public:
     CachedSVGDocumentReference* cachedSVGDocumentReference() const { return m_cachedSVGDocumentReference.get(); }
 
     FilterEffect* filterEffect() const { return m_filterEffect.get(); }
-    void setFilterEffect(PassRefPtr<FilterEffect>);
+    void setFilterEffect(RefPtr<FilterEffect>&&);
 
 private:
     ReferenceFilterOperation(const String& url, const String& fragment);
@@ -213,19 +213,19 @@ private:
 // For HUE_ROTATE, the angle of rotation is stored in m_amount.
 class WEBCORE_EXPORT BasicColorMatrixFilterOperation : public FilterOperation {
 public:
-    static PassRefPtr<BasicColorMatrixFilterOperation> create(double amount, OperationType type)
+    static Ref<BasicColorMatrixFilterOperation> create(double amount, OperationType type)
     {
-        return adoptRef(new BasicColorMatrixFilterOperation(amount, type));
+        return adoptRef(*new BasicColorMatrixFilterOperation(amount, type));
     }
 
-    PassRefPtr<FilterOperation> clone() const override
+    Ref<FilterOperation> clone() const override
     {
-        return adoptRef(new BasicColorMatrixFilterOperation(amount(), type()));
+        return adoptRef(*new BasicColorMatrixFilterOperation(amount(), type()));
     }
 
     double amount() const { return m_amount; }
 
-    PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false) override;
+    RefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false) override;
 
 private:
     bool operator==(const FilterOperation&) const override;
@@ -244,21 +244,21 @@ private:
 // INVERT, BRIGHTNESS, CONTRAST and OPACITY are variations on a basic component transfer effect.
 class WEBCORE_EXPORT BasicComponentTransferFilterOperation : public FilterOperation {
 public:
-    static PassRefPtr<BasicComponentTransferFilterOperation> create(double amount, OperationType type)
+    static Ref<BasicComponentTransferFilterOperation> create(double amount, OperationType type)
     {
-        return adoptRef(new BasicComponentTransferFilterOperation(amount, type));
+        return adoptRef(*new BasicComponentTransferFilterOperation(amount, type));
     }
 
-    PassRefPtr<FilterOperation> clone() const override
+    Ref<FilterOperation> clone() const override
     {
-        return adoptRef(new BasicComponentTransferFilterOperation(amount(), type()));
+        return adoptRef(*new BasicComponentTransferFilterOperation(amount(), type()));
     }
 
     double amount() const { return m_amount; }
 
     bool affectsOpacity() const override { return m_type == OPACITY; }
 
-    PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false) override;
+    RefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false) override;
 
 private:
     bool operator==(const FilterOperation&) const override;
@@ -276,14 +276,14 @@ private:
 
 class WEBCORE_EXPORT BlurFilterOperation : public FilterOperation {
 public:
-    static PassRefPtr<BlurFilterOperation> create(Length stdDeviation)
+    static Ref<BlurFilterOperation> create(Length stdDeviation)
     {
-        return adoptRef(new BlurFilterOperation(WTFMove(stdDeviation)));
+        return adoptRef(*new BlurFilterOperation(WTFMove(stdDeviation)));
     }
 
-    PassRefPtr<FilterOperation> clone() const override
+    Ref<FilterOperation> clone() const override
     {
-        return adoptRef(new BlurFilterOperation(stdDeviation()));
+        return adoptRef(*new BlurFilterOperation(stdDeviation()));
     }
 
     const Length& stdDeviation() const { return m_stdDeviation; }
@@ -291,7 +291,7 @@ public:
     bool affectsOpacity() const override { return true; }
     bool movesPixels() const override { return true; }
 
-    PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false) override;
+    RefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false) override;
 
 private:
     bool operator==(const FilterOperation&) const override;
@@ -307,14 +307,14 @@ private:
 
 class WEBCORE_EXPORT DropShadowFilterOperation : public FilterOperation {
 public:
-    static PassRefPtr<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, const Color& color)
+    static Ref<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, const Color& color)
     {
-        return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color));
+        return adoptRef(*new DropShadowFilterOperation(location, stdDeviation, color));
     }
 
-    PassRefPtr<FilterOperation> clone() const override
+    Ref<FilterOperation> clone() const override
     {
-        return adoptRef(new DropShadowFilterOperation(location(), stdDeviation(), color()));
+        return adoptRef(*new DropShadowFilterOperation(location(), stdDeviation(), color()));
     }
 
     int x() const { return m_location.x(); }
@@ -326,7 +326,7 @@ public:
     bool affectsOpacity() const override { return true; }
     bool movesPixels() const override { return true; }
 
-    PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false) override;
+    RefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false) override;
 
 private:
     bool operator==(const FilterOperation&) const override;
index aad13f3..ad22b47 100644 (file)
@@ -81,7 +81,7 @@ static void convertFormat(GraphicsContext3D* context, Texture::Format format, un
     }
 }
 
-PassRefPtr<Texture> Texture::create(GraphicsContext3D* context, Format format, int width, int height)
+RefPtr<Texture> Texture::create(GraphicsContext3D* context, Format format, int width, int height)
 {
     int maxTextureSize = 0;
     context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize);
@@ -102,7 +102,7 @@ PassRefPtr<Texture> Texture::create(GraphicsContext3D* context, Format format, i
         if (!textureId) {
             for (int i = 0; i < numTiles; i++)
                 context->deleteTexture(textureIds->at(i));
-            return 0;
+            return nullptr;
         }
         textureIds->at(i) = textureId;
 
index 3aa55f8..57a6832 100644 (file)
@@ -45,7 +45,7 @@ class Texture : public RefCounted<Texture> {
 public:
     ~Texture();
     enum Format { RGBA8, BGRA8 };
-    static PassRefPtr<Texture> create(GraphicsContext3D*, Format, int width, int height);
+    static RefPtr<Texture> create(GraphicsContext3D*, Format, int width, int height);
     void bindTile(int tile);
     void load(void* pixels);
     void updateSubRect(void* pixels, const IntRect&);
index bd18e5c..472aa7d 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
 
 class AudioTrackPrivateGStreamer final : public AudioTrackPrivate, public TrackPrivateBaseGStreamer {
 public:
-    static PassRefPtr<AudioTrackPrivateGStreamer> create(GRefPtr<GstElement> playbin, gint index, GRefPtr<GstPad> pad)
+    static RefPtr<AudioTrackPrivateGStreamer> create(GRefPtr<GstElement> playbin, gint index, GRefPtr<GstPad> pad)
     {
-        return adoptRef(new AudioTrackPrivateGStreamer(playbin, index, pad));
+        return adoptRef(*new AudioTrackPrivateGStreamer(playbin, index, pad));
     }
 
     void disconnect() override;
index 1ecd334..d3e04f6 100644 (file)
@@ -29,7 +29,7 @@
 #include <gst/gst.h>
 #include <gst/video/video-frame.h>
 
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
@@ -38,13 +38,13 @@ class IntSize;
 
 class ImageGStreamer : public RefCounted<ImageGStreamer> {
     public:
-        static PassRefPtr<ImageGStreamer> createImage(GstSample* sample)
+        static Ref<ImageGStreamer> createImage(GstSample* sample)
         {
-            return adoptRef(new ImageGStreamer(sample));
+            return adoptRef(*new ImageGStreamer(sample));
         }
         ~ImageGStreamer();
 
-        PassRefPtr<BitmapImage> image()
+        BitmapImage* image()
         {
             ASSERT(m_image);
             return m_image.get();
index e942a2c..4d4db4e 100644 (file)
@@ -34,9 +34,9 @@ namespace WebCore {
 
 class InbandMetadataTextTrackPrivateGStreamer : public InbandTextTrackPrivate {
 public:
-    static PassRefPtr<InbandMetadataTextTrackPrivateGStreamer> create(Kind kind, CueFormat cueFormat, const AtomicString& id = emptyAtom)
+    static Ref<InbandMetadataTextTrackPrivateGStreamer> create(Kind kind, CueFormat cueFormat, const AtomicString& id = emptyAtom)
     {
-        return adoptRef(new InbandMetadataTextTrackPrivateGStreamer(kind, cueFormat, id));
+        return adoptRef(*new InbandMetadataTextTrackPrivateGStreamer(kind, cueFormat, id));
     }
 
     ~InbandMetadataTextTrackPrivateGStreamer() { }
@@ -52,10 +52,10 @@ public:
         client()->addDataCue(start, end, data, length);
     }
 
-    void addGenericCue(PassRefPtr<GenericCueData> data)
+    void addGenericCue(GenericCueData& data)
     {
         ASSERT(cueFormat() == Generic);
-        client()->addGenericCue(*data);
+        client()->addGenericCue(data);
     }
 
 private:
index cc3a6f0..6a90744 100644 (file)
@@ -40,9 +40,9 @@ typedef struct _GstSample GstSample;
 
 class InbandTextTrackPrivateGStreamer : public InbandTextTrackPrivate, public TrackPrivateBaseGStreamer {
 public:
-    static PassRefPtr<InbandTextTrackPrivateGStreamer> create(gint index, GRefPtr<GstPad> pad)
+    static Ref<InbandTextTrackPrivateGStreamer> create(gint index, GRefPtr<GstPad> pad)
     {
-        return adoptRef(new InbandTextTrackPrivateGStreamer(index, pad));
+        return adoptRef(*new InbandTextTrackPrivateGStreamer(index, pad));
     }
 
     void disconnect() override;
index b356038..79c151b 100644 (file)
@@ -1177,7 +1177,7 @@ void MediaPlayerPrivateGStreamer::processTableOfContentsEntry(GstTocEntry* entry
 {
     ASSERT(entry);
 
-    RefPtr<GenericCueData> cue = GenericCueData::create();
+    auto cue = GenericCueData::create();
 
     gint64 start = -1, stop = -1;
     gst_toc_entry_get_start_stop_times(entry, &start, &stop);
@@ -1196,7 +1196,7 @@ void MediaPlayerPrivateGStreamer::processTableOfContentsEntry(GstTocEntry* entry
         }
     }
 
-    m_chaptersTrack->addGenericCue(cue.release());
+    m_chaptersTrack->addGenericCue(cue);
 
     for (GList* i = gst_toc_entry_get_sub_entries(entry); i; i = i->next)
         processTableOfContentsEntry(static_cast<GstTocEntry*>(i->data));
index ca4f090..c270726 100644 (file)
@@ -852,7 +852,7 @@ void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext& context, const Floa
     if (!gstImage)
         return;
 
-    if (Image* image = reinterpret_cast<Image*>(gstImage->image().get()))
+    if (Image* image = reinterpret_cast<Image*>(gstImage->image()))
         context.drawImage(*image, rect, gstImage->rect(), paintingOptions);
 }
 
index ba46a69..5ea76e3 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
 
 class VideoTrackPrivateGStreamer final : public VideoTrackPrivate, public TrackPrivateBaseGStreamer {
 public:
-    static PassRefPtr<VideoTrackPrivateGStreamer> create(GRefPtr<GstElement> playbin, gint index, GRefPtr<GstPad> pad)
+    static Ref<VideoTrackPrivateGStreamer> create(GRefPtr<GstElement> playbin, gint index, GRefPtr<GstPad> pad)
     {
-        return adoptRef(new VideoTrackPrivateGStreamer(playbin, index, pad));
+        return adoptRef(*new VideoTrackPrivateGStreamer(playbin, index, pad));
     }
 
     void disconnect() override;
index 663c825..cb6dff5 100644 (file)
@@ -183,12 +183,12 @@ void MediaSourceClientGStreamerMSE::flush(AtomicString trackId)
         m_playerPrivate->m_playbackPipeline->flush(trackId);
 }
 
-void MediaSourceClientGStreamerMSE::enqueueSample(PassRefPtr<MediaSample> prpSample)
+void MediaSourceClientGStreamerMSE::enqueueSample(Ref<MediaSample>&& sample)
 {
     ASSERT(WTF::isMainThread());
 
     if (m_playerPrivate)
-        m_playerPrivate->m_playbackPipeline->enqueueSample(prpSample);
+        m_playerPrivate->m_playbackPipeline->enqueueSample(WTFMove(sample));
 }
 
 GRefPtr<WebKitMediaSrc> MediaSourceClientGStreamerMSE::webKitMediaSrc()
index c3d4ac7..da798cf 100644 (file)
@@ -51,7 +51,7 @@ public:
     bool append(RefPtr<SourceBufferPrivateGStreamer>, const unsigned char*, unsigned);
     void removedFromMediaSource(RefPtr<SourceBufferPrivateGStreamer>);
     void flush(AtomicString);
-    void enqueueSample(PassRefPtr<MediaSample>);
+    void enqueueSample(Ref<MediaSample>&&);
 
     void clearPlayerPrivate();
 
index 92095b6..e62cd56 100644 (file)
@@ -45,7 +45,7 @@
 #include "SourceBufferPrivateGStreamer.h"
 #include "TimeRanges.h"
 #include "WebKitMediaSourceGStreamer.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 #include <wtf/glib/GRefPtr.h>
 
 namespace WebCore {
index b919e55..8a2ff43 100644 (file)
@@ -476,7 +476,7 @@ void PlaybackPipeline::flush(AtomicString trackId)
     GST_DEBUG("trackId=%s flushed", trackId.string().utf8().data());
 }
 
-void PlaybackPipeline::enqueueSample(RefPtr<MediaSample> mediaSample)
+void PlaybackPipeline::enqueueSample(Ref<MediaSample>&& mediaSample)
 {
     ASSERT(WTF::isMainThread());
 
@@ -503,7 +503,7 @@ void PlaybackPipeline::enqueueSample(RefPtr<MediaSample> mediaSample)
     GstElement* appsrc = stream->appsrc;
     MediaTime lastEnqueuedTime = stream->lastEnqueuedTime;
 
-    GStreamerMediaSample* sample = static_cast<GStreamerMediaSample*>(mediaSample.get());
+    GStreamerMediaSample* sample = static_cast<GStreamerMediaSample*>(mediaSample.ptr());
     if (sample->sample() && gst_sample_get_buffer(sample->sample())) {
         GRefPtr<GstSample> gstSample = sample->sample();
         GstBuffer* buffer = gst_sample_get_buffer(gstSample.get());
index 08f0e60..da498d9 100644 (file)
@@ -66,7 +66,7 @@ public:
 
     // From SourceBufferPrivateGStreamer.
     void flush(AtomicString);
-    void enqueueSample(RefPtr<MediaSample>);
+    void enqueueSample(Ref<MediaSample>&&);
 
     GstElement* pipeline();
 private:
index 49ccc91..84645b7 100644 (file)
 
 namespace WebCore {
 
-static PassRefPtr<Image> loadImageFromGResource(const char* iconName)
+static Ref<Image> loadImageFromGResource(const char* iconName)
 {
-    RefPtr<BitmapImage> icon = BitmapImage::create();
+    auto icon = BitmapImage::create();
     GUniquePtr<char> path(g_strdup_printf("/org/webkitgtk/resources/images/%s", iconName));
     GRefPtr<GBytes> data = adoptGRef(g_resources_lookup_data(path.get(), G_RESOURCE_LOOKUP_FLAGS_NONE, nullptr));
     ASSERT(data);
     icon->setData(SharedBuffer::create(static_cast<const unsigned char*>(g_bytes_get_data(data.get(), nullptr)), g_bytes_get_size(data.get())), true);
-    return icon.release();
+    return WTFMove(icon);
 }
 
-static PassRefPtr<SharedBuffer> loadResourceSharedBuffer(const char* filename)
+static Ref<SharedBuffer> loadResourceSharedBuffer(const char* filename)
 {
     GUniqueOutPtr<gchar> content;
     gsize length;
@@ -60,21 +60,21 @@ void BitmapImage::invalidatePlatformData()
 {
 }
 
-static PassRefPtr<Image> loadMissingImageIconFromTheme(const char* name)
+static Ref<Image> loadMissingImageIconFromTheme(const char* name)
 {
     int iconSize = g_str_has_suffix(name, "@2x") ? 32 : 16;
-    RefPtr<BitmapImage> icon = BitmapImage::create();
+    auto icon = BitmapImage::create();
     GUniquePtr<GtkIconInfo> iconInfo(gtk_icon_theme_lookup_icon(gtk_icon_theme_get_default(), GTK_STOCK_MISSING_IMAGE, iconSize, GTK_ICON_LOOKUP_NO_SVG));
     if (iconInfo) {
-        RefPtr<SharedBuffer> buffer = loadResourceSharedBuffer(gtk_icon_info_get_filename(iconInfo.get()));
-        icon->setData(buffer.release(), true);
-        return icon.release();
+        auto buffer = loadResourceSharedBuffer(gtk_icon_info_get_filename(iconInfo.get()));
+        icon->setData(WTFMove(buffer), true);
+        return WTFMove(icon);
     }
 
     return loadImageFromGResource(name);
 }
 
-PassRefPtr<Image> Image::loadPlatformResource(const char* name)
+Ref<Image> Image::loadPlatformResource(const char* name)
 {
     return g_str_has_prefix(name, "missingImage") ? loadMissingImageIconFromTheme(name) : loadImageFromGResource(name);
 }
index f03cace..83ff27e 100644 (file)
@@ -48,10 +48,10 @@ const hb_tag_t HarfBuzzFace::kernTag = HB_TAG('k', 'e', 'r', 'n');
 
 class FaceCacheEntry : public RefCounted<FaceCacheEntry> {
 public:
-    static PassRefPtr<FaceCacheEntry> create(hb_face_t* face)
+    static Ref<FaceCacheEntry> create(hb_face_t* face)
     {
         ASSERT(face);
-        return adoptRef(new FaceCacheEntry(face));
+        return adoptRef(*new FaceCacheEntry(face));
     }
     ~FaceCacheEntry()
     {
index 63179fe..59cee9c 100644 (file)
@@ -34,7 +34,7 @@
 #include <hb.h>
 
 #include <wtf/HashMap.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
@@ -47,9 +47,9 @@ public:
     static const hb_tag_t vrt2Tag;
     static const hb_tag_t kernTag;
 
-    static PassRefPtr<HarfBuzzFace> create(FontPlatformData* platformData, uint64_t uniqueID)
+    static Ref<HarfBuzzFace> create(FontPlatformData* platformData, uint64_t uniqueID)
     {
-        return adoptRef(new HarfBuzzFace(platformData, uniqueID));
+        return adoptRef(*new HarfBuzzFace(platformData, uniqueID));
     }
     ~HarfBuzzFace();
 
index f5fa697..e1cfe3f 100644 (file)
@@ -56,7 +56,7 @@ void BitmapImage::invalidatePlatformData()
     m_tiffRep = nullptr;
 }
 
-PassRefPtr<Image> Image::loadPlatformResource(const char *name)
+Ref<Image> Image::loadPlatformResource(const char *name)
 {
     NSBundle *bundle = [NSBundle bundleForClass:[WebCoreBundleFinder class]];
     NSString *imagePath = [bundle pathForResource:[NSString stringWithUTF8String:name] ofType:@"png"];
index 97d754d..dc34bbb 100644 (file)
@@ -27,7 +27,7 @@
 #pragma once
 
 #include "Glyph.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
 
@@ -43,9 +43,9 @@ class Font;
 
 class OpenTypeMathData : public RefCounted<OpenTypeMathData> {
 public:
-    static PassRefPtr<OpenTypeMathData> create(const FontPlatformData& font)
+    static Ref<OpenTypeMathData> create(const FontPlatformData& font)
     {
-        return adoptRef(new OpenTypeMathData(font));
+        return adoptRef(*new OpenTypeMathData(font));
     }
     ~OpenTypeMathData();
 
index 3245638..dc5931e 100644 (file)
@@ -30,8 +30,8 @@
 #include "IntPoint.h"
 #include "IntRect.h"
 #include "IntSize.h"
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
@@ -84,7 +84,7 @@ public:
     inline int numberOfBytes() const { return size().width() * size().height() * bpp() >> 3; }
     inline bool isOpaque() const { return !(m_flags & SupportsAlpha); }
 
-    virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) { return this; }
+    virtual RefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) { return this; }
 
 protected:
     IntSize m_contentSize;
index 5890602..450977d 100644 (file)
@@ -33,8 +33,8 @@
 #include "TextureMapperShaderProgram.h"
 #include "Timer.h"
 #include <wtf/HashMap.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 
 #if USE(CAIRO)
 #include "CairoUtilities.h"
@@ -214,7 +214,7 @@ static unsigned getPassesRequiredForFilter(FilterOperation::OperationType type)
     }
 }
 
-PassRefPtr<BitmapTexture> BitmapTextureGL::applyFilters(TextureMapper& textureMapper, const FilterOperations& filters)
+RefPtr<BitmapTexture> BitmapTextureGL::applyFilters(TextureMapper& textureMapper, const FilterOperations& filters)
 {
     if (filters.isEmpty())
         return this;
@@ -241,7 +241,7 @@ PassRefPtr<BitmapTexture> BitmapTextureGL::applyFilters(TextureMapper& textureMa
             }
 
             if (last) {
-                toBitmapTextureGL(resultSurface.get())->m_filterInfo = BitmapTextureGL::FilterInfo(filter, j, spareSurface);
+                toBitmapTextureGL(resultSurface.get())->m_filterInfo = BitmapTextureGL::FilterInfo(filter.copyRef(), j, spareSurface.copyRef());
                 break;
             }
 
index c4a8022..3a4d804 100644 (file)
@@ -59,16 +59,16 @@ public:
     void updateContentsNoSwizzle(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, unsigned bytesPerPixel = 4, Platform3DObject glFormat = GraphicsContext3D::RGBA);
     bool isBackedByOpenGL() const override { return true; }
 
-    PassRefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) override;
+    RefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) override;
     struct FilterInfo {
         RefPtr<FilterOperation> filter;
         unsigned pass;
         RefPtr<BitmapTexture> contentTexture;
 
-        FilterInfo(PassRefPtr<FilterOperation> f = 0, unsigned p = 0, PassRefPtr<BitmapTexture> t = 0)
-            : filter(f)
+        FilterInfo(RefPtr<FilterOperation>&& f = nullptr, unsigned p = 0, RefPtr<BitmapTexture>&& t = nullptr)
+            : filter(WTFMove(f))
             , pass(p)
-            , contentTexture(t)
+            , contentTexture(WTFMove(t))
             { }
     };
     const FilterInfo* filterInfo() const { return &m_filterInfo; }
index 78a0246..a026f4c 100644 (file)
@@ -468,7 +468,7 @@ void GraphicsLayerTextureMapper::commitLayerChanges()
         m_layer.setFilters(filters());
 
     if (m_changeMask & BackingStoreChange)
-        m_layer.setBackingStore(m_backingStore);
+        m_layer.setBackingStore(m_backingStore.copyRef());
 
     if (m_changeMask & DebugVisualsChange)
         m_layer.setDebugVisuals(isShowingDebugBorder(), debugBorderColor(), debugBorderWidth(), isShowingRepaintCounter());
index 973047f..1f9e682 100644 (file)
@@ -32,11 +32,11 @@ TextureMapper::TextureMapper() = default;
 
 TextureMapper::~TextureMapper() = default;
 
-PassRefPtr<BitmapTexture> TextureMapper::acquireTextureFromPool(const IntSize& size, const BitmapTexture::Flags flags)
+RefPtr<BitmapTexture> TextureMapper::acquireTextureFromPool(const IntSize& size, const BitmapTexture::Flags flags)
 {
     RefPtr<BitmapTexture> selectedTexture = m_texturePool->acquireTexture(size, flags);
     selectedTexture->reset(size, flags);
-    return selectedTexture.release();
+    return selectedTexture;
 }
 
 std::unique_ptr<TextureMapper> TextureMapper::create()
index 7233d0d..6730d8e 100644 (file)
@@ -77,7 +77,7 @@ public:
     virtual void beginClip(const TransformationMatrix&, const FloatRect&) = 0;
     virtual void endClip() = 0;
     virtual IntRect clipBounds() = 0;
-    virtual PassRefPtr<BitmapTexture> createTexture() = 0;
+    virtual Ref<BitmapTexture> createTexture() = 0;
 
     virtual void beginPainting(PaintFlags = 0) { }
     virtual void endPainting() { }
@@ -86,7 +86,7 @@ public:
 
     virtual IntSize maxTextureSize() const = 0;
 
-    virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&, const BitmapTexture::Flags = BitmapTexture::SupportsAlpha);
+    virtual RefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&, const BitmapTexture::Flags = BitmapTexture::SupportsAlpha);
 
     void setPatternTransform(const TransformationMatrix& p) { m_patternTransform = p; }
     void setWrapMode(WrapMode m) { m_wrapMode = m; }
index 7464d04..98dc845 100644 (file)
@@ -36,7 +36,7 @@
 #include "Timer.h"
 #include <wtf/HashMap.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/SetForScope.h>
 
@@ -746,7 +746,7 @@ IntRect TextureMapperGL::clipBounds()
     return clipStack().current().scissorBox;
 }
 
-PassRefPtr<BitmapTexture> TextureMapperGL::createTexture()
+Ref<BitmapTexture> TextureMapperGL::createTexture()
 {
     return BitmapTextureGL::create(*m_context3D);
 }
index acc78e8..e7c80e9 100644 (file)
@@ -70,7 +70,7 @@ public:
     void endClip() override;
     IntRect clipBounds() override;
     IntSize maxTextureSize() const override { return IntSize(2000, 2000); }
-    PassRefPtr<BitmapTexture> createTexture() override;
+    Ref<BitmapTexture> createTexture() override;
     inline GraphicsContext3D* graphicsContext3D() const { return m_context3D.get(); }
 
     void drawFiltered(const BitmapTexture& sourceTexture, const BitmapTexture* contentTexture, const FilterOperation&, int pass);
index d39cffc..ab377fe 100644 (file)
@@ -365,7 +365,7 @@ void TextureMapperLayer::applyMask(const TextureMapperPaintOptions& options)
     options.textureMapper.setMaskMode(false);
 }
 
-PassRefPtr<BitmapTexture> TextureMapperLayer::paintIntoSurface(const TextureMapperPaintOptions& options, const IntSize& size)
+RefPtr<BitmapTexture> TextureMapperLayer::paintIntoSurface(const TextureMapperPaintOptions& options, const IntSize& size)
 {
     RefPtr<BitmapTexture> surface = options.textureMapper.acquireTextureFromPool(size, BitmapTexture::SupportsAlpha | BitmapTexture::FBOAttachment);
     TextureMapperPaintOptions paintOptions(options);
@@ -376,16 +376,16 @@ PassRefPtr<BitmapTexture> TextureMapperLayer::paintIntoSurface(const TextureMapp
         m_state.maskLayer->applyMask(options);
     surface = surface->applyFilters(options.textureMapper, m_currentFilters);
     options.textureMapper.bindSurface(surface.get());
-    return surface.release();
+    return surface;
 }
 
-static void commitSurface(const TextureMapperPaintOptions& options, PassRefPtr<BitmapTexture> surface, const IntRect& rect, float opacity)
+static void commitSurface(const TextureMapperPaintOptions& options, BitmapTexture& surface, const IntRect& rect, float opacity)
 {
     options.textureMapper.bindSurface(options.surface.get());
     TransformationMatrix targetTransform;
     targetTransform.translate(options.offset.width(), options.offset.height());
     targetTransform.multiply(options.transform);
-    options.textureMapper.drawTexture(*surface.get(), rect, targetTransform, opacity);
+    options.textureMapper.drawTexture(surface, rect, targetTransform, opacity);
 }
 
 void TextureMapperLayer::paintWithIntermediateSurface(const TextureMapperPaintOptions& options, const IntRect& rect)
@@ -405,7 +405,7 @@ void TextureMapperLayer::paintWithIntermediateSurface(const TextureMapperPaintOp
     }
 
     if (replicaSurface && options.opacity == 1) {
-        commitSurface(options, replicaSurface, rect, 1);
+        commitSurface(options, *replicaSurface, rect, 1);
         replicaSurface = nullptr;
     }
 
@@ -416,7 +416,7 @@ void TextureMapperLayer::paintWithIntermediateSurface(const TextureMapperPaintOp
         mainSurface = replicaSurface;
     }
 
-    commitSurface(options, mainSurface, rect, options.opacity);
+    commitSurface(options, *mainSurface, rect, options.opacity);
 }
 
 void TextureMapperLayer::paintRecursive(const TextureMapperPaintOptions& options)
@@ -637,9 +637,9 @@ void TextureMapperLayer::setFixedToViewport(bool fixedToViewport)
     m_fixedToViewport = fixedToViewport;
 }
 
-void TextureMapperLayer::setBackingStore(PassRefPtr<TextureMapperBackingStore> backingStore)
+void TextureMapperLayer::setBackingStore(RefPtr<TextureMapperBackingStore>&& backingStore)
 {
-    m_backingStore = backingStore;
+    m_backingStore = WTFMove(backingStore);
 }
 
 bool TextureMapperLayer::descendantsOrSelfHaveRunningAnimations() const
index 3b1c16b..bed1f6c 100644 (file)
@@ -117,7 +117,7 @@ public:
     void setAnimations(const TextureMapperAnimations&);
     void setFixedToViewport(bool);
     bool fixedToViewport() const { return m_fixedToViewport; }
-    void setBackingStore(PassRefPtr<TextureMapperBackingStore>);
+    void setBackingStore(RefPtr<TextureMapperBackingStore>&&);
 
     void syncAnimations();
     bool descendantsOrSelfHaveRunningAnimations() const;
@@ -157,7 +157,7 @@ private:
 
     void paintRecursive(const TextureMapperPaintOptions&);
     void paintUsingOverlapRegions(const TextureMapperPaintOptions&);
-    PassRefPtr<BitmapTexture> paintIntoSurface(const TextureMapperPaintOptions&, const IntSize&);
+    RefPtr<BitmapTexture> paintIntoSurface(const TextureMapperPaintOptions&, const IntSize&);
     void paintWithIntermediateSurface(const TextureMapperPaintOptions&, const IntRect&);
     void paintSelf(const TextureMapperPaintOptions&);
     void paintSelfAndChildren(const TextureMapperPaintOptions&);
index 8514a4f..4238c5d 100644 (file)
@@ -32,7 +32,7 @@ class TextureMapper;
 
 class TextureMapperTiledBackingStore : public TextureMapperBackingStore {
 public:
-    static PassRefPtr<TextureMapperTiledBackingStore> create() { return adoptRef(new TextureMapperTiledBackingStore); }
+    static Ref<TextureMapperTiledBackingStore> create() { return adoptRef(*new TextureMapperTiledBackingStore); }
     virtual ~TextureMapperTiledBackingStore() { }
 
     RefPtr<BitmapTexture> texture() const override;
index f897148..a2662ef 100644 (file)
@@ -623,7 +623,7 @@ void CoordinatedGraphicsLayer::syncImageBacking()
             releaseImageBackingIfNeeded();
 
         if (!m_coordinatedImageBacking) {
-            m_coordinatedImageBacking = m_coordinator->createImageBackingIfNeeded(m_compositedImage.get());
+            m_coordinatedImageBacking = m_coordinator->createImageBackingIfNeeded(*m_compositedImage);
             m_coordinatedImageBacking->addHost(this);
             m_layerState.imageID = m_coordinatedImageBacking->id();
         }
index bf25111..b774e00 100644 (file)
@@ -46,7 +46,7 @@ class CoordinatedGraphicsLayerClient {
 public:
     virtual bool isFlushingLayerChanges() const = 0;
     virtual FloatRect visibleContentsRect() const = 0;
-    virtual Ref<CoordinatedImageBacking> createImageBackingIfNeeded(Image*) = 0;
+    virtual Ref<CoordinatedImageBacking> createImageBackingIfNeeded(Image&) = 0;
     virtual void detachLayer(CoordinatedGraphicsLayer*) = 0;
     virtual bool paintToSurface(const IntSize&, CoordinatedSurface::Flags, uint32_t& atlasID, IntPoint&, CoordinatedSurface::Client&) = 0;
 
index f529475..560c2e1 100644 (file)
@@ -57,14 +57,14 @@ CoordinatedImageBackingID CoordinatedImageBacking::getCoordinatedImageBackingID(
     return reinterpret_cast<CoordinatedImageBackingID>(image);
 }
 
-PassRefPtr<CoordinatedImageBacking> CoordinatedImageBacking::create(Client* client, PassRefPtr<Image> image)
+Ref<CoordinatedImageBacking> CoordinatedImageBacking::create(Client& client, Ref<Image>&& image)
 {
-    return adoptRef(new CoordinatedImageBacking(client, image));
+    return adoptRef(*new CoordinatedImageBacking(client, WTFMove(image)));
 }
 
-CoordinatedImageBacking::CoordinatedImageBacking(Client* client, PassRefPtr<Image> image)
-    : m_client(client)
-    , m_image(image)
+CoordinatedImageBacking::CoordinatedImageBacking(Client& client, Ref<Image>&& image)
+    : m_client(&client)
+    , m_image(WTFMove(image))
     , m_id(getCoordinatedImageBackingID(m_image.get()))
     , m_clearContentsTimer(*this, &CoordinatedImageBacking::clearContentsTimerFired)
     , m_isDirty(false)
index b8603c6..4c69e58 100644 (file)
@@ -52,7 +52,7 @@ public:
         virtual bool imageBackingVisible() = 0;
     };
 
-    static PassRefPtr<CoordinatedImageBacking> create(Client*, PassRefPtr<Image>);
+    static Ref<CoordinatedImageBacking> create(Client&, Ref<Image>&&);
     virtual ~CoordinatedImageBacking();
 
     static CoordinatedImageBackingID getCoordinatedImageBackingID(Image*);
@@ -68,7 +68,7 @@ public:
     void update();
 
 private:
-    CoordinatedImageBacking(Client*, PassRefPtr<Image>);
+    CoordinatedImageBacking(Client&, Ref<Image>&&);
 
     void releaseSurfaceIfNeeded();
     void updateVisibilityIfNeeded(bool& changedToVisible);
index 1e58bee..0d8820e 100644 (file)
@@ -30,7 +30,7 @@
 #include "SharedBuffer.h"
 
 // This function loads resources from WebKit
-PassRefPtr<WebCore::SharedBuffer> loadResourceIntoBuffer(const char*);
+RefPtr<WebCore::SharedBuffer> loadResourceIntoBuffer(const char*);
 
 namespace WebCore {
 
@@ -38,12 +38,12 @@ void BitmapImage::invalidatePlatformData()
 {
 }
 
-PassRefPtr<Image> Image::loadPlatformResource(const char *name)
+Ref<Image> Image::loadPlatformResource(const char *name)
 {
-    RefPtr<SharedBuffer> buffer = loadResourceIntoBuffer(name);
-    RefPtr<BitmapImage> img = BitmapImage::create();
-    img->setData(buffer.release(), true);
-    return img.release();
+    auto buffer = loadResourceIntoBuffer(name);
+    auto img = BitmapImage::create();
+    img->setData(WTFMove(buffer), true);
+    return img;
 }
 
 bool BitmapImage::getHBITMAP(HBITMAP bmp)
index 0d098bd..16b6b5d 100644 (file)
@@ -93,20 +93,15 @@ void MediaPlayerPrivateFullscreenWindow::createWindow(HWND parentHwnd)
 }
 
 #if USE(CA)
-void MediaPlayerPrivateFullscreenWindow::setRootChildLayer(PassRefPtr<PlatformCALayer> rootChild)
+void MediaPlayerPrivateFullscreenWindow::setRootChildLayer(Ref<PlatformCALayer>&& rootChild)
 {
-    if (m_rootChild == rootChild)
+    if (m_rootChild == rootChild.ptr())
         return;
 
     if (m_rootChild)
         m_rootChild->removeFromSuperlayer();
 
-    m_rootChild = rootChild;
-
-    if (!m_rootChild) {
-        m_layerTreeHost = nullptr;
-        return;
-    }
+    m_rootChild = WTFMove(rootChild);
 
     if (!m_layerTreeHost) {
         m_layerTreeHost = CACFLayerTreeHost::create();
index cdd0ca3..4a20d9e 100644 (file)
@@ -58,7 +58,7 @@ public:
 
 #if USE(CA)
     PlatformCALayer* rootChildLayer() const { return m_rootChild.get(); }
-    void setRootChildLayer(PassRefPtr<PlatformCALayer>);
+    void setRootChildLayer(Ref<PlatformCALayer>&&);
 #endif
 
 private:
index 1b9229e..9dfb5ae 100644 (file)
@@ -54,7 +54,7 @@ ID2D1BitmapBrush* Pattern::createPlatformPattern(const GraphicsContext& context,
     RELEASE_ASSERT(platformContext);
 
     ID2D1BitmapBrush* patternBrush = nullptr;
-    HRESULT hr = platformContext->CreateBitmapBrush(patternImage->nativeImage(&context).get(), &bitmapBrushProperties, &brushProperties, &patternBrush);
+    HRESULT hr = platformContext->CreateBitmapBrush(patternImage.nativeImage(&context).get(), &bitmapBrushProperties, &brushProperties, &patternBrush);
     ASSERT(SUCCEEDED(hr));
     return patternBrush;
 }
index 89e4219..4ce367b 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef SharedGDIObject_h
 #define SharedGDIObject_h
 
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/win/GDIObject.h>
 
@@ -34,9 +34,9 @@ namespace WebCore {
 
 template <typename T> class SharedGDIObject : public RefCounted<SharedGDIObject<T>> {
 public:
-    static PassRefPtr<SharedGDIObject> create(GDIObject<T> object)
+    static Ref<SharedGDIObject> create(GDIObject<T> object)
     {
-        return adoptRef(new SharedGDIObject<T>(WTFMove(object)));
+        return adoptRef(*new SharedGDIObject<T>(WTFMove(object)));
     }
 
     T get() const
index 4254ef9..e5bf04d 100644 (file)
@@ -142,7 +142,7 @@ bool FilterEffectRenderer::build(RenderElement& renderer, const FilterOperations
         case FilterOperation::REFERENCE: {
             auto& referenceOperation = downcast<ReferenceFilterOperation>(filterOperation);
             effect = buildReferenceFilter(renderer, *previousEffect, referenceOperation);
-            referenceOperation.setFilterEffect(effect);
+            referenceOperation.setFilterEffect(effect.copyRef());
             break;
         }
         case FilterOperation::GRAYSCALE: {
index bd1e55e..1a94a56 100644 (file)
@@ -94,7 +94,7 @@ void RenderImageResource::resetAnimation()
 
 RefPtr<Image> RenderImageResource::image(const IntSize&) const
 {
-    return m_cachedImage ? m_cachedImage->imageForRenderer(m_renderer) : Image::nullImage();
+    return m_cachedImage ? m_cachedImage->imageForRenderer(m_renderer) : &Image::nullImage();
 }
 
 bool RenderImageResource::errorOccurred() const
index 9ce224f..24a214e 100644 (file)
@@ -3723,12 +3723,12 @@ void RenderLayer::drawPlatformResizerImage(GraphicsContext& context, const Layou
     RefPtr<Image> resizeCornerImage;
     FloatSize cornerResizerSize;
     if (renderer().document().deviceScaleFactor() >= 2) {
-        static NeverDestroyed<Image*> resizeCornerImageHiRes(Image::loadPlatformResource("textAreaResizeCorner@2x").leakRef());
+        static NeverDestroyed<Image*> resizeCornerImageHiRes(&Image::loadPlatformResource("textAreaResizeCorner@2x").leakRef());
         resizeCornerImage = resizeCornerImageHiRes;
         cornerResizerSize = resizeCornerImage->size();
         cornerResizerSize.scale(0.5f);
     } else {
-        static NeverDestroyed<Image*> resizeCornerImageLoRes(Image::loadPlatformResource("textAreaResizeCorner").leakRef());
+        static NeverDestroyed<Image*> resizeCornerImageLoRes(&Image::loadPlatformResource("textAreaResizeCorner").leakRef());
         resizeCornerImage = resizeCornerImageLoRes;
         cornerResizerSize = resizeCornerImage->size();
     }
index e98ff30..5222090 100644 (file)
@@ -890,9 +890,9 @@ bool RenderThemeWin::paintSearchFieldCancelButton(const RenderBox& o, const Pain
     // be one pixel closer to the bottom of the field.  This tends to look better with the text.
     bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
 
-    static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
-    static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef();
-    paintInfo.context().drawImage(isPressed(o) ? *cancelPressedImage : *cancelImage, bounds);
+    static Image& cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
+    static Image& cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef();
+    paintInfo.context().drawImage(isPressed(o) ? cancelPressedImage : cancelImage, bounds);
     return false;
 }
 
@@ -939,8 +939,8 @@ bool RenderThemeWin::paintSearchFieldResultsDecorationPart(const RenderBox& o, c
     // be one pixel closer to the bottom of the field.  This tends to look better with the text.
     bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
     
-    static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef();
-    paintInfo.context().drawImage(*magnifierImage, bounds);
+    static Image& magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef();
+    paintInfo.context().drawImage(magnifierImage, bounds);
     return false;
 }
 
@@ -974,8 +974,8 @@ bool RenderThemeWin::paintSearchFieldResultsButton(const RenderBox& o, const Pai
     // be one pixel closer to the bottom of the field.  This tends to look better with the text.
     bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
 
-    static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef();
-    paintInfo.context().drawImage(*magnifierImage, bounds);
+    static Image& magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef();
+    paintInfo.context().drawImage(magnifierImage, bounds);
     return false;
 }
 
index ea936a4..0fb8280 100644 (file)
@@ -115,7 +115,7 @@ PatternData* RenderSVGResourcePattern::buildPattern(RenderElement& renderer, uns
 
     // Build pattern.
     auto patternData = std::make_unique<PatternData>();
-    patternData->pattern = Pattern::create(copiedImage, true, true);
+    patternData->pattern = Pattern::create(copiedImage.releaseNonNull(), true, true);
 
     // Compute pattern space transformation.
 
index 75f24c4..ca0f68f 100644 (file)
@@ -115,31 +115,30 @@ bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect,
     if (attrName == SVGNames::diffuseConstantAttr)
         return diffuseLighting->setDiffuseConstant(diffuseConstant());
 
-    LightSource* lightSource = const_cast<LightSource*>(diffuseLighting->lightSource());
+    auto& lightSource = const_cast<LightSource&>(diffuseLighting->lightSource());
     const SVGFELightElement* lightElement = SVGFELightElement::findLightElement(this);
-    ASSERT(lightSource);
     ASSERT(lightElement);
 
     if (attrName == SVGNames::azimuthAttr)
-        return lightSource->setAzimuth(lightElement->azimuth());
+        return lightSource.setAzimuth(lightElement->azimuth());
     if (attrName == SVGNames::elevationAttr)
-        return lightSource->setElevation(lightElement->elevation());
+        return lightSource.setElevation(lightElement->elevation());
     if (attrName == SVGNames::xAttr)
-        return lightSource->setX(lightElement->x());
+        return lightSource.setX(lightElement->x());
     if (attrName == SVGNames::yAttr)
-        return lightSource->setY(lightElement->y());
+        return lightSource.setY(lightElement->y());
     if (attrName == SVGNames::zAttr)
-        return lightSource->setZ(lightElement->z());
+        return lightSource.setZ(lightElement->z());
     if (attrName == SVGNames::pointsAtXAttr)
-        return lightSource->setPointsAtX(lightElement->pointsAtX());
+        return lightSource.setPointsAtX(lightElement->pointsAtX());
     if (attrName == SVGNames::pointsAtYAttr)
-        return lightSource->setPointsAtY(lightElement->pointsAtY());
+        return lightSource.setPointsAtY(lightElement->pointsAtY());
     if (attrName == SVGNames::pointsAtZAttr)
-        return lightSource->setPointsAtZ(lightElement->pointsAtZ());
+        return lightSource.setPointsAtZ(lightElement->pointsAtZ());
     if (attrName == SVGNames::specularExponentAttr)
-        return lightSource->setSpecularExponent(lightElement->specularExponent());
+        return lightSource.setSpecularExponent(lightElement->specularExponent());
     if (attrName == SVGNames::limitingConeAngleAttr)
-        return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle());
+        return lightSource.setLimitingConeAngle(lightElement->limitingConeAngle());
 
     ASSERT_NOT_REACHED();
     return false;
@@ -188,8 +187,7 @@ RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filter
 
     const Color& color = renderer->style().svgStyle().lightingColor();
 
-    RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(),
-                                                                kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource));
+    RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(), kernelUnitLengthX(), kernelUnitLengthY(), lightSource.releaseNonNull());
     effect->inputEffects().append(input1);
     return effect;
 }
index 5565b91..170437f 100644 (file)
@@ -126,31 +126,30 @@ bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect
     if (attrName == SVGNames::specularExponentAttr)
         return specularLighting->setSpecularExponent(specularExponent());
 
-    LightSource* lightSource = const_cast<LightSource*>(specularLighting->lightSource());
+    auto& lightSource = const_cast<LightSource&>(specularLighting->lightSource());
     const SVGFELightElement* lightElement = SVGFELightElement::findLightElement(this);
-    ASSERT(lightSource);
     ASSERT(lightElement);
 
     if (attrName == SVGNames::azimuthAttr)
-        return lightSource->setAzimuth(lightElement->azimuth());
+        return lightSource.setAzimuth(lightElement->azimuth());
     if (attrName == SVGNames::elevationAttr)
-        return lightSource->setElevation(lightElement->elevation());
+        return lightSource.setElevation(lightElement->elevation());
     if (attrName == SVGNames::xAttr)
-        return lightSource->setX(lightElement->x());
+        return lightSource.setX(lightElement->x());
     if (attrName == SVGNames::yAttr)
-        return lightSource->setY(lightElement->y());
+        return lightSource.setY(lightElement->y());
     if (attrName == SVGNames::zAttr)
-        return lightSource->setZ(lightElement->z());
+        return lightSource.setZ(lightElement->z());
     if (attrName == SVGNames::pointsAtXAttr)
-        return lightSource->setPointsAtX(lightElement->pointsAtX());
+        return lightSource.setPointsAtX(lightElement->pointsAtX());
     if (attrName == SVGNames::pointsAtYAttr)
-        return lightSource->setPointsAtY(lightElement->pointsAtY());
+        return lightSource.setPointsAtY(lightElement->pointsAtY());
     if (attrName == SVGNames::pointsAtZAttr)
-        return lightSource->setPointsAtZ(lightElement->pointsAtZ());
+        return lightSource.setPointsAtZ(lightElement->pointsAtZ());
     if (attrName == SVGNames::specularExponentAttr)
-        return lightSource->setSpecularExponent(lightElement->specularExponent());
+        return lightSource.setSpecularExponent(lightElement->specularExponent());
     if (attrName == SVGNames::limitingConeAngleAttr)
-        return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle());
+        return lightSource.setLimitingConeAngle(lightElement->limitingConeAngle());
 
     ASSERT_NOT_REACHED();
     return false;
@@ -199,8 +198,7 @@ RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filte
     
     const Color& color = renderer->style().svgStyle().lightingColor();
 
-    RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(),
-                                          specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), WTFMove(lightSource));
+    RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(), specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), lightSource.releaseNonNull());
     effect->inputEffects().append(input1);
     return effect;
 }
index 399d6ba..44d0cba 100644 (file)
@@ -78,7 +78,7 @@ Image* SVGImageCache::imageForRenderer(const RenderObject* renderer) const
 {
     auto* image = findImageForRenderer(renderer);
     if (!image)
-        return Image::nullImage();
+        return &Image::nullImage();
     ASSERT(!image->size().isEmpty());
     return image;
 }
index 6a4b119..79ccb99 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-11  Chris Dumez  <cdumez@apple.com>
+
+        Stop using PassRefPtr in platform/graphics
+        https://bugs.webkit.org/show_bug.cgi?id=171977
+
+        Reviewed by Alex Christensen.
+
+        Build fix.
+
+        * FullscreenVideoController.cpp:
+        (FullscreenVideoController::enterFullscreen):
+        * WebKitDLL.cpp:
+        (loadResourceIntoBuffer):
+
 2017-05-09  Sam Weinig  <sam@webkit.org>
 
         Remove support for legacy Notifications
index 8571850..3572071 100644 (file)
@@ -286,7 +286,7 @@ void FullscreenVideoController::enterFullscreen()
     ::ShowWindow(m_fullscreenWindow->hwnd(), SW_SHOW);
 
 #if USE(CA)
-    m_fullscreenWindow->setRootChildLayer(m_rootChild);
+    m_fullscreenWindow->setRootChildLayer(*m_rootChild);
 
     PlatformCALayer* videoLayer = PlatformCALayer::platformCALayer(m_videoElement->platformLayer());
     ASSERT(videoLayer);
index bdd9418..7c3fbb2 100644 (file)
@@ -171,8 +171,8 @@ void shutDownWebKit()
 }
 
 //FIXME: We should consider moving this to a new file for cross-project functionality
-WEBKIT_API PassRefPtr<WebCore::SharedBuffer> loadResourceIntoBuffer(const char* name);
-PassRefPtr<WebCore::SharedBuffer> loadResourceIntoBuffer(const char* name)
+WEBKIT_API RefPtr<WebCore::SharedBuffer> loadResourceIntoBuffer(const char* name);
+RefPtr<WebCore::SharedBuffer> loadResourceIntoBuffer(const char* name)
 {
     int idr;
     // temporary hack to get resource id
@@ -225,17 +225,17 @@ PassRefPtr<WebCore::SharedBuffer> loadResourceIntoBuffer(const char* name)
     else if (!strcmp(name, "fsVideoPlay"))
         idr = IDR_FS_VIDEO_PLAY;
     else
-        return 0;
+        return nullptr;
 
     HRSRC resInfo = FindResource(gInstance, MAKEINTRESOURCE(idr), L"PNG");
     if (!resInfo)
-        return 0;
+        return nullptr;
     HANDLE res = LoadResource(gInstance, resInfo);
     if (!res)
-        return 0;
+        return nullptr;
     void* resource = LockResource(res);
     if (!resource)
-        return 0;
+        return nullptr;
     unsigned size = SizeofResource(gInstance, resInfo);
 
     return WebCore::SharedBuffer::create(reinterpret_cast<const char*>(resource), size);
index 22fe6e8..46ccd5b 100644 (file)
@@ -1,3 +1,28 @@
+2017-05-11  Chris Dumez  <cdumez@apple.com>
+
+        Stop using PassRefPtr in platform/graphics
+        https://bugs.webkit.org/show_bug.cgi?id=171977
+
+        Reviewed by Alex Christensen.
+
+        Build fix.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
+        (WebKit::CoordinatedGraphicsScene::removeBackingStoreIfNeeded):
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<Cursor>::decode):
+        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
+        (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
+        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
+        * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
+        (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
+        (WebKit::GraphicsLayerCARemote::createPlatformCAAnimation):
+        * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
+        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
+        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
+        (WebKit::PlatformCAAnimationRemote::copy):
+
 2017-05-11  Tim Horton  <timothy_horton@apple.com>
 
         Data loss when saving a PDF form where only radio buttons/checkboxes were modified
index 4006558..7615f09 100644 (file)
@@ -349,9 +349,9 @@ void CoordinatedGraphicsScene::createBackingStoreIfNeeded(TextureMapperLayer* la
     if (m_backingStores.contains(layer))
         return;
 
-    RefPtr<CoordinatedBackingStore> backingStore(CoordinatedBackingStore::create());
-    m_backingStores.add(layer, backingStore);
-    layer->setBackingStore(backingStore);
+    auto backingStore = CoordinatedBackingStore::create();
+    m_backingStores.add(layer, backingStore.copyRef());
+    layer->setBackingStore(WTFMove(backingStore));
 }
 
 void CoordinatedGraphicsScene::removeBackingStoreIfNeeded(TextureMapperLayer* layer)
@@ -360,7 +360,7 @@ void CoordinatedGraphicsScene::removeBackingStoreIfNeeded(TextureMapperLayer* la
     if (!backingStore)
         return;
 
-    layer->setBackingStore(0);
+    layer->setBackingStore(nullptr);
 }
 
 void CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize(TextureMapperLayer* layer)
index 7af6648..53f05ce 100644 (file)
@@ -964,7 +964,7 @@ bool ArgumentCoder<Cursor>::decode(Decoder& decoder, Cursor& cursor)
         return false;
 
     if (!isValidImagePresent) {
-        cursor = Cursor(Image::nullImage(), IntPoint());
+        cursor = Cursor(&Image::nullImage(), IntPoint());
         return true;
     }
 
index e5572e1..811eeea 100644 (file)
@@ -211,11 +211,11 @@ void CompositingCoordinator::syncLayerState(CoordinatedLayerID id, CoordinatedGr
     m_state.layersToUpdate.append(std::make_pair(id, state));
 }
 
-Ref<CoordinatedImageBacking> CompositingCoordinator::createImageBackingIfNeeded(Image* image)
+Ref<CoordinatedImageBacking> CompositingCoordinator::createImageBackingIfNeeded(Image& image)
 {
-    CoordinatedImageBackingID imageID = CoordinatedImageBacking::getCoordinatedImageBackingID(image);
-    auto addResult = m_imageBackings.ensure(imageID, [this, image] {
-        return CoordinatedImageBacking::create(this, image);
+    CoordinatedImageBackingID imageID = CoordinatedImageBacking::getCoordinatedImageBackingID(&image);
+    auto addResult = m_imageBackings.ensure(imageID, [this, &image] {
+        return CoordinatedImageBacking::create(*this, image);
     });
     return *addResult.iterator->value;
 }
index d2ca784..7c54018 100644 (file)
@@ -111,7 +111,7 @@ private:
     // CoordinatedGraphicsLayerClient
     bool isFlushingLayerChanges() const override { return m_isFlushingLayerChanges; }
     WebCore::FloatRect visibleContentsRect() const override;
-    Ref<WebCore::CoordinatedImageBacking> createImageBackingIfNeeded(WebCore::Image*) override;
+    Ref<WebCore::CoordinatedImageBacking> createImageBackingIfNeeded(WebCore::Image&) override;
     void detachLayer(WebCore::CoordinatedGraphicsLayer*) override;
     bool paintToSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags, uint32_t& /* atlasID */, WebCore::IntPoint&, WebCore::CoordinatedSurface::Client&) override;
     void syncLayerState(WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayerState&) override;
index 761b2a2..2df42e9 100644 (file)
@@ -42,7 +42,7 @@ bool GraphicsLayerCARemote::filtersCanBeComposited(const FilterOperations& filte
     return PlatformCALayerRemote::filtersCanBeComposited(filters);
 }
 
-PassRefPtr<PlatformCALayer> GraphicsLayerCARemote::createPlatformCALayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* owner)
+Ref<PlatformCALayer> GraphicsLayerCARemote::createPlatformCALayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* owner)
 {
     auto result = PlatformCALayerRemote::create(layerType, owner, m_context);
 
@@ -52,12 +52,12 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCARemote::createPlatformCALayer(Platfor
     return WTFMove(result);
 }
 
-PassRefPtr<PlatformCALayer> GraphicsLayerCARemote::createPlatformCALayer(PlatformLayer* platformLayer, PlatformCALayerClient* owner)
+Ref<PlatformCALayer> GraphicsLayerCARemote::createPlatformCALayer(PlatformLayer* platformLayer, PlatformCALayerClient* owner)
 {
     return PlatformCALayerRemote::create(platformLayer, owner, m_context);
 }
 
-PassRefPtr<PlatformCAAnimation> GraphicsLayerCARemote::createPlatformCAAnimation(PlatformCAAnimation::AnimationType type, const String& keyPath)
+Ref<PlatformCAAnimation> GraphicsLayerCARemote::createPlatformCAAnimation(PlatformCAAnimation::AnimationType type, const String& keyPath)
 {
     return PlatformCAAnimationRemote::create(type, keyPath);
 }
index 835e4b7..e4a9257 100644 (file)
@@ -47,9 +47,9 @@ public:
 private:
     bool isGraphicsLayerCARemote() const override { return true; }
 
-    PassRefPtr<WebCore::PlatformCALayer> createPlatformCALayer(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner) override;
-    PassRefPtr<WebCore::PlatformCALayer> createPlatformCALayer(PlatformLayer*, WebCore::PlatformCALayerClient* owner) override;
-    PassRefPtr<WebCore::PlatformCAAnimation> createPlatformCAAnimation(WebCore::PlatformCAAnimation::AnimationType, const String& keyPath) override;
+    Ref<WebCore::PlatformCALayer> createPlatformCALayer(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner) override;
+    Ref<WebCore::PlatformCALayer> createPlatformCALayer(PlatformLayer*, WebCore::PlatformCALayerClient* owner) override;
+    Ref<WebCore::PlatformCAAnimation> createPlatformCAAnimation(WebCore::PlatformCAAnimation::AnimationType, const String& keyPath) override;
 
     // PlatformCALayerRemote can't currently proxy directly composited image contents, so opt out of this optimization.
     bool shouldDirectlyCompositeImage(WebCore::Image*) const override { return false; }
index ff74c73..6339b22 100644 (file)
@@ -53,7 +53,7 @@ public:
 
     bool isPlatformCAAnimationRemote() const override { return true; }
 
-    PassRefPtr<PlatformCAAnimation> copy() const override;
+    Ref<PlatformCAAnimation> copy() const override;
 
     String keyPath() const override;
 
index 163a72b..b100370 100644 (file)
@@ -306,9 +306,9 @@ Ref<PlatformCAAnimation> PlatformCAAnimationRemote::create(PlatformCAAnimation::
     return adoptRef(*new PlatformCAAnimationRemote(type, keyPath));
 }
 
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationRemote::copy() const
+Ref<PlatformCAAnimation> PlatformCAAnimationRemote::copy() const
 {
-    RefPtr<PlatformCAAnimation> animation = create(animationType(), keyPath());
+    auto animation = create(animationType(), keyPath());
     
     animation->setBeginTime(beginTime());
     animation->setDuration(duration());
@@ -322,7 +322,7 @@ PassRefPtr<PlatformCAAnimation> PlatformCAAnimationRemote::copy() const
     animation->copyTimingFunctionFrom(*this);
     animation->setValueFunction(valueFunction());
 
-    downcast<PlatformCAAnimationRemote>(*animation).setHasExplicitBeginTime(hasExplicitBeginTime());
+    downcast<PlatformCAAnimationRemote>(animation.get()).setHasExplicitBeginTime(hasExplicitBeginTime());
     
     // Copy the specific Basic or Keyframe values.
     if (animationType() == Keyframe) {