[GLIB] Use GUniquePtr instead of GOwnPtr
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jan 2014 07:53:48 +0000 (07:53 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jan 2014 07:53:48 +0000 (07:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127431

Reviewed by Martin Robinson.

GUniquePtr is a template alias of std::unique_ptr with a custom
deleter that replaces GOwnPtr. GOwnPtr is still used for the cases
where the output pointer is needed, but it will also be replaced soon.

Source/WebCore:

* GNUmakefile.list.am:
* PlatformGTK.cmake:
* accessibility/atk/AXObjectCacheAtk.cpp:
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):
(accessibilityObjectLength):
(textExtents):
(webkitAccessibleTextGetChar):
(numberOfReplacedElementsBeforeOffset):
* page/ContextMenuController.cpp:
* platform/SharedBuffer.h:
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcConstructed):
(webKitWebAudioSrcLoop):
* platform/audio/gtk/AudioBusGtk.cpp:
(WebCore::AudioBus::loadPlatformResource):
* platform/geoclue/GeolocationProviderGeoclue.cpp:
* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcAddSrc):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart):
(ResourceHandleStreamingClient::wasBlocked):
(ResourceHandleStreamingClient::cannotShowURL):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::getThemeIconFileName):
(WebCore::Image::loadPlatformResource):
* platform/gtk/ContextMenuGtk.cpp:
(WebCore::ContextMenu::itemCount):
(WebCore::contextMenuItemVector):
* platform/gtk/ContextMenuItemGtk.cpp:
(WebCore::createPlatformMenuItemDescription):
* platform/gtk/DataObjectGtk.cpp:
(WebCore::DataObjectGtk::setURIList):
(WebCore::DataObjectGtk::setURL):
* platform/gtk/FileSystemGtk.cpp:
(WebCore::filenameToString):
(WebCore::fileSystemRepresentation):
(WebCore::filenameForDisplay):
(WebCore::pathGetFileName):
(WebCore::applicationDirectoryPath):
(WebCore::sharedResourcesPath):
(WebCore::directoryName):
(WebCore::listDirectory):
(WebCore::openTemporaryFile):
* platform/gtk/GOwnPtrGtk.cpp: Removed.
* platform/gtk/GOwnPtrGtk.h: Removed.
* platform/gtk/GUniquePtrGtk.h: Added.
* platform/gtk/GamepadsGtk.cpp:
(WebCore::GamepadsGtk::GamepadsGtk):
* platform/gtk/GtkClickCounter.cpp:
(WebCore::GtkClickCounter::shouldProcessButtonEvent):
* platform/gtk/GtkInputMethodFilter.cpp:
(WebCore::GtkInputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents):
* platform/gtk/GtkPopupMenu.cpp:
(WebCore::GtkPopupMenu::popUp):
(WebCore::GtkPopupMenu::typeAheadFind):
* platform/gtk/LanguageGtk.cpp:
(WebCore::platformLanguage):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::imageTitle):
(WebCore::localizedMediaTimeDescription):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::selectionDataToUTF8String):
(WebCore::PasteboardHelper::getClipboardContents):
(WebCore::PasteboardHelper::fillSelectionData):
* platform/gtk/PopupMenuGtk.cpp:
(WebCore::PopupMenuGtk::createGtkActionForMenuItem):
(WebCore::PopupMenuGtk::show):
* platform/gtk/WebKitAuthenticationWidget.cpp:
(webkitAuthenticationWidgetInitialize):
* platform/network/ResourceHandleInternal.h:
* platform/network/gtk/CredentialBackingStore.cpp:
(WebCore::credentialForChallengeAsyncReadyCallback):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM):
(WebCore::cookiesForSession):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
(WebCore::getHostnamesWithCookies):
(WebCore::deleteCookiesForHostname):
(WebCore::deleteAllCookies):
* platform/network/soup/DNSSoup.cpp:
* platform/network/soup/GUniquePtrSoup.h: Added.
* platform/network/soup/ResourceErrorSoup.cpp:
(WebCore::failingURI):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::ensureReadBuffer):
(WebCore::cleanupSoupRequestOperation):
(WebCore::createSoupRequestAndMessageForHandle):
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageMembers):
(WebCore::ResourceRequest::updateSoupMessage):
* platform/network/soup/ResourceResponseSoup.cpp:
* platform/network/soup/SoupURIUtils.cpp:
(WebCore::soupURIToKURL):
* platform/soup/SharedBufferSoup.cpp:
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::clearPlatformData):
(WebCore::SharedBuffer::maybeTransferPlatformData):
(WebCore::SharedBuffer::hasPlatformData):
* plugins/gtk/PluginPackageGtk.cpp:
(WebCore::PluginPackage::fetchInfo):
(WebCore::PluginPackage::load):

Source/WebKit/gtk:

* WebCoreSupport/ContextMenuClientGtk.cpp:
(WebKit::getUnicodeMenuItemPosition):
* WebCoreSupport/DragClientGtk.cpp:
(WebKit::DragClient::startDrag):
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::setValueForUser):
* WebCoreSupport/EditorClientGtk.h:
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::userAgent):
(WebKit::FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
(WebKit::FrameLoaderClient::dispatchWillSendRequest):
(WebKit::FrameLoaderClient::assignIdentifierToInitialRequest):
(WebKit::FrameLoaderClient::dispatchDidReceiveResponse):
(WebKit::FrameLoaderClient::dispatchDidReceiveContentLength):
(WebKit::FrameLoaderClient::dispatchDidFinishLoading):
(WebKit::FrameLoaderClient::dispatchDidFailLoading):
(WebKit::FrameLoaderClient::dispatchDidFailLoad):
* WebCoreSupport/InspectorClientGtk.h:
* webkit/webkitfavicondatabase.cpp:
(webkit_favicon_database_set_path):
* webkit/webkitfilechooserrequest.cpp:
* webkit/webkitglobals.cpp:
(webkitInit):
* webkit/webkithittestresult.cpp:
(WebKit::kit):
* webkit/webkiticondatabase.cpp:
(webkit_icon_database_set_path):
* webkit/webkitspellcheckerenchant.cpp:
* webkit/webkitwebplugin.cpp:
(webkit_web_plugin_get_path):
* webkit/webkitwebpluginprivate.h:
* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):
(webkit_web_settings_copy):
* webkit/webkitwebview.cpp:
(webkit_web_view_forward_context_menu_event):
(fileChooserDialogResponseCallback):
(webkit_web_view_drag_end):
* webkit/webkitwebviewprivate.h:

Source/WebKit2:

* Shared/Downloads/soup/DownloadSoup.cpp:
(WebKit::DownloadClient::didReceiveResponse):
* Shared/NativeWebKeyboardEvent.h:
* Shared/NativeWebMouseEvent.h:
* Shared/NativeWebWheelEvent.h:
* Shared/gtk/ArgumentCodersGtk.cpp:
(IPC::encodeGKeyFile):
(IPC::decodeGKeyFile):
(IPC::encode):
(IPC::decode):
* UIProcess/API/gtk/WebKitContextMenuItem.cpp:
(webkitContextMenuItemSetSubMenuFromGtkMenu):
* UIProcess/API/gtk/WebKitDownload.cpp:
(webkitDownloadDecideDestination):
(webkitDownloadNotifyProgress):
(webkitDownloadFailed):
* UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
(webkit_file_chooser_request_select_files):
* UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
(didReceiveWebViewMessageFromInjectedBundle):
(getInjectedBundleInitializationUserData):
* UIProcess/API/gtk/WebKitLoaderClient.cpp:
(didFailProvisionalLoadWithErrorForFrame):
(didFailLoadWithErrorForFrame):
* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(drawPagesForPrintingCompleted):
* UIProcess/API/gtk/WebKitURIRequest.cpp:
(webkit_uri_request_get_http_headers):
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(webkit_uri_scheme_request_get_scheme):
(webkit_uri_scheme_request_get_path):
* UIProcess/API/gtk/WebKitWebContext.cpp:
(injectedBundleFilename):
(webkit_web_context_set_favicon_database_directory):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewLoadFail):
(webkitWebViewCreateJavaScriptDialog):
(fileChooserDialogResponseCallback):
(webkitWebViewLoadChanged):
(webkitWebViewLoadFailedWithTLSErrors):
(webkitWebViewPopulateContextMenu):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseButtonPressEvent):
(webkitWebViewBaseStartDrag):
* UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
(WebKit::WebInspectorServer::platformResourceForPath):
* UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
(WebKit::connectionCallback):
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContext::platformDefaultApplicationCacheDirectory):
(WebKit::WebContext::platformDefaultDatabaseDirectory):
(WebKit::WebContext::platformDefaultIconDatabasePath):
(WebKit::WebContext::platformDefaultLocalStorageDirectory):
(WebKit::WebContext::platformDefaultDiskCacheDirectory):
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::contextMenuItemVisibilityChanged):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformInspectedURLChanged):
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::createGtkActionForMenuItem):
* WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformInitialize):
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
* WebProcess/gtk/WebProcessMainGtk.cpp:
* WebProcess/soup/WebSoupRequestManager.cpp:
(WebKit::WebSoupRequestManager::send):

Tools:

* DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
(printAccessibilityEvent):
(axObjectEventListener):
* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(indexRangeInTable):
(AccessibilityUIElement::role):
(AccessibilityUIElement::title):
(AccessibilityUIElement::description):
(AccessibilityUIElement::stringValue):
(AccessibilityUIElement::language):
(AccessibilityUIElement::lineForIndex):
(AccessibilityUIElement::selectedTextRange):
(AccessibilityUIElement::url):
* DumpRenderTree/efl/AccessibilityControllerEfl.cpp:
(AccessibilityController::accessibleElementById):
* DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
(AccessibilityController::accessibleElementById):
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(getOutputDir):
(getFontsPath):
(initializeFonts):
(dumpFramesAsText):
(compareHistoryItems):
(dumpHistoryItem):
(soupURIToStringPreservingPassword):
(resetDefaultsToConsistentValues):
(temporaryDatabaseDirectory):
(webViewTitleChanged):
(webFrameLoadStatusNotified):
(pathFromSoupURI):
(convertWebResourceToURLPath):
(urlSuitableForTestResult):
(descriptionSuitableForTestResult):
(willSendRequestCallback):
(frameLoadEventCallback):
* DumpRenderTree/gtk/EditingCallbacks.cpp:
(dumpNodePath):
(dumpRange):
(shouldApplyStyle):
* DumpRenderTree/gtk/EventSender.cpp:
(contextClickCallback):
(beginDragWithFilesCallback):
* DumpRenderTree/gtk/TestRunnerGtk.cpp:
(TestRunner::pathToLocalResource):
(TestRunner::queueLoad):
(TestRunner::removeOriginAccessWhitelistEntry):
(TestRunner::setMockGeolocationPositionUnavailableError):
(TestRunner::setIconDatabaseEnabled):
(TestRunner::findString):
(TestRunner::setDomainRelaxationForbiddenForURLScheme):
(TestRunner::overridePreference):
(TestRunner::addUserScript):
(TestRunner::addUserStyleSheet):
(TestRunner::setTextDirection):
* DumpRenderTree/gtk/TextInputController.cpp:
(setMarkedTextCallback):
(insertTextCallback):
(doCommandCallback):
* DumpRenderTree/gtk/WorkQueueItemGtk.cpp:
(LoadHTMLStringItem::invoke):
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp:
(WebKitDOMNodeTest::testTagNames):
* TestWebKitAPI/Tests/WebKit2Gtk/TestBackForwardList.cpp:
(testBackForwardListLimitAndCache):
* TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp:
(testContextMenuSmartSeparators):
* TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(testDownloadLocalFile):
(testDownloadLocalFileError):
(addContentDispositionHTTPHeaderToResponse):
(serverCallback):
(testDownloadRemoteFileError):
* TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp:
(startTestServer):
(testInspectorServerPageList):
(openRemoteDebuggingSession):
* TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp:
(testPrintOperationPrint):
* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(addCacheHTTPHeadersToResponse):
(serverCallback):
* TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
(httpsServerCallback):
(httpServerCallback):
* TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
(testWebViewJavaScriptDialogs):
(testWebViewWindowProperties):
(testWebViewFileChooserRequest):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp:
(testWebExtensionWindowObjectCleared):
(testWebExtensionIsolatedWorld):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitAccessibility.cpp:
(startTestServer):
(checkAtspiAccessible):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
(serverCallback):
(testClearDatabase):
(testGetFaviconURI):
(webkitFaviconDatabaseFinalizedCallback):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
(testWebContextGetPlugins):
(testWebContextURIScheme):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewRunJavaScript):
(testWebViewMode):
(testWebViewPageVisibility):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebViewGroup.cpp:
(isStyleSheetInjectedForURLAtPath):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp:
(testWebViewEditorCutCopyPasteNonEditable):
(testWebViewEditorCutCopyPasteEditable):
(testWebViewEditorSelectAllNonEditable):
(testWebViewEditorSelectAllEditable):
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(sendRequestCallback):
(methodCallCallback):
* TestWebKitAPI/gtk/PlatformUtilitiesGtk.cpp:
(TestWebKitAPI::Util::createInjectedBundlePath):
(TestWebKitAPI::Util::createURLForResource):
* TestWebKitAPI/gtk/PlatformWebViewGtk.cpp:
(TestWebKitAPI::doKeyStroke):
(TestWebKitAPI::doMouseButtonEvent):
(TestWebKitAPI::PlatformWebView::simulateMouseMove):
* TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp:
(loadFailedCallback):
(LoadTrackingTest::loadURI):
(LoadTrackingTest::loadHtml):
(LoadTrackingTest::loadPlainText):
(LoadTrackingTest::loadRequest):
(LoadTrackingTest::reload):
(LoadTrackingTest::goBack):
(LoadTrackingTest::goForward):
* TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h:
* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp:
(registerGResource):
(removeNonEmptyDirectory):
(main):
* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
(Test::getWebKit1TestResoucesDir):
(Test::getResourcesDir):
* TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp:
(WebKitTestBus::run):
* TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.cpp:
(WebKitTestServer::WebKitTestServer):
(WebKitTestServer::getURIForPath):
* TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp:
(WebProcessTestRunner::runTest):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(resourceGetDataCallback):
(WebViewTest::mainResourceData):
(WebViewTest::mouseMoveTo):
(WebViewTest::keyStroke):
(WebViewTest::doMouseButtonEvent):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp:
(WTR::AccessibilityController::accessibleElementById):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::role):
(WTR::AccessibilityUIElement::title):
(WTR::AccessibilityUIElement::description):
(WTR::AccessibilityUIElement::stringValue):
(WTR::AccessibilityUIElement::language):
(WTR::AccessibilityUIElement::lineForIndex):
(WTR::AccessibilityUIElement::selectedTextRange):
(WTR::AccessibilityUIElement::url):
* WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
(WTR::getOutputDir):
(WTR::getFontsPath):
(WTR::initializeFontConfigSetting):
* WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.cpp:
(WTR::topLevelPath):
* WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp:
(WTR::TestRunner::pathToLocalResource):
* WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::TestController::initializeInjectedBundlePath):
(WTR::TestController::initializeTestPluginDirectory):

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

138 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/PlatformGTK.cmake
Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/platform/SharedBuffer.h
Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp
Source/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
Source/WebCore/platform/graphics/gtk/ImageGtk.cpp
Source/WebCore/platform/gtk/ContextMenuGtk.cpp
Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp
Source/WebCore/platform/gtk/DataObjectGtk.cpp
Source/WebCore/platform/gtk/FileSystemGtk.cpp
Source/WebCore/platform/gtk/GOwnPtrGtk.cpp [deleted file]
Source/WebCore/platform/gtk/GUniquePtrGtk.h [moved from Source/WebCore/platform/gtk/GOwnPtrGtk.h with 75% similarity]
Source/WebCore/platform/gtk/GamepadsGtk.cpp
Source/WebCore/platform/gtk/GtkClickCounter.cpp
Source/WebCore/platform/gtk/GtkInputMethodFilter.cpp
Source/WebCore/platform/gtk/GtkPopupMenu.cpp
Source/WebCore/platform/gtk/LanguageGtk.cpp
Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
Source/WebCore/platform/gtk/PasteboardHelper.cpp
Source/WebCore/platform/gtk/PopupMenuGtk.cpp
Source/WebCore/platform/gtk/WebKitAuthenticationWidget.cpp
Source/WebCore/platform/network/ResourceHandleInternal.h
Source/WebCore/platform/network/gtk/CredentialBackingStore.cpp
Source/WebCore/platform/network/soup/CookieJarSoup.cpp
Source/WebCore/platform/network/soup/DNSSoup.cpp
Source/WebCore/platform/network/soup/GUniquePtrSoup.h [new file with mode: 0644]
Source/WebCore/platform/network/soup/ResourceErrorSoup.cpp
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp
Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp
Source/WebCore/platform/network/soup/SoupURIUtils.cpp
Source/WebCore/platform/soup/SharedBufferSoup.cpp
Source/WebCore/plugins/gtk/PluginPackageGtk.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp
Source/WebKit/gtk/webkit/webkitfilechooserrequest.cpp
Source/WebKit/gtk/webkit/webkitglobals.cpp
Source/WebKit/gtk/webkit/webkithittestresult.cpp
Source/WebKit/gtk/webkit/webkiticondatabase.cpp
Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp
Source/WebKit/gtk/webkit/webkitwebplugin.cpp
Source/WebKit/gtk/webkit/webkitwebpluginprivate.h
Source/WebKit/gtk/webkit/webkitwebsettings.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/gtk/webkit/webkitwebviewprivate.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp
Source/WebKit2/Shared/NativeWebKeyboardEvent.h
Source/WebKit2/Shared/NativeWebMouseEvent.h
Source/WebKit2/Shared/NativeWebWheelEvent.h
Source/WebKit2/Shared/gtk/ArgumentCodersGtk.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit2/UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp
Source/WebKit2/UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp
Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp
Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp
Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorGtk.cpp
Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp
Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp
Tools/ChangeLog
Tools/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp
Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp
Tools/DumpRenderTree/efl/AccessibilityControllerEfl.cpp
Tools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
Tools/DumpRenderTree/gtk/EditingCallbacks.cpp
Tools/DumpRenderTree/gtk/EventSender.cpp
Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp
Tools/DumpRenderTree/gtk/TextInputController.cpp
Tools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp
Tools/TestWebKitAPI/PlatformGTK.cmake
Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestBackForwardList.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitAccessibility.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.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/gtk/PlatformUtilitiesGtk.cpp
Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h
Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h
Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp
Tools/WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.cpp
Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp
Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp

index f3cf389..16fa115 100644 (file)
@@ -1,3 +1,125 @@
+2014-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GLIB] Use GUniquePtr instead of GOwnPtr
+        https://bugs.webkit.org/show_bug.cgi?id=127431
+
+        Reviewed by Martin Robinson.
+
+        GUniquePtr is a template alias of std::unique_ptr with a custom
+        deleter that replaces GOwnPtr. GOwnPtr is still used for the cases
+        where the output pointer is needed, but it will also be replaced soon.
+
+        * GNUmakefile.list.am:
+        * PlatformGTK.cmake:
+        * accessibility/atk/AXObjectCacheAtk.cpp:
+        * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
+        (getAttributeSetForAccessibilityObject):
+        (accessibilityObjectLength):
+        (textExtents):
+        (webkitAccessibleTextGetChar):
+        (numberOfReplacedElementsBeforeOffset):
+        * page/ContextMenuController.cpp:
+        * platform/SharedBuffer.h:
+        * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
+        (webKitWebAudioSrcConstructed):
+        (webKitWebAudioSrcLoop):
+        * platform/audio/gtk/AudioBusGtk.cpp:
+        (WebCore::AudioBus::loadPlatformResource):
+        * platform/geoclue/GeolocationProviderGeoclue.cpp:
+        * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
+        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+        * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
+        (webKitMediaSrcAddSrc):
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcStart):
+        (ResourceHandleStreamingClient::wasBlocked):
+        (ResourceHandleStreamingClient::cannotShowURL):
+        * platform/graphics/gtk/ImageBufferGtk.cpp:
+        (WebCore::encodeImage):
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/gtk/ImageGtk.cpp:
+        (WebCore::getThemeIconFileName):
+        (WebCore::Image::loadPlatformResource):
+        * platform/gtk/ContextMenuGtk.cpp:
+        (WebCore::ContextMenu::itemCount):
+        (WebCore::contextMenuItemVector):
+        * platform/gtk/ContextMenuItemGtk.cpp:
+        (WebCore::createPlatformMenuItemDescription):
+        * platform/gtk/DataObjectGtk.cpp:
+        (WebCore::DataObjectGtk::setURIList):
+        (WebCore::DataObjectGtk::setURL):
+        * platform/gtk/FileSystemGtk.cpp:
+        (WebCore::filenameToString):
+        (WebCore::fileSystemRepresentation):
+        (WebCore::filenameForDisplay):
+        (WebCore::pathGetFileName):
+        (WebCore::applicationDirectoryPath):
+        (WebCore::sharedResourcesPath):
+        (WebCore::directoryName):
+        (WebCore::listDirectory):
+        (WebCore::openTemporaryFile):
+        * platform/gtk/GOwnPtrGtk.cpp: Removed.
+        * platform/gtk/GOwnPtrGtk.h: Removed.
+        * platform/gtk/GUniquePtrGtk.h: Added.
+        * platform/gtk/GamepadsGtk.cpp:
+        (WebCore::GamepadsGtk::GamepadsGtk):
+        * platform/gtk/GtkClickCounter.cpp:
+        (WebCore::GtkClickCounter::shouldProcessButtonEvent):
+        * platform/gtk/GtkInputMethodFilter.cpp:
+        (WebCore::GtkInputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents):
+        * platform/gtk/GtkPopupMenu.cpp:
+        (WebCore::GtkPopupMenu::popUp):
+        (WebCore::GtkPopupMenu::typeAheadFind):
+        * platform/gtk/LanguageGtk.cpp:
+        (WebCore::platformLanguage):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::imageTitle):
+        (WebCore::localizedMediaTimeDescription):
+        * platform/gtk/PasteboardHelper.cpp:
+        (WebCore::selectionDataToUTF8String):
+        (WebCore::PasteboardHelper::getClipboardContents):
+        (WebCore::PasteboardHelper::fillSelectionData):
+        * platform/gtk/PopupMenuGtk.cpp:
+        (WebCore::PopupMenuGtk::createGtkActionForMenuItem):
+        (WebCore::PopupMenuGtk::show):
+        * platform/gtk/WebKitAuthenticationWidget.cpp:
+        (webkitAuthenticationWidgetInitialize):
+        * platform/network/ResourceHandleInternal.h:
+        * platform/network/gtk/CredentialBackingStore.cpp:
+        (WebCore::credentialForChallengeAsyncReadyCallback):
+        * platform/network/soup/CookieJarSoup.cpp:
+        (WebCore::setCookiesFromDOM):
+        (WebCore::cookiesForSession):
+        (WebCore::getRawCookies):
+        (WebCore::deleteCookie):
+        (WebCore::getHostnamesWithCookies):
+        (WebCore::deleteCookiesForHostname):
+        (WebCore::deleteAllCookies):
+        * platform/network/soup/DNSSoup.cpp:
+        * platform/network/soup/GUniquePtrSoup.h: Added.
+        * platform/network/soup/ResourceErrorSoup.cpp:
+        (WebCore::failingURI):
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::ResourceHandle::ensureReadBuffer):
+        (WebCore::cleanupSoupRequestOperation):
+        (WebCore::createSoupRequestAndMessageForHandle):
+        * platform/network/soup/ResourceRequestSoup.cpp:
+        (WebCore::ResourceRequest::updateSoupMessageMembers):
+        (WebCore::ResourceRequest::updateSoupMessage):
+        * platform/network/soup/ResourceResponseSoup.cpp:
+        * platform/network/soup/SoupURIUtils.cpp:
+        (WebCore::soupURIToKURL):
+        * platform/soup/SharedBufferSoup.cpp:
+        (WebCore::SharedBuffer::SharedBuffer):
+        (WebCore::SharedBuffer::clearPlatformData):
+        (WebCore::SharedBuffer::maybeTransferPlatformData):
+        (WebCore::SharedBuffer::hasPlatformData):
+        * plugins/gtk/PluginPackageGtk.cpp:
+        (WebCore::PluginPackage::fetchInfo):
+        (WebCore::PluginPackage::load):
+
 2014-01-22  Simon Fraser  <simon.fraser@apple.com>
 
         Surround fixedVisibleContentRect code with USE(TILED_BACKING_STORE)
index e1b07ca..992d7c4 100644 (file)
@@ -6251,10 +6251,9 @@ platformgtk_sources += \
        Source/WebCore/platform/gtk/DragIcon.h \
        Source/WebCore/platform/gtk/EventLoopGtk.cpp \
        Source/WebCore/platform/gtk/FileSystemGtk.cpp \
-       Source/WebCore/platform/gtk/GOwnPtrGtk.cpp \
-       Source/WebCore/platform/gtk/GOwnPtrGtk.h \
        Source/WebCore/platform/gtk/GRefPtrGtk.cpp \
        Source/WebCore/platform/gtk/GRefPtrGtk.h \
+       Source/WebCore/platform/gtk/GUniquePtr.h \
        Source/WebCore/platform/gtk/GtkClickCounter.cpp \
        Source/WebCore/platform/gtk/GtkClickCounter.h \
        Source/WebCore/platform/gtk/GtkInputMethodFilter.cpp \
index 0148b36..dfe38cc 100644 (file)
@@ -196,7 +196,6 @@ list(APPEND WebCorePlatformGTK_SOURCES
     platform/gtk/ErrorsGtk.cpp
     platform/gtk/EventLoopGtk.cpp
     platform/gtk/FileSystemGtk.cpp
-    platform/gtk/GOwnPtrGtk.cpp
     platform/gtk/GRefPtrGtk.cpp
     platform/gtk/GtkClickCounter.cpp
     platform/gtk/GtkDragAndDropHelper.cpp
index 61552fe..2191f77 100644 (file)
@@ -30,7 +30,6 @@
 #include "Range.h"
 #include "TextIterator.h"
 #include "WebKitAccessibleWrapperAtk.h"
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
 #include <wtf/text/CString.h>
 
index 48f6a24..8422d70 100644 (file)
@@ -51,7 +51,7 @@
 #include "WebKitAccessibleUtil.h"
 #include "WebKitAccessibleWrapperAtk.h"
 #include "htmlediting.h"
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebCore;
@@ -87,18 +87,18 @@ static AtkAttributeSet* getAttributeSetForAccessibilityObject(const Accessibilit
     RenderStyle* style = &renderer->style();
 
     AtkAttributeSet* result = 0;
-    GOwnPtr<gchar> buffer(g_strdup_printf("%i", style->fontSize()));
+    GUniquePtr<gchar> buffer(g_strdup_printf("%i", style->fontSize()));
     result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_SIZE), buffer.get());
 
     Color bgColor = style->visitedDependentColor(CSSPropertyBackgroundColor);
     if (bgColor.isValid()) {
-        buffer.set(g_strdup_printf("%i,%i,%i", bgColor.red(), bgColor.green(), bgColor.blue()));
+        buffer.reset(g_strdup_printf("%i,%i,%i", bgColor.red(), bgColor.green(), bgColor.blue()));
         result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_BG_COLOR), buffer.get());
     }
 
     Color fgColor = style->visitedDependentColor(CSSPropertyColor);
     if (fgColor.isValid()) {
-        buffer.set(g_strdup_printf("%i,%i,%i", fgColor.red(), fgColor.green(), fgColor.blue()));
+        buffer.reset(g_strdup_printf("%i,%i,%i", fgColor.red(), fgColor.green(), fgColor.blue()));
         result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_FG_COLOR), buffer.get());
     }
 
@@ -120,13 +120,13 @@ static AtkAttributeSet* getAttributeSetForAccessibilityObject(const Accessibilit
     }
 
     if (includeRise) {
-        buffer.set(g_strdup_printf("%i", baselinePosition));
+        buffer.reset(g_strdup_printf("%i", baselinePosition));
         result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_RISE), buffer.get());
     }
 
     if (!style->textIndent().isUndefined()) {
         int indentation = valueForLength(style->textIndent(), object->size().width(), &renderer->view());
-        buffer.set(g_strdup_printf("%i", indentation));
+        buffer.reset(g_strdup_printf("%i", indentation));
         result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_INDENT), buffer.get());
     }
 
@@ -166,7 +166,7 @@ static AtkAttributeSet* getAttributeSetForAccessibilityObject(const Accessibilit
         fontWeight = 900;
     }
     if (fontWeight > 0) {
-        buffer.set(g_strdup_printf("%i", fontWeight));
+        buffer.reset(g_strdup_printf("%i", fontWeight));
         result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_WEIGHT), buffer.get());
     }
 
@@ -261,7 +261,7 @@ static guint accessibilityObjectLength(const AccessibilityObject* object)
     // well known API to always get the text in a consistent way
     AtkObject* atkObj = ATK_OBJECT(object->wrapper());
     if (ATK_IS_TEXT(atkObj)) {
-        GOwnPtr<gchar> text(webkitAccessibleTextGetText(ATK_TEXT(atkObj), 0, -1));
+        GUniquePtr<gchar> text(webkitAccessibleTextGetText(ATK_TEXT(atkObj), 0, -1));
         return g_utf8_strlen(text.get(), -1);
     }
 
@@ -335,7 +335,7 @@ static AtkAttributeSet* getRunAttributesFromAccesibilityObject(const Accessibili
 
 static IntRect textExtents(AtkText* text, gint startOffset, gint length, AtkCoordType coords)
 {
-    GOwnPtr<char> textContent(webkitAccessibleTextGetText(text, startOffset, -1));
+    GUniquePtr<char> textContent(webkitAccessibleTextGetText(text, startOffset, -1));
     gint textLength = g_utf8_strlen(textContent.get(), -1);
 
     // The first case (endOffset of -1) should work, but seems broken for all Gtk+ apps.
@@ -529,7 +529,7 @@ static char* webkitAccessibleTextGetChar(AtkText* text, int offset, GetTextRelat
     else if (textPosition == GetTextPositionAfter)
         actualOffset++;
 
-    GOwnPtr<char> textData(webkitAccessibleTextGetText(text, 0, -1));
+    GUniquePtr<char> textData(webkitAccessibleTextGetText(text, 0, -1));
     int textLength = g_utf8_strlen(textData.get(), -1);
 
     *startOffset = std::max(0, actualOffset);
@@ -637,7 +637,7 @@ static VisibleSelection wordAtPositionForAtkBoundary(const AccessibilityObject*
 
 static int numberOfReplacedElementsBeforeOffset(AtkText* text, unsigned offset)
 {
-    GOwnPtr<char> textForObject(webkitAccessibleTextGetText(text, 0, offset));
+    GUniquePtr<char> textForObject(webkitAccessibleTextGetText(text, 0, offset));
     String textBeforeOffset = String::fromUTF8(textForObject.get());
 
     int count = 0;
index 6d5cf74..04a06d1 100644 (file)
 #include <wtf/unicode/CharacterNames.h>
 #include <wtf/unicode/Unicode.h>
 
-#if PLATFORM(GTK)
-#include <wtf/gobject/GOwnPtr.h>
-#endif
-
 using namespace WTF;
 using namespace Unicode;
 
index 106c830..8c5953a 100644 (file)
@@ -38,7 +38,7 @@
 #endif
 
 #if USE(SOUP)
-#include "GOwnPtrSoup.h"
+#include "GUniquePtrSoup.h"
 #endif
 
 #if PLATFORM(MAC)
@@ -211,7 +211,7 @@ private:
 
 #if USE(SOUP)
     explicit SharedBuffer(SoupBuffer*);
-    GOwnPtr<SoupBuffer> m_soupBuffer;
+    GUniquePtr<SoupBuffer> m_soupBuffer;
 #endif
 };
 
index b2bb882..ff672f3 100644 (file)
 
 #include "AudioBus.h"
 #include "AudioIOCallback.h"
-#include <wtf/gobject/GOwnPtr.h>
 #include "GRefPtrGStreamer.h"
 #include "GStreamerUtilities.h"
 #include <gst/audio/audio.h>
 #include <gst/pbutils/pbutils.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 using namespace WebCore;
 
@@ -221,7 +221,7 @@ static void webKitWebAudioSrcConstructed(GObject* object)
     // For each channel of the bus create a new upstream branch for interleave, like:
     // queue ! capsfilter ! audioconvert. which is plugged to a new interleave request sinkpad.
     for (unsigned channelIndex = 0; channelIndex < priv->bus->numberOfChannels(); channelIndex++) {
-        GOwnPtr<gchar> queueName(g_strdup_printf("webaudioQueue%u", channelIndex));
+        GUniquePtr<gchar> queueName(g_strdup_printf("webaudioQueue%u", channelIndex));
         GstElement* queue = gst_element_factory_make("queue", queueName.get());
         GstElement* capsfilter = gst_element_factory_make("capsfilter", 0);
         GstElement* audioconvert = gst_element_factory_make("audioconvert", 0);
@@ -356,8 +356,8 @@ static void webKitWebAudioSrcLoop(WebKitWebAudioSrc* src)
         if (priv->newStreamEventPending) {
             GRefPtr<GstElement> queue = adoptGRef(gst_pad_get_parent_element(pad));
             GRefPtr<GstPad> sinkPad = adoptGRef(gst_element_get_static_pad(queue.get(), "sink"));
-            GOwnPtr<gchar> queueName(gst_element_get_name(queue.get()));
-            GOwnPtr<gchar> streamId(g_strdup_printf("webaudio/%s", queueName.get()));
+            GUniquePtr<gchar> queueName(gst_element_get_name(queue.get()));
+            GUniquePtr<gchar> streamId(g_strdup_printf("webaudio/%s", queueName.get()));
             GstEvent* streamStartEvent = gst_event_new_stream_start(streamId.get());
 #if GST_CHECK_VERSION(1, 2, 0)
             gst_event_set_group_id(streamStartEvent, groupId);
index 96b2753..2adee9b 100644 (file)
 
 #include "AudioFileReader.h"
 #include "FileSystem.h"
-
-#include <wtf/gobject/GOwnPtr.h>
-#include <wtf/text/CString.h>
-
 #include <glib.h>
+#include <wtf/gobject/GUniquePtr.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
 PassRefPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, float sampleRate)
 {
-    GOwnPtr<gchar> filename(g_strdup_printf("%s.wav", name));
+    GUniquePtr<gchar> filename(g_strdup_printf("%s.wav", name));
     const char* environmentPath = getenv("AUDIO_RESOURCES_PATH");
-    GOwnPtr<gchar> absoluteFilename;
+    GUniquePtr<gchar> absoluteFilename;
     if (environmentPath)
-        absoluteFilename.set(g_build_filename(environmentPath, filename.get(), NULL));
+        absoluteFilename.reset(g_build_filename(environmentPath, filename.get(), NULL));
     else
-        absoluteFilename.set(g_build_filename(sharedResourcesPath().data(), "resources", "audio", filename.get(), NULL));
+        absoluteFilename.reset(g_build_filename(sharedResourcesPath().data(), "resources", "audio", filename.get(), NULL));
     return createBusFromAudioFile(absoluteFilename.get(), false, sampleRate);
 }
 
index e537604..b2a5701 100644 (file)
@@ -28,8 +28,6 @@
 
 #if ENABLE(GEOLOCATION)
 
-#include <wtf/gobject/GOwnPtr.h>
-
 using namespace WebCore;
 
 static void getPositionCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GError* error, GeolocationProviderGeoclue* provider)
index 7d5c3f9..c4a0fd8 100644 (file)
@@ -38,6 +38,7 @@
 #include <gst/pbutils/missing-plugins.h>
 #include <limits>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 #if ENABLE(VIDEO_TRACK)
@@ -190,7 +191,7 @@ void MediaPlayerPrivateGStreamer::setAudioStreamProperties(GObject* object)
     GstStructure* structure = gst_structure_new("stream-properties", "media.role", G_TYPE_STRING, role, NULL);
     g_object_set(object, "stream-properties", structure, NULL);
     gst_structure_free(structure);
-    GOwnPtr<gchar> elementName(gst_element_get_name(GST_ELEMENT(object)));
+    GUniquePtr<gchar> elementName(gst_element_get_name(GST_ELEMENT(object)));
     LOG_MEDIA_MESSAGE("Set media.role as %s at %s", role, elementName.get());
 }
 
@@ -1037,7 +1038,7 @@ gboolean MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
         gst_message_parse_request_state(message, &requestedState);
         gst_element_get_state(m_playBin.get(), &currentState, NULL, 250);
         if (requestedState < currentState) {
-            GOwnPtr<gchar> elementName(gst_element_get_name(GST_ELEMENT(message)));
+            GUniquePtr<gchar> elementName(gst_element_get_name(GST_ELEMENT(message)));
             INFO_MEDIA_MESSAGE("Element %s requested state change to %s", elementName.get(),
                 gst_element_state_get_name(requestedState));
             m_requestedState = requestedState;
index 55dce95..83b137f 100644 (file)
@@ -30,7 +30,7 @@
 #include <gst/app/gstappsrc.h>
 #include <gst/gst.h>
 #include <gst/pbutils/missing-plugins.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 typedef struct _Source {
@@ -141,7 +141,6 @@ static void webKitMediaSrcAddSrc(WebKitMediaSrc* src, GstElement* element)
 {
     GstPad* ghostPad;
     WebKitMediaSrcPrivate* priv = src->priv;
-    GOwnPtr<gchar> name;
 
     if (!gst_bin_add(GST_BIN(src), element)) {
         GST_DEBUG_OBJECT(src, "Src element not added");
@@ -154,7 +153,7 @@ static void webKitMediaSrcAddSrc(WebKitMediaSrc* src, GstElement* element)
     }
 
     gst_element_sync_state_with_parent(element);
-    name.set(g_strdup_printf("src_%u", priv->nbSource));
+    GUniquePtr<gchar> name(g_strdup_printf("src_%u", priv->nbSource));
     ghostPad = WebCore::webkitGstGhostPadFromStaticTemplate(&srcTemplate, name.get(), targetsrc.get());
     gst_pad_set_active(ghostPad, TRUE);
 
index 3aee48c..524d44d 100644 (file)
@@ -41,8 +41,8 @@
 #include <gst/pbutils/missing-plugins.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/gobject/GMutexLocker.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebCore;
@@ -502,9 +502,7 @@ static gboolean webKitWebSrcStart(WebKitWebSrc* src)
         request.setHTTPUserAgent("Quicktime/7.6.6");
 
     if (priv->requestedOffset) {
-        GOwnPtr<gchar> val;
-
-        val.set(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-", priv->requestedOffset));
+        GUniquePtr<gchar> val(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-", priv->requestedOffset));
         request.setHTTPHeaderField("Range", val.get());
     }
     priv->offset = priv->requestedOffset;
@@ -1150,12 +1148,12 @@ void ResourceHandleStreamingClient::didFail(ResourceHandle*, const ResourceError
 void ResourceHandleStreamingClient::wasBlocked(ResourceHandle*)
 {
     WebKitWebSrc* src = WEBKIT_WEB_SRC(m_src.get());
-    GOwnPtr<gchar> uri;
+    GUniquePtr<gchar> uri;
 
     GST_ERROR_OBJECT(src, "Request was blocked");
 
     GMutexLocker locker(GST_OBJECT_GET_LOCK(src));
-    uri.set(g_strdup(src->priv->uri));
+    uri.reset(g_strdup(src->priv->uri));
     locker.unlock();
 
     GST_ELEMENT_ERROR(src, RESOURCE, OPEN_READ, ("Access to \"%s\" was blocked", uri.get()), (0));
@@ -1164,12 +1162,12 @@ void ResourceHandleStreamingClient::wasBlocked(ResourceHandle*)
 void ResourceHandleStreamingClient::cannotShowURL(ResourceHandle*)
 {
     WebKitWebSrc* src = WEBKIT_WEB_SRC(m_src.get());
-    GOwnPtr<gchar> uri;
+    GUniquePtr<gchar> uri;
 
     GST_ERROR_OBJECT(src, "Cannot show URL");
 
     GMutexLocker locker(GST_OBJECT_GET_LOCK(src));
-    uri.set(g_strdup(src->priv->uri));
+    uri.reset(g_strdup(src->priv->uri));
     locker.unlock();
 
     GST_ELEMENT_ERROR(src, RESOURCE, OPEN_READ, ("Can't show \"%s\"", uri.get()), (0));
index 9b693e3..766f6c5 100644 (file)
 
 #include "CairoUtilities.h"
 #include "GdkCairoUtilities.h"
-#include <wtf/gobject/GOwnPtr.h>
 #include "GRefPtrGtk.h"
 #include "MIMETypeRegistry.h"
 #include <cairo.h>
 #include <gtk/gtk.h>
+#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/text/Base64.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
@@ -65,12 +65,12 @@ static bool encodeImage(cairo_surface_t* surface, const String& mimeType, const
     if (!pixbuf)
         return false;
 
-    GError* error = 0;
+    GOwnPtr<GError> error;
     if (type == "jpeg" && quality && *quality >= 0.0 && *quality <= 1.0) {
         String qualityString = String::format("%d", static_cast<int>(*quality * 100.0 + 0.5));
-        gdk_pixbuf_save_to_buffer(pixbuf.get(), &buffer.outPtr(), &bufferSize, type.utf8().data(), &error, "quality", qualityString.utf8().data(), NULL);
+        gdk_pixbuf_save_to_buffer(pixbuf.get(), &buffer.outPtr(), &bufferSize, type.utf8().data(), &error.outPtr(), "quality", qualityString.utf8().data(), NULL);
     } else
-        gdk_pixbuf_save_to_buffer(pixbuf.get(), &buffer.outPtr(), &bufferSize, type.utf8().data(), &error, NULL);
+        gdk_pixbuf_save_to_buffer(pixbuf.get(), &buffer.outPtr(), &bufferSize, type.utf8().data(), &error.outPtr(), NULL);
 
     return !error;
 }
@@ -79,7 +79,7 @@ String ImageBuffer::toDataURL(const String& mimeType, const double* quality, Coo
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
-    GOwnPtr<gchar> buffer(0);
+    GOwnPtr<gchar> buffer;
     gsize bufferSize;
     if (!encodeImage(m_data.m_surface.get(), mimeType, quality, buffer, bufferSize))
         return "data:,";
index 80ab66f..2e7c44c 100644 (file)
 
 #include "BitmapImage.h"
 #include "FileSystem.h"
+#include "GUniquePtrGtk.h"
 #include "GdkCairoUtilities.h"
-#include "GOwnPtrGtk.h"
 #include "SharedBuffer.h"
+#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <cairo.h>
 #include <gtk/gtk.h>
@@ -54,7 +56,7 @@ static CString getThemeIconFileName(const char* name, int size)
                                               GTK_STOCK_MISSING_IMAGE, size,
                                               GTK_ICON_LOOKUP_NO_SVG);
     if (iconInfo) {
-        GOwnPtr<GtkIconInfo> info(iconInfo);
+        GUniquePtr<GtkIconInfo> info(iconInfo);
         return CString(gtk_icon_info_get_filename(info.get()));
     }
 
@@ -93,8 +95,8 @@ PassRefPtr<Image> Image::loadPlatformResource(const char* name)
     if (!strcmp("missingImage", name))
         fileName = getThemeIconFileName(GTK_STOCK_MISSING_IMAGE, 16);
     if (fileName.isNull()) {
-        GOwnPtr<gchar> imageName(g_strdup_printf("%s.png", name));
-        GOwnPtr<gchar> glibFileName(getPathToImageResource(imageName.get()));
+        GUniquePtr<gchar> imageName(g_strdup_printf("%s.png", name));
+        GUniquePtr<gchar> glibFileName(getPathToImageResource(imageName.get()));
         fileName = glibFileName.get();
     }
 
index 8c002c4..96cd268 100644 (file)
@@ -24,8 +24,8 @@
 #include "ContextMenu.h"
 
 #include <gtk/gtk.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 namespace WebCore {
 
@@ -87,7 +87,7 @@ unsigned ContextMenu::itemCount() const
 {
     ASSERT(m_platformDescription);
 
-    GOwnPtr<GList> children(gtk_container_get_children(GTK_CONTAINER(m_platformDescription)));
+    GUniquePtr<GList> children(gtk_container_get_children(GTK_CONTAINER(m_platformDescription)));
     return g_list_length(children.get());
 }
 
@@ -95,7 +95,7 @@ Vector<ContextMenuItem> contextMenuItemVector(const PlatformMenuDescription menu
 {
     Vector<ContextMenuItem> menuItemVector;
 
-    GOwnPtr<GList> children(gtk_container_get_children(GTK_CONTAINER(menu)));
+    GUniquePtr<GList> children(gtk_container_get_children(GTK_CONTAINER(menu)));
     int itemCount = g_list_length(children.get());
     menuItemVector.reserveCapacity(itemCount);
 
index d70b5be..b6ad67c 100644 (file)
@@ -25,9 +25,9 @@
 #include "ContextMenuItem.h"
 
 #include "ContextMenu.h"
-#include <wtf/gobject/GOwnPtr.h>
-#include <wtf/gobject/GRefPtr.h>
 #include <gtk/gtk.h>
+#include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 #define WEBKIT_CONTEXT_MENU_ACTION "webkit-context-menu"
@@ -124,7 +124,7 @@ static PlatformMenuItemDescription createPlatformMenuItemDescription(ContextMenu
     if (type == SeparatorType)
         return GTK_MENU_ITEM(gtk_separator_menu_item_new());
 
-    GOwnPtr<char> actionName(g_strdup_printf("context-menu-action-%d", action));
+    GUniquePtr<char> actionName(g_strdup_printf("context-menu-action-%d", action));
     GRefPtr<GtkAction> platformAction;
 
     if (type == CheckableActionType) {
index 1779d52..7715500 100644 (file)
@@ -22,6 +22,7 @@
 #include "markup.h"
 #include <gtk/gtk.h>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
@@ -102,7 +103,7 @@ void DataObjectGtk::setURIList(const String& uriListString)
             }
 
             GOwnPtr<GError> error;
-            GOwnPtr<gchar> filename(g_filename_from_uri(line.utf8().data(), 0, &error.outPtr()));
+            GUniquePtr<gchar> filename(g_filename_from_uri(line.utf8().data(), 0, &error.outPtr()));
             if (!error && filename)
                 m_filenames.append(String::fromUTF8(filename.get()));
         }
@@ -123,7 +124,7 @@ void DataObjectGtk::setURL(const URL& url, const String& label)
     markup.append("<a href=\"");
     markup.append(url.string());
     markup.append("\">");
-    GOwnPtr<gchar> escaped(g_markup_escape_text(actualLabel.utf8().data(), -1));
+    GUniquePtr<gchar> escaped(g_markup_escape_text(actualLabel.utf8().data(), -1));
     markup.append(String::fromUTF8(escaped.get()));
     markup.append("</a>");
     setMarkup(markup.toString());
index 27c4ab0..7fc4947 100644 (file)
@@ -30,6 +30,7 @@
 #include <glib/gstdio.h>
 #include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/gobject/GlibUtilities.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
@@ -48,7 +49,7 @@ String filenameToString(const char* filename)
 #if OS(WINDOWS)
     return String::fromUTF8(filename);
 #else
-    GOwnPtr<gchar> escapedString(g_uri_escape_string(filename, "/:", false));
+    GUniquePtr<gchar> escapedString(g_uri_escape_string(filename, "/:", false));
     return escapedString.get();
 #endif
 }
@@ -58,7 +59,7 @@ CString fileSystemRepresentation(const String& path)
 #if OS(WINDOWS)
     return path.utf8();
 #else
-    GOwnPtr<gchar> filename(g_uri_unescape_string(path.utf8().data(), 0));
+    GUniquePtr<gchar> filename(g_uri_unescape_string(path.utf8().data(), 0));
     return filename.get();
 #endif
 }
@@ -70,7 +71,7 @@ String filenameForDisplay(const String& string)
     return string;
 #else
     CString filename = fileSystemRepresentation(string);
-    GOwnPtr<gchar> display(g_filename_to_utf8(filename.data(), 0, 0, 0, 0));
+    GUniquePtr<gchar> display(g_filename_to_utf8(filename.data(), 0, 0, 0, 0));
     if (!display)
         return string;
 
@@ -190,7 +191,7 @@ String pathGetFileName(const String& pathName)
         return pathName;
 
     CString tmpFilename = fileSystemRepresentation(pathName);
-    GOwnPtr<gchar> baseName(g_path_get_basename(tmpFilename.data()));
+    GUniquePtr<gchar> baseName(g_path_get_basename(tmpFilename.data()));
     return String::fromUTF8(baseName.get());
 }
 
@@ -201,11 +202,11 @@ CString applicationDirectoryPath()
         return path;
 
     // If the above fails, check the PATH env variable.
-    GOwnPtr<char> currentExePath(g_find_program_in_path(g_get_prgname()));
+    GUniquePtr<char> currentExePath(g_find_program_in_path(g_get_prgname()));
     if (!currentExePath.get())
         return CString();
 
-    GOwnPtr<char> dirname(g_path_get_dirname(currentExePath.get()));
+    GUniquePtr<char> dirname(g_path_get_dirname(currentExePath.get()));
     return dirname.get();
 }
 
@@ -219,10 +220,10 @@ CString sharedResourcesPath()
     HMODULE hmodule = 0;
     GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char*>(sharedResourcesPath), &hmodule);
 
-    GOwnPtr<gchar> runtimeDir(g_win32_get_package_installation_directory_of_module(hmodule));
-    GOwnPtr<gchar> dataPath(g_build_filename(runtimeDir.get(), "share", "webkitgtk-" WEBKITGTK_API_VERSION_STRING, NULL));
+    GUniquePtr<gchar> runtimeDir(g_win32_get_package_installation_directory_of_module(hmodule));
+    GUniquePtr<gchar> dataPath(g_build_filename(runtimeDir.get(), "share", "webkitgtk-" WEBKITGTK_API_VERSION_STRING, NULL));
 #else
-    GOwnPtr<gchar> dataPath(g_build_filename(DATA_DIR, "webkitgtk-" WEBKITGTK_API_VERSION_STRING, NULL));
+    GUniquePtr<gchar> dataPath(g_build_filename(DATA_DIR, "webkitgtk-" WEBKITGTK_API_VERSION_STRING, NULL));
 #endif
 
     cachedPath = dataPath.get();
@@ -242,7 +243,7 @@ uint64_t getVolumeFreeSizeForPath(const char* path)
 String directoryName(const String& path)
 {
     /* No null checking needed */
-    GOwnPtr<char> dirname(g_path_get_dirname(fileSystemRepresentation(path).data()));
+    GUniquePtr<char> dirname(g_path_get_dirname(fileSystemRepresentation(path).data()));
     return String::fromUTF8(dirname.get());
 }
 
@@ -251,28 +252,26 @@ Vector<String> listDirectory(const String& path, const String& filter)
     Vector<String> entries;
 
     CString filename = fileSystemRepresentation(path);
-    GDir* dir = g_dir_open(filename.data(), 0, 0);
+    GUniquePtr<GDir> dir(g_dir_open(filename.data(), 0, nullptr));
     if (!dir)
         return entries;
 
-    GPatternSpec *pspec = g_pattern_spec_new((filter.utf8()).data());
-    while (const char* name = g_dir_read_name(dir)) {
-        if (!g_pattern_match_string(pspec, name))
+    GUniquePtr<GPatternSpec> pspec(g_pattern_spec_new((filter.utf8()).data()));
+    while (const char* name = g_dir_read_name(dir.get())) {
+        if (!g_pattern_match_string(pspec.get(), name))
             continue;
 
-        GOwnPtr<gchar> entry(g_build_filename(filename.data(), name, NULL));
+        GUniquePtr<gchar> entry(g_build_filename(filename.data(), name, NULL));
         entries.append(filenameToString(entry.get()));
     }
-    g_pattern_spec_free(pspec);
-    g_dir_close(dir);
 
     return entries;
 }
 
 String openTemporaryFile(const String& prefix, PlatformFileHandle& handle)
 {
-    GOwnPtr<gchar> filename(g_strdup_printf("%s%s", prefix.utf8().data(), createCanonicalUUIDString().utf8().data()));
-    GOwnPtr<gchar> tempPath(g_build_filename(g_get_tmp_dir(), filename.get(), NULL));
+    GUniquePtr<gchar> filename(g_strdup_printf("%s%s", prefix.utf8().data(), createCanonicalUUIDString().utf8().data()));
+    GUniquePtr<gchar> tempPath(g_build_filename(g_get_tmp_dir(), filename.get(), NULL));
     GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(tempPath.get()));
 
     handle = g_file_create_readwrite(file.get(), G_FILE_CREATE_NONE, 0, 0);
diff --git a/Source/WebCore/platform/gtk/GOwnPtrGtk.cpp b/Source/WebCore/platform/gtk/GOwnPtrGtk.cpp
deleted file mode 100644 (file)
index 9b693f4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *  Copyright (C) 2010 Igalia S.L.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "GOwnPtrGtk.h"
-
-#include <gtk/gtk.h>
-
-namespace WTF {
-
-template <> void freeOwnedGPtr<GdkEvent>(GdkEvent* ptr)
-{
-    if (ptr)
-        gdk_event_free(ptr);
-}
-
-template <> void freeOwnedGPtr<GtkIconInfo>(GtkIconInfo* info)
-{
-    if (info)
-        gtk_icon_info_free(info);
-}
-
-}
similarity index 75%
rename from Source/WebCore/platform/gtk/GOwnPtrGtk.h
rename to Source/WebCore/platform/gtk/GUniquePtrGtk.h
index bd5e837..a7c7c44 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2010 Igalia S.L.
+ *  Copyright (C) 2014 Igalia S.L.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Library General Public
  *  Boston, MA 02110-1301, USA.
  */
 
-#ifndef GOwnPtrGtk_h
-#define GOwnPtrGtk_h
+#ifndef GUniquePtrGtk_h
+#define GUniquePtrGtk_h
 
-#include <wtf/gobject/GOwnPtr.h>
+#include <gtk/gtk.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 namespace WTF {
 
-template <> void freeOwnedGPtr<GdkEvent>(GdkEvent*);
-template <> void freeOwnedGPtr<GtkIconInfo>(GtkIconInfo*);
+WTF_DEFINE_GPTR_DELETER(GdkEvent, gdk_event_free)
+WTF_DEFINE_GPTR_DELETER(GtkIconInfo, gtk_icon_info_free)
 
-}
+} // namespace WTF
 
 #endif
index af9609d..442bbee 100644 (file)
@@ -37,6 +37,7 @@
 #include <wtf/PassOwnPtr.h>
 #include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringHash.h>
 
@@ -123,7 +124,7 @@ GamepadsGtk::GamepadsGtk(unsigned length)
     m_gudevClient = adoptGRef(g_udev_client_new(subsystems));
     g_signal_connect(m_gudevClient.get(), "uevent", G_CALLBACK(onUEventCallback), this);
 
-    GOwnPtr<GList> devicesList(g_udev_client_query_by_subsystem(m_gudevClient.get(), subsystems[0]));
+    GUniquePtr<GList> devicesList(g_udev_client_query_by_subsystem(m_gudevClient.get(), subsystems[0]));
     for (GList* listItem = devicesList.get(); listItem; listItem = g_list_next(listItem)) {
         GUdevDevice* device = G_UDEV_DEVICE(listItem->data);
         String deviceFile = String::fromUTF8(g_udev_device_get_device_file(device));
index acc8a32..baa8917 100644 (file)
@@ -19,7 +19,7 @@
 #include "config.h"
 #include "GtkClickCounter.h"
 
-#include "GOwnPtrGtk.h"
+#include "GUniquePtrGtk.h"
 #include <gtk/gtk.h>
 
 namespace WebCore {
@@ -46,7 +46,7 @@ bool GtkClickCounter::shouldProcessButtonEvent(GdkEventButton* buttonEvent)
     // coming up, ignore this event as it certainly generated the double or triple
     // click. The consequence of not eating this event is two DOM button press events
     // are generated.
-    GOwnPtr<GdkEvent> nextEvent(gdk_event_peek());
+    GUniquePtr<GdkEvent> nextEvent(gdk_event_peek());
     if (!nextEvent)
         return true;
     if (nextEvent->any.type == GDK_2BUTTON_PRESS || nextEvent->any.type == GDK_3BUTTON_PRESS)
index b9980b5..0a02665 100644 (file)
 #include "config.h"
 #include "GtkInputMethodFilter.h"
 
-#include "GOwnPtrGtk.h"
+#include "GUniquePtrGtk.h"
 #include "GtkVersioning.h"
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 #include <wtf/MathExtras.h>
+#include <wtf/gobject/GOwnPtr.h>
 
 // The Windows composition key event code is 299 or VK_PROCESSKEY. We need to
 // emit this code for web compatibility reasons when key events trigger
@@ -270,7 +271,7 @@ void GtkInputMethodFilter::updatePreedit()
 
 void GtkInputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents(ResultsToSend resultsToSend)
 {
-    GOwnPtr<GdkEvent> event(gdk_event_new(GDK_KEY_PRESS));
+    GUniquePtr<GdkEvent> event(gdk_event_new(GDK_KEY_PRESS));
     event->key.time = GDK_CURRENT_TIME;
     event->key.keyval = gCompositionEventKeyCode;
     sendKeyEventWithCompositionResults(&event->key, resultsToSend, EventFaked);
index 458af4d..e52cea7 100644 (file)
@@ -27,9 +27,9 @@
 #include "config.h"
 #include "GtkPopupMenu.h"
 
-#include <wtf/gobject/GOwnPtr.h>
 #include "GtkVersioning.h"
 #include <gtk/gtk.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 namespace WebCore {
@@ -89,7 +89,7 @@ void GtkPopupMenu::popUp(const IntSize& menuSize, const IntPoint& menuPosition,
     gtk_widget_set_size_request(m_popup.get(), std::max(menuSize.width(), requisition.width), -1);
 
     if (itemCount) {
-        GOwnPtr<GList> children(gtk_container_get_children(GTK_CONTAINER(m_popup.get())));
+        GUniquePtr<GList> children(gtk_container_get_children(GTK_CONTAINER(m_popup.get())));
         int i;
         GList* child;
         for (i = 0, child = children.get(); i < itemCount; i++, child = g_list_next(child)) {
@@ -159,7 +159,7 @@ bool GtkPopupMenu::typeAheadFind(GdkEventKey* event)
     }
 
     glong charactersWritten;
-    GOwnPtr<gunichar2> utf16String(g_ucs4_to_utf16(&unicodeCharacter, 1, 0, &charactersWritten, 0));
+    GUniquePtr<gunichar2> utf16String(g_ucs4_to_utf16(&unicodeCharacter, 1, 0, &charactersWritten, 0));
     if (!utf16String) {
         resetTypeAheadFindState();
         return false;
@@ -179,7 +179,7 @@ bool GtkPopupMenu::typeAheadFind(GdkEventKey* event)
 
     // Like the Chromium port, we case fold before searching, because 
     // strncmp does not handle non-ASCII characters.
-    GOwnPtr<gchar> searchStringWithCaseFolded(g_utf8_casefold(m_currentSearchString.utf8().data(), -1));
+    GUniquePtr<gchar> searchStringWithCaseFolded(g_utf8_casefold(m_currentSearchString.utf8().data(), -1));
     size_t prefixLength = strlen(searchStringWithCaseFolded.get());
 
     GList* children = gtk_container_get_children(GTK_CONTAINER(m_popup.get()));
@@ -210,7 +210,7 @@ bool GtkPopupMenu::typeAheadFind(GdkEventKey* event)
         if (!currentChild)
             currentChild = children;
 
-        GOwnPtr<gchar> itemText(g_utf8_casefold(gtk_menu_item_get_label(GTK_MENU_ITEM(currentChild->data)), -1));
+        GUniquePtr<gchar> itemText(g_utf8_casefold(gtk_menu_item_get_label(GTK_MENU_ITEM(currentChild->data)), -1));
         if (!strncmp(searchStringWithCaseFolded.get(), itemText.get(), prefixLength)) {
             gtk_menu_shell_select_item(GTK_MENU_SHELL(m_popup.get()), GTK_WIDGET(currentChild->data));
             break;
index 37a71e5..58d3a91 100644 (file)
@@ -20,8 +20,8 @@
 #include "config.h"
 #include "Language.h"
 
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/Vector.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
@@ -40,7 +40,7 @@ static String platformLanguage()
     if (!localeDefault)
         return String("c");
 
-    GOwnPtr<gchar> normalizedDefault(g_ascii_strdown(localeDefault, -1));
+    GUniquePtr<gchar> normalizedDefault(g_ascii_strdown(localeDefault, -1));
     char* ptr = strchr(normalizedDefault.get(), '_');
 
     if (ptr)
index 9471d9d..30d7d13 100644 (file)
  */
 
 #include "config.h"
-
 #include "LocalizedStrings.h"
-#include <wtf/gobject/GOwnPtr.h>
+
 #include "IntSize.h"
 #include "NotImplemented.h"
+#include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
 #include <wtf/MathExtras.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
-#include <glib/gi18n-lib.h>
-#include <gtk/gtk.h>
-
 namespace WebCore {
 
 static const char* gtkStockLabel(const char* stockID)
@@ -544,9 +543,8 @@ String unknownFileSizeText()
 
 String imageTitle(const String& filename, const IntSize& size)
 {
-    GOwnPtr<gchar> string(g_strdup_printf(C_("Title string for images", "%s  (%dx%d pixels)"),
-                                          filename.utf8().data(),
-                                          size.width(), size.height()));
+    GUniquePtr<gchar> string(g_strdup_printf(C_("Title string for images", "%s  (%dx%d pixels)"),
+        filename.utf8().data(), size.width(), size.height()));
 
     return String::fromUTF8(string.get());
 }
@@ -668,21 +666,21 @@ String localizedMediaTimeDescription(float time)
     seconds %= 60;
 
     if (days) {
-        GOwnPtr<gchar> string(g_strdup_printf("%d days %d hours %d minutes %d seconds", days, hours, minutes, seconds));
+        GUniquePtr<gchar> string(g_strdup_printf("%d days %d hours %d minutes %d seconds", days, hours, minutes, seconds));
         return String::fromUTF8(string.get());
     }
 
     if (hours) {
-        GOwnPtr<gchar> string(g_strdup_printf("%d hours %d minutes %d seconds", hours, minutes, seconds));
+        GUniquePtr<gchar> string(g_strdup_printf("%d hours %d minutes %d seconds", hours, minutes, seconds));
         return String::fromUTF8(string.get());
     }
 
     if (minutes) {
-        GOwnPtr<gchar> string(g_strdup_printf("%d minutes %d seconds", minutes, seconds));
+        GUniquePtr<gchar> string(g_strdup_printf("%d minutes %d seconds", minutes, seconds));
         return String::fromUTF8(string.get());
     }
 
-    GOwnPtr<gchar> string(g_strdup_printf("%d seconds", seconds));
+    GUniquePtr<gchar> string(g_strdup_printf("%d seconds", seconds));
     return String::fromUTF8(string.get());
 }
 #endif  // ENABLE(VIDEO)
index fa7bc7b..5573416 100644 (file)
@@ -33,6 +33,7 @@
 #include "TextResourceDecoder.h"
 #include <gtk/gtk.h>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 namespace WebCore {
 
@@ -117,7 +118,7 @@ GtkTargetList* PasteboardHelper::targetList() const
 static String selectionDataToUTF8String(GtkSelectionData* data)
 {
     // g_strndup guards against selection data that is not null-terminated.
-    GOwnPtr<gchar> markupString(g_strndup(reinterpret_cast<const char*>(gtk_selection_data_get_data(data)), gtk_selection_data_get_length(data)));
+    GUniquePtr<gchar> markupString(g_strndup(reinterpret_cast<const char*>(gtk_selection_data_get_data(data)), gtk_selection_data_get_length(data)));
     return String::fromUTF8(markupString.get());
 }
 
@@ -127,7 +128,7 @@ void PasteboardHelper::getClipboardContents(GtkClipboard* clipboard)
     ASSERT(dataObject);
 
     if (gtk_clipboard_wait_is_text_available(clipboard)) {
-        GOwnPtr<gchar> textData(gtk_clipboard_wait_for_text(clipboard));
+        GUniquePtr<gchar> textData(gtk_clipboard_wait_for_text(clipboard));
         if (textData)
             dataObject->setText(String::fromUTF8(textData.get()));
     }
@@ -176,7 +177,7 @@ void PasteboardHelper::fillSelectionData(GtkSelectionData* selectionData, guint
         else
             result.append(url);
 
-        GOwnPtr<gchar> resultData(g_strdup(result.utf8().data()));
+        GUniquePtr<gchar> resultData(g_strdup(result.utf8().data()));
         gtk_selection_data_set(selectionData, netscapeURLAtom, 8,
             reinterpret_cast<const guchar*>(resultData.get()), strlen(resultData.get()));
 
@@ -193,12 +194,12 @@ void PasteboardHelper::fillSelectionData(GtkSelectionData* selectionData, guint
         auto types = dataObject->unknownTypes();
         auto end = types.end();
         for (auto it = types.begin(); it != end; ++it) {
-            GOwnPtr<gchar> dictItem(g_strdup_printf("{'%s', '%s'}", it->key.utf8().data(), it->value.utf8().data()));
+            GUniquePtr<gchar> dictItem(g_strdup_printf("{'%s', '%s'}", it->key.utf8().data(), it->value.utf8().data()));
             g_variant_builder_add_parsed(&builder, dictItem.get());
         }
 
         GRefPtr<GVariant> variant = g_variant_builder_end(&builder);
-        GOwnPtr<gchar> serializedVariant(g_variant_print(variant.get(), TRUE));
+        GUniquePtr<gchar> serializedVariant(g_variant_print(variant.get(), TRUE));
         gtk_selection_data_set(selectionData, unknownAtom, 1, reinterpret_cast<const guchar*>(serializedVariant.get()), strlen(serializedVariant.get()));
     }
 }
index e0fb1fd..5403cba 100644 (file)
 #include "PopupMenuGtk.h"
 
 #include "FrameView.h"
-#include "GOwnPtrGtk.h"
+#include "GUniquePtrGtk.h"
 #include "GtkUtilities.h"
 #include "HostWindow.h"
 #include <gtk/gtk.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/text/CString.h>
 
 namespace WebCore {
@@ -52,7 +51,7 @@ PopupMenuGtk::~PopupMenuGtk()
 
 GtkAction* PopupMenuGtk::createGtkActionForMenuItem(int itemIndex)
 {
-    GOwnPtr<char> actionName(g_strdup_printf("popup-menu-action-%d", itemIndex));
+    GUniquePtr<char> actionName(g_strdup_printf("popup-menu-action-%d", itemIndex));
     GtkAction* action = gtk_action_new(actionName.get(), client()->itemText(itemIndex).utf8().data(), client()->itemToolTip(itemIndex).utf8().data(), 0);
     g_object_set_data(G_OBJECT(action), "popup-menu-action-index", GINT_TO_POINTER(itemIndex));
     g_signal_connect(action, "activate", G_CALLBACK(menuItemActivated), this);
@@ -86,7 +85,7 @@ void PopupMenuGtk::show(const IntRect& rect, FrameView* view, int index)
     IntPoint menuPosition = convertWidgetPointToScreenPoint(GTK_WIDGET(view->hostWindow()->platformPageClient()), view->contentsToWindow(rect.location()));
     menuPosition.move(0, rect.height());
 
-    GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event());
+    GUniquePtr<GdkEvent> currentEvent(gtk_get_current_event());
     m_popup->popUp(rect.size(), menuPosition, size, index, currentEvent.get());
 
     // GTK can refuse to actually open the menu when mouse grabs fails.
index e47d599..77806ef 100644 (file)
@@ -23,7 +23,7 @@
 #include "CredentialBackingStore.h"
 #include "GtkVersioning.h"
 #include <glib/gi18n-lib.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebCore;
@@ -151,7 +151,7 @@ static void webkitAuthenticationWidgetInitialize(WebKitAuthenticationWidget* aut
     gtk_widget_show(icon);
 
     WebKitAuthenticationWidgetPrivate* priv = authWidget->priv;
-    GOwnPtr<char> prompt(g_strdup_printf(
+    GUniquePtr<char> prompt(g_strdup_printf(
         _("The site %s:%i requests a username and password"),
         priv->challenge.protectionSpace().host().utf8().data(),
         priv->challenge.protectionSpace().port()));
index f19d04d..7dc43e2 100644 (file)
@@ -49,8 +49,8 @@
 #endif
 
 #if USE(SOUP)
+#include "GUniquePtrSoup.h"
 #include <libsoup/soup.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
 class Frame;
 #endif
@@ -197,7 +197,7 @@ namespace WebCore {
         GRefPtr<GCancellable> m_cancellable;
         GRefPtr<GAsyncResult> m_deferredResult;
         GRefPtr<GSource> m_timeoutSource;
-        GOwnPtr<SoupBuffer> m_soupBuffer;
+        GUniquePtr<SoupBuffer> m_soupBuffer;
         unsigned long m_bodySize;
         unsigned long m_bodyDataSent;
         SoupSession* soupSession();
index 5f1e4c5..1412002 100644 (file)
@@ -35,6 +35,7 @@
 #include <libsecret/secret.h>
 #include <libsoup/soup.h>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #endif
 
@@ -77,7 +78,7 @@ static void credentialForChallengeAsyncReadyCallback(SecretService* service, GAs
     delete callbackData;
 
     GOwnPtr<GError> error;
-    GOwnPtr<GList> elements(secret_service_search_finish(service, asyncResult, &error.outPtr()));
+    GUniquePtr<GList> elements(secret_service_search_finish(service, asyncResult, &error.outPtr()));
     if (error || !elements || !elements->data) {
         callback(Credential(), data);
         return;
index 15fd7c5..8101e52 100644 (file)
@@ -22,7 +22,7 @@
 #include "CookieJarSoup.h"
 
 #include "Cookie.h"
-#include "GOwnPtrSoup.h"
+#include "GUniquePtrSoup.h"
 #include "URL.h"
 #include "NetworkingContext.h"
 #include "PlatformCookieJar.h"
@@ -88,8 +88,8 @@ void setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstPar
     if (!jar)
         return;
 
-    GOwnPtr<SoupURI> origin(soup_uri_new(url.string().utf8().data()));
-    GOwnPtr<SoupURI> firstPartyURI(soup_uri_new(firstParty.string().utf8().data()));
+    GUniquePtr<SoupURI> origin(soup_uri_new(url.string().utf8().data()));
+    GUniquePtr<SoupURI> firstPartyURI(soup_uri_new(firstParty.string().utf8().data()));
 
     // Get existing cookies for this origin.
     GSList* existingCookies = soup_cookie_jar_get_cookie_list(jar, origin.get(), TRUE);
@@ -98,7 +98,7 @@ void setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstPar
     value.split('\n', cookies);
     const size_t cookiesCount = cookies.size();
     for (size_t i = 0; i < cookiesCount; ++i) {
-        GOwnPtr<SoupCookie> cookie(soup_cookie_parse(cookies[i].utf8().data(), origin.get()));
+        GUniquePtr<SoupCookie> cookie(soup_cookie_parse(cookies[i].utf8().data(), origin.get()));
         if (!cookie)
             continue;
 
@@ -122,8 +122,8 @@ static String cookiesForSession(const NetworkStorageSession& session, const URL&
     if (!jar)
         return String();
 
-    GOwnPtr<SoupURI> uri(soup_uri_new(url.string().utf8().data()));
-    GOwnPtr<char> cookies(soup_cookie_jar_get_cookies(jar, uri.get(), forHTTPHeader));
+    GUniquePtr<SoupURI> uri(soup_uri_new(url.string().utf8().data()));
+    GUniquePtr<char> cookies(soup_cookie_jar_get_cookies(jar, uri.get(), forHTTPHeader));
     return String::fromUTF8(cookies.get());
 }
 
@@ -149,8 +149,8 @@ bool getRawCookies(const NetworkStorageSession& session, const URL& /*firstParty
     if (!jar)
         return false;
 
-    GOwnPtr<SoupURI> uri(soup_uri_new(url.string().utf8().data()));
-    GOwnPtr<GSList> cookies(soup_cookie_jar_get_cookie_list(jar, uri.get(), TRUE));
+    GUniquePtr<SoupURI> uri(soup_uri_new(url.string().utf8().data()));
+    GUniquePtr<GSList> cookies(soup_cookie_jar_get_cookie_list(jar, uri.get(), TRUE));
     if (!cookies)
         return false;
 
@@ -171,8 +171,8 @@ void deleteCookie(const NetworkStorageSession& session, const URL& url, const St
     if (!jar)
         return;
 
-    GOwnPtr<SoupURI> uri(soup_uri_new(url.string().utf8().data()));
-    GOwnPtr<GSList> cookies(soup_cookie_jar_get_cookie_list(jar, uri.get(), TRUE));
+    GUniquePtr<SoupURI> uri(soup_uri_new(url.string().utf8().data()));
+    GUniquePtr<GSList> cookies(soup_cookie_jar_get_cookie_list(jar, uri.get(), TRUE));
     if (!cookies)
         return;
 
@@ -191,7 +191,7 @@ void deleteCookie(const NetworkStorageSession& session, const URL& url, const St
 void getHostnamesWithCookies(const NetworkStorageSession& session, HashSet<String>& hostnames)
 {
     SoupCookieJar* cookieJar = cookieJarForSession(session);
-    GOwnPtr<GSList> cookies(soup_cookie_jar_all_cookies(cookieJar));
+    GUniquePtr<GSList> cookies(soup_cookie_jar_all_cookies(cookieJar));
     for (GSList* item = cookies.get(); item; item = g_slist_next(item)) {
         SoupCookie* cookie = static_cast<SoupCookie*>(item->data);
         if (cookie->domain)
@@ -204,7 +204,7 @@ void deleteCookiesForHostname(const NetworkStorageSession& session, const String
 {
     CString hostNameString = hostname.utf8();
     SoupCookieJar* cookieJar = cookieJarForSession(session);
-    GOwnPtr<GSList> cookies(soup_cookie_jar_all_cookies(cookieJar));
+    GUniquePtr<GSList> cookies(soup_cookie_jar_all_cookies(cookieJar));
     for (GSList* item = cookies.get(); item; item = g_slist_next(item)) {
         SoupCookie* cookie = static_cast<SoupCookie*>(item->data);
         if (soup_cookie_domain_matches(cookie, hostNameString.data()))
@@ -216,7 +216,7 @@ void deleteCookiesForHostname(const NetworkStorageSession& session, const String
 void deleteAllCookies(const NetworkStorageSession& session)
 {
     SoupCookieJar* cookieJar = cookieJarForSession(session);
-    GOwnPtr<GSList> cookies(soup_cookie_jar_all_cookies(cookieJar));
+    GUniquePtr<GSList> cookies(soup_cookie_jar_all_cookies(cookieJar));
     for (GSList* item = cookies.get(); item; item = g_slist_next(item)) {
         SoupCookie* cookie = static_cast<SoupCookie*>(item->data);
         soup_cookie_jar_delete_cookie(cookieJar, cookie);
index 2eab9a3..6f630b5 100644 (file)
@@ -28,7 +28,6 @@
 #include "DNS.h"
 #include "DNSResolveQueue.h"
 
-#include "GOwnPtrSoup.h"
 #include "SoupNetworkSession.h"
 #include <libsoup/soup.h>
 #include <wtf/MainThread.h>
diff --git a/Source/WebCore/platform/network/soup/GUniquePtrSoup.h b/Source/WebCore/platform/network/soup/GUniquePtrSoup.h
new file mode 100644 (file)
index 0000000..32775fb
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ *  Copyright (C) 2014 Igalia S.L
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#ifndef GUniquePtrSoup_h
+#define GUniquePtrSoup_h
+
+#include <libsoup/soup.h>
+#include <wtf/gobject/GUniquePtr.h>
+
+namespace WTF {
+
+WTF_DEFINE_GPTR_DELETER(SoupURI, soup_uri_free)
+WTF_DEFINE_GPTR_DELETER(SoupCookie, soup_cookie_free)
+WTF_DEFINE_GPTR_DELETER(SoupMessageHeaders, soup_message_headers_free)
+WTF_DEFINE_GPTR_DELETER(SoupBuffer, soup_buffer_free)
+
+} // namespace WTF
+
+#endif
index ba8657b..bb72c64 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "LocalizedStrings.h"
 #include <libsoup/soup.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 namespace WebCore {
@@ -36,7 +36,7 @@ namespace WebCore {
 static String failingURI(SoupURI* soupURI)
 {
     ASSERT(soupURI);
-    GOwnPtr<char> uri(soup_uri_to_string(soupURI, FALSE));
+    GUniquePtr<char> uri(soup_uri_to_string(soupURI, FALSE));
     return uri.get();
 }
 
index 4c70749..7a6776e 100644 (file)
@@ -56,6 +56,7 @@
 #include <unistd.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/SHA1.h>
+#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
 #include <wtf/text/Base64.h>
 #include <wtf/text/CString.h>
@@ -286,9 +287,9 @@ void ResourceHandle::ensureReadBuffer()
     size_t bufferSize;
     char* bufferFromClient = client()->getOrCreateReadBuffer(gDefaultReadBufferSize, bufferSize);
     if (bufferFromClient)
-        d->m_soupBuffer.set(soup_buffer_new(SOUP_MEMORY_TEMPORARY, bufferFromClient, bufferSize));
+        d->m_soupBuffer.reset(soup_buffer_new(SOUP_MEMORY_TEMPORARY, bufferFromClient, bufferSize));
     else
-        d->m_soupBuffer.set(soup_buffer_new(SOUP_MEMORY_TAKE, static_cast<char*>(g_malloc(gDefaultReadBufferSize)), gDefaultReadBufferSize));
+        d->m_soupBuffer.reset(soup_buffer_new(SOUP_MEMORY_TAKE, static_cast<char*>(g_malloc(gDefaultReadBufferSize)), gDefaultReadBufferSize));
 
     ASSERT(d->m_soupBuffer);
 }
@@ -547,7 +548,7 @@ static void cleanupSoupRequestOperation(ResourceHandle* handle, bool isDestroyin
     d->m_inputStream.clear();
     d->m_multipartInputStream.clear();
     d->m_cancellable.clear();
-    d->m_soupBuffer.clear();
+    d->m_soupBuffer.reset();
 
     if (d->m_soupMessage) {
         g_signal_handlers_disconnect_matched(d->m_soupMessage.get(), G_SIGNAL_MATCH_DATA,
@@ -992,7 +993,7 @@ static bool createSoupRequestAndMessageForHandle(ResourceHandle* handle, const R
 
     GOwnPtr<GError> error;
 
-    GOwnPtr<SoupURI> soupURI(request.soupURI());
+    GUniquePtr<SoupURI> soupURI(request.soupURI());
     if (!soupURI)
         return false;
 
index 4788487..2359fd6 100644 (file)
 #include "config.h"
 #include "ResourceRequest.h"
 
-#include "GOwnPtrSoup.h"
+#include "GUniquePtrSoup.h"
 #include "HTTPParsers.h"
 #include "MIMETypeRegistry.h"
 #include "SoupURIUtils.h"
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
@@ -36,7 +35,7 @@ void ResourceRequest::updateSoupMessageMembers(SoupMessage* soupMessage) const
 
     String firstPartyString = firstPartyForCookies().string();
     if (!firstPartyString.isEmpty()) {
-        GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
+        GUniquePtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
         soup_message_set_first_party(soupMessage, firstParty.get());
     }
 
@@ -71,7 +70,7 @@ void ResourceRequest::updateSoupMessage(SoupMessage* soupMessage) const
 {
     g_object_set(soupMessage, SOUP_MESSAGE_METHOD, httpMethod().utf8().data(), NULL);
 
-    GOwnPtr<SoupURI> uri(soupURI());
+    GUniquePtr<SoupURI> uri(soupURI());
     soup_message_set_uri(soupMessage, uri.get());
 
     updateSoupMessageMembers(soupMessage);
index 5416dbb..e362f7b 100644 (file)
@@ -21,7 +21,6 @@
 #include "config.h"
 #include "ResourceResponse.h"
 
-#include <wtf/gobject/GOwnPtr.h>
 #include "HTTPParsers.h"
 #include "MIMETypeRegistry.h"
 #include "SoupURIUtils.h"
index 553bad9..ea8902a 100644 (file)
@@ -19,8 +19,8 @@
 #include "config.h"
 #include "SoupURIUtils.h"
 
-#include <wtf/gobject/GOwnPtr.h>
 #include <libsoup/soup.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 namespace WebCore {
 
@@ -31,7 +31,7 @@ namespace WebCore {
 // not want to break compatibility with previous implementations
 URL soupURIToKURL(SoupURI* soupURI)
 {
-    GOwnPtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE));
+    GUniquePtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE));
     URL url(URL(), String::fromUTF8(urlString.get()));
 
     if (!soupURI->password)
index fb55738..7457906 100644 (file)
@@ -26,9 +26,9 @@ namespace WebCore {
 
 SharedBuffer::SharedBuffer(SoupBuffer* soupBuffer)
     : m_size(0)
+    , m_soupBuffer(soupBuffer)
 {
     ASSERT(soupBuffer);
-    m_soupBuffer.set(soupBuffer);
 }
 
 PassRefPtr<SharedBuffer> SharedBuffer::wrapSoupBuffer(SoupBuffer* soupBuffer)
@@ -38,7 +38,7 @@ PassRefPtr<SharedBuffer> SharedBuffer::wrapSoupBuffer(SoupBuffer* soupBuffer)
 
 void SharedBuffer::clearPlatformData()
 {
-    m_soupBuffer.clear();
+    m_soupBuffer.reset();
 }
 
 void SharedBuffer::tryReplaceContentsWithPlatformBuffer(SharedBuffer* newContents)
@@ -55,7 +55,7 @@ void SharedBuffer::maybeTransferPlatformData()
 
     // Hang on to the m_soupBuffer pointer in a local pointer as append() will re-enter maybeTransferPlatformData()
     // and we need to make sure to early return when it does.
-    GOwnPtr<SoupBuffer> soupBuffer;
+    GUniquePtr<SoupBuffer> soupBuffer;
     soupBuffer.swap(m_soupBuffer);
 
     append(soupBuffer->data, soupBuffer->length);
@@ -63,7 +63,7 @@ void SharedBuffer::maybeTransferPlatformData()
 
 bool SharedBuffer::hasPlatformData() const
 {
-    return m_soupBuffer;
+    return m_soupBuffer.get();
 }
 
 const char* SharedBuffer::platformData() const
index 926a7d9..a81f5a1 100644 (file)
 #include "config.h"
 #include "PluginPackage.h"
 
-#include "GOwnPtrGtk.h"
 #include "GRefPtrGtk.h"
 #include "MIMETypeRegistry.h"
 #include "NotImplemented.h"
 #include "npruntime_impl.h"
 #include "PluginDebug.h"
 #include <gio/gio.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 namespace WebCore {
@@ -72,7 +72,7 @@ bool PluginPackage::fetchInfo()
 
     gchar** mimeDescs = g_strsplit(types, ";", -1);
     for (int i = 0; mimeDescs[i] && mimeDescs[i][0]; i++) {
-        GOwnPtr<char> mime(g_utf8_strdown(mimeDescs[i], -1));
+        GUniquePtr<char> mime(g_utf8_strdown(mimeDescs[i], -1));
         gchar** mimeData = g_strsplit(mime.get(), ":", 3);
         if (g_strv_length(mimeData) < 3) {
             g_strfreev(mimeData);
@@ -129,22 +129,22 @@ bool PluginPackage::load()
         return true;
     }
 
-    GOwnPtr<gchar> finalPath(g_strdup(m_path.utf8().data()));
+    GUniquePtr<gchar> finalPath(g_strdup(m_path.utf8().data()));
     while (g_file_test(finalPath.get(), G_FILE_TEST_IS_SYMLINK)) {
         GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(finalPath.get()));
         GRefPtr<GFile> dir = adoptGRef(g_file_get_parent(file.get()));
-        GOwnPtr<gchar> linkPath(g_file_read_link(finalPath.get(), 0));
+        GUniquePtr<gchar> linkPath(g_file_read_link(finalPath.get(), 0));
         GRefPtr<GFile> resolvedFile = adoptGRef(g_file_resolve_relative_path(dir.get(), linkPath.get()));
-        finalPath.set(g_file_get_path(resolvedFile.get()));
+        finalPath.reset(g_file_get_path(resolvedFile.get()));
     }
 
     // No joke. If there is a netscape component in the path, go back
     // to the symlink, as flash breaks otherwise.
     // See http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/plugins/plugin_list_posix.cc
-    GOwnPtr<gchar> baseName(g_path_get_basename(finalPath.get()));
+    GUniquePtr<gchar> baseName(g_path_get_basename(finalPath.get()));
     if (!g_strcmp0(baseName.get(), "libflashplayer.so")
         && g_strstr_len(finalPath.get(), -1, "/netscape/"))
-        finalPath.set(g_strdup(m_path.utf8().data()));
+        finalPath.reset(g_strdup(m_path.utf8().data()));
 
     m_module = g_module_open(finalPath.get(), G_MODULE_BIND_LOCAL);
 
index f55e8db..5b69266 100644 (file)
@@ -1,3 +1,54 @@
+2014-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GLIB] Use GUniquePtr instead of GOwnPtr
+        https://bugs.webkit.org/show_bug.cgi?id=127431
+
+        Reviewed by Martin Robinson.
+
+        GUniquePtr is a template alias of std::unique_ptr with a custom
+        deleter that replaces GOwnPtr. GOwnPtr is still used for the cases
+        where the output pointer is needed, but it will also be replaced soon.
+
+        * WebCoreSupport/ContextMenuClientGtk.cpp:
+        (WebKit::getUnicodeMenuItemPosition):
+        * WebCoreSupport/DragClientGtk.cpp:
+        (WebKit::DragClient::startDrag):
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::setValueForUser):
+        * WebCoreSupport/EditorClientGtk.h:
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::userAgent):
+        (WebKit::FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
+        (WebKit::FrameLoaderClient::dispatchWillSendRequest):
+        (WebKit::FrameLoaderClient::assignIdentifierToInitialRequest):
+        (WebKit::FrameLoaderClient::dispatchDidReceiveResponse):
+        (WebKit::FrameLoaderClient::dispatchDidReceiveContentLength):
+        (WebKit::FrameLoaderClient::dispatchDidFinishLoading):
+        (WebKit::FrameLoaderClient::dispatchDidFailLoading):
+        (WebKit::FrameLoaderClient::dispatchDidFailLoad):
+        * WebCoreSupport/InspectorClientGtk.h:
+        * webkit/webkitfavicondatabase.cpp:
+        (webkit_favicon_database_set_path):
+        * webkit/webkitfilechooserrequest.cpp:
+        * webkit/webkitglobals.cpp:
+        (webkitInit):
+        * webkit/webkithittestresult.cpp:
+        (WebKit::kit):
+        * webkit/webkiticondatabase.cpp:
+        (webkit_icon_database_set_path):
+        * webkit/webkitspellcheckerenchant.cpp:
+        * webkit/webkitwebplugin.cpp:
+        (webkit_web_plugin_get_path):
+        * webkit/webkitwebpluginprivate.h:
+        * webkit/webkitwebsettings.cpp:
+        (webkit_web_settings_class_init):
+        (webkit_web_settings_copy):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_forward_context_menu_event):
+        (fileChooserDialogResponseCallback):
+        (webkit_web_view_drag_end):
+        * webkit/webkitwebviewprivate.h:
+
 2014-01-22  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
 
         [EFL][GTK] Get EFL and GTK compiling with ACCESSIBILITY disabled
index 9eb75de..ab5f53a 100644 (file)
@@ -74,7 +74,7 @@ static GtkWidget* inputMethodsMenuItem (WebKitWebView* webView)
 
 static int getUnicodeMenuItemPosition(GtkMenu* menu)
 {
-    GOwnPtr<GList> items(gtk_container_get_children(GTK_CONTAINER(menu)));
+    GUniquePtr<GList> items(gtk_container_get_children(GTK_CONTAINER(menu)));
     int unicodeMenuItemPosition = -1;
     GList* iter;
     int i = 0;
index 09055eb..11117b5 100644 (file)
@@ -28,8 +28,8 @@
 #include "DragController.h"
 #include "Element.h"
 #include "Frame.h"
-#include "GOwnPtrGtk.h"
 #include "GRefPtrGtk.h"
+#include "GUniquePtrGtk.h"
 #include "GtkVersioning.h"
 #include "NotImplemented.h"
 #include "Pasteboard.h"
@@ -81,7 +81,7 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin,
     WebKitWebView* webView = webkit_web_frame_get_web_view(kit(&frame));
     RefPtr<DataObjectGtk> dataObject = clipboard.pasteboard().dataObject();
     GRefPtr<GtkTargetList> targetList = adoptGRef(PasteboardHelper::defaultPasteboardHelper()->targetListForDataObject(dataObject.get()));
-    GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event());
+    GUniquePtr<GdkEvent> currentEvent(gtk_get_current_event());
 
     GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView), targetList.get(), dragOperationToGdkDragActions(clipboard.sourceOperation()), 1, currentEvent.get());
     webView->priv->dragAndDropHelper.startedDrag(context, dataObject.get());
index 8c9e762..afa6a5d 100644 (file)
@@ -487,7 +487,7 @@ void DumpRenderTreeSupportGtk::setValueForUser(JSContextRef context, JSValueRef
         return;
 
     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(value);
-    GOwnPtr<gchar> valueBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    GUniquePtr<gchar> valueBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
     JSStringGetUTF8CString(value, valueBuffer.get(), bufferSize);
     inputElement->setValueForUser(String::fromUTF8(valueBuffer.get()));
 }
index 5f51cfc..b487b6f 100644 (file)
@@ -36,7 +36,6 @@
 #include "TextCheckerClient.h"
 #include <wtf/Deque.h>
 #include <wtf/Forward.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
 
 #if ENABLE(SPELLCHECK)
index a101815..2a246a7 100644 (file)
@@ -97,6 +97,7 @@
 #include <stdio.h>
 #include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringConcatenate.h>
 
@@ -123,7 +124,7 @@ FrameLoaderClient::~FrameLoaderClient()
 String FrameLoaderClient::userAgent(const URL& url)
 {
     WebKitWebSettings* settings = webkit_web_view_get_settings(getViewFromFrame(m_frame));
-    GOwnPtr<gchar> userAgentString(webkitWebSettingsUserAgentForURI(settings, url.string().utf8().data()));
+    GUniquePtr<gchar> userAgentString(webkitWebSettingsUserAgentForURI(settings, url.string().utf8().data()));
     return String::fromUTF8(userAgentString.get());
 }
 
@@ -204,7 +205,7 @@ void FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(WebCore::Docum
     if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
         CString username;
         CString password;
-        GOwnPtr<gchar> identifierString(toString(identifier));
+        GUniquePtr<gchar> identifierString(toString(identifier));
         WebKitWebResource* webResource = webkit_web_view_get_resource(view, identifierString.get());
         if (!DumpRenderTreeSupportGtk::s_authenticationCallback || !DumpRenderTreeSupportGtk::s_authenticationCallback(username, password, webResource)) {
             challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge);
@@ -244,7 +245,7 @@ void FrameLoaderClient::dispatchWillSendRequest(WebCore::DocumentLoader* loader,
         networkResponse = adoptGRef(kitNew(redirectResponse));
 
     WebKitWebView* webView = getViewFromFrame(m_frame);
-    GOwnPtr<gchar> identifierString(toString(identifier));
+    GUniquePtr<gchar> identifierString(toString(identifier));
     WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
     GRefPtr<WebKitNetworkRequest> networkRequest(adoptGRef(kitNew(request)));
 
@@ -270,7 +271,7 @@ void FrameLoaderClient::dispatchWillSendRequest(WebCore::DocumentLoader* loader,
 
 void FrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader* loader, const ResourceRequest& request)
 {
-    GOwnPtr<gchar> identifierString(toString(identifier));
+    GUniquePtr<gchar> identifierString(toString(identifier));
 
     WebKitWebResource* webResource = WEBKIT_WEB_RESOURCE(g_object_new(WEBKIT_TYPE_WEB_RESOURCE, "uri", request.url().string().utf8().data(), 0));
 
@@ -300,7 +301,7 @@ void FrameLoaderClient::dispatchDidReceiveResponse(WebCore::DocumentLoader* load
     m_response = response;
 
     WebKitWebView* webView = getViewFromFrame(m_frame);
-    GOwnPtr<gchar> identifierString(toString(identifier));
+    GUniquePtr<gchar> identifierString(toString(identifier));
     WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
     GRefPtr<WebKitNetworkResponse> networkResponse(adoptGRef(kitNew(response)));
 
@@ -942,7 +943,7 @@ void FrameLoaderClient::setTitle(const StringWithDirection& title, const URL& ur
 void FrameLoaderClient::dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength)
 {
     WebKitWebView* webView = getViewFromFrame(m_frame);
-    GOwnPtr<gchar> identifierString(toString(identifier));
+    GUniquePtr<gchar> identifierString(toString(identifier));
     WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
 
     g_signal_emit_by_name(webResource, "content-length-received", dataLength);
@@ -955,7 +956,7 @@ void FrameLoaderClient::dispatchDidFinishLoading(WebCore::DocumentLoader* loader
     static_cast<WebKit::DocumentLoader*>(loader)->decreaseLoadCount(identifier);
 
     WebKitWebView* webView = getViewFromFrame(m_frame);
-    GOwnPtr<gchar> identifierString(toString(identifier));
+    GUniquePtr<gchar> identifierString(toString(identifier));
     WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
 
     // A NULL WebResource means the load has been interrupted, and
@@ -988,7 +989,7 @@ void FrameLoaderClient::dispatchDidFailLoading(WebCore::DocumentLoader* loader,
     static_cast<WebKit::DocumentLoader*>(loader)->decreaseLoadCount(identifier);
 
     WebKitWebView* webView = getViewFromFrame(m_frame);
-    GOwnPtr<gchar> identifierString(toString(identifier));
+    GUniquePtr<gchar> identifierString(toString(identifier));
     WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
 
     // A NULL WebResource means the load has been interrupted, and
@@ -996,9 +997,8 @@ void FrameLoaderClient::dispatchDidFailLoading(WebCore::DocumentLoader* loader,
     if (!webResource)
         return;
 
-    GOwnPtr<GError> webError(g_error_new_literal(g_quark_from_string(error.domain().utf8().data()),
-                                                 error.errorCode(),
-                                                 error.localizedDescription().utf8().data()));
+    GUniquePtr<GError> webError(g_error_new_literal(g_quark_from_string(error.domain().utf8().data()),
+        error.errorCode(), error.localizedDescription().utf8().data()));
 
     g_signal_emit_by_name(webResource, "load-failed", webError.get());
     g_signal_emit_by_name(m_frame, "resource-load-failed", webResource, webError.get());
@@ -1026,7 +1026,7 @@ void FrameLoaderClient::dispatchDidFailLoad(const ResourceError& error)
     notifyStatus(m_frame, WEBKIT_LOAD_FAILED);
 
     WebKitWebView* webView = getViewFromFrame(m_frame);
-    GOwnPtr<GError> webError(g_error_new_literal(
+    GUniquePtr<GError> webError(g_error_new_literal(
         g_quark_from_string(error.domain().utf8().data()),
         error.errorCode(),
         error.localizedDescription().utf8().data()));
@@ -1039,7 +1039,7 @@ void FrameLoaderClient::dispatchDidFailLoad(const ResourceError& error)
     m_loadingErrorPage = true;
 
     String content;
-    GOwnPtr<gchar> errorPath(g_build_filename(sharedResourcesPath().data(), "resources", "error.html", NULL));
+    GUniquePtr<gchar> errorPath(g_build_filename(sharedResourcesPath().data(), "resources", "error.html", NULL));
     GRefPtr<GFile> errorFile = adoptGRef(g_file_new_for_path(errorPath.get()));
 
     if (!errorFile)
index 7141cff..b92a8d5 100644 (file)
@@ -35,8 +35,8 @@
 #include "webkitwebinspector.h"
 #include "webkitwebview.h"
 #include <wtf/Forward.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 namespace WebCore {
 class Page;
@@ -71,7 +71,7 @@ private:
     WebKitWebView* m_inspectedWebView;
     WebCore::Page* m_frontendPage;
     InspectorFrontendClient* m_frontendClient;
-    GOwnPtr<gchar> m_inspectorFilesPath;
+    GUniquePtr<gchar> m_inspectorFilesPath;
 };
 
 class InspectorFrontendClient : public WebCore::InspectorFrontendClientLocal {
index 0e2ce6c..1d9609e 100644 (file)
@@ -35,8 +35,8 @@
 #include "webkitwebframe.h"
 #include <glib/gi18n-lib.h>
 #include <wtf/MainThread.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 /**
@@ -188,7 +188,7 @@ typedef Vector<OwnPtr<PendingIconRequest> > PendingIconRequestVector;
 typedef HashMap<String, PendingIconRequestVector*> PendingIconRequestMap;
 
 struct _WebKitFaviconDatabasePrivate {
-    GOwnPtr<gchar> path;
+    GUniquePtr<gchar> path;
     IconDatabaseClientGtk iconDatabaseClient;
     PendingIconRequestMap pendingIconRequests;
     bool importFinished;
@@ -345,7 +345,7 @@ void webkit_favicon_database_set_path(WebKitFaviconDatabase* database, const gch
 
     database->priv->importFinished = false;
     if (!path || !path[0]) {
-        database->priv->path.set(0);
+        database->priv->path.reset();
         iconDatabase().setEnabled(false);
         return;
     }
@@ -358,7 +358,7 @@ void webkit_favicon_database_set_path(WebKitFaviconDatabase* database, const gch
         return;
     }
 
-    database->priv->path.set(g_strdup(path));
+    database->priv->path.reset(g_strdup(path));
 }
 
 /**
index c1373ed..1a22851 100644 (file)
@@ -25,7 +25,6 @@
 #include "webkitfilechooserrequestprivate.h"
 #include "webkitglobalsprivate.h"
 #include <glib/gi18n-lib.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
 #include <wtf/text/CString.h>
 
index f61c8e2..aff2760 100644 (file)
@@ -53,8 +53,8 @@
 #include <runtime/InitializeThreading.h>
 #include <stdlib.h>
 #include <wtf/MainThread.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 static WebKitCacheModel cacheModel = WEBKIT_CACHE_MODEL_DEFAULT;
 
@@ -550,15 +550,15 @@ void webkitInit()
     // that may only be done by the main thread.
     atomicCanonicalTextEncodingName("UTF-8");
 
-    GOwnPtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
+    GUniquePtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
     webkit_set_web_database_directory_path(databaseDirectory.get());
 
-    GOwnPtr<gchar> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "webkitgtk", "applications", NULL));
+    GUniquePtr<gchar> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "webkitgtk", "applications", NULL));
     WebCore::cacheStorage().setCacheDirectory(cacheDirectory.get());
 
     PageGroup::setShouldTrackVisitedLinks(true);
 
-    GOwnPtr<gchar> iconDatabasePath(g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL));
+    GUniquePtr<gchar> iconDatabasePath(g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL));
     webkit_icon_database_set_path(webkit_get_icon_database(), iconDatabasePath.get());
 
     WebCore::ResourceHandle::setIgnoreSSLErrors(true);
index cb41edd..09635cd 100644 (file)
@@ -30,8 +30,8 @@
 #include "webkitglobals.h"
 #include "webkitglobalsprivate.h"
 #include <glib/gi18n-lib.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 /**
@@ -283,26 +283,26 @@ namespace WebKit {
 WebKitHitTestResult* kit(const WebCore::HitTestResult& result)
 {
     guint context = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
-    GOwnPtr<char> linkURI(0);
-    GOwnPtr<char> imageURI(0);
-    GOwnPtr<char> mediaURI(0);
+    GUniquePtr<char> linkURI;
+    GUniquePtr<char> imageURI;
+    GUniquePtr<char> mediaURI;
     WebKitDOMNode* node = 0;
     WebCore::Frame* innerNodeFrame;
     WebCore::IntPoint point;
 
     if (!result.absoluteLinkURL().isEmpty()) {
         context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;
-        linkURI.set(g_strdup(result.absoluteLinkURL().string().utf8().data()));
+        linkURI.reset(g_strdup(result.absoluteLinkURL().string().utf8().data()));
     }
 
     if (!result.absoluteImageURL().isEmpty()) {
         context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
-        imageURI.set(g_strdup(result.absoluteImageURL().string().utf8().data()));
+        imageURI.reset(g_strdup(result.absoluteImageURL().string().utf8().data()));
     }
 
     if (!result.absoluteMediaURL().isEmpty()) {
         context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;
-        mediaURI.set(g_strdup(result.absoluteMediaURL().string().utf8().data()));
+        mediaURI.reset(g_strdup(result.absoluteMediaURL().string().utf8().data()));
     }
 
     if (result.isSelected())
index 70b5114..412d21e 100644 (file)
@@ -29,7 +29,7 @@
 #include "webkitsecurityoriginprivate.h"
 #include "webkitwebframe.h"
 #include <glib/gi18n-lib.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 /**
@@ -80,7 +80,7 @@ static guint webkit_icon_database_signals[LAST_SIGNAL] = { 0, };
 G_DEFINE_TYPE(WebKitIconDatabase, webkit_icon_database, G_TYPE_OBJECT);
 
 struct _WebKitIconDatabasePrivate {
-    GOwnPtr<gchar> path;
+    GUniquePtr<gchar> path;
 };
 
 static void webkit_icon_database_finalize(GObject* object)
@@ -234,12 +234,12 @@ void webkit_icon_database_set_path(WebKitIconDatabase* database, const gchar* pa
         WebCore::iconDatabase().close();
 
     if (!(path && path[0])) {
-        database->priv->path.set(0);
+        database->priv->path.reset();
         WebCore::iconDatabase().setEnabled(false);
         return;
     }
 
-    database->priv->path.set(g_strdup(path));
+    database->priv->path.reset(g_strdup(path));
 
     WebCore::iconDatabase().setEnabled(true);
     WebCore::iconDatabase().open(WebCore::filenameToString(database->priv->path.get()), WebCore::IconDatabase::defaultDatabaseFilename());
index e461408..0c4d707 100644 (file)
@@ -25,7 +25,6 @@
 #include "webkitspellchecker.h"
 #include <gtk/gtk.h>
 #include <wtf/OwnPtr.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebCore;
index 73b42ee..cec614f 100644 (file)
@@ -24,6 +24,7 @@
 #include "webkitglobalsprivate.h"
 #include "webkitwebpluginprivate.h"
 #include <glib/gi18n-lib.h>
+#include <wtf/gobject/GOwnPtr.h>
 
 /**
  * SECTION:webkitwebplugin
@@ -192,14 +193,14 @@ const char* webkit_web_plugin_get_path(WebKitWebPlugin* plugin)
         return priv->path.get();
 
     GOwnPtr<GError> error;
-    priv->path.set(g_filename_from_utf8(priv->corePlugin->path().utf8().data(), -1, 0, 0, &error.outPtr()));
+    priv->path.reset(g_filename_from_utf8(priv->corePlugin->path().utf8().data(), -1, 0, 0, &error.outPtr()));
 
     if (!error)
         return priv->path.get();
 
     // In the unlikely case the convertion fails, report the error and make sure we free
     // any partial convertion that ended up in the variable.
-    priv->path.clear();
+    priv->path.reset();
 
     g_warning("Failed to convert '%s' to system filename encoding: %s", priv->corePlugin->path().utf8().data(), error->message);
 
index 507f72e..ed21779 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "webkitwebplugin.h"
 #include <glib-object.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 namespace WebCore {
@@ -39,7 +39,7 @@ struct _WebKitWebPluginPrivate {
     RefPtr<WebCore::PluginPackage> corePlugin;
     CString name;
     CString description;
-    GOwnPtr<char> path;
+    GUniquePtr<char> path;
     GSList* mimeTypes;
 };
 
index 09accf8..3aceec0 100644 (file)
@@ -35,7 +35,7 @@
 #include "webkitglobalsprivate.h"
 #include "webkitversion.h"
 #include "webkitwebsettingsprivate.h"
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringConcatenate.h>
 #include <glib/gi18n-lib.h>
@@ -484,7 +484,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
     *
     * Since: 1.5.2
     */
-    GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
+    GUniquePtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
     g_object_class_install_property(gobject_class,
                                     PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH,
                                     g_param_spec_string("html5-local-storage-database-path",
@@ -1480,9 +1480,9 @@ WebKitWebSettings* webkit_web_settings_new()
 WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* original)
 {
     unsigned numberOfProperties = 0;
-    GOwnPtr<GParamSpec*> properties(g_object_class_list_properties(
+    GUniquePtr<GParamSpec*> properties(g_object_class_list_properties(
         G_OBJECT_CLASS(WEBKIT_WEB_SETTINGS_GET_CLASS(original)), &numberOfProperties));
-    GOwnPtr<GParameter> parameters(g_new0(GParameter, numberOfProperties));
+    GUniquePtr<GParameter> parameters(g_new0(GParameter, numberOfProperties));
 
     for (size_t i = 0; i < numberOfProperties; i++) {
         GParamSpec* property = properties.get()[i];
index 32965e0..bbfc299 100644 (file)
@@ -62,7 +62,7 @@
 #include "FrameLoaderClientGtk.h"
 #include "FrameLoaderTypes.h"
 #include "FrameView.h"
-#include "GOwnPtrGtk.h"
+#include "GUniquePtrGtk.h"
 #include "GeolocationClientGtk.h"
 #include "GeolocationController.h"
 #include "GraphicsContext.h"
@@ -419,7 +419,7 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie
     g_signal_emit(webView, webkit_web_view_signals[POPULATE_POPUP], 0, defaultMenu);
 
     // If the context menu is now empty, don't show it.
-    GOwnPtr<GList> items(gtk_container_get_children(GTK_CONTAINER(defaultMenu)));
+    GUniquePtr<GList> items(gtk_container_get_children(GTK_CONTAINER(defaultMenu)));
     if (!items)
         return FALSE;
 
@@ -1304,7 +1304,7 @@ static void fileChooserDialogResponseCallback(GtkDialog* dialog, gint responseID
 {
     GRefPtr<WebKitFileChooserRequest> adoptedRequest = adoptGRef(request);
     if (responseID == GTK_RESPONSE_ACCEPT) {
-        GOwnPtr<GSList> filesList(gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)));
+        GUniquePtr<GSList> filesList(gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)));
         GRefPtr<GPtrArray> filesArray = adoptGRef(g_ptr_array_new());
         for (GSList* file = filesList.get(); file; file = g_slist_next(file))
             g_ptr_array_add(filesArray.get(), file->data);
@@ -1514,7 +1514,7 @@ static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context)
     Frame& frame = core(webView)->focusController().focusedOrMainFrame();
 
     // Synthesize a button release event to send with the drag end action.
-    GOwnPtr<GdkEvent> event(gdk_event_new(GDK_BUTTON_RELEASE));
+    GUniquePtr<GdkEvent> event(gdk_event_new(GDK_BUTTON_RELEASE));
     int x, y, xRoot, yRoot;
     GdkModifierType modifiers = static_cast<GdkModifierType>(0);
 #ifdef GTK_API_VERSION_2
index aeefbd0..b5e6978 100644 (file)
@@ -33,7 +33,6 @@
 #include "WebViewInputMethodFilter.h"
 #include "WidgetBackingStore.h"
 #include <webkit/webkitwebview.h>
-#include <wtf/gobject/GOwnPtr.h>
 
 #if ENABLE(MEDIA_STREAM)
 #include "UserMediaClientGtk.h"
index 4c75809..7cd0885 100644 (file)
@@ -1,3 +1,84 @@
+2014-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GLIB] Use GUniquePtr instead of GOwnPtr
+        https://bugs.webkit.org/show_bug.cgi?id=127431
+
+        Reviewed by Martin Robinson.
+
+        GUniquePtr is a template alias of std::unique_ptr with a custom
+        deleter that replaces GOwnPtr. GOwnPtr is still used for the cases
+        where the output pointer is needed, but it will also be replaced soon.
+
+        * Shared/Downloads/soup/DownloadSoup.cpp:
+        (WebKit::DownloadClient::didReceiveResponse):
+        * Shared/NativeWebKeyboardEvent.h:
+        * Shared/NativeWebMouseEvent.h:
+        * Shared/NativeWebWheelEvent.h:
+        * Shared/gtk/ArgumentCodersGtk.cpp:
+        (IPC::encodeGKeyFile):
+        (IPC::decodeGKeyFile):
+        (IPC::encode):
+        (IPC::decode):
+        * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
+        (webkitContextMenuItemSetSubMenuFromGtkMenu):
+        * UIProcess/API/gtk/WebKitDownload.cpp:
+        (webkitDownloadDecideDestination):
+        (webkitDownloadNotifyProgress):
+        (webkitDownloadFailed):
+        * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
+        (webkit_file_chooser_request_select_files):
+        * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
+        (didReceiveWebViewMessageFromInjectedBundle):
+        (getInjectedBundleInitializationUserData):
+        * UIProcess/API/gtk/WebKitLoaderClient.cpp:
+        (didFailProvisionalLoadWithErrorForFrame):
+        (didFailLoadWithErrorForFrame):
+        * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+        (drawPagesForPrintingCompleted):
+        * UIProcess/API/gtk/WebKitURIRequest.cpp:
+        (webkit_uri_request_get_http_headers):
+        * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
+        (webkit_uri_scheme_request_get_scheme):
+        (webkit_uri_scheme_request_get_path):
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        (injectedBundleFilename):
+        (webkit_web_context_set_favicon_database_directory):
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkitWebViewLoadFail):
+        (webkitWebViewCreateJavaScriptDialog):
+        (fileChooserDialogResponseCallback):
+        (webkitWebViewLoadChanged):
+        (webkitWebViewLoadFailedWithTLSErrors):
+        (webkitWebViewPopulateContextMenu):
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseButtonPressEvent):
+        (webkitWebViewBaseStartDrag):
+        * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
+        (WebKit::WebInspectorServer::platformResourceForPath):
+        * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
+        (WebKit::connectionCallback):
+        * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
+        (WebKit::ProcessLauncher::launchProcess):
+        * UIProcess/gtk/WebContextGtk.cpp:
+        (WebKit::WebContext::platformDefaultApplicationCacheDirectory):
+        (WebKit::WebContext::platformDefaultDatabaseDirectory):
+        (WebKit::WebContext::platformDefaultIconDatabasePath):
+        (WebKit::WebContext::platformDefaultLocalStorageDirectory):
+        (WebKit::WebContext::platformDefaultDiskCacheDirectory):
+        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
+        (WebKit::contextMenuItemVisibilityChanged):
+        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
+        (WebKit::WebInspectorProxy::platformInspectedURLChanged):
+        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
+        (WebKit::WebPopupMenuProxyGtk::createGtkActionForMenuItem):
+        * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
+        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+        (WebKit::WebPage::platformInitialize):
+        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+        * WebProcess/gtk/WebProcessMainGtk.cpp:
+        * WebProcess/soup/WebSoupRequestManager.cpp:
+        (WebKit::WebSoupRequestManager::send):
+
 2014-01-22  Simon Fraser  <simon.fraser@apple.com>
 
         Surround fixedVisibleContentRect code with USE(TILED_BACKING_STORE)
index 28b1dcd..86cdce3 100644 (file)
@@ -34,6 +34,7 @@
 #include <gio/gio.h>
 #include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 #if PLATFORM(GTK)
@@ -94,7 +95,7 @@ public:
         m_destinationURI = m_download->decideDestinationWithSuggestedFilename(suggestedFilename, overwrite);
         if (m_destinationURI.isEmpty()) {
 #if PLATFORM(GTK)
-            GOwnPtr<char> buffer(g_strdup_printf(_("Cannot determine destination URI for download with suggested filename %s"), suggestedFilename.utf8().data()));
+            GUniquePtr<char> buffer(g_strdup_printf(_("Cannot determine destination URI for download with suggested filename %s"), suggestedFilename.utf8().data()));
             String errorMessage = String::fromUTF8(buffer.get());
 #else
             String errorMessage = makeString("Cannot determine destination URI for download with suggested filename ", suggestedFilename);
index c17b342..dfc83e3 100644 (file)
@@ -34,8 +34,8 @@
 #include <wtf/RetainPtr.h>
 OBJC_CLASS NSView;
 #elif PLATFORM(GTK)
-#include <GOwnPtrGtk.h>
 #include <WebCore/CompositionResults.h>
+#include <WebCore/GUniquePtrGtk.h>
 #include <WebCore/GtkInputMethodFilter.h>
 typedef union _GdkEvent GdkEvent;
 #elif PLATFORM(EFL)
@@ -79,7 +79,7 @@ private:
 #if USE(APPKIT)
     RetainPtr<NSEvent> m_nativeEvent;
 #elif PLATFORM(GTK)
-    GOwnPtr<GdkEvent> m_nativeEvent;
+    GUniquePtr<GdkEvent> m_nativeEvent;
     WebCore::CompositionResults m_compositionResults;
     bool m_fakeEventForComposition;
 #elif PLATFORM(EFL)
index e1d4d2a..2b77ffe 100644 (file)
@@ -32,7 +32,7 @@
 #include <wtf/RetainPtr.h>
 OBJC_CLASS NSView;
 #elif PLATFORM(GTK)
-#include <GOwnPtrGtk.h>
+#include <WebCore/GUniquePtrGtk.h>
 typedef union _GdkEvent GdkEvent;
 #elif PLATFORM(EFL)
 #include <Evas.h>
@@ -68,7 +68,7 @@ private:
 #if USE(APPKIT)
     RetainPtr<NSEvent> m_nativeEvent;
 #elif PLATFORM(GTK)
-    GOwnPtr<GdkEvent> m_nativeEvent;
+    GUniquePtr<GdkEvent> m_nativeEvent;
 #elif PLATFORM(EFL)
     const void* m_nativeEvent;
 #endif
index 19debaa..aed301c 100644 (file)
@@ -32,7 +32,7 @@
 #include <wtf/RetainPtr.h>
 OBJC_CLASS NSView;
 #elif PLATFORM(GTK)
-#include <GOwnPtrGtk.h>
+#include <WebCore/GUniquePtrGtk.h>
 typedef union _GdkEvent GdkEvent;
 #elif PLATFORM(EFL)
 #include <Evas.h>
@@ -66,7 +66,7 @@ private:
 #if USE(APPKIT)
     RetainPtr<NSEvent> m_nativeEvent;
 #elif PLATFORM(GTK)
-    GOwnPtr<GdkEvent> m_nativeEvent;
+    GUniquePtr<GdkEvent> m_nativeEvent;
 #elif PLATFORM(EFL)
     const Evas_Event_Mouse_Wheel* m_nativeEvent;
 #endif
index 112e798..42c3ac1 100644 (file)
@@ -34,7 +34,7 @@
 #include <WebCore/GraphicsContext.h>
 #include <WebCore/GtkVersioning.h>
 #include <WebCore/PlatformContextCairo.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 using namespace WebCore;
 using namespace WebKit;
@@ -237,11 +237,11 @@ bool ArgumentCoder<DragData>::decode(ArgumentDecoder& decoder, DragData& dragDat
 static void encodeGKeyFile(ArgumentEncoder& encoder, GKeyFile* keyFile)
 {
     gsize dataSize;
-    GOwnPtr<char> data(g_key_file_to_data(keyFile, &dataSize, 0));
+    GUniquePtr<char> data(g_key_file_to_data(keyFile, &dataSize, 0));
     encoder << DataReference(reinterpret_cast<uint8_t*>(data.get()), dataSize);
 }
 
-static bool decodeGKeyFile(ArgumentDecoder& decoder, GOwnPtr<GKeyFile>& keyFile)
+static bool decodeGKeyFile(ArgumentDecoder& decoder, GUniquePtr<GKeyFile>& keyFile)
 {
     DataReference dataReference;
     if (!decoder.decode(dataReference))
@@ -250,9 +250,9 @@ static bool decodeGKeyFile(ArgumentDecoder& decoder, GOwnPtr<GKeyFile>& keyFile)
     if (!dataReference.size())
         return true;
 
-    keyFile.set(g_key_file_new());
+    keyFile.reset(g_key_file_new());
     if (!g_key_file_load_from_data(keyFile.get(), reinterpret_cast<const gchar*>(dataReference.data()), dataReference.size(), G_KEY_FILE_NONE, 0)) {
-        keyFile.clear();
+        keyFile.reset();
         return false;
     }
 
@@ -261,14 +261,14 @@ static bool decodeGKeyFile(ArgumentDecoder& decoder, GOwnPtr<GKeyFile>& keyFile)
 
 void encode(ArgumentEncoder& encoder, GtkPrintSettings* printSettings)
 {
-    GOwnPtr<GKeyFile> keyFile(g_key_file_new());
+    GUniquePtr<GKeyFile> keyFile(g_key_file_new());
     gtk_print_settings_to_key_file(printSettings, keyFile.get(), "Print Settings");
     encodeGKeyFile(encoder, keyFile.get());
 }
 
 bool decode(ArgumentDecoder& decoder, GRefPtr<GtkPrintSettings>& printSettings)
 {
-    GOwnPtr<GKeyFile> keyFile;
+    GUniquePtr<GKeyFile> keyFile;
     if (!decodeGKeyFile(decoder, keyFile))
         return false;
 
@@ -284,14 +284,14 @@ bool decode(ArgumentDecoder& decoder, GRefPtr<GtkPrintSettings>& printSettings)
 
 void encode(ArgumentEncoder& encoder, GtkPageSetup* pageSetup)
 {
-    GOwnPtr<GKeyFile> keyFile(g_key_file_new());
+    GUniquePtr<GKeyFile> keyFile(g_key_file_new());
     gtk_page_setup_to_key_file(pageSetup, keyFile.get(), "Page Setup");
     encodeGKeyFile(encoder, keyFile.get());
 }
 
 bool decode(ArgumentDecoder& decoder, GRefPtr<GtkPageSetup>& pageSetup)
 {
-    GOwnPtr<GKeyFile> keyFile;
+    GUniquePtr<GKeyFile> keyFile;
     if (!decodeGKeyFile(decoder, keyFile))
         return false;
 
index e752b6a..c5e4553 100644 (file)
@@ -31,8 +31,8 @@
 #include <gtk/gtk.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 using namespace WebKit;
 using namespace WebCore;
@@ -123,7 +123,7 @@ void webkitContextMenuItemSetSubMenuFromGtkMenu(WebKitContextMenuItem* item, Gtk
     if (!subMenu)
         return;
 
-    GOwnPtr<GList> children(gtk_container_get_children(GTK_CONTAINER(subMenu)));
+    GUniquePtr<GList> children(gtk_container_get_children(GTK_CONTAINER(subMenu)));
     if (!g_list_length(children.get()))
         return;
 
index ff6d2c4..e95e4c0 100644 (file)
@@ -28,8 +28,8 @@
 #include <WebCore/ErrorsGtk.h>
 #include <WebCore/ResourceResponse.h>
 #include <glib/gi18n-lib.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 using namespace WebKit;
 using namespace WebCore;
@@ -80,7 +80,7 @@ struct _WebKitDownloadPrivate {
     CString destinationURI;
     guint64 currentSize;
     bool isCancelled;
-    GOwnPtr<GTimer> timer;
+    GUniquePtr<GTimer> timer;
     gdouble lastProgress;
     gdouble lastElapsed;
 };
@@ -113,14 +113,14 @@ static gboolean webkitDownloadDecideDestination(WebKitDownload* download, const
     if (!download->priv->destinationURI.isNull())
         return FALSE;
 
-    GOwnPtr<char> filename(g_strdelimit(g_strdup(suggestedFilename), G_DIR_SEPARATOR_S, '_'));
+    GUniquePtr<char> filename(g_strdelimit(g_strdup(suggestedFilename), G_DIR_SEPARATOR_S, '_'));
     const gchar *downloadsDir = g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD);
     if (!downloadsDir) {
         // If we don't have XDG user dirs info, set just to HOME.
         downloadsDir = g_get_home_dir();
     }
-    GOwnPtr<char> destination(g_build_filename(downloadsDir, filename.get(), NULL));
-    GOwnPtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
+    GUniquePtr<char> destination(g_build_filename(downloadsDir, filename.get(), NULL));
+    GUniquePtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
     download->priv->destinationURI = destinationURI.get();
     g_object_notify(G_OBJECT(download), "destination");
     return TRUE;
@@ -313,7 +313,7 @@ void webkitDownloadNotifyProgress(WebKitDownload* download, guint64 bytesReceive
         return;
 
     if (!download->priv->timer)
-        download->priv->timer.set(g_timer_new());
+        download->priv->timer.reset(g_timer_new());
 
     priv->currentSize += bytesReceived;
     g_signal_emit(download, signals[RECEIVED_DATA], 0, bytesReceived);
@@ -339,9 +339,8 @@ void webkitDownloadNotifyProgress(WebKitDownload* download, guint64 bytesReceive
 
 void webkitDownloadFailed(WebKitDownload* download, const ResourceError& resourceError)
 {
-    GOwnPtr<GError> webError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
-                                                 resourceError.errorCode(),
-                                                 resourceError.localizedDescription().utf8().data()));
+    GUniquePtr<GError> webError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
+        resourceError.errorCode(), resourceError.localizedDescription().utf8().data()));
     if (download->priv->timer)
         g_timer_stop(download->priv->timer.get());
 
index 7e3c26b..0855dee 100644 (file)
@@ -27,8 +27,8 @@
 #include "WebOpenPanelResultListenerProxy.h"
 #include <WebCore/FileSystem.h>
 #include <glib/gi18n-lib.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebKit;
@@ -306,7 +306,7 @@ void webkit_file_chooser_request_select_files(WebKitFileChooserRequest* request,
         // Make sure the file path is presented as an URI (escaped
         // string, with the 'file://' prefix) to WebCore otherwise the
         // FileChooser won't actually choose it.
-        GOwnPtr<char> uri(g_file_get_uri(filename.get()));
+        GUniquePtr<char> uri(g_file_get_uri(filename.get()));
         choosenFiles.append(API::URL::create(String::fromUTF8(uri.get())));
 
         // Do not use the URI here because this won't reach WebCore.
index f271222..1b77b6e 100644 (file)
@@ -26,7 +26,7 @@
 #include "WebKitWebContextPrivate.h"
 #include "WebKitWebResourcePrivate.h"
 #include "WebKitWebViewPrivate.h"
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 using namespace WebKit;
 using namespace WebCore;
@@ -86,7 +86,7 @@ static void didReceiveWebViewMessageFromInjectedBundle(WebKitWebView* webView, c
 
         API::Error* webError = static_cast<API::Error*>(message.get(String::fromUTF8("Error")));
         const ResourceError& platformError = webError->platformError();
-        GOwnPtr<GError> resourceError(g_error_new_literal(g_quark_from_string(platformError.domain().utf8().data()),
+        GUniquePtr<GError> resourceError(g_error_new_literal(g_quark_from_string(platformError.domain().utf8().data()),
             platformError.errorCode(), platformError.localizedDescription().utf8().data()));
 
         webkitWebResourceFailed(resource.get(), resourceError.get());
@@ -121,7 +121,7 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag
 static WKTypeRef getInjectedBundleInitializationUserData(WKContextRef, const void* clientInfo)
 {
     GRefPtr<GVariant> data = webkitWebContextInitializeWebExtensions(WEBKIT_WEB_CONTEXT(clientInfo));
-    GOwnPtr<gchar> dataString(g_variant_print(data.get(), TRUE));
+    GUniquePtr<gchar> dataString(g_variant_print(data.get(), TRUE));
     return static_cast<WKTypeRef>(WKStringCreateWithUTF8CString(dataString.get()));
 }
 
index 6e4d2f9..4b2e59c 100644 (file)
@@ -25,7 +25,7 @@
 #include "WebKitURIResponsePrivate.h"
 #include "WebKitWebViewBasePrivate.h"
 #include "WebKitWebViewPrivate.h"
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebKit;
@@ -53,9 +53,8 @@ static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef f
         return;
 
     const ResourceError& resourceError = toImpl(error)->platformError();
-    GOwnPtr<GError> webError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
-                                                 resourceError.errorCode(),
-                                                 resourceError.localizedDescription().utf8().data()));
+    GUniquePtr<GError> webError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
+        resourceError.errorCode(), resourceError.localizedDescription().utf8().data()));
     if (resourceError.tlsErrors()) {
         webkitWebViewLoadFailedWithTLSErrors(WEBKIT_WEB_VIEW(clientInfo), resourceError.failingURL().utf8().data(), webError.get(),
             static_cast<GTlsCertificateFlags>(resourceError.tlsErrors()), resourceError.certificate());
@@ -85,9 +84,8 @@ static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErr
         return;
 
     const ResourceError& resourceError = toImpl(error)->platformError();
-    GOwnPtr<GError> webError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
-                                                 resourceError.errorCode(),
-                                                 resourceError.localizedDescription().utf8().data()));
+    GUniquePtr<GError> webError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
+        resourceError.errorCode(), resourceError.localizedDescription().utf8().data()));
     webkitWebViewLoadFailed(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_LOAD_COMMITTED,
                             resourceError.failingURL().utf8().data(), webError.get());
 }
index 35513c2..ee97248 100644 (file)
@@ -27,8 +27,8 @@
 #include <WebCore/GtkUtilities.h>
 #include <WebCore/NotImplemented.h>
 #include <glib/gi18n-lib.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 #ifdef HAVE_GTK_UNIX_PRINTING
@@ -264,9 +264,8 @@ static void drawPagesForPrintingCompleted(WKErrorRef wkPrintError, WKErrorRef, v
 
     const WebCore::ResourceError& resourceError = wkPrintError ? toImpl(wkPrintError)->platformError() : WebCore::ResourceError();
     if (!resourceError.isNull()) {
-        GOwnPtr<GError> printError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
-                                                     resourceError.errorCode(),
-                                                     resourceError.localizedDescription().utf8().data()));
+        GUniquePtr<GError> printError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
+            resourceError.errorCode(), resourceError.localizedDescription().utf8().data()));
         g_signal_emit(printOperation.get(), signals[FAILED], 0, printError.get());
     }
     g_signal_emit(printOperation.get(), signals[FINISHED], 0, NULL);
index 384bd37..2c59cd8 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "WebKitPrivate.h"
 #include "WebKitURIRequestPrivate.h"
-#include <WebCore/GOwnPtrSoup.h>
+#include <WebCore/GUniquePtrSoup.h>
 #include <glib/gi18n-lib.h>
 #include <wtf/text/CString.h>
 
@@ -48,7 +48,7 @@ using namespace WebCore;
 struct _WebKitURIRequestPrivate {
     WebCore::ResourceRequest resourceRequest;
     CString uri;
-    GOwnPtr<SoupMessageHeaders> httpHeaders;
+    GUniquePtr<SoupMessageHeaders> httpHeaders;
 };
 
 WEBKIT_DEFINE_TYPE(WebKitURIRequest, webkit_uri_request, G_TYPE_OBJECT)
@@ -166,7 +166,7 @@ SoupMessageHeaders* webkit_uri_request_get_http_headers(WebKitURIRequest* reques
     if (!request->priv->resourceRequest.url().protocolIsInHTTPFamily())
         return 0;
 
-    request->priv->httpHeaders.set(soup_message_headers_new(SOUP_MESSAGE_HEADERS_REQUEST));
+    request->priv->httpHeaders.reset(soup_message_headers_new(SOUP_MESSAGE_HEADERS_REQUEST));
     request->priv->resourceRequest.updateSoupMessageHeaders(request->priv->httpHeaders.get());
     return request->priv->httpHeaders.get();
 }
index d0136cd..e1e4221 100644 (file)
 #include "WebKitWebView.h"
 #include "WebPageProxy.h"
 #include "WebSoupRequestManagerProxy.h"
-#include <WebCore/GOwnPtrSoup.h>
+#include <WebCore/GUniquePtrSoup.h>
 #include <WebCore/ResourceError.h>
 #include <libsoup/soup.h>
+#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
 #include <wtf/text/CString.h>
 
@@ -58,7 +59,7 @@ struct _WebKitURISchemeRequestPrivate {
     RefPtr<WebPageProxy> initiatingPage;
     uint64_t requestID;
     CString uri;
-    GOwnPtr<SoupURI> soupURI;
+    GUniquePtr<SoupURI> soupURI;
 
     GRefPtr<GInputStream> stream;
     uint64_t streamLength;
@@ -109,7 +110,7 @@ const char* webkit_uri_scheme_request_get_scheme(WebKitURISchemeRequest* request
     g_return_val_if_fail(WEBKIT_IS_URI_SCHEME_REQUEST(request), 0);
 
     if (!request->priv->soupURI)
-        request->priv->soupURI.set(soup_uri_new(request->priv->uri.data()));
+        request->priv->soupURI.reset(soup_uri_new(request->priv->uri.data()));
     return request->priv->soupURI->scheme;
 }
 
@@ -141,7 +142,7 @@ const char* webkit_uri_scheme_request_get_path(WebKitURISchemeRequest* request)
     g_return_val_if_fail(WEBKIT_IS_URI_SCHEME_REQUEST(request), 0);
 
     if (!request->priv->soupURI)
-        request->priv->soupURI.set(soup_uri_new(request->priv->uri.data()));
+        request->priv->soupURI.reset(soup_uri_new(request->priv->uri.data()));
     return request->priv->soupURI->path;
 }
 
index d56f5e5..0a7aad6 100644 (file)
@@ -50,8 +50,8 @@
 #include <wtf/OwnPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebKit;
@@ -216,7 +216,7 @@ static CString injectedBundleDirectory()
 
 static CString injectedBundleFilename()
 {
-    GOwnPtr<char> bundleFilename(g_build_filename(injectedBundleDirectory().data(), "libwebkit2gtkinjectedbundle.so", NULL));
+    GUniquePtr<char> bundleFilename(g_build_filename(injectedBundleDirectory().data(), "libwebkit2gtkinjectedbundle.so", NULL));
     return bundleFilename.get();
 }
 
@@ -443,9 +443,8 @@ void webkit_web_context_set_favicon_database_directory(WebKitWebContext* context
         : directoryPath.utf8();
 
     // Build the full path to the icon database file on disk.
-    GOwnPtr<gchar> faviconDatabasePath(g_build_filename(priv->faviconDatabaseDirectory.data(),
-                                                        WebCore::IconDatabase::defaultDatabaseFilename().utf8().data(),
-                                                        NULL));
+    GUniquePtr<gchar> faviconDatabasePath(g_build_filename(priv->faviconDatabaseDirectory.data(),
+        WebCore::IconDatabase::defaultDatabaseFilename().utf8().data(), nullptr));
 
     // Setting the path will cause the icon database to be opened.
     priv->context->setIconDatabasePath(WebCore::filenameToString(faviconDatabasePath.get()));
index 2388614..7ee0c8b 100644 (file)
@@ -61,8 +61,8 @@
 #include <JavaScriptCore/APICast.h>
 #include <WebCore/CertificateInfo.h>
 #include <WebCore/DragIcon.h>
-#include <WebCore/GOwnPtrGtk.h>
-#include <WebCore/GOwnPtrSoup.h>
+#include <WebCore/GUniquePtrGtk.h>
+#include <WebCore/GUniquePtrSoup.h>
 #include <WebCore/GtkUtilities.h>
 #include <WebCore/RefPtrCairo.h>
 #include <glib/gi18n-lib.h>
@@ -212,7 +212,7 @@ static gboolean webkitWebViewLoadFail(WebKitWebView* webView, WebKitLoadEvent, c
         || g_error_matches(error, WEBKIT_PLUGIN_ERROR, WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD))
         return FALSE;
 
-    GOwnPtr<char> htmlString(g_strdup_printf("<html><body>%s</body></html>", error->message));
+    GUniquePtr<char> htmlString(g_strdup_printf("<html><body>%s</body></html>", error->message));
     webkit_web_view_load_alternate_html(webView, htmlString.get(), failingURI, 0);
 
     return TRUE;
@@ -228,7 +228,7 @@ static GtkWidget* webkitWebViewCreateJavaScriptDialog(WebKitWebView* webView, Gt
     GtkWidget* parent = gtk_widget_get_toplevel(GTK_WIDGET(webView));
     GtkWidget* dialog = gtk_message_dialog_new(widgetIsOnscreenToplevelWindow(parent) ? GTK_WINDOW(parent) : 0,
                                                GTK_DIALOG_DESTROY_WITH_PARENT, type, buttons, "%s", message);
-    GOwnPtr<char> title(g_strdup_printf("JavaScript - %s", webkit_web_view_get_uri(webView)));
+    GUniquePtr<char> title(g_strdup_printf("JavaScript - %s", webkit_web_view_get_uri(webView)));
     gtk_window_set_title(GTK_WINDOW(dialog), title.get());
     gtk_dialog_set_default_response(GTK_DIALOG(dialog), defaultResponse);
 
@@ -450,7 +450,7 @@ static void fileChooserDialogResponseCallback(GtkDialog* dialog, gint responseID
 {
     GRefPtr<WebKitFileChooserRequest> adoptedRequest = adoptGRef(request);
     if (responseID == GTK_RESPONSE_ACCEPT) {
-        GOwnPtr<GSList> filesList(gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)));
+        GUniquePtr<GSList> filesList(gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)));
         GRefPtr<GPtrArray> filesArray = adoptGRef(g_ptr_array_new());
         for (GSList* file = filesList.get(); file; file = g_slist_next(file))
             g_ptr_array_add(filesArray.get(), file->data);
@@ -1517,7 +1517,7 @@ void webkitWebViewLoadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent)
         priv->waitingForMainResource = false;
     } else if (loadEvent == WEBKIT_LOAD_COMMITTED) {
         WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(priv->context);
-        GOwnPtr<char> faviconURI(webkit_favicon_database_get_favicon_uri(database, priv->activeURI.data()));
+        GUniquePtr<char> faviconURI(webkit_favicon_database_get_favicon_uri(database, priv->activeURI.data()));
         webkitWebViewUpdateFaviconURI(webView, faviconURI.get());
 
         if (!priv->mainResource) {
@@ -1552,7 +1552,7 @@ void webkitWebViewLoadFailedWithTLSErrors(WebKitWebView* webView, const char* fa
 
     WebKitTLSErrorsPolicy tlsErrorsPolicy = webkit_web_context_get_tls_errors_policy(webView->priv->context);
     if (tlsErrorsPolicy == WEBKIT_TLS_ERRORS_POLICY_FAIL) {
-        GOwnPtr<SoupURI> soupURI(soup_uri_new(failingURI));
+        GUniquePtr<SoupURI> soupURI(soup_uri_new(failingURI));
         WebKitCertificateInfo info(certificate, tlsErrors);
         gboolean returnValue;
         g_signal_emit(webView, signals[LOAD_FAILED_WITH_TLS_ERRORS], 0, &info, soupURI->host, &returnValue);
@@ -1815,7 +1815,7 @@ void webkitWebViewPopulateContextMenu(WebKitWebView* webView, API::Array* propos
         webkitWebViewCreateAndAppendInputMethodsMenuItem(webView, contextMenu.get());
 
     GRefPtr<WebKitHitTestResult> hitTestResult = adoptGRef(webkitHitTestResultCreate(webHitTestResult));
-    GOwnPtr<GdkEvent> contextMenuEvent(webkitWebViewBaseTakeContextMenuEvent(webViewBase));
+    GUniquePtr<GdkEvent> contextMenuEvent(webkitWebViewBaseTakeContextMenuEvent(webViewBase));
 
     gboolean returnValue;
     g_signal_emit(webView, signals[CONTEXT_MENU], 0, contextMenu.get(), contextMenuEvent.get(), hitTestResult.get(), &returnValue);
index 9559279..007d262 100644 (file)
@@ -50,7 +50,7 @@
 #include <WebCore/DataObjectGtk.h>
 #include <WebCore/DragData.h>
 #include <WebCore/DragIcon.h>
-#include <WebCore/GOwnPtrGtk.h>
+#include <WebCore/GUniquePtrGtk.h>
 #include <WebCore/GtkClickCounter.h>
 #include <WebCore/GtkDragAndDropHelper.h>
 #include <WebCore/GtkUtilities.h>
@@ -65,7 +65,6 @@
 #include <gdk/gdkx.h>
 #endif
 #include <wtf/HashMap.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
 #include <wtf/text/CString.h>
 
@@ -108,7 +107,7 @@ struct _WebKitWebViewBasePrivate {
     GtkWidget* inspectorView;
     AttachmentSide inspectorAttachmentSide;
     unsigned inspectorViewSize;
-    GOwnPtr<GdkEvent> contextMenuEvent;
+    GUniquePtr<GdkEvent> contextMenuEvent;
     WebContextMenuProxyGtk* activeContextMenuProxy;
     WebViewBaseInputMethodFilter inputMethodFilter;
 
@@ -667,7 +666,7 @@ static gboolean webkitWebViewBaseButtonPressEvent(GtkWidget* widget, GdkEventBut
 
     // If it's a right click event save it as a possible context menu event.
     if (buttonEvent->button == 3)
-        priv->contextMenuEvent.set(gdk_event_copy(reinterpret_cast<GdkEvent*>(buttonEvent)));
+        priv->contextMenuEvent.reset(gdk_event_copy(reinterpret_cast<GdkEvent*>(buttonEvent)));
     priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(reinterpret_cast<GdkEvent*>(buttonEvent),
                                                      priv->clickCounter.clickCountForGdkButtonEvent(widget, buttonEvent)));
     return TRUE;
@@ -994,7 +993,7 @@ void webkitWebViewBaseStartDrag(WebKitWebViewBase* webViewBase, const DragData&
 
     RefPtr<DataObjectGtk> dataObject = adoptRef(dragData.platformData());
     GRefPtr<GtkTargetList> targetList = adoptGRef(PasteboardHelper::defaultPasteboardHelper()->targetListForDataObject(dataObject.get()));
-    GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event());
+    GUniquePtr<GdkEvent> currentEvent(gtk_get_current_event());
     GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(webViewBase),
                                              targetList.get(),
                                              dragOperationToGdkDragActions(dragData.draggingSourceOperationMask()),
index b836c11..b06fa73 100644 (file)
@@ -34,6 +34,7 @@
 #include <gio/gio.h>
 #include <glib.h>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/StringConcatenate.h>
@@ -78,7 +79,7 @@ bool WebInspectorServer::platformResourceForPath(const String& path, Vector<char
     if (!g_input_stream_read_all(G_INPUT_STREAM(inputStream.get()), data.data(), data.size(), 0, 0, 0))
         return false;
 
-    contentType = GOwnPtr<gchar>(g_file_info_get_attribute_as_string(fileInfo.get(), G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE)).get();
+    contentType = GUniquePtr<gchar>(g_file_info_get_attribute_as_string(fileInfo.get(), G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE)).get();
     return true;
 }
 
index 28f4f21..f3ad13a 100644 (file)
@@ -32,7 +32,7 @@
 #include <gio/gio.h>
 #include <glib.h>
 #include <wtf/PassOwnPtr.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebCore;
@@ -43,7 +43,7 @@ static gboolean connectionCallback(GSocketService* /*service*/, GSocketConnectio
 {
 #if !LOG_DISABLED
     GRefPtr<GSocketAddress> socketAddress = adoptGRef(g_socket_connection_get_remote_address(connection, 0));
-    GOwnPtr<gchar> addressString(g_inet_address_to_string(g_inet_socket_address_get_address(G_INET_SOCKET_ADDRESS(socketAddress.get()))));
+    GUniquePtr<gchar> addressString(g_inet_address_to_string(g_inet_socket_address_get_address(G_INET_SOCKET_ADDRESS(socketAddress.get()))));
     LOG(InspectorServer, "New Connection from %s:%d.", addressString.get(), g_inet_socket_address_get_port(G_INET_SOCKET_ADDRESS(socketAddress.get())));
 #endif
 
index abe8204..4fb5c90 100644 (file)
@@ -40,6 +40,7 @@
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/gobject/GlibUtilities.h>
 
 #if OS(UNIX)
@@ -95,7 +96,7 @@ void ProcessLauncher::launchProcess()
     }
 
     realExecutablePath = fileSystemRepresentation(executablePath);
-    GOwnPtr<gchar> socket(g_strdup_printf("%d", sockets[0]));
+    GUniquePtr<gchar> socket(g_strdup_printf("%d", sockets[0]));
 
     unsigned nargs = 4; // size of the argv array for g_spawn_async()
 
index 8acef3c..44fa59b 100644 (file)
@@ -36,7 +36,7 @@
 #include <WebCore/FileSystem.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/SchemeRegistry.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 #if ENABLE(NETWORK_PROCESS)
@@ -90,7 +90,7 @@ static void initInspectorServer()
 
 WTF::String WebContext::platformDefaultApplicationCacheDirectory() const
 {
-    GOwnPtr<gchar> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "webkitgtk", "applications", NULL));
+    GUniquePtr<gchar> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "webkitgtk", "applications", nullptr));
     return WebCore::filenameToString(cacheDirectory.get());
 }
 
@@ -125,25 +125,25 @@ void WebContext::platformInvalidateContext()
 
 String WebContext::platformDefaultDatabaseDirectory() const
 {
-    GOwnPtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "databases", NULL));
+    GUniquePtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "databases", nullptr));
     return WebCore::filenameToString(databaseDirectory.get());
 }
 
 String WebContext::platformDefaultIconDatabasePath() const
 {
-    GOwnPtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "icondatabase", NULL));
+    GUniquePtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "icondatabase", nullptr));
     return WebCore::filenameToString(databaseDirectory.get());
 }
 
 String WebContext::platformDefaultLocalStorageDirectory() const
 {
-    GOwnPtr<gchar> storageDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "localstorage", NULL));
+    GUniquePtr<gchar> storageDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "localstorage", nullptr));
     return WebCore::filenameToString(storageDirectory.get());
 }
 
 String WebContext::platformDefaultDiskCacheDirectory() const
 {
-    GOwnPtr<char> diskCacheDirectory(g_build_filename(g_get_user_cache_dir(), g_get_prgname(), NULL));
+    GUniquePtr<char> diskCacheDirectory(g_build_filename(g_get_user_cache_dir(), g_get_prgname(), nullptr));
     return WebCore::filenameToString(diskCacheDirectory.get());
 }
 
index f352c3a..cc25e64 100644 (file)
@@ -59,7 +59,7 @@ static void contextMenuItemVisibilityChanged(GtkAction* action, GParamSpec*, Web
     if (!menu)
         return;
 
-    GOwnPtr<GList> items(gtk_container_get_children(GTK_CONTAINER(menu)));
+    GUniquePtr<GList> items(gtk_container_get_children(GTK_CONTAINER(menu)));
     bool previousVisibleItemIsNotASeparator = false;
     GtkWidget* lastItemVisibleSeparator = 0;
     for (GList* iter = items.get(); iter; iter = g_list_next(iter)) {
index 9522a0a..f822082 100644 (file)
@@ -38,7 +38,7 @@
 #include <WebCore/NotImplemented.h>
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
@@ -144,7 +144,7 @@ void WebInspectorProxy::platformInspectedURLChanged(const String& url)
 
     if (!m_inspectorWindow)
         return;
-    GOwnPtr<gchar> title(g_strdup_printf("%s - %s", _("Web Inspector"), url.utf8().data()));
+    GUniquePtr<gchar> title(g_strdup_printf("%s - %s", _("Web Inspector"), url.utf8().data()));
     gtk_window_set_title(GTK_WINDOW(m_inspectorWindow), title.get());
 }
 
index a41839a..782730d 100644 (file)
@@ -30,7 +30,7 @@
 #include "WebPopupItem.h"
 #include <WebCore/GtkUtilities.h>
 #include <gtk/gtk.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 using namespace WebCore;
@@ -54,7 +54,7 @@ WebPopupMenuProxyGtk::~WebPopupMenuProxyGtk()
 
 GtkAction* WebPopupMenuProxyGtk::createGtkActionForMenuItem(const WebPopupItem& item, int itemIndex)
 {
-    GOwnPtr<char> actionName(g_strdup_printf("popup-menu-action-%d", itemIndex));
+    GUniquePtr<char> actionName(g_strdup_printf("popup-menu-action-%d", itemIndex));
     GtkAction* action = gtk_action_new(actionName.get(), item.m_text.utf8().data(), item.m_toolTip.utf8().data(), 0);
     g_object_set_data(G_OBJECT(action), "popup-menu-action-index", GINT_TO_POINTER(itemIndex));
     g_signal_connect(action, "activate", G_CALLBACK(menuItemActivated), this);
index e77e4be..5a0ef9e 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <WebCore/FileSystem.h>
 #include <glib.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebKit {
index 87c555b..4a55acb 100644 (file)
@@ -41,7 +41,7 @@
 #include <WebCore/PasteboardHelper.h>
 #include <WebCore/PlatformKeyboardEvent.h>
 #include <WebCore/Settings.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 using namespace WebCore;
 
@@ -55,7 +55,7 @@ void WebPage::platformInitialize()
     // process to connect the two worlds through the accessibility
     // object there specifically placed for that purpose (the socket).
     m_accessibilityObject = adoptGRef(webPageAccessibilityObjectNew(this));
-    GOwnPtr<gchar> plugID(atk_plug_get_id(ATK_PLUG(m_accessibilityObject.get())));
+    GUniquePtr<gchar> plugID(atk_plug_get_id(ATK_PLUG(m_accessibilityObject.get())));
     send(Messages::WebPageProxy::BindAccessibilityTree(String(plugID.get())));
 #endif
 
index b1eb155..cb46881 100644 (file)
@@ -41,6 +41,7 @@
 #include <gtk/gtk.h>
 #include <wtf/Vector.h>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 #ifdef HAVE_GTK_UNIX_PRINTING
 #include "PrinterListGtk.h"
@@ -75,7 +76,7 @@ public:
 
         static int jobNumber = 0;
         const char* applicationName = g_get_application_name();
-        GOwnPtr<char>jobName(g_strdup_printf("%s job #%d", applicationName ? applicationName : "WebKit", ++jobNumber));
+        GUniquePtr<char>jobName(g_strdup_printf("%s job #%d", applicationName ? applicationName : "WebKit", ++jobNumber));
         m_printJob = adoptGRef(gtk_print_job_new(jobName.get(), printer, m_printSettings.get(), m_pageSetup.get()));
 
         GOwnPtr<GError> error;
index e15f602..57d4ab3 100644 (file)
@@ -38,7 +38,6 @@
 #include <libsoup/soup.h>
 #include <unistd.h>
 #include <wtf/RunLoop.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
 
 using namespace WebCore;
index 70fcad5..818eef0 100644 (file)
@@ -31,7 +31,7 @@
 #include <WebCore/ResourceHandle.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/SoupNetworkSession.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 namespace WebKit {
@@ -176,7 +176,7 @@ void WebSoupRequestManager::send(GTask* task)
 {
     WebKitSoupRequestGeneric* request = WEBKIT_SOUP_REQUEST_GENERIC(g_task_get_source_object(task));
     SoupRequest* soupRequest = SOUP_REQUEST(request);
-    GOwnPtr<char> uriString(soup_uri_to_string(soup_request_get_uri(soupRequest), FALSE));
+    GUniquePtr<char> uriString(soup_uri_to_string(soup_request_get_uri(soupRequest), FALSE));
 
     uint64_t requestID = generateSoupRequestID();
     m_requestMap.set(requestID, adoptPtr(new WebSoupRequestAsyncData(task, request)));
index eb7a5db..d4df64e 100644 (file)
@@ -1,3 +1,194 @@
+2014-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GLIB] Use GUniquePtr instead of GOwnPtr
+        https://bugs.webkit.org/show_bug.cgi?id=127431
+
+        Reviewed by Martin Robinson.
+
+        GUniquePtr is a template alias of std::unique_ptr with a custom
+        deleter that replaces GOwnPtr. GOwnPtr is still used for the cases
+        where the output pointer is needed, but it will also be replaced soon.
+
+        * DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
+        (printAccessibilityEvent):
+        (axObjectEventListener):
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
+        (indexRangeInTable):
+        (AccessibilityUIElement::role):
+        (AccessibilityUIElement::title):
+        (AccessibilityUIElement::description):
+        (AccessibilityUIElement::stringValue):
+        (AccessibilityUIElement::language):
+        (AccessibilityUIElement::lineForIndex):
+        (AccessibilityUIElement::selectedTextRange):
+        (AccessibilityUIElement::url):
+        * DumpRenderTree/efl/AccessibilityControllerEfl.cpp:
+        (AccessibilityController::accessibleElementById):
+        * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+        (AccessibilityController::accessibleElementById):
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (getOutputDir):
+        (getFontsPath):
+        (initializeFonts):
+        (dumpFramesAsText):
+        (compareHistoryItems):
+        (dumpHistoryItem):
+        (soupURIToStringPreservingPassword):
+        (resetDefaultsToConsistentValues):
+        (temporaryDatabaseDirectory):
+        (webViewTitleChanged):
+        (webFrameLoadStatusNotified):
+        (pathFromSoupURI):
+        (convertWebResourceToURLPath):
+        (urlSuitableForTestResult):
+        (descriptionSuitableForTestResult):
+        (willSendRequestCallback):
+        (frameLoadEventCallback):
+        * DumpRenderTree/gtk/EditingCallbacks.cpp:
+        (dumpNodePath):
+        (dumpRange):
+        (shouldApplyStyle):
+        * DumpRenderTree/gtk/EventSender.cpp:
+        (contextClickCallback):
+        (beginDragWithFilesCallback):
+        * DumpRenderTree/gtk/TestRunnerGtk.cpp:
+        (TestRunner::pathToLocalResource):
+        (TestRunner::queueLoad):
+        (TestRunner::removeOriginAccessWhitelistEntry):
+        (TestRunner::setMockGeolocationPositionUnavailableError):
+        (TestRunner::setIconDatabaseEnabled):
+        (TestRunner::findString):
+        (TestRunner::setDomainRelaxationForbiddenForURLScheme):
+        (TestRunner::overridePreference):
+        (TestRunner::addUserScript):
+        (TestRunner::addUserStyleSheet):
+        (TestRunner::setTextDirection):
+        * DumpRenderTree/gtk/TextInputController.cpp:
+        (setMarkedTextCallback):
+        (insertTextCallback):
+        (doCommandCallback):
+        * DumpRenderTree/gtk/WorkQueueItemGtk.cpp:
+        (LoadHTMLStringItem::invoke):
+        * TestWebKitAPI/PlatformGTK.cmake:
+        * TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp:
+        (WebKitDOMNodeTest::testTagNames):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestBackForwardList.cpp:
+        (testBackForwardListLimitAndCache):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp:
+        (testContextMenuSmartSeparators):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp:
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
+        (testDownloadLocalFile):
+        (testDownloadLocalFileError):
+        (addContentDispositionHTTPHeaderToResponse):
+        (serverCallback):
+        (testDownloadRemoteFileError):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp:
+        (startTestServer):
+        (testInspectorServerPageList):
+        (openRemoteDebuggingSession):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp:
+        (testPrintOperationPrint):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
+        (addCacheHTTPHeadersToResponse):
+        (serverCallback):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
+        (httpsServerCallback):
+        (httpServerCallback):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
+        (testWebViewJavaScriptDialogs):
+        (testWebViewWindowProperties):
+        (testWebViewFileChooserRequest):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp:
+        (testWebExtensionWindowObjectCleared):
+        (testWebExtensionIsolatedWorld):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitAccessibility.cpp:
+        (startTestServer):
+        (checkAtspiAccessible):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
+        (serverCallback):
+        (testClearDatabase):
+        (testGetFaviconURI):
+        (webkitFaviconDatabaseFinalizedCallback):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
+        (testWebContextGetPlugins):
+        (testWebContextURIScheme):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
+        (testWebViewRunJavaScript):
+        (testWebViewMode):
+        (testWebViewPageVisibility):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebViewGroup.cpp:
+        (isStyleSheetInjectedForURLAtPath):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp:
+        (testWebViewEditorCutCopyPasteNonEditable):
+        (testWebViewEditorCutCopyPasteEditable):
+        (testWebViewEditorSelectAllNonEditable):
+        (testWebViewEditorSelectAllEditable):
+        * TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
+        (sendRequestCallback):
+        (methodCallCallback):
+        * TestWebKitAPI/gtk/PlatformUtilitiesGtk.cpp:
+        (TestWebKitAPI::Util::createInjectedBundlePath):
+        (TestWebKitAPI::Util::createURLForResource):
+        * TestWebKitAPI/gtk/PlatformWebViewGtk.cpp:
+        (TestWebKitAPI::doKeyStroke):
+        (TestWebKitAPI::doMouseButtonEvent):
+        (TestWebKitAPI::PlatformWebView::simulateMouseMove):
+        * TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp:
+        (loadFailedCallback):
+        (LoadTrackingTest::loadURI):
+        (LoadTrackingTest::loadHtml):
+        (LoadTrackingTest::loadPlainText):
+        (LoadTrackingTest::loadRequest):
+        (LoadTrackingTest::reload):
+        (LoadTrackingTest::goBack):
+        (LoadTrackingTest::goForward):
+        * TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h:
+        * TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp:
+        (registerGResource):
+        (removeNonEmptyDirectory):
+        (main):
+        * TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
+        (Test::getWebKit1TestResoucesDir):
+        (Test::getResourcesDir):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp:
+        (WebKitTestBus::run):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.cpp:
+        (WebKitTestServer::WebKitTestServer):
+        (WebKitTestServer::getURIForPath):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp:
+        (WebProcessTestRunner::runTest):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
+        (resourceGetDataCallback):
+        (WebViewTest::mainResourceData):
+        (WebViewTest::mouseMoveTo):
+        (WebViewTest::keyStroke):
+        (WebViewTest::doMouseButtonEvent):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp:
+        (WTR::AccessibilityController::accessibleElementById):
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::role):
+        (WTR::AccessibilityUIElement::title):
+        (WTR::AccessibilityUIElement::description):
+        (WTR::AccessibilityUIElement::stringValue):
+        (WTR::AccessibilityUIElement::language):
+        (WTR::AccessibilityUIElement::lineForIndex):
+        (WTR::AccessibilityUIElement::selectedTextRange):
+        (WTR::AccessibilityUIElement::url):
+        * WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
+        (WTR::getOutputDir):
+        (WTR::getFontsPath):
+        (WTR::initializeFontConfigSetting):
+        * WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.cpp:
+        (WTR::topLevelPath):
+        * WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp:
+        (WTR::TestRunner::pathToLocalResource):
+        * WebKitTestRunner/gtk/TestControllerGtk.cpp:
+        (WTR::TestController::initializeInjectedBundlePath):
+        (WTR::TestController::initializeTestPluginDirectory):
+
 2014-01-05  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] [CMake] run-webkit-tests should support the CMake build
index e923f3f..a908241 100644 (file)
@@ -36,7 +36,7 @@
 #include "DumpRenderTree.h"
 #include "JSRetainPtr.h"
 #include <atk/atk.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 #if PLATFORM(GTK)
 #include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
@@ -79,7 +79,7 @@ static void printAccessibilityEvent(AtkObject* accessible, const gchar* signalNa
     if (!objectName || *objectName == '\0')
         objectName = "(No name)";
 
-    GOwnPtr<gchar> signalNameAndValue(signalValue ? g_strdup_printf("%s = %s", signalName, signalValue) : g_strdup(signalName));
+    GUniquePtr<gchar> signalNameAndValue(signalValue ? g_strdup_printf("%s = %s", signalName, signalValue) : g_strdup(signalName));
     printf("Accessibility object emitted \"%s\" / Name: \"%s\" / Role: %d\n", signalNameAndValue.get(), objectName, objectRole);
 }
 
@@ -94,37 +94,37 @@ static gboolean axObjectEventListener(GSignalInvocationHint *signalHint, guint n
         return true;
 
     GSignalQuery signalQuery;
-    GOwnPtr<gchar> signalName;
-    GOwnPtr<gchar> signalValue;
+    GUniquePtr<gchar> signalName;
+    GUniquePtr<gchar> signalValue;
     String notificationName;
 
     g_signal_query(signalHint->signal_id, &signalQuery);
 
     if (!g_strcmp0(signalQuery.signal_name, "state-change")) {
-        signalName.set(g_strdup_printf("state-change:%s", g_value_get_string(&paramValues[1])));
-        signalValue.set(g_strdup_printf("%d", g_value_get_boolean(&paramValues[2])));
+        signalName.reset(g_strdup_printf("state-change:%s", g_value_get_string(&paramValues[1])));
+        signalValue.reset(g_strdup_printf("%d", g_value_get_boolean(&paramValues[2])));
         if (!g_strcmp0(g_value_get_string(&paramValues[1]), "checked"))
             notificationName = "CheckedStateChanged";
         else if (!g_strcmp0(g_value_get_string(&paramValues[1]), "invalid-entry"))
             notificationName = "AXInvalidStatusChanged";
     } else if (!g_strcmp0(signalQuery.signal_name, "focus-event")) {
-        signalName.set(g_strdup("focus-event"));
-        signalValue.set(g_strdup_printf("%d", g_value_get_boolean(&paramValues[1])));
+        signalName.reset(g_strdup("focus-event"));
+        signalValue.reset(g_strdup_printf("%d", g_value_get_boolean(&paramValues[1])));
         if (g_value_get_boolean(&paramValues[1]))
             notificationName = "AXFocusedUIElementChanged";
     } else if (!g_strcmp0(signalQuery.signal_name, "children-changed")) {
         const gchar* childrenChangedDetail = g_quark_to_string(signalHint->detail);
-        signalName.set(g_strdup_printf("children-changed:%s", childrenChangedDetail));
-        signalValue.set(g_strdup_printf("%d", g_value_get_uint(&paramValues[1])));
+        signalName.reset(g_strdup_printf("children-changed:%s", childrenChangedDetail));
+        signalValue.reset(g_strdup_printf("%d", g_value_get_uint(&paramValues[1])));
         notificationName = !g_strcmp0(childrenChangedDetail, "add") ? "AXChildrenAdded" : "AXChildrenRemoved";
     } else if (!g_strcmp0(signalQuery.signal_name, "property-change")) {
-        signalName.set(g_strdup_printf("property-change:%s", g_quark_to_string(signalHint->detail)));
+        signalName.reset(g_strdup_printf("property-change:%s", g_quark_to_string(signalHint->detail)));
         if (!g_strcmp0(g_quark_to_string(signalHint->detail), "accessible-value"))
             notificationName = "AXValueChanged";
     } else if (!g_strcmp0(signalQuery.signal_name, "load-complete"))
         notificationName = "AXLoadComplete";
     else
-        signalName.set(g_strdup(signalQuery.signal_name));
+        signalName.reset(g_strdup(signalQuery.signal_name));
 
     if (loggingAccessibilityEvents)
         printAccessibilityEvent(accessible, signalName.get(), signalValue.get());
index 96e3e07..adc84db 100644 (file)
@@ -35,8 +35,8 @@
 #include <JavaScriptCore/OpaqueJSString.h>
 #include <atk/atk.h>
 #include <wtf/Assertions.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/WTFString.h>
@@ -93,7 +93,7 @@ const char* landmarkStringSearch = "AXLandmarkSearch";
 String jsStringToWTFString(JSStringRef attribute)
 {
     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(attribute);
-    GOwnPtr<gchar> buffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    GUniquePtr<gchar> buffer(static_cast<gchar*>(g_malloc(bufferSize)));
     JSStringGetUTF8CString(attribute, buffer.get(), bufferSize);
 
     return String::fromUTF8(buffer.get());
@@ -177,7 +177,7 @@ String getAtkAttributeSetAsString(AtkObject* accessible, AtkAttributeType type)
     StringBuilder builder;
     for (AtkAttributeSet* attributes = attributeSet; attributes; attributes = attributes->next) {
         AtkAttribute* attribute = static_cast<AtkAttribute*>(attributes->data);
-        GOwnPtr<gchar> attributeData(g_strconcat(attribute->name, ":", attribute->value, NULL));
+        GUniquePtr<gchar> attributeData(g_strconcat(attribute->name, ":", attribute->value, NULL));
         builder.append(attributeData.get());
         if (attributes->next)
             builder.append(", ");
@@ -489,7 +489,7 @@ static Vector<AccessibilityUIElement> getVisibleCells(AccessibilityUIElement* el
 
 JSStringRef indexRangeInTable(PlatformUIElement element, bool isRowRange)
 {
-    GOwnPtr<gchar> rangeString(g_strdup("{0, 0}"));
+    GUniquePtr<gchar> rangeString(g_strdup("{0, 0}"));
 
     if (!ATK_IS_OBJECT(element))
         return JSStringCreateWithUTF8CString(rangeString.get());
@@ -519,7 +519,7 @@ JSStringRef indexRangeInTable(PlatformUIElement element, bool isRowRange)
             base = column;
             length = atk_table_get_column_extent_at(ATK_TABLE(axTable), row, column);
         }
-        rangeString.set(g_strdup_printf("{%d, %d}", base, length));
+        rangeString.reset(g_strdup_printf("{%d, %d}", base, length));
     }
 
     return JSStringCreateWithUTF8CString(rangeString.get());
@@ -737,7 +737,7 @@ JSStringRef AccessibilityUIElement::role()
     if (!atk_object_get_role(ATK_OBJECT(m_element)))
         return JSStringCreateWithCharacters(0, 0);
 
-    GOwnPtr<char> roleStringWithPrefix(g_strdup_printf("AXRole: %s", roleToString(ATK_OBJECT(m_element))));
+    GUniquePtr<char> roleStringWithPrefix(g_strdup_printf("AXRole: %s", roleToString(ATK_OBJECT(m_element))));
     return JSStringCreateWithUTF8CString(roleStringWithPrefix.get());
 }
 
@@ -757,7 +757,7 @@ JSStringRef AccessibilityUIElement::title()
         return JSStringCreateWithCharacters(0, 0);
 
     const gchar* name = atk_object_get_name(ATK_OBJECT(m_element));
-    GOwnPtr<gchar> axTitle(g_strdup_printf("AXTitle: %s", name ? name : ""));
+    GUniquePtr<gchar> axTitle(g_strdup_printf("AXTitle: %s", name ? name : ""));
 
     return JSStringCreateWithUTF8CString(axTitle.get());
 }
@@ -771,7 +771,7 @@ JSStringRef AccessibilityUIElement::description()
     if (!description)
         return JSStringCreateWithCharacters(0, 0);
 
-    GOwnPtr<gchar> axDesc(g_strdup_printf("AXDescription: %s", description));
+    GUniquePtr<gchar> axDesc(g_strdup_printf("AXDescription: %s", description));
 
     return JSStringCreateWithUTF8CString(axDesc.get());
 }
@@ -781,9 +781,9 @@ JSStringRef AccessibilityUIElement::stringValue()
     if (!ATK_IS_TEXT(m_element))
         return JSStringCreateWithCharacters(0, 0);
 
-    GOwnPtr<gchar> text(atk_text_get_text(ATK_TEXT(m_element), 0, -1));
-    GOwnPtr<gchar> textWithReplacedCharacters(replaceCharactersForResults(text.get()));
-    GOwnPtr<gchar> axValue(g_strdup_printf("AXValue: %s", textWithReplacedCharacters.get()));
+    GUniquePtr<gchar> text(atk_text_get_text(ATK_TEXT(m_element), 0, -1));
+    GUniquePtr<gchar> textWithReplacedCharacters(replaceCharactersForResults(text.get()));
+    GUniquePtr<gchar> axValue(g_strdup_printf("AXValue: %s", textWithReplacedCharacters.get()));
 
     return JSStringCreateWithUTF8CString(axValue.get());
 }
@@ -797,7 +797,7 @@ JSStringRef AccessibilityUIElement::language()
     if (!locale)
         return JSStringCreateWithCharacters(0, 0);
 
-    GOwnPtr<char> axValue(g_strdup_printf("AXLanguage: %s", locale));
+    GUniquePtr<char> axValue(g_strdup_printf("AXLanguage: %s", locale));
     return JSStringCreateWithUTF8CString(axValue.get());
 }
 
@@ -1127,7 +1127,7 @@ int AccessibilityUIElement::lineForIndex(int index)
     if (index < 0 || index > atk_text_get_character_count(ATK_TEXT(m_element)))
         return -1;
 
-    GOwnPtr<gchar> text(atk_text_get_text(ATK_TEXT(m_element), 0, index));
+    GUniquePtr<gchar> text(atk_text_get_text(ATK_TEXT(m_element), 0, index));
     int lineNo = 0;
     for (gchar* offset = text.get(); *offset; ++offset) {
         if (*offset == '\n')
@@ -1195,7 +1195,7 @@ JSStringRef AccessibilityUIElement::selectedTextRange()
     gint start, end;
     g_free(atk_text_get_selection(ATK_TEXT(m_element), 0, &start, &end));
 
-    GOwnPtr<gchar> selection(g_strdup_printf("{%d, %d}", start, end - start));
+    GUniquePtr<gchar> selection(g_strdup_printf("{%d, %d}", start, end - start));
     return JSStringCreateWithUTF8CString(selection.get());
 }
 
@@ -1387,7 +1387,7 @@ JSStringRef AccessibilityUIElement::url()
         return JSStringCreateWithCharacters(0, 0);
 
     AtkHyperlink* hyperlink = atk_hyperlink_impl_get_hyperlink(ATK_HYPERLINK_IMPL(m_element));
-    GOwnPtr<char> hyperlinkURI(atk_hyperlink_get_uri(hyperlink, 0));
+    GUniquePtr<char> hyperlinkURI(atk_hyperlink_get_uri(hyperlink, 0));
 
     // Build the result string, stripping the absolute URL paths if present.
     char* localURI = g_strstr_len(hyperlinkURI.get(), -1, "LayoutTests");
index 8012da6..683e653 100644 (file)
@@ -37,7 +37,7 @@
 #include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
 
 #include <atk/atk.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
@@ -64,7 +64,7 @@ AccessibilityUIElement AccessibilityController::accessibleElementById(JSStringRe
         return 0;
 
     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(id);
-    GOwnPtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    GUniquePtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
     JSStringGetUTF8CString(id, idBuffer.get(), bufferSize);
 
     AtkObject* result = childElementById(root, idBuffer.get());
index 4dcd2b5..7ee1d94 100644 (file)
@@ -38,7 +38,7 @@
 #include <atk/atk.h>
 #include <gtk/gtk.h>
 #include <webkit/webkit.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
@@ -65,7 +65,7 @@ AccessibilityUIElement AccessibilityController::accessibleElementById(JSStringRe
         return 0;
 
     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(id);
-    GOwnPtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    GUniquePtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
     JSStringGetUTF8CString(id, idBuffer.get(), bufferSize);
 
     AtkObject* result = childElementById(root, idBuffer.get());
index 40c35c4..043335a 100644 (file)
@@ -45,7 +45,7 @@
 #include "WorkQueue.h"
 #include "WorkQueueItem.h"
 #include <JavaScriptCore/JavaScript.h>
-#include <WebCore/platform/network/soup/GOwnPtrSoup.h>
+#include <WebCore/platform/network/soup/GUniquePtrSoup.h>
 #include <cassert>
 #include <cstdlib>
 #include <cstring>
@@ -205,19 +205,19 @@ CString getOutputDir()
         return webkitOutputDir;
 
     CString topLevelPath = getTopLevelPath();
-    GOwnPtr<char> outputDir(g_build_filename(topLevelPath.data(), "WebKitBuild", NULL));
+    GUniquePtr<char> outputDir(g_build_filename(topLevelPath.data(), "WebKitBuild", NULL));
     return outputDir.get();
 }
 
 static CString getFontsPath()
 {
     CString webkitOutputDir = getOutputDir();
-    GOwnPtr<char> fontsPath(g_build_filename(webkitOutputDir.data(), "Dependencies", "Root", "webkitgtk-test-fonts", NULL));
+    GUniquePtr<char> fontsPath(g_build_filename(webkitOutputDir.data(), "Dependencies", "Root", "webkitgtk-test-fonts", NULL));
     if (g_file_test(fontsPath.get(), static_cast<GFileTest>(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
         return fontsPath.get();
 
     // Try alternative fonts path.
-    fontsPath.set(g_build_filename(webkitOutputDir.data(), "webkitgtk-test-fonts", NULL));
+    fontsPath.reset(g_build_filename(webkitOutputDir.data(), "webkitgtk-test-fonts", NULL));
     if (g_file_test(fontsPath.get(), static_cast<GFileTest>(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
         return fontsPath.get();
 
@@ -241,7 +241,7 @@ static void initializeFonts(const char* testURL = 0)
     // Load our configuration file, which sets up proper aliases for family
     // names like sans, serif and monospace.
     FcConfig* config = FcConfigCreate();
-    GOwnPtr<gchar> fontConfigFilename(g_build_filename(FONTS_CONF_DIR, "fonts.conf", NULL));
+    GUniquePtr<gchar> fontConfigFilename(g_build_filename(FONTS_CONF_DIR, "fonts.conf", nullptr));
     if (!FcConfigParseAndLoad(config, reinterpret_cast<FcChar8*>(fontConfigFilename.get()), true))
         g_error("Couldn't load font configuration file from: %s", fontConfigFilename.get());
 
@@ -249,30 +249,30 @@ static void initializeFonts(const char* testURL = 0)
     if (fontsPath.isNull())
         g_error("Could not locate test fonts at %s. Is WEBKIT_TOP_LEVEL set?", fontsPath.data());
 
-    GOwnPtr<GDir> fontsDirectory(g_dir_open(fontsPath.data(), 0, 0));
+    GUniquePtr<GDir> fontsDirectory(g_dir_open(fontsPath.data(), 0, nullptr));
     while (const char* directoryEntry = g_dir_read_name(fontsDirectory.get())) {
         if (!g_str_has_suffix(directoryEntry, ".ttf") && !g_str_has_suffix(directoryEntry, ".otf"))
             continue;
-        GOwnPtr<gchar> fontPath(g_build_filename(fontsPath.data(), directoryEntry, NULL));
+        GUniquePtr<gchar> fontPath(g_build_filename(fontsPath.data(), directoryEntry, nullptr));
         if (!FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(fontPath.get())))
             g_error("Could not load font at %s!", fontPath.get());
 
     }
 
     // Ahem is used by many layout tests.
-    GOwnPtr<gchar> ahemFontFilename(g_build_filename(FONTS_CONF_DIR, "AHEM____.TTF", NULL));
+    GUniquePtr<gchar> ahemFontFilename(g_build_filename(FONTS_CONF_DIR, "AHEM____.TTF", nullptr));
     if (!FcConfigAppFontAddFile(config, reinterpret_cast<FcChar8*>(ahemFontFilename.get())))
         g_error("Could not load font at %s!", ahemFontFilename.get()); 
 
     for (int i = 1; i <= 9; i++) {
-        GOwnPtr<gchar> fontFilename(g_strdup_printf("WebKitWeightWatcher%i00.ttf", i));
-        GOwnPtr<gchar> fontPath(g_build_filename(FONTS_CONF_DIR, "..", "..", "fonts", fontFilename.get(), NULL));
+        GUniquePtr<gchar> fontFilename(g_strdup_printf("WebKitWeightWatcher%i00.ttf", i));
+        GUniquePtr<gchar> fontPath(g_build_filename(FONTS_CONF_DIR, "..", "..", "fonts", fontFilename.get(), nullptr));
         if (!FcConfigAppFontAddFile(config, reinterpret_cast<FcChar8*>(fontPath.get())))
             g_error("Could not load font at %s!", fontPath.get()); 
     }
 
     // A font with no valid Fontconfig encoding to test https://bugs.webkit.org/show_bug.cgi?id=47452
-    GOwnPtr<gchar> fontWithNoValidEncodingFilename(g_build_filename(FONTS_CONF_DIR, "FontWithNoValidEncoding.fon", NULL));
+    GUniquePtr<gchar> fontWithNoValidEncodingFilename(g_build_filename(FONTS_CONF_DIR, "FontWithNoValidEncoding.fon", nullptr));
     if (!FcConfigAppFontAddFile(config, reinterpret_cast<FcChar8*>(fontWithNoValidEncodingFilename.get())))
         g_error("Could not load font at %s!", fontWithNoValidEncodingFilename.get()); 
 
@@ -301,7 +301,7 @@ static gchar* dumpFramesAsText(WebKitWebFrame* frame)
     if (gTestRunner->dumpChildFramesAsText()) {
         GSList* children = DumpRenderTreeSupportGtk::getFrameChildren(frame);
         for (GSList* child = children; child; child = g_slist_next(child)) {
-            GOwnPtr<gchar> childData(dumpFramesAsText(static_cast<WebKitWebFrame*>(child->data)));
+            GUniquePtr<gchar> childData(dumpFramesAsText(static_cast<WebKitWebFrame*>(child->data)));
             appendString(result, childData.get());
         }
         g_slist_free(children);
@@ -312,8 +312,8 @@ static gchar* dumpFramesAsText(WebKitWebFrame* frame)
 
 static gint compareHistoryItems(gpointer* item1, gpointer* item2)
 {
-    GOwnPtr<gchar> firstItemTarget(webkit_web_history_item_get_target(WEBKIT_WEB_HISTORY_ITEM(item1)));
-    GOwnPtr<gchar> secondItemTarget(webkit_web_history_item_get_target(WEBKIT_WEB_HISTORY_ITEM(item2)));
+    GUniquePtr<gchar> firstItemTarget(webkit_web_history_item_get_target(WEBKIT_WEB_HISTORY_ITEM(item1)));
+    GUniquePtr<gchar> secondItemTarget(webkit_web_history_item_get_target(WEBKIT_WEB_HISTORY_ITEM(item2)));
     return g_ascii_strcasecmp(firstItemTarget.get(), secondItemTarget.get());
 }
 
@@ -349,7 +349,7 @@ static void dumpHistoryItem(WebKitWebHistoryItem* item, int indent, bool current
 
     g_free(uriScheme);
 
-    GOwnPtr<gchar> target(webkit_web_history_item_get_target(item));
+    GUniquePtr<gchar> target(webkit_web_history_item_get_target(item));
     if (target.get() && strlen(target.get()) > 0)
         printf(" (in frame \"%s\")", target.get());
     if (webkit_web_history_item_is_target_item(item))
@@ -431,19 +431,19 @@ bool shouldSetWaitToDumpWatchdog()
 CString soupURIToStringPreservingPassword(SoupURI* soupURI)
 {
     if (!soupURI->password) {
-        GOwnPtr<char> uriString(soup_uri_to_string(soupURI, FALSE));
+        GUniquePtr<char> uriString(soup_uri_to_string(soupURI, FALSE));
         return uriString.get();
     }
 
     // soup_uri_to_string does not insert the password into the string, so we need to create the
     // URI string and then reinsert any credentials that were present in the SoupURI. All tests that
     // use URL-embedded credentials use HTTP, so it's safe here.
-    GOwnPtr<char> password(soupURI->password);
-    GOwnPtr<char> user(soupURI->user);
+    GUniquePtr<char> password(soupURI->password);
+    GUniquePtr<char> user(soupURI->user);
     soupURI->password = 0;
     soupURI->user = 0;
 
-    GOwnPtr<char> uriString(soup_uri_to_string(soupURI, FALSE));
+    GUniquePtr<char> uriString(soup_uri_to_string(soupURI, FALSE));
     String absoluteURIWithoutCredentialString = String::fromUTF8(uriString.get());
     String protocolAndCredential = String::format("http://%s:%s@", user ? user.get() : "", password.get());
     return absoluteURIWithoutCredentialString.replace("http://", protocolAndCredential).utf8();
@@ -462,7 +462,7 @@ static void invalidateAnyPreviousWaitToDumpWatchdog()
 static void resetDefaultsToConsistentValues()
 {
     WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
-    GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "DumpRenderTreeGtk", "databases", NULL));
+    GUniquePtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "DumpRenderTreeGtk", "databases", nullptr));
     g_object_set(G_OBJECT(settings),
         "enable-accelerated-compositing", FALSE,
         "enable-private-browsing", FALSE,
@@ -683,7 +683,7 @@ static CString temporaryDatabaseDirectory()
     const char* directoryFromEnvironment = g_getenv("DUMPRENDERTREE_TEMP");
     if (directoryFromEnvironment)
         return directoryFromEnvironment;
-    GOwnPtr<char> fallback(g_build_filename(g_get_user_data_dir(), "gtkwebkitdrt", "databases", NULL));
+    GUniquePtr<char> fallback(g_build_filename(g_get_user_data_dir(), "gtkwebkitdrt", "databases", NULL));
     return fallback.get();
 }
 
@@ -990,7 +990,7 @@ static gboolean webViewScriptConfirm(WebKitWebView* view, WebKitWebFrame* frame,
 static void webViewTitleChanged(WebKitWebView* view, WebKitWebFrame* frame, const gchar* title, gpointer data)
 {
     if (gTestRunner->dumpFrameLoadCallbacks() && !done) {
-        GOwnPtr<char> frameName(getFrameNameSuitableForTestResult(view, frame));
+        GUniquePtr<char> frameName(getFrameNameSuitableForTestResult(view, frame));
         printf("%s - didReceiveTitle: %s\n", frameName.get(), title ? title : "");
     }
 
@@ -1138,7 +1138,7 @@ static void webFrameLoadStatusNotified(WebKitWebFrame* frame, gpointer user_data
     WebKitLoadStatus loadStatus = webkit_web_frame_get_load_status(frame);
 
     if (gTestRunner->dumpFrameLoadCallbacks()) {
-        GOwnPtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame));
+        GUniquePtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame));
 
         switch (loadStatus) {
         case WEBKIT_LOAD_PROVISIONAL:
@@ -1182,10 +1182,10 @@ static String pathFromSoupURI(SoupURI* uri)
         return soupURIToStringPreservingPassword(uri).data();
 
     String pathString = uri->path;
-    GOwnPtr<gchar> pathBasename(g_path_get_basename(pathString.utf8().data()));
+    GUniquePtr<gchar> pathBasename(g_path_get_basename(pathString.utf8().data()));
 
     WebKitWebFrame* mainFrame = webkit_web_view_get_main_frame(webView);
-    GOwnPtr<SoupURI> mainFrameUri(soup_uri_new(webkit_web_frame_get_uri(mainFrame)));
+    GUniquePtr<SoupURI> mainFrameUri(soup_uri_new(webkit_web_frame_get_uri(mainFrame)));
 
     String mainFrameUriPathString = mainFrameUri.get()->path;
     String basePath = mainFrameUriPathString.substring(0, mainFrameUriPathString.reverseFind('/') + 1);
@@ -1212,7 +1212,7 @@ static CString convertNetworkRequestToURLPath(WebKitNetworkRequest* request)
 
 static CString convertWebResourceToURLPath(WebKitWebResource* webResource)
 {
-    GOwnPtr<SoupURI> uri(soup_uri_new(webkit_web_resource_get_uri(webResource)));
+    GUniquePtr<SoupURI> uri(soup_uri_new(webkit_web_resource_get_uri(webResource)));
     return pathFromSoupURI(uri.get()).utf8();
 }
 
@@ -1221,7 +1221,7 @@ static CString urlSuitableForTestResult(const char* uriString)
     if (!g_str_has_prefix(uriString, "file://"))
         return CString(uriString);
 
-    GOwnPtr<gchar> basename(g_path_get_basename(uriString));
+    GUniquePtr<gchar> basename(g_path_get_basename(uriString));
     return CString(basename.get());
 }
 
@@ -1230,7 +1230,7 @@ static CString descriptionSuitableForTestResult(SoupURI* uri)
     if (!uri)
         return CString("(null)");
 
-    GOwnPtr<char> uriString(soup_uri_to_string(uri, false));
+    GUniquePtr<char> uriString(soup_uri_to_string(uri, false));
     return urlSuitableForTestResult(uriString.get());
 }
 
@@ -1246,7 +1246,7 @@ static CString descriptionSuitableForTestResult(GError* error, WebKitWebResource
         errorDomain = "WebKitErrorDomain";
 
     // TODO: the other ports get the failingURL from the ResourceError
-    GOwnPtr<char> errorString(g_strdup_printf("<NSError domain %s, code %d, failing URL \"%s\">",
+    GUniquePtr<char> errorString(g_strdup_printf("<NSError domain %s, code %d, failing URL \"%s\">",
                                               errorDomain, error->code, resourceURIString.data()));
     return CString(errorString.get());
 }
@@ -1261,7 +1261,7 @@ static CString descriptionSuitableForTestResult(WebKitNetworkRequest* request)
     SoupURI* mainDocumentURI = soup_message_get_first_party(soupMessage);
     CString mainDocumentURIString(descriptionSuitableForTestResult(mainDocumentURI));
     CString path(convertNetworkRequestToURLPath(request));
-    GOwnPtr<char> description(g_strdup_printf("<NSURLRequest URL %s, main document URL %s, http method %s>",
+    GUniquePtr<char> description(g_strdup_printf("<NSURLRequest URL %s, main document URL %s, http method %s>",
         path.data(), mainDocumentURIString.data(), soupMessage->method));
     return CString(description.get());
 }
@@ -1282,7 +1282,7 @@ static CString descriptionSuitableForTestResult(WebKitNetworkResponse* response)
     } else
         path = CString("(null)");
 
-    GOwnPtr<char> description(g_strdup_printf("<NSURLResponse %s, http status code %d>", path.data(), statusCode));
+    GUniquePtr<char> description(g_strdup_printf("<NSURLResponse %s, http status code %d>", path.data(), statusCode));
     return CString(description.get());
 }
 
@@ -1306,7 +1306,7 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF
     SoupURI* uri = soup_uri_new(webkit_network_request_get_uri(request));
 
     if (SOUP_URI_IS_VALID(uri)) {
-        GOwnPtr<char> uriString(soup_uri_to_string(uri, FALSE));
+        GUniquePtr<char> uriString(soup_uri_to_string(uri, FALSE));
 
         if (SOUP_URI_VALID_FOR_HTTP(uri) && g_strcmp0(uri->host, "127.0.0.1")
             && g_strcmp0(uri->host, "255.255.255.255")
@@ -1380,7 +1380,7 @@ static void frameLoadEventCallback(WebKitWebFrame* frame, DumpRenderTreeSupportG
     if (done || !gTestRunner->dumpFrameLoadCallbacks())
         return;
 
-    GOwnPtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame));
+    GUniquePtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame));
     switch (event) {
     case DumpRenderTreeSupportGtk::WillPerformClientRedirectToURL:
         ASSERT(url);
index ef5a969..3c08f80 100644 (file)
 #include "TestRunner.h"
 #include <gtk/gtk.h>
 #include <webkit/webkit.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 static CString dumpNodePath(WebKitDOMNode* node)
 {
-    GOwnPtr<gchar> nodeName(webkit_dom_node_get_node_name(node));
+    GUniquePtr<gchar> nodeName(webkit_dom_node_get_node_name(node));
     GString* path = g_string_new(nodeName.get());
 
     WebKitDOMNode* parent = webkit_dom_node_get_parent_node(node);
     while (parent) {
-        GOwnPtr<gchar> parentName(webkit_dom_node_get_node_name(parent));
+        GUniquePtr<gchar> parentName(webkit_dom_node_get_node_name(parent));
 
         g_string_append(path, " > ");
         g_string_append(path, parentName.get());
         parent = webkit_dom_node_get_parent_node(parent);
     }
 
-    GOwnPtr<gchar> pathBuffer(g_string_free(path, FALSE));
+    GUniquePtr<gchar> pathBuffer(g_string_free(path, FALSE));
     return pathBuffer.get();
 }
 
@@ -59,7 +59,7 @@ static CString dumpRange(WebKitDOMRange* range)
     if (!range)
         return "(null)";
 
-    GOwnPtr<gchar> dump(g_strdup_printf("range from %li of %s to %li of %s",
+    GUniquePtr<gchar> dump(g_strdup_printf("range from %li of %s to %li of %s",
         webkit_dom_range_get_start_offset(range, 0),
         dumpNodePath(webkit_dom_range_get_start_container(range, 0)).data(),
         webkit_dom_range_get_end_offset(range, 0),
@@ -151,7 +151,7 @@ gboolean shouldChangeSelectedRange(WebKitWebView* webView, WebKitDOMRange* fromR
 gboolean shouldApplyStyle(WebKitWebView* webView, WebKitDOMCSSStyleDeclaration* style, WebKitDOMRange* range)
 {
     if (!done && gTestRunner->dumpEditingCallbacks()) {
-        GOwnPtr<gchar> styleText(webkit_dom_css_style_declaration_get_css_text(style));
+        GUniquePtr<gchar> styleText(webkit_dom_css_style_declaration_get_css_text(style));
         printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n",
                styleText.get(), dumpRange(range).data());
     }
index 3c63648..5826027 100644 (file)
@@ -35,7 +35,6 @@
 
 #include "DumpRenderTree.h"
 #include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
-#include <GOwnPtrGtk.h>
 #include <GRefPtrGtk.h>
 #include <GtkVersioning.h>
 #include <JavaScriptCore/JSObjectRef.h>
@@ -48,6 +47,8 @@
 #include <webkit/webkitwebview.h>
 #include <wtf/ASCIICType.h>
 #include <wtf/Platform.h>
+#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 extern "C" {
@@ -220,7 +221,7 @@ static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef functio
     WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
     GtkMenu* gtkMenu = webkit_web_view_get_context_menu(view);
     if (gtkMenu) {
-        GOwnPtr<GList> items(gtk_container_get_children(GTK_CONTAINER(gtkMenu)));
+        GUniquePtr<GList> items(gtk_container_get_children(GTK_CONTAINER(gtkMenu)));
         JSValueRef arrayValues[g_list_length(items.get())];
         int index = 0;
         for (GList* item = g_list_first(items.get()); item; item = g_list_next(item)) {
@@ -542,9 +543,9 @@ static JSValueRef beginDragWithFilesCallback(JSContextRef context, JSObjectRef f
     // If this is an HTTP test, we still need to pass a local file path
     // to WebCore. Even though the file doesn't exist, this should be fine
     // for most tests.
-    GOwnPtr<gchar> scheme(g_file_get_uri_scheme(parentDirectory.get()));
+    GUniquePtr<gchar> scheme(g_file_get_uri_scheme(parentDirectory.get()));
     if (g_str_equal(scheme.get(), "http") || g_str_equal(scheme.get(), "https")) {
-        GOwnPtr<gchar> currentDirectory(g_get_current_dir());
+        GUniquePtr<gchar> currentDirectory(g_get_current_dir());
         parentDirectory = adoptGRef(g_file_new_for_path(currentDirectory.get()));
     }
 
@@ -557,7 +558,7 @@ static JSValueRef beginDragWithFilesCallback(JSContextRef context, JSObjectRef f
         JSStringRef filenameString = JSValueToStringCopy(context,
                                                          JSObjectGetPropertyAtIndex(context, filesArray, i, 0), 0);
         size_t bufferSize = JSStringGetMaximumUTF8CStringSize(filenameString);
-        GOwnPtr<gchar> filenameBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+        GUniquePtr<gchar> filenameBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
         JSStringGetUTF8CString(filenameString, filenameBuffer.get(), bufferSize);
         JSStringRelease(filenameString);
 
index ea57d23..a7c397e 100644 (file)
@@ -47,7 +47,7 @@
 #include <glib.h>
 #include <libsoup/soup.h>
 #include <webkit/webkit.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/WTFString.h>
 
 extern "C" {
@@ -132,19 +132,19 @@ void TestRunner::notifyDone()
 
 JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url)
 {
-    GOwnPtr<char> urlCString(JSStringCopyUTF8CString(url));
+    GUniquePtr<char> urlCString(JSStringCopyUTF8CString(url));
     if (!g_str_has_prefix(urlCString.get(), "file:///tmp/LayoutTests/"))
         return JSStringRetain(url);
 
     const char* layoutTestsSuffix = urlCString.get() + strlen("file:///tmp/");
-    GOwnPtr<char> testPath(g_build_filename(getTopLevelPath().data(), layoutTestsSuffix, NULL));
-    GOwnPtr<char> testURI(g_filename_to_uri(testPath.get(), 0, 0));
+    GUniquePtr<char> testPath(g_build_filename(getTopLevelPath().data(), layoutTestsSuffix, nullptr));
+    GUniquePtr<char> testURI(g_filename_to_uri(testPath.get(), 0, 0));
     return JSStringCreateWithUTF8CString(testURI.get());
 }
 
 void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
 {
-    GOwnPtr<gchar> relativeURL(JSStringCopyUTF8CString(url));
+    GUniquePtr<gchar> relativeURL(JSStringCopyUTF8CString(url));
     SoupURI* baseURI = soup_uri_new(webkit_web_frame_get_uri(mainFrame));
     SoupURI* absoluteURI = soup_uri_new_with_base(baseURI, relativeURL.get());
     soup_uri_free(baseURI);
@@ -219,9 +219,9 @@ void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStrin
 
 void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
 {
-    GOwnPtr<gchar> sourceOriginGChar(JSStringCopyUTF8CString(sourceOrigin));
-    GOwnPtr<gchar> protocolGChar(JSStringCopyUTF8CString(protocol));
-    GOwnPtr<gchar> hostGChar(JSStringCopyUTF8CString(host));
+    GUniquePtr<gchar> sourceOriginGChar(JSStringCopyUTF8CString(sourceOrigin));
+    GUniquePtr<gchar> protocolGChar(JSStringCopyUTF8CString(protocol));
+    GUniquePtr<gchar> hostGChar(JSStringCopyUTF8CString(host));
     DumpRenderTreeSupportGtk::removeWhiteListAccessFromOrigin(sourceOriginGChar.get(), protocolGChar.get(), hostGChar.get(), includeSubdomains);
 }
 
@@ -403,7 +403,7 @@ void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message)
         view = webkit_web_frame_get_web_view(mainFrame);
     ASSERT(view);
 
-    GOwnPtr<gchar> cMessage(JSStringCopyUTF8CString(message));
+    GUniquePtr<gchar> cMessage(JSStringCopyUTF8CString(message));
     DumpRenderTreeSupportGtk::setMockGeolocationPositionUnavailableError(view, cMessage.get());
 }
 
@@ -450,7 +450,7 @@ void TestRunner::setIconDatabaseEnabled(bool enabled)
 {
     WebKitIconDatabase* database = webkit_get_icon_database();
     if (enabled) {
-        GOwnPtr<gchar> iconDatabasePath(g_build_filename(g_get_tmp_dir(), "DumpRenderTree", "icondatabase", NULL));
+        GUniquePtr<gchar> iconDatabasePath(g_build_filename(g_get_tmp_dir(), "DumpRenderTree", "icondatabase", nullptr));
         webkit_icon_database_set_path(database, iconDatabasePath.get());
     } else
         webkit_icon_database_set_path(database, 0);
@@ -498,7 +498,7 @@ bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRe
     if (!JSValueIsNumber(context, lengthValue))
         return false;
 
-    GOwnPtr<gchar> targetString(JSStringCopyUTF8CString(target));
+    GUniquePtr<gchar> targetString(JSStringCopyUTF8CString(target));
 
     size_t length = static_cast<size_t>(JSValueToNumber(context, lengthValue, 0));
     for (size_t i = 0; i < length; ++i) {
@@ -631,7 +631,7 @@ void TestRunner::syncLocalStorage()
 
 void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
 {
-    GOwnPtr<gchar> urlScheme(JSStringCopyUTF8CString(scheme));
+    GUniquePtr<gchar> urlScheme(JSStringCopyUTF8CString(scheme));
     DumpRenderTreeSupportGtk::setDomainRelaxationForbiddenForURLScheme(forbidden, urlScheme.get());
 }
 
@@ -659,8 +659,8 @@ static gboolean booleanFromValue(gchar* value)
 
 void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
 {
-    GOwnPtr<gchar> originalName(JSStringCopyUTF8CString(key));
-    GOwnPtr<gchar> valueAsString(JSStringCopyUTF8CString(value));
+    GUniquePtr<gchar> originalName(JSStringCopyUTF8CString(key));
+    GUniquePtr<gchar> valueAsString(JSStringCopyUTF8CString(value));
 
     WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
     ASSERT(view);
@@ -734,13 +734,13 @@ void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
 
 void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
 {
-    GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
+    GUniquePtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
     DumpRenderTreeSupportGtk::addUserScript(mainFrame, sourceCode.get(), runAtStart, allFrames);
 }
 
 void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
 {
-    GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
+    GUniquePtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
     DumpRenderTreeSupportGtk::addUserStyleSheet(mainFrame, sourceCode.get(), allFrames);
     // FIXME: needs more investigation why userscripts/user-style-top-frame-only.html fails when allFrames is false.
 
@@ -829,7 +829,7 @@ void TestRunner::setSerializeHTTPLoads(bool serialize)
 
 void TestRunner::setTextDirection(JSStringRef direction)
 {
-    GOwnPtr<gchar> writingDirection(JSStringCopyUTF8CString(direction));
+    GUniquePtr<gchar> writingDirection(JSStringCopyUTF8CString(direction));
 
     WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
     ASSERT(view);
index eed3bbe..aee5597 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "DumpRenderTree.h"
 #include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
-#include <GOwnPtrGtk.h>
+#include <GUniquePtrGtk.h>
 #include <JavaScriptCore/JSObjectRef.h>
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <JavaScriptCore/JSStringRef.h>
@@ -49,7 +49,7 @@ static JSValueRef setMarkedTextCallback(JSContextRef context, JSObjectRef functi
     ASSERT(!exception || !*exception);
 
     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(string);
-    GOwnPtr<gchar> stringBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    GUniquePtr<gchar> stringBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
     JSStringGetUTF8CString(string, stringBuffer.get(), bufferSize);
     JSStringRelease(string);
 
@@ -99,7 +99,7 @@ static JSValueRef insertTextCallback(JSContextRef context, JSObjectRef function,
     ASSERT(!exception || !*exception);
 
     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(string);
-    GOwnPtr<gchar> stringBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    GUniquePtr<gchar> stringBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
     JSStringGetUTF8CString(string, stringBuffer.get(), bufferSize);
     JSStringRelease(string);
 
@@ -173,7 +173,7 @@ static JSValueRef doCommandCallback(JSContextRef context, JSObjectRef function,
     ASSERT(!exception || !*exception);
 
     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(string);
-    GOwnPtr<gchar> stringBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    GUniquePtr<gchar> stringBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
     JSStringGetUTF8CString(string, stringBuffer.get(), bufferSize);
     JSStringRelease(string);
 
index 23eca7b..9546127 100644 (file)
@@ -25,7 +25,7 @@
 #include <JavaScriptCore/JSStringRef.h>
 #include <string.h>
 #include <webkit/webkit.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 // Returns a newly allocated UTF-8 character buffer which must be freed with g_free()
 gchar* JSStringCopyUTF8CString(JSStringRef jsString)
@@ -59,11 +59,11 @@ bool LoadItem::invoke() const
 
 bool LoadHTMLStringItem::invoke() const
 {
-    GOwnPtr<gchar> content(JSStringCopyUTF8CString(m_content.get()));
-    GOwnPtr<gchar> baseURL(JSStringCopyUTF8CString(m_baseURL.get()));
+    GUniquePtr<gchar> content(JSStringCopyUTF8CString(m_content.get()));
+    GUniquePtr<gchar> baseURL(JSStringCopyUTF8CString(m_baseURL.get()));
 
     if (m_unreachableURL) {
-        GOwnPtr<gchar> unreachableURL(JSStringCopyUTF8CString(m_unreachableURL.get()));
+        GUniquePtr<gchar> unreachableURL(JSStringCopyUTF8CString(m_unreachableURL.get()));
         webkit_web_frame_load_alternate_string(mainFrame, content.get(), baseURL.get(), unreachableURL.get());
         return true;
     }
index 916a939..190b1fe 100644 (file)
@@ -33,7 +33,6 @@ set(webkit2_api_harness_SOURCES
     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
     ${TESTWEBKITAPI_DIR}/gtk/PlatformWebViewGtk.cpp
     ${TESTWEBKITAPI_DIR}/gtk/PlatformWebViewGtk.cpp
-    ../../Source/WebCore/platform/gtk/GOwnPtrGtk.cpp
 )
 
 list(APPEND test_wtf_LIBRARIES
index e1754cf..d187c59 100644 (file)
@@ -22,7 +22,7 @@
 #include "WebProcessTest.h"
 #include <gio/gio.h>
 #include <webkit2/webkit-web-extension.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 class WebKitDOMNodeTest : public WebProcessTest {
 public:
@@ -185,7 +185,7 @@ private:
         for (unsigned i = 0; i < nodeCount; i++) {
             WebKitDOMNode* node = webkit_dom_node_list_item(list, i);
             g_assert(WEBKIT_DOM_IS_NODE(node));
-            GOwnPtr<char> tagName(webkit_dom_node_get_node_name(node));
+            GUniquePtr<char> tagName(webkit_dom_node_get_node_name(node));
             g_assert_cmpstr(tagName.get(), ==, expectedTagNames[i]);
         }
 
index b479366..65c3d2d 100644 (file)
@@ -246,7 +246,7 @@ static void testBackForwardListNavigation(BackForwardListTest* test, gconstpoint
 static void testBackForwardListLimitAndCache(BackForwardListTest* test, gconstpointer)
 {
     for (int i = 0; i < kBackForwardListLimit; i++) {
-        GOwnPtr<char> path(g_strdup_printf("/Page%d", i));
+        GUniquePtr<char> path(g_strdup_printf("/Page%d", i));
         test->m_changedFlags = BackForwardListTest::CurrentItem | BackForwardListTest::AddedItem;
         test->loadURI(kServer->getURIForPath(path.get()).data());
         test->waitUntilLoadFinished();
@@ -254,9 +254,9 @@ static void testBackForwardListLimitAndCache(BackForwardListTest* test, gconstpo
 
     g_assert_cmpuint(webkit_back_forward_list_get_length(test->m_list), ==, kBackForwardListLimit);
     WebKitBackForwardListItem* itemPageFirst = webkit_back_forward_list_get_nth_item(test->m_list, -(kBackForwardListLimit - 1));
-    GOwnPtr<GList> removedItems(g_list_prepend(0, itemPageFirst));
+    GUniquePtr<GList> removedItems(g_list_prepend(0, itemPageFirst));
 
-    GOwnPtr<char> path(g_strdup_printf("/Page%d", kBackForwardListLimit));
+    GUniquePtr<char> path(g_strdup_printf("/Page%d", kBackForwardListLimit));
     test->m_changedFlags = BackForwardListTest::CurrentItem | BackForwardListTest::AddedItem | BackForwardListTest::RemovedItems;
     test->loadURI(kServer->getURIForPath(path.get()).data());
     test->waitUntilLoadFinishedAndCheckRemovedItems(removedItems.get());
index a2329b9..a91e787 100644 (file)
@@ -76,7 +76,7 @@ public:
 
     GtkMenu* getPopupMenu()
     {
-        GOwnPtr<GList> toplevels(gtk_window_list_toplevels());
+        GUniquePtr<GList> toplevels(gtk_window_list_toplevels());
         for (GList* iter = toplevels.get(); iter; iter = g_list_next(iter)) {
             if (!GTK_IS_WINDOW(iter->data))
                 continue;
@@ -432,7 +432,7 @@ public:
 
     GtkMenuItem* getMenuItem(GtkMenu* menu, const gchar* itemLabel)
     {
-        GOwnPtr<GList> items(gtk_container_get_children(GTK_CONTAINER(menu)));
+        GUniquePtr<GList> items(gtk_container_get_children(GTK_CONTAINER(menu)));
         for (GList* iter = items.get(); iter; iter = g_list_next(iter)) {
             GtkMenuItem* child = GTK_MENU_ITEM(iter->data);
             if (g_str_equal(itemLabel, gtk_menu_item_get_label(child)))
@@ -785,7 +785,7 @@ static void testContextMenuSmartSeparators(ContextMenuSmartSeparatorsTest* test,
     g_assert(menu);
 
     // Leading and trailing separators are not added to the context menu.
-    GOwnPtr<GList> menuItems(gtk_container_get_children(GTK_CONTAINER(menu)));
+    GUniquePtr<GList> menuItems(gtk_container_get_children(GTK_CONTAINER(menu)));
     g_assert_cmpuint(g_list_length(menuItems.get()), ==, 6);
     GtkWidget* item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 0));
     g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
@@ -803,7 +803,7 @@ static void testContextMenuSmartSeparators(ContextMenuSmartSeparatorsTest* test,
     // Hiding a menu item between two separators hides the following separator.
     GtkAction* action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(g_list_nth_data(menuItems.get(), 3)));
     gtk_action_set_visible(action, FALSE);
-    menuItems.set(gtk_container_get_children(GTK_CONTAINER(menu)));
+    menuItems.reset(gtk_container_get_children(GTK_CONTAINER(menu)));
     g_assert_cmpuint(g_list_length(menuItems.get()), ==, 6);
     item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 0));
     g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
@@ -836,7 +836,7 @@ static void testContextMenuSmartSeparators(ContextMenuSmartSeparatorsTest* test,
     // Trailing separators are hidden too.
     action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(g_list_nth_data(menuItems.get(), 5)));
     gtk_action_set_visible(action, FALSE);
-    menuItems.set(gtk_container_get_children(GTK_CONTAINER(menu)));
+    menuItems.reset(gtk_container_get_children(GTK_CONTAINER(menu)));
     item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 0));
     g_assert(!GTK_IS_SEPARATOR_MENU_ITEM(item) && gtk_widget_get_visible(item));
     item = GTK_WIDGET(g_list_nth_data(menuItems.get(), 1));
index adc6b5b..bf351e1 100644 (file)
@@ -72,12 +72,12 @@ public:
         switch (storage) {
         case WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT:
             if (!m_cookiesTextFile)
-                m_cookiesTextFile.set(g_build_filename(kTempDirectory, "cookies.txt", NULL));
+                m_cookiesTextFile.reset(g_build_filename(kTempDirectory, "cookies.txt", NULL));
             filename = m_cookiesTextFile.get();
             break;
         case WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE:
             if (!m_cookiesSQLiteFile)
-                m_cookiesSQLiteFile.set(g_build_filename(kTempDirectory, "cookies.db", NULL));
+                m_cookiesSQLiteFile.reset(g_build_filename(kTempDirectory, "cookies.db", NULL));
             filename = m_cookiesSQLiteFile.get();
             break;
         default:
@@ -166,8 +166,8 @@ public:
     char** m_domains;
     bool m_cookiesChanged;
     bool m_finishLoopWhenCookiesChange;
-    GOwnPtr<char> m_cookiesTextFile;
-    GOwnPtr<char> m_cookiesSQLiteFile;
+    GUniquePtr<char> m_cookiesTextFile;
+    GUniquePtr<char> m_cookiesSQLiteFile;
 };
 
 static void testCookieManagerAcceptPolicy(CookieManagerTest* test, gconstpointer)
index b7ca73a..a4d27a5 100644 (file)
@@ -27,8 +27,8 @@
 #include <string.h>
 #include <webkit2/webkit2.h>
 #include <wtf/Vector.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 static char* kTempDirectory;
@@ -144,8 +144,8 @@ public:
 
     virtual void decideDestination(WebKitDownload* download, const gchar* suggestedFilename)
     {
-        GOwnPtr<char> destination(g_build_filename(kTempDirectory, suggestedFilename, NULL));
-        GOwnPtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
+        GUniquePtr<char> destination(g_build_filename(kTempDirectory, suggestedFilename, NULL));
+        GUniquePtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
         webkit_download_set_destination(download, destinationURI.get());
     }
 
@@ -168,7 +168,7 @@ public:
         if (!webkit_download_get_destination(download))
             return;
         GRefPtr<GFile> destFile = adoptGRef(g_file_new_for_uri(webkit_download_get_destination(download)));
-        GOwnPtr<char> destBasename(g_file_get_basename(destFile.get()));
+        GUniquePtr<char> destBasename(g_file_get_basename(destFile.get()));
         g_assert_cmpstr(destBasename.get(), ==, expectedName);
 
         g_file_delete(destFile.get(), 0, 0);
@@ -182,10 +182,10 @@ public:
 
 static void testDownloadLocalFile(DownloadTest* test, gconstpointer)
 {
-    GOwnPtr<char> sourcePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), "test.pdf", NULL));
+    GUniquePtr<char> sourcePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), "test.pdf", NULL));
     GRefPtr<GFile> source = adoptGRef(g_file_new_for_path(sourcePath.get()));
     GRefPtr<GFileInfo> sourceInfo = adoptGRef(g_file_query_info(source.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE, static_cast<GFileQueryInfoFlags>(0), 0, 0));
-    GOwnPtr<char> sourceURI(g_file_get_uri(source.get()));
+    GUniquePtr<char> sourceURI(g_file_get_uri(source.get()));
     GRefPtr<WebKitDownload> download = adoptGRef(test->downloadURIAndWaitUntilFinishes(sourceURI.get()));
     g_assert(!webkit_download_get_web_view(download.get()));
 
@@ -262,9 +262,9 @@ static void testDownloadLocalFileError(DownloadErrorTest* test, gconstpointer)
     g_assert_cmpfloat(webkit_download_get_estimated_progress(download.get()), <, 1);
 
     test->m_expectedError = WEBKIT_DOWNLOAD_ERROR_DESTINATION;
-    GOwnPtr<char> path(g_build_filename(Test::getWebKit1TestResoucesDir().data(), "test.pdf", NULL));
+    GUniquePtr<char> path(g_build_filename(Test::getWebKit1TestResoucesDir().data(), "test.pdf", NULL));
     GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(path.get()));
-    GOwnPtr<char> uri(g_file_get_uri(file.get()));
+    GUniquePtr<char> uri(g_file_get_uri(file.get()));
     download = adoptGRef(test->downloadURIAndWaitUntilFinishes(uri.get()));
     g_assert(!webkit_download_get_web_view(download.get()));
 
@@ -296,7 +296,7 @@ static const char* kServerSuggestedFilename = "webkit-downloaded-file";
 
 static void addContentDispositionHTTPHeaderToResponse(SoupMessage* message)
 {
-    GOwnPtr<char> contentDisposition(g_strdup_printf("filename=%s", kServerSuggestedFilename));
+    GUniquePtr<char> contentDisposition(g_strdup_printf("filename=%s", kServerSuggestedFilename));
     soup_message_headers_append(message->response_headers, "Content-Disposition", contentDisposition.get());
 }
 
@@ -329,7 +329,7 @@ static void serverCallback(SoupServer* server, SoupMessage* message, const char*
         return;
     }
 
-    GOwnPtr<char> filePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), path, NULL));
+    GUniquePtr<char> filePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), path, NULL));
     char* contents;
     gsize contentsLength;
     if (!g_file_get_contents(filePath.get(), &contents, &contentsLength, 0)) {
@@ -409,7 +409,7 @@ static void testDownloadRemoteFileError(DownloadErrorTest* test, gconstpointer)
     events.clear();
     g_assert_cmpfloat(webkit_download_get_estimated_progress(download.get()), <, 1);
     // Check the intermediate file is deleted when the download is cancelled.
-    GOwnPtr<char> intermediateURI(g_strdup_printf("%s.wkdownload", webkit_download_get_destination(download.get())));
+    GUniquePtr<char> intermediateURI(g_strdup_printf("%s.wkdownload", webkit_download_get_destination(download.get())));
     GRefPtr<GFile> intermediateFile = adoptGRef(g_file_new_for_uri(intermediateURI.get()));
     g_assert(!g_file_query_exists(intermediateFile.get(), nullptr));
 }
@@ -444,8 +444,8 @@ public:
 
     static gboolean downloadDecideDestinationCallback(WebKitDownload* download, const gchar* suggestedFilename, WebViewDownloadTest* test)
     {
-        GOwnPtr<char> destination(g_build_filename(kTempDirectory, suggestedFilename, NULL));
-        GOwnPtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
+        GUniquePtr<char> destination(g_build_filename(kTempDirectory, suggestedFilename, NULL));
+        GUniquePtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
         webkit_download_set_destination(download, destinationURI.get());
         return TRUE;
     }
index fbb62ce..a687826 100644 (file)
@@ -79,7 +79,7 @@ static void startTestServerMonitor()
 static void startTestServer()
 {
     // Prepare argv[] for spawning the server process.
-    GOwnPtr<char> testServerPath(g_build_filename(WEBKIT_EXEC_PATH, "TestWebKitAPI", "WebKit2Gtk", gTestServerAppName, NULL));
+    GUniquePtr<char> testServerPath(g_build_filename(WEBKIT_EXEC_PATH, "TestWebKitAPI", "WebKit2Gtk", gTestServerAppName, NULL));
 
     // We install a handler to ensure that we kill the child process
     // if the parent dies because of whatever the reason is.
@@ -173,17 +173,17 @@ static void testInspectorServerPageList(InspectorServerTest* test, gconstpointer
     g_assert(!error.get());
     int pageId = WebViewTest::javascriptResultToNumber(javascriptResult);
 
-    GOwnPtr<char> valueString;
+    GUniquePtr<char> valueString;
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("pages[0].url;", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "http://127.0.0.1:2999/");
 
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("pages[0].inspectorUrl;", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     String validInspectorURL = String("/Main.html?page=") + String::number(pageId);
     ASSERT_CMP_CSTRING(valueString.get(), ==, validInspectorURL.utf8());
 }
@@ -241,7 +241,7 @@ static void openRemoteDebuggingSession(InspectorServerTest* test, gconstpointer)
     g_assert(javascriptResult);
     g_assert(!error.get());
 
-    GOwnPtr<char> title(WebViewTest::javascriptResultToCString(javascriptResult));
+    GUniquePtr<char> title(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(title.get(), ==, "http://127.0.0.1:2999/");
 }
 
index 0524072..99efa7c 100644 (file)
@@ -134,9 +134,9 @@ static void testPrintOperationPrint(PrintTest* test, gconstpointer)
         return;
     }
 
-    GOwnPtr<char> outputFilename(g_build_filename(kTempDirectory, "webkit-print.pdf", NULL));
+    GUniquePtr<char> outputFilename(g_build_filename(kTempDirectory, "webkit-print.pdf", NULL));
     GRefPtr<GFile> outputFile = adoptGRef(g_file_new_for_path(outputFilename.get()));
-    GOwnPtr<char> outputURI(g_file_get_uri(outputFile.get()));
+    GUniquePtr<char> outputURI(g_file_get_uri(outputFile.get()));
 
     GRefPtr<GtkPrintSettings> printSettings = adoptGRef(gtk_print_settings_new());
     gtk_print_settings_set_printer(printSettings.get(), gtk_printer_get_name(printer.get()));
@@ -247,9 +247,9 @@ public:
             return;
         }
 
-        GOwnPtr<char> outputFilename(g_build_filename(kTempDirectory, "webkit-close-after-print.pdf", NULL));
+        GUniquePtr<char> outputFilename(g_build_filename(kTempDirectory, "webkit-close-after-print.pdf", NULL));
         m_outputFile = adoptGRef(g_file_new_for_path(outputFilename.get()));
-        GOwnPtr<char> outputURI(g_file_get_uri(m_outputFile.get()));
+        GUniquePtr<char> outputURI(g_file_get_uri(m_outputFile.get()));
 
         GRefPtr<GtkPrintSettings> printSettings = adoptGRef(gtk_print_settings_new());
         gtk_print_settings_set_printer(printSettings.get(), gtk_printer_get_name(printer.get()));
index 0c21c71..3a459a0 100644 (file)
@@ -168,7 +168,7 @@ public:
         g_assert_cmpint(dataSize, >, 0);
 
         ResourcesTest* test = static_cast<ResourcesTest*>(userData);
-        test->m_resourceData.set(reinterpret_cast<char*>(data));
+        test->m_resourceData.reset(reinterpret_cast<char*>(data));
         test->m_resourceDataSize = dataSize;
         g_main_loop_quit(test->m_mainLoop);
     }
@@ -191,12 +191,12 @@ public:
             g_assert(!strncmp(m_resourceData.get(), kJavascript, m_resourceDataSize));
         } else
             g_assert_not_reached();
-        m_resourceData.clear();
+        m_resourceData.reset();
     }
 
     size_t m_resourcesLoaded;
     size_t m_resourcesToLoad;
-    GOwnPtr<char> m_resourceData;
+    GUniquePtr<char> m_resourceData;
     size_t m_resourceDataSize;
     GList* m_subresources;
 };
@@ -671,12 +671,12 @@ static void addCacheHTTPHeadersToResponse(SoupMessage* message)
 {
     // The actual date doesn't really matter.
     SoupDate* soupDate = soup_date_new_from_now(0);
-    GOwnPtr<char> date(soup_date_to_string(soupDate, SOUP_DATE_HTTP));
+    GUniquePtr<char> date(soup_date_to_string(soupDate, SOUP_DATE_HTTP));
     soup_message_headers_append(message->response_headers, "Last-Modified", date.get());
     soup_date_free(soupDate);
     soup_message_headers_append(message->response_headers, "Cache-control", "public, max-age=31536000");
     soupDate = soup_date_new_from_now(3600);
-    date.set(soup_date_to_string(soupDate, SOUP_DATE_HTTP));
+    date.reset(soup_date_to_string(soupDate, SOUP_DATE_HTTP));
     soup_message_headers_append(message->response_headers, "Expires", date.get());
     soup_date_free(soupDate);
 }
@@ -734,7 +734,7 @@ static void serverCallback(SoupServer* server, SoupMessage* message, const char*
         static const char* javascriptRelativeHTML = "<html><head><script language='javascript' src='/redirected-to-cancel.js'></script></head><body></body></html>";
         soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, javascriptRelativeHTML, strlen(javascriptRelativeHTML));
     } else if (g_str_equal(path, "/blank.ico")) {
-        GOwnPtr<char> filePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), path, NULL));
+        GUniquePtr<char> filePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), path, NULL));
         char* contents;
         gsize contentsLength;
         g_file_get_contents(filePath.get(), &contents, &contentsLength, 0);
index e3180c5..5c60da1 100644 (file)
@@ -161,7 +161,7 @@ public:
         if (m_certificateInfo)
             webkit_certificate_info_free(m_certificateInfo);
         m_certificateInfo = webkit_certificate_info_copy(info);
-        m_host.set(g_strdup(host));
+        m_host.reset(g_strdup(host));
         g_main_loop_quit(m_mainLoop);
     }
 
@@ -182,7 +182,7 @@ public:
 
 private:
     WebKitCertificateInfo* m_certificateInfo;
-    GOwnPtr<char> m_host;
+    GUniquePtr<char> m_host;
 };
 
 static void testLoadFailedWithTLSErrors(TLSErrorsTest* test, gconstpointer)
@@ -225,7 +225,7 @@ static void httpsServerCallback(SoupServer* server, SoupMessage* message, const
         soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, indexHTML, strlen(indexHTML));
         soup_message_body_complete(message->response_body);
     } else if (g_str_equal(path, "/insecure-content/")) {
-        GOwnPtr<char> responseHTML(g_strdup_printf(insecureContentHTML, kHttpServer->getURIForPath("/test-script").data(), kHttpServer->getURIForPath("/test-image").data()));
+        GUniquePtr<char> responseHTML(g_strdup_printf(insecureContentHTML, kHttpServer->getURIForPath("/test-script").data(), kHttpServer->getURIForPath("/test-image").data()));
         soup_message_body_append(message->response_body, SOUP_MEMORY_COPY, responseHTML.get(), strlen(responseHTML.get()));
         soup_message_set_status(message, SOUP_STATUS_OK);
         soup_message_body_complete(message->response_body);
@@ -245,7 +245,7 @@ static void httpServerCallback(SoupServer* server, SoupMessage* message, const c
     }
 
     if (g_str_equal(path, "/test-script")) {
-        GOwnPtr<char> pathToFile(g_build_filename(Test::getResourcesDir().data(), "link-title.js", NULL));
+        GUniquePtr<char> pathToFile(g_build_filename(Test::getResourcesDir().data(), "link-title.js", NULL));
         char* contents;
         gsize length;
         g_file_get_contents(pathToFile.get(), &contents, &length, 0);
@@ -254,7 +254,7 @@ static void httpServerCallback(SoupServer* server, SoupMessage* message, const c
         soup_message_set_status(message, SOUP_STATUS_OK);
         soup_message_body_complete(message->response_body);
     } else if (g_str_equal(path, "/test-image")) {
-        GOwnPtr<char> pathToFile(g_build_filename(Test::getWebKit1TestResoucesDir().data(), "blank.ico", NULL));
+        GUniquePtr<char> pathToFile(g_build_filename(Test::getWebKit1TestResoucesDir().data(), "blank.ico", NULL));
         char* contents;
         gsize length;
         g_file_get_contents(pathToFile.get(), &contents, &length, 0);
index bc30d6d..d24edc6 100644 (file)
@@ -377,20 +377,20 @@ static void testWebViewJavaScriptDialogs(UIClientTest* test, gconstpointer)
     static const char* jsPromptFormat = "alert(prompt('%s', 'default'));";
 
     test->m_scriptDialogType = WEBKIT_SCRIPT_DIALOG_ALERT;
-    GOwnPtr<char> alertDialogMessage(g_strdup_printf(jsAlertFormat, kAlertDialogMessage));
-    GOwnPtr<char> alertHTML(g_strdup_printf(htmlOnLoadFormat, alertDialogMessage.get()));
+    GUniquePtr<char> alertDialogMessage(g_strdup_printf(jsAlertFormat, kAlertDialogMessage));
+    GUniquePtr<char> alertHTML(g_strdup_printf(htmlOnLoadFormat, alertDialogMessage.get()));
     test->loadHtml(alertHTML.get(), 0);
     test->waitUntilMainLoopFinishes();
 
     test->m_scriptDialogType = WEBKIT_SCRIPT_DIALOG_CONFIRM;
-    GOwnPtr<char> confirmDialogMessage(g_strdup_printf(jsConfirmFormat, kConfirmDialogMessage));
-    GOwnPtr<char> confirmHTML(g_strdup_printf(htmlOnLoadFormat, confirmDialogMessage.get()));
+    GUniquePtr<char> confirmDialogMessage(g_strdup_printf(jsConfirmFormat, kConfirmDialogMessage));
+    GUniquePtr<char> confirmHTML(g_strdup_printf(htmlOnLoadFormat, confirmDialogMessage.get()));
     test->loadHtml(confirmHTML.get(), 0);
     test->waitUntilMainLoopFinishes();
 
     test->m_scriptDialogType = WEBKIT_SCRIPT_DIALOG_PROMPT;
-    GOwnPtr<char> promptDialogMessage(g_strdup_printf(jsPromptFormat, kPromptDialogMessage));
-    GOwnPtr<char> promptHTML(g_strdup_printf(htmlOnLoadFormat, promptDialogMessage.get()));
+    GUniquePtr<char> promptDialogMessage(g_strdup_printf(jsPromptFormat, kPromptDialogMessage));
+    GUniquePtr<char> promptHTML(g_strdup_printf(htmlOnLoadFormat, promptDialogMessage.get()));
     test->loadHtml(promptHTML.get(), 0);
     test->waitUntilMainLoopFinishes();
 }
@@ -401,7 +401,7 @@ static void testWebViewWindowProperties(UIClientTest* test, gconstpointer)
     GdkRectangle geometry = { 100, 150, 400, 400 };
     test->setExpectedWindowProperties(UIClientTest::WindowProperties(&geometry, false, false, false, false, false, true, false));
 
-    GOwnPtr<char> htmlString(g_strdup_printf("<html><body onLoad=\"window.open('', '', '%s').close();\"></body></html>", windowProrpertiesString));
+    GUniquePtr<char> htmlString(g_strdup_printf("<html><body onLoad=\"window.open('', '', '%s').close();\"></body></html>", windowProrpertiesString));
     test->loadHtml(htmlString.get(), 0);
     test->waitUntilMainLoopFinishes();
 
@@ -586,7 +586,7 @@ static void testWebViewFileChooserRequest(FileChooserTest* test, gconstpointer)
     static const char* fileChooserHTMLFormat = "<html><body><input style='position:absolute;left:0;top:0;margin:0;padding:0' type='file' %s/></body></html>";
 
     // Multiple selections not allowed, no MIME filtering.
-    GOwnPtr<char> simpleFileUploadHTML(g_strdup_printf(fileChooserHTMLFormat, ""));
+    GUniquePtr<char> simpleFileUploadHTML(g_strdup_printf(fileChooserHTMLFormat, ""));
     test->loadHtml(simpleFileUploadHTML.get(), 0);
     test->waitUntilLoadFinished();
     WebKitFileChooserRequest* fileChooserRequest = test->clickMouseButtonAndWaitForFileChooserRequest(5, 5);
@@ -601,7 +601,7 @@ static void testWebViewFileChooserRequest(FileChooserTest* test, gconstpointer)
     webkit_file_chooser_request_cancel(fileChooserRequest);
 
     // Multiple selections allowed, no MIME filtering, some pre-selected files.
-    GOwnPtr<char> multipleSelectionFileUploadHTML(g_strdup_printf(fileChooserHTMLFormat, "multiple"));
+    GUniquePtr<char> multipleSelectionFileUploadHTML(g_strdup_printf(fileChooserHTMLFormat, "multiple"));
     test->loadHtml(multipleSelectionFileUploadHTML.get(), 0);
     test->waitUntilLoadFinished();
     fileChooserRequest = test->clickMouseButtonAndWaitForFileChooserRequest(5, 5);
@@ -638,7 +638,7 @@ static void testWebViewFileChooserRequest(FileChooserTest* test, gconstpointer)
     webkit_file_chooser_request_cancel(fileChooserRequest);
 
     // Multiple selections not allowed, only accept images, audio and video files..
-    GOwnPtr<char> mimeFilteredFileUploadHTML(g_strdup_printf(fileChooserHTMLFormat, "accept='audio/*,video/*,image/*'"));
+    GUniquePtr<char> mimeFilteredFileUploadHTML(g_strdup_printf(fileChooserHTMLFormat, "accept='audio/*,video/*,image/*'"));
     test->loadHtml(mimeFilteredFileUploadHTML.get(), 0);
     test->waitUntilLoadFinished();
     fileChooserRequest = test->clickMouseButtonAndWaitForFileChooserRequest(5, 5);
index e9ef192..9a10e37 100644 (file)
@@ -110,7 +110,7 @@ static void testWebExtensionWindowObjectCleared(WebViewTest* test, gconstpointer
     WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.echo('Foo');", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    GOwnPtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
+    GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "Foo");
 }
 
@@ -147,7 +147,7 @@ static void testWebExtensionIsolatedWorld(WebViewTest* test, gconstpointer)
 
     WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementById('console').innerHTML", 0);
     g_assert(javascriptResult);
-    GOwnPtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
+    GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "Foo");
 
     static const char* isolatedWorldScript =
@@ -170,7 +170,7 @@ static void testWebExtensionIsolatedWorld(WebViewTest* test, gconstpointer)
     // Check that 'top.foo' defined in main world is not visible in isolated world.
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementById('console').innerHTML", 0);
     g_assert(javascriptResult);
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "undefined");
 
     g_signal_handler_disconnect(test->m_webView, scriptDialogID);
index 047cc31..a5d8df9 100644 (file)
@@ -33,8 +33,8 @@ extern "C" {
 #include <signal.h>
 #include <unistd.h>
 #include <wtf/PassRefPtr.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 // Name of the test server application creating the webView object.
 static const char* kTestServerAppName = "AccessibilityTestServer";
@@ -87,7 +87,7 @@ static void startTestServerMonitor()
 static void startTestServer()
 {
     // Prepare argv[] for spawning the server process.
-    GOwnPtr<char> testServerPath(g_build_filename(WEBKIT_EXEC_PATH, "TestWebKitAPI", "WebKit2Gtk", kTestServerAppName, NULL));
+    GUniquePtr<char> testServerPath(g_build_filename(WEBKIT_EXEC_PATH, "TestWebKitAPI", "WebKit2Gtk", kTestServerAppName, nullptr));
 
     char* testServerArgv[2];
     testServerArgv[0] = testServerPath.get();
@@ -125,7 +125,7 @@ static void checkAtspiAccessible(AtspiAccessible* accessible, const char* target
 {
     g_assert(ATSPI_IS_ACCESSIBLE(accessible));
 
-    GOwnPtr<char> name(atspi_accessible_get_name(accessible, 0));
+    GUniquePtr<char> name(atspi_accessible_get_name(accessible, 0));
     g_assert_cmpstr(targetName, ==, name.get());
     g_assert_cmpint(targetRole, ==, atspi_accessible_get_role(accessible, 0));
 }
index 1a06f74..95b5c01 100644 (file)
@@ -24,6 +24,7 @@
 #include <glib/gstdio.h>
 #include <libsoup/soup.h>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 static WebKitTestServer* kServer;
 static char* kTempDirectory;
@@ -118,7 +119,7 @@ serverCallback(SoupServer* server, SoupMessage* message, const char* path, GHash
     char* contents;
     gsize length;
     if (g_str_equal(path, "/icon/favicon.ico")) {
-        GOwnPtr<char> pathToFavicon(g_build_filename(Test::getWebKit1TestResoucesDir().data(), "blank.ico", NULL));
+        GUniquePtr<char> pathToFavicon(g_build_filename(Test::getWebKit1TestResoucesDir().data(), "blank.ico", NULL));
         g_file_get_contents(pathToFavicon.get(), &contents, &length, 0);
         soup_message_body_append(message->response_body, SOUP_MEMORY_TAKE, contents, length);
     } else if (g_str_equal(path, "/nofavicon")) {
@@ -153,7 +154,7 @@ static void testClearDatabase(FaviconDatabaseTest* test)
     WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(test->m_webContext);
     webkit_favicon_database_clear(database);
 
-    GOwnPtr<char> iconURI(webkit_favicon_database_get_favicon_uri(database, kServer->getURIForPath("/foo").data()));
+    GUniquePtr<char> iconURI(webkit_favicon_database_get_favicon_uri(database, kServer->getURIForPath("/foo").data()));
     g_assert(!iconURI);
 }
 
@@ -203,7 +204,7 @@ static void testGetFaviconURI(FaviconDatabaseTest* test)
     WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(test->m_webContext);
 
     CString baseURI = kServer->getURIForPath("/foo");
-    GOwnPtr<char> iconURI(webkit_favicon_database_get_favicon_uri(database, baseURI.data()));
+    GUniquePtr<char> iconURI(webkit_favicon_database_get_favicon_uri(database, baseURI.data()));
     ASSERT_CMP_CSTRING(iconURI.get(), ==, kServer->getURIForPath("/icon/favicon.ico"));
 }
 
@@ -257,7 +258,7 @@ static void webkitFaviconDatabaseFinalizedCallback(gpointer, GObject*)
     if (!g_file_test(kTempDirectory, G_FILE_TEST_IS_DIR))
         return;
 
-    GOwnPtr<char> filename(g_build_filename(kTempDirectory, "WebpageIcons.db", NULL));
+    GUniquePtr<char> filename(g_build_filename(kTempDirectory, "WebpageIcons.db", nullptr));
     g_unlink(filename.get());
 
     g_rmdir(kTempDirectory);
index a414853..319eec4 100644 (file)
@@ -24,8 +24,8 @@
 #include <gtk/gtk.h>
 #include <webkit2/webkit2.h>
 #include <wtf/HashMap.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/StringHash.h>
 
 static WebKitTestServer* kServer;
@@ -89,7 +89,7 @@ static void testWebContextGetPlugins(PluginsTest* test, gconstpointer)
     }
     g_assert(WEBKIT_IS_PLUGIN(testPlugin.get()));
 
-    GOwnPtr<char> pluginPath(g_build_filename(WEBKIT_TEST_PLUGIN_DIR, "libTestNetscapePlugin.so", NULL));
+    GUniquePtr<char> pluginPath(g_build_filename(WEBKIT_TEST_PLUGIN_DIR, "libTestNetscapePlugin.so", nullptr));
     g_assert_cmpstr(webkit_plugin_get_path(testPlugin.get()), ==, pluginPath.get());
     g_assert_cmpstr(webkit_plugin_get_description(testPlugin.get()), ==, "Simple Netscape┬« plug-in that handles test content for WebKit");
     GList* mimeInfoList = webkit_plugin_get_mime_info_list(testPlugin.get());
@@ -156,7 +156,7 @@ public:
         g_assert(test->m_handlersMap.contains(String::fromUTF8(scheme)));
 
         if (!g_strcmp0(scheme, "error")) {
-            GOwnPtr<GError> error(g_error_new_literal(g_quark_from_string(errorDomain), errorCode, errorMessage));
+            GUniquePtr<GError> error(g_error_new_literal(g_quark_from_string(errorDomain), errorCode, errorMessage));
             webkit_uri_scheme_request_finish_error(request, error.get());
             return;
         }
@@ -197,7 +197,7 @@ static void testWebContextURIScheme(URISchemeTest* test, gconstpointer)
     test->registerURISchemeHandler("echo", kEchoHTMLFormat, -1, "text/html");
     test->loadURI("echo:hello world");
     test->waitUntilLoadFinished();
-    GOwnPtr<char> echoHTML(g_strdup_printf(kEchoHTMLFormat, webkit_uri_scheme_request_get_path(test->m_uriSchemeRequest.get())));
+    GUniquePtr<char> echoHTML(g_strdup_printf(kEchoHTMLFormat, webkit_uri_scheme_request_get_path(test->m_uriSchemeRequest.get())));
     mainResourceDataSize = 0;
     mainResourceData = test->mainResourceData(mainResourceDataSize);
     g_assert_cmpint(mainResourceDataSize, ==, strlen(echoHTML.get()));
index a49b376..7342b60 100644 (file)
@@ -90,19 +90,19 @@ static void testWebViewRunJavaScript(WebViewTest* test, gconstpointer)
     WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.getElementById('WebKitLink').title;", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    GOwnPtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
+    GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "WebKitGTK+ Title");
 
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.getElementById('WebKitLink').href;", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "http://www.webkitgtk.org/");
 
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.getElementById('WebKitLink').textContent", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "WebKitGTK+ Website");
 
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("a = 25;", &error.outPtr());
@@ -138,7 +138,7 @@ static void testWebViewRunJavaScript(WebViewTest* test, gconstpointer)
     javascriptResult = test->runJavaScriptFromGResourceAndWaitUntilFinished("/org/webkit/webkit2gtk/tests/link-title.js", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "WebKitGTK+ Title");
 
     javascriptResult = test->runJavaScriptFromGResourceAndWaitUntilFinished("/wrong/path/to/resource.js", &error.outPtr());
@@ -371,14 +371,14 @@ public:
 
     void saveAndWaitForFile()
     {
-        m_saveDestinationFilePath.set(g_build_filename(m_tempDirectory.get(), "testWebViewSaveResult.mht", NULL));
+        m_saveDestinationFilePath.reset(g_build_filename(m_tempDirectory.get(), "testWebViewSaveResult.mht", NULL));
         m_file = adoptGRef(g_file_new_for_path(m_saveDestinationFilePath.get()));
         webkit_web_view_save_to_file(m_webView, m_file.get(), WEBKIT_SAVE_MODE_MHTML, 0, reinterpret_cast<GAsyncReadyCallback>(webViewSavedToFileCallback), this);
         g_main_loop_run(m_mainLoop);
     }
 
-    GOwnPtr<char> m_tempDirectory;
-    GOwnPtr<char> m_saveDestinationFilePath;
+    GUniquePtr<char> m_tempDirectory;
+    GUniquePtr<char> m_saveDestinationFilePath;
     GRefPtr<GInputStream> m_inputStream;
     GRefPtr<GFile> m_file;
 };
@@ -428,7 +428,7 @@ static void testWebViewMode(WebViewTest* test, gconstpointer)
     test->loadHtml(indexHTML, 0);
     test->waitUntilLoadFinished();
     WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.body.textContent;", 0);
-    GOwnPtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
+    GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "Test Web View Mode");
 
     // Source mode.
@@ -436,7 +436,7 @@ static void testWebViewMode(WebViewTest* test, gconstpointer)
     test->loadHtml(indexHTML, 0);
     test->waitUntilLoadFinished();
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.body.textContent;", 0);
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, indexHTML);
 }
 
@@ -462,7 +462,7 @@ static void testWebViewPageVisibility(WebViewTest* test, gconstpointer)
     WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.visibilityState;", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    GOwnPtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
+    GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "hidden");
 
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.hidden;", &error.outPtr());
@@ -477,7 +477,7 @@ static void testWebViewPageVisibility(WebViewTest* test, gconstpointer)
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.visibilityState;", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "visible");
 
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.hidden;", &error.outPtr());
@@ -492,7 +492,7 @@ static void testWebViewPageVisibility(WebViewTest* test, gconstpointer)
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.visibilityState;", &error.outPtr());
     g_assert(javascriptResult);
     g_assert(!error.get());
-    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
+    valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult));
     g_assert_cmpstr(valueString.get(), ==, "hidden");
 
     javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.hidden;", &error.outPtr());
index 401655f..74008eb 100644 (file)
@@ -108,7 +108,7 @@ static bool isStyleSheetInjectedForURLAtPath(WebViewTest* test, const char* path
     g_assert(javascriptResult);
     g_assert(!error.get());
 
-    GOwnPtr<char> resultString(WebViewTest::javascriptResultToCString(javascriptResult));
+    GUniquePtr<char> resultString(WebViewTest::javascriptResultToCString(javascriptResult));
     return !g_strcmp0(resultString.get(), kStyleSheetTestScriptResult);
 }
 
index 1ea2acd..7f0a061 100644 (file)
@@ -101,7 +101,7 @@ static void testWebViewEditorCutCopyPasteNonEditable(EditorTest* test, gconstpoi
     g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE));
 
     test->copyClipboard();
-    GOwnPtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard));
+    GUniquePtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard));
     g_assert_cmpstr(clipboardText.get(), ==, "make Jack a dull");
 }
 
@@ -127,7 +127,7 @@ static void testWebViewEditorCutCopyPasteEditable(EditorTest* test, gconstpointe
     g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE));
 
     test->copyClipboard();
-    GOwnPtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard));
+    GUniquePtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard));
     g_assert_cmpstr(clipboardText.get(), ==, "All work and no play make Jack a dull boy.");
 }
 
@@ -147,14 +147,14 @@ static void testWebViewEditorSelectAllNonEditable(EditorTest* test, gconstpointe
     g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL));
 
     test->copyClipboard();
-    GOwnPtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard));
+    GUniquePtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard));
 
     // Initially only the subspan is selected.
     g_assert_cmpstr(clipboardText.get(), ==, "make Jack a dull");
 
     webkit_web_view_execute_editing_command(test->m_webView, WEBKIT_EDITING_COMMAND_SELECT_ALL);
     test->copyClipboard();
-    clipboardText.set(gtk_clipboard_wait_for_text(test->m_clipboard));
+    clipboardText.reset(gtk_clipboard_wait_for_text(test->m_clipboard));
 
     // The mainspan should be selected after calling SELECT_ALL.
     g_assert_cmpstr(clipboardText.get(), ==, "All work and no play make Jack a dull boy.");
@@ -176,14 +176,14 @@ static void testWebViewEditorSelectAllEditable(EditorTest* test, gconstpointer)
     g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL));
 
     test->copyClipboard();
-    GOwnPtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard));
+    GUniquePtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard));
 
     // Initially only the subspan is selected.
     g_assert_cmpstr(clipboardText.get(), ==, "make Jack a dull");
 
     webkit_web_view_execute_editing_command(test->m_webView, WEBKIT_EDITING_COMMAND_SELECT_ALL);
     test->copyClipboard();
-    clipboardText.set(gtk_clipboard_wait_for_text(test->m_clipboard));
+    clipboardText.reset(gtk_clipboard_wait_for_text(test->m_clipboard));
 
     // The mainspan should be selected after calling SELECT_ALL.
     g_assert_cmpstr(clipboardText.get(), ==, "All work and no play make Jack a dull boy.");
index e8a2b9f..2e8034f 100644 (file)
@@ -30,6 +30,7 @@
 #include <wtf/PassOwnPtr.h>
 #include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 static const char introspectionXML[] =
@@ -131,8 +132,8 @@ static gboolean sendRequestCallback(WebKitWebPage*, WebKitURIRequest* request, W
     g_assert(requestURI);
 
     if (const char* suffix = g_strrstr(requestURI, "/remove-this/javascript.js")) {
-        GOwnPtr<char> prefix(g_strndup(requestURI, strlen(requestURI) - strlen(suffix)));
-        GOwnPtr<char> newURI(g_strdup_printf("%s/javascript.js", prefix.get()));
+        GUniquePtr<char> prefix(g_strndup(requestURI, strlen(requestURI) - strlen(suffix)));
+        GUniquePtr<char> newURI(g_strdup_printf("%s/javascript.js", prefix.get()));
         webkit_uri_request_set_uri(request, newURI.get());
     } else if (g_str_has_suffix(requestURI, "/add-do-not-track-header")) {
         SoupMessageHeaders* headers = webkit_uri_request_get_http_headers(request);
@@ -199,7 +200,7 @@ static void methodCallCallback(GDBusConnection* connection, const char* sender,
             return;
 
         WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
-        GOwnPtr<char> title(webkit_dom_document_get_title(document));
+        GUniquePtr<char> title(webkit_dom_document_get_title(document));
         g_dbus_method_invocation_return_value(invocation, g_variant_new("(s)", title.get()));
     } else if (!g_strcmp0(methodName, "RunJavaScriptInIsolatedWorld")) {
         uint64_t pageID;
index 6fd05f5..ee65dca 100644 (file)
@@ -27,8 +27,8 @@
 #include "PlatformUtilities.h"
 
 #include <gtk/gtk.h>
-#include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 namespace TestWebKitAPI {
 namespace Util {
@@ -67,18 +67,18 @@ static char* getFilenameFromEnvironmentVariableAsUTF8(const char* variableName)
 
 WKStringRef createInjectedBundlePath()
 {
-    GOwnPtr<char> injectedBundlePath(getFilenameFromEnvironmentVariableAsUTF8("TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"));
-    GOwnPtr<char> injectedBundleFilename(g_build_filename(injectedBundlePath.get(), "libTestWebKitAPIInjectedBundle.la", NULL));
+    GUniquePtr<char> injectedBundlePath(getFilenameFromEnvironmentVariableAsUTF8("TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"));
+    GUniquePtr<char> injectedBundleFilename(g_build_filename(injectedBundlePath.get(), "libTestWebKitAPIInjectedBundle.la", nullptr));
     return WKStringCreateWithUTF8CString(injectedBundleFilename.get());
 }
 
 WKURLRef createURLForResource(const char* resource, const char* extension)
 {
-    GOwnPtr<char> testResourcesPath(getFilenameFromEnvironmentVariableAsUTF8("TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"));
-    GOwnPtr<char> resourceBasename(g_strdup_printf("%s.%s", resource, extension));
-    GOwnPtr<char> resourceFilename(g_build_filename(testResourcesPath.get(), resourceBasename.get(), NULL));
+    GUniquePtr<char> testResourcesPath(getFilenameFromEnvironmentVariableAsUTF8("TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"));
+    GUniquePtr<char> resourceBasename(g_strdup_printf("%s.%s", resource, extension));
+    GUniquePtr<char> resourceFilename(g_build_filename(testResourcesPath.get(), resourceBasename.get(), nullptr));
     GRefPtr<GFile> resourceFile = adoptGRef(g_file_new_for_path(resourceFilename.get()));
-    GOwnPtr<char> resourceURI(g_file_get_uri(resourceFile.get()));
+    GUniquePtr<char> resourceURI(g_file_get_uri(resourceFile.get()));
     return WKURLCreateWithUTF8CString(resourceURI.get());
 }
 
index ba6fab0..12eeed7 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "PlatformWebView.h"
 
-#include <WebCore/GOwnPtrGtk.h>
+#include <WebCore/GUniquePtrGtk.h>
 #include <gtk/gtk.h>
 #include <wtf/gobject/GOwnPtr.h>
 
@@ -58,7 +58,7 @@ void PlatformWebView::resizeTo(unsigned width, unsigned height)
 
 static void doKeyStroke(GtkWidget* viewWidget, unsigned int keyVal)
 {
-    GOwnPtr<GdkEvent> event(gdk_event_new(GDK_KEY_PRESS));
+    GUniquePtr<GdkEvent> event(gdk_event_new(GDK_KEY_PRESS));
     event->key.keyval = keyVal;
     event->key.time = GDK_CURRENT_TIME;
     event->key.state = 0;
@@ -95,7 +95,7 @@ void PlatformWebView::simulateAltKeyPress()
 
 static void doMouseButtonEvent(GtkWidget* viewWidget, GdkEventType eventType, int x, int y, unsigned int button)
 {
-    GOwnPtr<GdkEvent> event(gdk_event_new(eventType));
+    GUniquePtr<GdkEvent> event(gdk_event_new(eventType));
     event->button.x = x;
     event->button.y = y;
     event->button.button = button;
@@ -124,7 +124,7 @@ void PlatformWebView::simulateRightClick(unsigned x, unsigned y)
 
 void PlatformWebView::simulateMouseMove(unsigned x, unsigned y)
 {
-    GOwnPtr<GdkEvent> event(gdk_event_new(GDK_MOTION_NOTIFY));
+    GUniquePtr<GdkEvent> event(gdk_event_new(GDK_MOTION_NOTIFY));
     event->motion.x = x;
     event->motion.y = y;
     event->motion.time = GDK_CURRENT_TIME;
index df34204..211fa8b 100644 (file)
@@ -63,7 +63,7 @@ static void loadChangedCallback(WebKitWebView* webView, WebKitLoadEvent loadEven
 static void loadFailedCallback(WebKitWebView* webView, WebKitLoadEvent loadEvent, const char* failingURI, GError* error, LoadTrackingTest* test)
 {
     test->m_loadFailed = true;
-    test->m_error.set(g_error_copy(error));
+    test->m_error.reset(g_error_copy(error));
 
     switch (loadEvent) {
     case WEBKIT_LOAD_STARTED:
@@ -154,7 +154,7 @@ void LoadTrackingTest::loadURI(const char* uri)
 {
     m_loadEvents.clear();
     m_estimatedProgress = 0;
-    m_error.clear();
+    m_error.reset();
     WebViewTest::loadURI(uri);
 }
 
@@ -162,7 +162,7 @@ void LoadTrackingTest::loadHtml(const char* html, const char* baseURI)
 {
     m_loadEvents.clear();
     m_estimatedProgress = 0;
-    m_error.clear();
+    m_error.reset();
     WebViewTest::loadHtml(html, baseURI);
 }
 
@@ -170,7 +170,7 @@ void LoadTrackingTest::loadPlainText(const char* plainText)
 {
     m_loadEvents.clear();
     m_estimatedProgress = 0;
-    m_error.clear();
+    m_error.reset();
     WebViewTest::loadPlainText(plainText);
 }
 
@@ -178,7 +178,7 @@ void LoadTrackingTest::loadRequest(WebKitURIRequest* request)
 {
     m_loadEvents.clear();
     m_estimatedProgress = 0;
-    m_error.clear();
+    m_error.reset();
     WebViewTest::loadRequest(request);
 }
 
@@ -186,7 +186,7 @@ void LoadTrackingTest::reload()
 {
     m_loadEvents.clear();
     m_estimatedProgress = 0;
-    m_error.clear();
+    m_error.reset();
     webkit_web_view_reload(m_webView);
 }
 
@@ -194,7 +194,7 @@ void LoadTrackingTest::goBack()
 {
     m_loadEvents.clear();
     m_estimatedProgress = 0;
-    m_error.clear();
+    m_error.reset();
     WebViewTest::goBack();
 }
 
@@ -202,6 +202,6 @@ void LoadTrackingTest::goForward()
 {
     m_loadEvents.clear();
     m_estimatedProgress = 0;
-    m_error.clear();
+    m_error.reset();
     WebViewTest::goForward();
 }
index a3cf784..d0ed1e5 100644 (file)
@@ -59,7 +59,7 @@ public:
     };
     bool m_runLoadUntilCompletion;
     bool m_loadFailed;
-    GOwnPtr<GError> m_error;
+    GUniquePtr<GError> m_error;
     Vector<LoadEvents> m_loadEvents;
     float m_estimatedProgress;
     CString m_redirectURI;
index d21ffd7..8043554 100644 (file)
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 #include <webkit2/webkit2.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 void beforeAll();
 void afterAll();
 
 static void registerGResource(void)
 {
-    GOwnPtr<char> resourcesPath(g_build_filename(WEBKIT_EXEC_PATH, "TestWebKitAPI", "WebKit2Gtk", "resources", "webkit2gtk-tests-resources.gresource", NULL));
+    GUniquePtr<char> resourcesPath(g_build_filename(WEBKIT_EXEC_PATH, "TestWebKitAPI", "WebKit2Gtk", "resources", "webkit2gtk-tests-resources.gresource", nullptr));
     GResource* resource = g_resource_load(resourcesPath.get(), 0);
     g_assert(resource);
 
@@ -44,7 +44,7 @@ static void removeNonEmptyDirectory(const char* directoryPath)
     g_assert(directory);
     const char* fileName;
     while ((fileName = g_dir_read_name(directory))) {
-        GOwnPtr<char> filePath(g_build_filename(directoryPath, fileName, NULL));
+        GUniquePtr<char> filePath(g_build_filename(directoryPath, fileName, nullptr));
         g_unlink(filePath.get());
     }
     g_dir_close(directory);
@@ -64,7 +64,7 @@ int main(int argc, char** argv)
 
     registerGResource();
 
-    GOwnPtr<char> diskCacheTempDirectory(g_dir_make_tmp("WebKit2TestsDiskCache-XXXXXX", 0));
+    GUniquePtr<char> diskCacheTempDirectory(g_dir_make_tmp("WebKit2TestsDiskCache-XXXXXX", 0));
     g_assert(diskCacheTempDirectory.get());
     webkit_web_context_set_disk_cache_directory(webkit_web_context_get_default(), diskCacheTempDirectory.get());
 
index 0e11d40..d5ceae8 100644 (file)
@@ -24,6 +24,7 @@
 #include <glib-object.h>
 #include <wtf/HashSet.h>
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
 #define MAKE_GLIB_TEST_FIXTURE(ClassName) \
@@ -37,7 +38,7 @@
     } \
     static void add(const char* suiteName, const char* testName, void (*testFunc)(ClassName*, const void*)) \
     { \
-        GOwnPtr<gchar> testPath(g_strdup_printf("/webkit2/%s/%s", suiteName, testName)); \
+        GUniquePtr<gchar> testPath(g_strdup_printf("/webkit2/%s/%s", suiteName, testName)); \
         g_test_add(testPath.get(), ClassName, 0, ClassName::setUp, testFunc, ClassName::tearDown); \
     }
 
@@ -83,13 +84,13 @@ public:
 
     static CString getWebKit1TestResoucesDir()
     {
-        GOwnPtr<char> resourcesDir(g_build_filename(WEBKIT_SRC_DIR, "Tools", "TestWebKitAPI", "Tests", "WebKitGtk", "resources", NULL));
+        GUniquePtr<char> resourcesDir(g_build_filename(WEBKIT_SRC_DIR, "Tools", "TestWebKitAPI", "Tests", "WebKitGtk", "resources", nullptr));
         return resourcesDir.get();
     }
 
     static CString getResourcesDir()
     {
-        GOwnPtr<char> resourcesDir(g_build_filename(WEBKIT_SRC_DIR, "Tools", "TestWebKitAPI", "Tests", "WebKit2Gtk", "resources", NULL));
+        GUniquePtr<char> resourcesDir(g_build_filename(WEBKIT_SRC_DIR, "Tools", "TestWebKitAPI", "Tests", "WebKit2Gtk", "resources", nullptr));
         return resourcesDir.get();
     }
 
index 8c2d3f6..d0dfae7 100644 (file)
@@ -21,6 +21,7 @@
 #include "WebKitTestBus.h"
 
 #include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/WTFString.h>
 
 WebKitTestBus::WebKitTestBus()
@@ -31,7 +32,7 @@ WebKitTestBus::WebKitTestBus()
 bool WebKitTestBus::run()
 {
     // FIXME: Use GTestDBus when we bump glib to 2.34.
-    GOwnPtr<char> dbusLaunch(g_find_program_in_path("dbus-launch"));
+    GUniquePtr<char> dbusLaunch(g_find_program_in_path("dbus-launch"));
     if (!dbusLaunch) {
         g_warning("Error starting DBUS daemon: dbus-launch not found in path");
         return false;
index 0aa86bc..8736771 100644 (file)
 #include "WebKitTestServer.h"
 
 #include "TestMain.h"
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 WebKitTestServer::WebKitTestServer(ServerType type)
 {
-    GOwnPtr<char> sslCertificateFile;
-    GOwnPtr<char> sslKeyFile;
+    GUniquePtr<char> sslCertificateFile;
+    GUniquePtr<char> sslKeyFile;
     if (type == ServerHTTPS) {
         CString resourcesDir = Test::getResourcesDir();
-        sslCertificateFile.set(g_build_filename(resourcesDir.data(), "test-cert.pem", NULL));
-        sslKeyFile.set(g_build_filename(resourcesDir.data(), "test-key.pem", NULL));
+        sslCertificateFile.reset(g_build_filename(resourcesDir.data(), "test-cert.pem", NULL));
+        sslKeyFile.reset(g_build_filename(resourcesDir.data(), "test-key.pem", NULL));
     }
 
     GRefPtr<SoupAddress> address = adoptGRef(soup_address_new("127.0.0.1", SOUP_ADDRESS_ANY_PORT));
@@ -57,7 +57,7 @@ void WebKitTestServer::run(SoupServerCallback serverCallback)
 CString WebKitTestServer::getURIForPath(const char* path)
 {
     SoupURI* uri = soup_uri_new_with_base(m_baseURI, path);
-    GOwnPtr<gchar> uriString(soup_uri_to_string(uri, FALSE));
+    GUniquePtr<gchar> uriString(soup_uri_to_string(uri, FALSE));
     soup_uri_free(uri);
     return uriString.get();
 }
index 4a3cd96..99a9dda 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "WebProcessTestRunner.h"
 
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 
 WebProcessTestRunner::WebProcessTestRunner()
     : m_mainLoop(g_main_loop_new(0, TRUE))
@@ -93,7 +93,7 @@ bool WebProcessTestRunner::runTest(const char* suiteName, const char* testName,
     g_main_loop_run(m_mainLoop);
 
     m_testResult = false;
-    GOwnPtr<char> testPath(g_strdup_printf("%s/%s", suiteName, testName));
+    GUniquePtr<char> testPath(g_strdup_printf("%s/%s", suiteName, testName));
     g_dbus_proxy_call(
         proxy(),
         "RunTest",
index 8d6df55..eb7b0df 100644 (file)
@@ -22,7 +22,7 @@
 #include "WebViewTest.h"
 
 #include <JavaScriptCore/JSRetainPtr.h>
-#include <WebCore/GOwnPtrGtk.h>
+#include <WebCore/GUniquePtrGtk.h>
 
 WebViewTest::WebViewTest()
     : m_webView(WEBKIT_WEB_VIEW(g_object_ref_sink(webkit_web_view_new())))
@@ -223,7 +223,7 @@ static void resourceGetDataCallback(GObject* object, GAsyncResult* result, gpoin
     g_assert(data);
 
     WebViewTest* test = static_cast<WebViewTest*>(userData);
-    test->m_resourceData.set(reinterpret_cast<char*>(data));
+    test->m_resourceData.reset(reinterpret_cast<char*>(data));
     test->m_resourceDataSize = dataSize;
     g_main_loop_quit(test->m_mainLoop);
 }
@@ -231,7 +231,7 @@ static void resourceGetDataCallback(GObject* object, GAsyncResult* result, gpoin
 const char* WebViewTest::mainResourceData(size_t& mainResourceDataSize)
 {
     m_resourceDataSize = 0;
-    m_resourceData.clear();
+    m_resourceData.reset();
     WebKitWebResource* resource = webkit_web_view_get_main_resource(m_webView);
     g_assert(resource);
 
@@ -248,7 +248,7 @@ void WebViewTest::mouseMoveTo(int x, int y, unsigned mouseModifiers)
     GtkWidget* viewWidget = GTK_WIDGET(m_webView);
     g_assert(gtk_widget_get_realized(viewWidget));
 
-    GOwnPtr<GdkEvent> event(gdk_event_new(GDK_MOTION_NOTIFY));
+    GUniquePtr<GdkEvent> event(gdk_event_new(GDK_MOTION_NOTIFY));
     event->motion.x = x;
     event->motion.y = y;
 
@@ -278,7 +278,7 @@ void WebViewTest::keyStroke(unsigned keyVal, unsigned keyModifiers)
     GtkWidget* viewWidget = GTK_WIDGET(m_webView);
     g_assert(gtk_widget_get_realized(viewWidget));
 
-    GOwnPtr<GdkEvent> event(gdk_event_new(GDK_KEY_PRESS));
+    GUniquePtr<GdkEvent> event(gdk_event_new(GDK_KEY_PRESS));
     event->key.keyval = keyVal;
 
     event->key.time = GDK_CURRENT_TIME;
@@ -304,7 +304,7 @@ void WebViewTest::doMouseButtonEvent(GdkEventType eventType, int x, int y, unsig
     GtkWidget* viewWidget = GTK_WIDGET(m_webView);
     g_assert(gtk_widget_get_realized(viewWidget));
 
-    GOwnPtr<GdkEvent> event(gdk_event_new(eventType));
+    GUniquePtr<GdkEvent> event(gdk_event_new(eventType));
     event->button.window = gtk_widget_get_window(viewWidget);
     g_object_ref(event->button.window);
 
index aeeb062..f45e125 100644 (file)
@@ -75,7 +75,7 @@ public:
     CString m_expectedTitle;
     WebKitJavascriptResult* m_javascriptResult;
     GError** m_javascriptError;
-    GOwnPtr<char> m_resourceData;
+    GUniquePtr<char> m_resourceData;
     size_t m_resourceDataSize;
     cairo_surface_t* m_surface;
 
index 4e11150..3573a2a 100644 (file)
@@ -36,7 +36,7 @@
 #include <WebKit2/WKBundlePagePrivate.h>
 #include <atk/atk.h>
 #include <cstdio>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace WTR {
@@ -104,7 +104,7 @@ PassRefPtr<AccessibilityUIElement> AccessibilityController::accessibleElementByI
         return nullptr;
 
     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(id);
-    GOwnPtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    GUniquePtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
     JSStringGetUTF8CString(id, idBuffer.get(), bufferSize);
 
     AtkObject* result = childElementById(root, idBuffer.get());
index 9155598..b521072 100644 (file)
@@ -29,7 +29,7 @@
 #include <WebKit2/WKBundlePage.h>
 #include <WebKit2/WKBundlePagePrivate.h>
 #include <wtf/HashMap.h>
-#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GUniquePtr.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
@@ -67,8 +67,8 @@ void printAccessibilityEvent(AtkObject* accessible, const char* signalName, cons
     if (!objectName || *objectName == '\0')
         objectName = "(No name)";
 
-    GOwnPtr<char> signalNameAndValue(signalValue ? g_strdup_printf("%s = %s", signalName, signalValue) : g_strdup(signalName));
-    GOwnPtr<char> accessibilityEventString(g_strdup_printf("Accessibility object emitted \"%s\" / Name: \"%s\" / Role: %d\n", signalNameAndValue.get(), objectName, objectRole));
+    GUniquePtr<char> signalNameAndValue(signalValue ? g_strdup_printf("%s = %s", signalName, signalValue) : g_strdup(signalName));
+    GUniquePtr<char> accessibilityEventString(g_strdup_printf("Accessibility object emitted \"%s\" / Name: \"%s\" / Role: %d\n", signalNameAndValue.get(), objectName, objectRole));
     InjectedBundle::shared().outputText(String::fromUTF8(accessibilityEventString.get()));
 }
 
@@ -83,37