[GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Feb 2014 18:22:20 +0000 (18:22 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Feb 2014 18:22:20 +0000 (18:22 +0000)
commite869a163d9e474d66631de20ccdab11fbb67721b
treed76d0c006d76def277c62ad3d03b17a25503df40
parent1609229f743a793c3cf5315eba4af9a5d1248268
[GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=127554

Reviewed by Gustavo Noronha Silva.

Source/WebCore:

Use GUniqueOutPtr instead of GOwnPtr.

* GNUmakefile.list.am:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
(WebCore::AudioDestinationGStreamer::handleMessage):
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::handleMessage):
* platform/glib/BatteryProviderUPower.cpp:
(BatteryProviderUPower::startUpdating):
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::getTag):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::loadResourceSharedBuffer):
* platform/gtk/DataObjectGtk.cpp:
(WebCore::DataObjectGtk::setURIList):
* platform/gtk/FileSystemGtk.cpp:
(WebCore::readFromFile):
* platform/gtk/GamepadsGtk.cpp:
(WebCore::GamepadDeviceGtk::readCallback):
* platform/gtk/GtkInputMethodFilter.cpp:
(WebCore::GtkInputMethodFilter::handlePreeditChanged):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::fillDataObjectFromDropData):
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::systemFont):
* platform/gtk/SharedBufferGtk.cpp:
(WebCore::SharedBuffer::createWithContentsOfFile):
* platform/network/gtk/CredentialBackingStore.cpp:
(WebCore::credentialForChallengeAsyncReadyCallback):
* platform/network/soup/GOwnPtrSoup.cpp: Removed.
* platform/network/soup/GOwnPtrSoup.h: Removed.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::redirectSkipCallback):
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):
(WebCore::addFileToSoupMessageBody):
(WebCore::createSoupRequestAndMessageForHandle):
(WebCore::readCallback):
* platform/network/soup/SocketStreamHandleSoup.cpp:
(WebCore::SocketStreamHandle::platformSend):
(WebCore::SocketStreamHandle::platformClose):
(WebCore::connectedCallback):
(WebCore::readReadyCallback):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::httpProxy):

Source/WebKit/gtk:

Use GUniqueOutPtr instead of GOwnPtr.

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidFailLoad):
* WebCoreSupport/TextCheckerClientGtk.cpp:
* webkit/webkitdownload.cpp:
(webkit_download_open_stream_for_uri):
(webkit_download_set_destination_uri):
(webkit_download_received_data):
* webkit/webkitwebplugin.cpp:
(webkit_web_plugin_get_path):
* webkit/webkitwebview.cpp:
(webkit_web_view_expose_event):

Source/WebKit2:

Use GUniqueOutPtr instead of GOwnPtr.

* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::getCacheDiskFreeSize):
* Shared/Downloads/soup/DownloadSoup.cpp:
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::didFinishLoading):
* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(processPendingIconsForPageURL):
(webkit_favicon_database_get_favicon):
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback):
* UIProcess/API/gtk/WebKitWebView.cpp:
(gotFaviconCallback):
* UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
(WebKit::WebInspectorServer::platformResourceForPath):
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::getCacheDiskFreeSize):

Source/WTF:

GUniqueOutPtr is a simplified version of GOwnPtr for the cases
where we need the address of the contained pointer. GUniqueOutPtr
uses GUniquePtr to free the contained object and to release the
container pointer. The API is very simple to make sure this is
only used when outPtr() is needed. It can't be constructed with a
pointer, and there's not method to set a new pointer. Another
difference with the old GOwnPtr is that outPtr() can be used
multiple times, because it frees any pointer previously set.

* GNUmakefile.list.am:
* wtf/PlatformEfl.cmake:
* wtf/PlatformGTK.cmake:
* wtf/gobject/GOwnPtr.cpp: Removed.
* wtf/gobject/GOwnPtr.h: Removed.
* wtf/gobject/GUniquePtr.h:
(WTF::GUniqueOutPtr::GUniqueOutPtr):
(WTF::GUniqueOutPtr::~GUniqueOutPtr):
(WTF::GUniqueOutPtr::outPtr):
(WTF::GUniqueOutPtr::reset):
(WTF::GUniqueOutPtr::release):
(WTF::GUniqueOutPtr::operator*):
(WTF::GUniqueOutPtr::operator->):
(WTF::GUniqueOutPtr::get):
(WTF::GUniqueOutPtr::operator!):
(WTF::GUniqueOutPtr::operator UnspecifiedBoolType):

Tools:

Use GUniqueOutPtr instead of GOwnPtr.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
* DumpRenderTree/gtk/EventSender.cpp:
(createKeyPressEvent):
* TestWebKitAPI/Tests/WTF/gobject/GUniquePtr.cpp:
(TestWebKitAPI::returnOutChar):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp:
(testInspectorServerPageList):
(openRemoteDebuggingSession):
(sendIncompleteRequest):
* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp:
(testWebExtensionWindowObjectCleared):
(testWebExtensionIsolatedWorld):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewRunJavaScript):
(testWebViewSave):
(testWebViewPageVisibility):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebViewGroup.cpp:
(isStyleSheetInjectedForURLAtPath):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp:
* TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp:
(TestWebKitAPI::TestInputMethodFilter::sendKeyEventToFilter):
* TestWebKitAPI/gtk/PlatformWebViewGtk.cpp:
(TestWebKitAPI::doKeyStroke):
* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
* TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp:
(WebKitTestBus::run):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(resourceGetDataCallback):
(WebViewTest::keyStroke):
(onSnapshotReady):
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::keyDown):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
69 files changed:
Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/wtf/PlatformEfl.cmake
Source/WTF/wtf/PlatformGTK.cmake
Source/WTF/wtf/gobject/GOwnPtr.cpp [deleted file]
Source/WTF/wtf/gobject/GOwnPtr.h [deleted file]
Source/WTF/wtf/gobject/GUniquePtr.h
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp
Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
Source/WebCore/platform/glib/BatteryProviderUPower.cpp
Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
Source/WebCore/platform/graphics/gtk/ImageGtk.cpp
Source/WebCore/platform/gtk/DataObjectGtk.cpp
Source/WebCore/platform/gtk/FileSystemGtk.cpp
Source/WebCore/platform/gtk/GamepadsGtk.cpp
Source/WebCore/platform/gtk/GtkInputMethodFilter.cpp
Source/WebCore/platform/gtk/PasteboardHelper.cpp
Source/WebCore/platform/gtk/RenderThemeGtk.cpp
Source/WebCore/platform/gtk/SharedBufferGtk.cpp
Source/WebCore/platform/network/gtk/CredentialBackingStore.cpp
Source/WebCore/platform/network/soup/GOwnPtrSoup.cpp [deleted file]
Source/WebCore/platform/network/soup/GOwnPtrSoup.h [deleted file]
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp
Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/TextCheckerClientGtk.cpp
Source/WebKit/gtk/webkit/webkitdownload.cpp
Source/WebKit/gtk/webkit/webkitwebplugin.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Source/WebKit2/UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
Tools/ChangeLog
Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
Tools/DumpRenderTree/gtk/EventSender.cpp
Tools/TestWebKitAPI/Tests/WTF/gobject/GUniquePtr.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebViewGroup.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp
Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp
Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h
Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp
Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp