Another round of removing use of OwnPtr, PassOwnPtr, and deleteOwnedPtr
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Apr 2015 02:13:39 +0000 (02:13 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Apr 2015 02:13:39 +0000 (02:13 +0000)
commited09b59ebbc83d9390488fc5b63e81691d60ba21
tree65b4cac616b52e99b43b7f1144a57d58b01e9960
parentc03ebc38286e33d044c31f8495f83106f785d8b5
Another round of removing use of OwnPtr, PassOwnPtr, and deleteOwnedPtr
https://bugs.webkit.org/show_bug.cgi?id=144090

Reviewed by Anders Carlsson.

Source/WebCore:

* Modules/encryptedmedia/CDMPrivateMediaPlayer.h: Removed unneeded include.

* Modules/navigatorcontentutils/NavigatorContentUtils.h: Removed include of
RefCountedSupplement.h.

* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
Pass data using rvalue references, and use new/delete to pass it across
threads, rather than using PassOwnPtr.
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: Pass data
in an rvalue reference instead of PassOwnPtr.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveBinaryData): Take an rvalue reference
instead of a PassOwnPtr.
* Modules/websockets/WebSocket.h: Ditto.
* Modules/websockets/WebSocketChannel.cpp: Ditto.
(WebCore::WebSocketChannel::processFrame): Ditto.
* Modules/websockets/WebSocketChannelClient.h:
(WebCore::WebSocketChannelClient::didReceiveBinaryData): Ditto.
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
Ditto.
* Modules/websockets/WorkerThreadableWebSocketChannel.h: Ditto.

* WebCore.xcodeproj/project.pbxproj: Removed RefCountedSupplement.h.

* loader/cocoa/DiskCacheMonitorCocoa.mm:
(WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Fixed comment
to not mention adoptPtr.

* page/make_settings.pl:
(generateInternalSettingsHeaderFile): Removed include of RefCountedSupplement.h.

* platform/ColorChooserClient.h: Removed unneded include.
* platform/ContextMenuItem.h: Ditto.

* platform/RefCountedSupplement.h: Removed.

* platform/ScrollAnimator.cpp: Removed unneeded include.
* platform/ScrollAnimatorNone.h: Ditto.

* platform/ThreadGlobalData.cpp: Added now-needed include of PassOwnPtr.h.

* platform/graphics/GlyphMetricsMap.h: Ditto.
* platform/graphics/MediaPlayer.h: Ditto.
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: Ditto.
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Ditto.
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Ditto.
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Ditto.
* platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h: Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: Ditto.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: Ditto.

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer): Use make_unique instead of adoptPtr.
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData): Return a RefPtr instead of a PassRefPtr.
* platform/graphics/cg/ImageBufferDataCG.h: Streamlined the header a bit,
use unique_ptr instead of OwnPtr and RefPtr instead of PassRefPtr.

* platform/graphics/cocoa/IOSurface.h: Use unique_ptr instead of OwnPtr.
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::ensureGraphicsContext): Use make_unique instead of adoptPtr.

* platform/graphics/egl/GLContextEGL.cpp: Removed unneeded includes.
* platform/graphics/filters/FilterOperation.h: Ditto.
* platform/graphics/harfbuzz/HarfBuzzShaper.h: Ditto.
* platform/ios/DeviceMotionClientIOS.h: Ditto.
* platform/ios/DeviceOrientationClientIOS.h: Ditto.

* platform/ios/LegacyTileCache.h: Use unique_ptr instead of OwnPtr.
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::LegacyTileCache): Use make_unique instead of
a create function, and also get rid of unneeded initialization to null.
(WebCore::LegacyTileCache::commitScaleChange): Ditto.

* platform/ios/LegacyTileGrid.h: Made constructor public and got rid of create
function. Made constructor take a reference to the tile cache, and make both
tileCache() and m_tileCache be references too.

* platform/ios/LegacyTileGrid.mm:
(WebCore::LegacyTileGrid::LegacyTileGrid): Updated to use reference.
(WebCore::LegacyTileGrid::visibleRect): Ditto.
(WebCore::LegacyTileGrid::tileByteSize) Ditto.:
(WebCore::LegacyTileGrid::dropDistantTiles): Ditto.
(WebCore::LegacyTileGrid::updateTileOpacity): Ditto.
(WebCore::LegacyTileGrid::updateTileBorderVisibility): Ditto.
(WebCore::LegacyTileGrid::updateHostLayerSize): Ditto.
(WebCore::LegacyTileGrid::invalidateTiles): Ditto.
(WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage): Ditto.
(WebCore::LegacyTileGrid::tileDistance2): Ditto.
(WebCore::LegacyTileGrid::createTiles): Ditto.
* platform/ios/LegacyTileGridTile.mm:
(WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
(WebCore::LegacyTileGridTile::invalidateRect): Ditto.
(WebCore::LegacyTileGridTile::showBorder): Ditto.
* platform/ios/LegacyTileLayer.mm:
(-[LegacyTileHostLayer renderInContext:]): Ditto.
(-[LegacyTileLayer layoutSublayers]): Ditto.
(-[LegacyTileLayer drawInContext:]): Ditto.

* platform/ios/LegacyTileLayerPool.h: Removed unneeded include.
* platform/ios/ScrollAnimatorIOS.mm: Ditto.
* platform/mac/ScrollAnimatorMac.mm: Ditto.
* platform/mac/WebVideoFullscreenController.h: Ditto.
* platform/network/BlobData.cpp: Ditto.

* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::ResourceHandle): Use make_unique instead of adoptPtr.
* platform/network/ResourceHandle.h: Use unique_ptr instead of OwnPtr.

* platform/network/ResourceHandleInternal.h: Added now-needed include.

* platform/network/ResourceResponseBase.h: Removed unneeded includes and
tweaked formatting a bit.

* platform/network/SynchronousLoaderClient.h: Removed the create function and
the private constructor. Used data member initialize to make the default
empty constructor automatically get generated (and be public now).

* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::formFinishFinalizationOnMainThread): Use delete instead of adoptPtr
to delete the context argument.

* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::defaultNetworkStorageSession): Return a unique_ptr& instead of an OwnPtr&.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Use make_unique
instead of adoptPtr.
(WebCore::NetworkStorageSession::defaultStorageSession): Ditto.

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Use a
SynchronousLoaderClient on the stack instead of putting one on the heap with adoptPtr.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.

* platform/text/TextCodec.h: Removed unneeded include.
* platform/win/CursorWin.cpp: Ditto.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects): Use move instead of release since
we are using RefPtr&& instead of PassRefPtr.

* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::setRenderer): Use RefPtr&& instead of PassRefPtr.
(WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients): Streamlined to use
modern for loops and auto.
(WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients): Ditto.

* rendering/RenderLayerFilterInfo.h: Streamlined code and removed some stuff that
I think is unneeded on iOS; there is no unused private field and I suspect the problem
that led to the warning is gone. Deleted friending of deleteOwnedPtr.

* rendering/RenderLayerMaskImageInfo.cpp: Removed unneeded includes. Moved private
client classes in here from the header and made them members of MaskImageInfo.
Streamlined them a bit in other ways.
(WebCore::RenderLayer::MaskImageInfo::getIfExists): Use nullptr.
(WebCore::RenderLayer::MaskImageInfo::MaskImageInfo): Use member initialization
and also pass the layer in rather than the MaskImageInfo.
(WebCore::RenderLayer::MaskImageInfo::notifyFinished): Deleted. Moved the code
into the SVGDocumentClient.
(WebCore::RenderLayer::MaskImageInfo::imageChanged): Deleted. Moved the code into
the ImageClient.
(WebCore::RenderLayer::MaskImageInfo::updateMaskImageClients): Streamlined a bit
to use a for loop.
(WebCore::RenderLayer::MaskImageInfo::removeMaskImageClients): Ditto.

* rendering/RenderLayerMaskImageInfo.h: Reduced unneeded includes. Got rid of
definitions of private member classes here in the header; they can be in the cpp
file instead. Also cut down from three classes to two, and gave the classes less
redundant names since they are already members of MaskImageInfo. Removed some
unneeded functions and friending of deleteOwnedPtr.

* testing/InternalSettings.cpp: Got rid of comment about RefCountedSupplement
since no code anywhere was using it, so not using it here was not remarkable.

Source/WebKit/win:

* FullscreenVideoController.cpp:
(FullscreenVideoController::FullscreenVideoController):
(FullscreenVideoController::exitFullscreen):
* FullscreenVideoController.h:
* Plugins/PluginView.h:
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::wndProc):
* WebCoreSupport/AcceleratedCompositingContext.h:
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::WebChromeClient):
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::WebFrameLoaderClient):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::highlight):
* WebCoreSupport/WebInspectorClient.h:
* WebElementPropertyBag.cpp:
(WebElementPropertyBag::WebElementPropertyBag):
* WebElementPropertyBag.h:
* WebFrame.h:
* WebHistoryItem.cpp:
* WebNodeHighlight.cpp:
* WebNotificationCenter.cpp:
(WebNotificationCenter::WebNotificationCenter):
* WebNotificationCenter.h:
Use make_unique and unique_ptr instead of adoptPtr and OwnPtr.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm: Removed unneeded include.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
91 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h
Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h
Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp
Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/Modules/websockets/WebSocket.h
Source/WebCore/Modules/websockets/WebSocketChannel.cpp
Source/WebCore/Modules/websockets/WebSocketChannelClient.h
Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp
Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm
Source/WebCore/page/make_settings.pl
Source/WebCore/platform/ColorChooserClient.h
Source/WebCore/platform/ContextMenuItem.h
Source/WebCore/platform/RefCountedSupplement.h [deleted file]
Source/WebCore/platform/ScrollAnimator.cpp
Source/WebCore/platform/ScrollAnimatorNone.h
Source/WebCore/platform/ThreadGlobalData.cpp
Source/WebCore/platform/graphics/GlyphMetricsMap.h
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h
Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp
Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h
Source/WebCore/platform/graphics/cocoa/IOSurface.h
Source/WebCore/platform/graphics/cocoa/IOSurface.mm
Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
Source/WebCore/platform/graphics/filters/FilterOperation.h
Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.h
Source/WebCore/platform/graphics/win/FullScreenController.cpp
Source/WebCore/platform/ios/DeviceMotionClientIOS.h
Source/WebCore/platform/ios/DeviceOrientationClientIOS.h
Source/WebCore/platform/ios/LegacyTileCache.h
Source/WebCore/platform/ios/LegacyTileCache.mm
Source/WebCore/platform/ios/LegacyTileGrid.h
Source/WebCore/platform/ios/LegacyTileGrid.mm
Source/WebCore/platform/ios/LegacyTileGridTile.mm
Source/WebCore/platform/ios/LegacyTileLayer.mm
Source/WebCore/platform/ios/LegacyTileLayerPool.h
Source/WebCore/platform/ios/ScrollAnimatorIOS.mm
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mac/WebVideoFullscreenController.h
Source/WebCore/platform/network/BlobData.cpp
Source/WebCore/platform/network/ResourceHandle.cpp
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/ResourceHandleInternal.h
Source/WebCore/platform/network/ResourceResponseBase.h
Source/WebCore/platform/network/SynchronousLoaderClient.h
Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp
Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebCore/platform/text/TextCodec.h
Source/WebCore/platform/win/CursorWin.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerFilterInfo.cpp
Source/WebCore/rendering/RenderLayerFilterInfo.h
Source/WebCore/rendering/RenderLayerMaskImageInfo.cpp
Source/WebCore/rendering/RenderLayerMaskImageInfo.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/FullscreenVideoController.cpp
Source/WebKit/win/FullscreenVideoController.h
Source/WebKit/win/Plugins/PluginView.h
Source/WebKit/win/Plugins/PluginViewWin.cpp
Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.h
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/win/WebCoreSupport/WebEditorClient.h
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
Source/WebKit/win/WebCoreSupport/WebInspectorClient.h
Source/WebKit/win/WebElementPropertyBag.cpp
Source/WebKit/win/WebElementPropertyBag.h
Source/WebKit/win/WebFrame.h
Source/WebKit/win/WebHistoryItem.cpp
Source/WebKit/win/WebNodeHighlight.cpp
Source/WebKit/win/WebNotificationCenter.cpp
Source/WebKit/win/WebNotificationCenter.h
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm