Changeset 244390 in webkit


Ignore:
Timestamp:
Apr 17, 2019, 11:28:56 AM (6 years ago)
Author:
achristensen@apple.com
Message:

WKRetainPtr's adoption constructor should be private
https://bugs.webkit.org/show_bug.cgi?id=197019

Reviewed by Tim Horton.

Source/WebKit:

RefPtr and RetainPtr have already done this. It makes us use nicer syntax.

  • UIProcess/API/C/WKContext.cpp:

(WKContextSetDownloadClient):

  • UIProcess/API/cpp/WKRetainPtr.h:

(WebKit::WKRetainPtr::WKRetainPtr):
(WebKit::adoptWK):

Tools:

  • DumpRenderTree/mac/DumpRenderTree.mm:

(dumpFramesAsText):

  • TestWebKitAPI/InjectedBundleController.cpp:

(TestWebKitAPI::InjectedBundleController::initialize):

  • TestWebKitAPI/PlatformUtilities.cpp:

(TestWebKitAPI::Util::createContextWithInjectedBundle):
(TestWebKitAPI::Util::createInitializationDictionaryForInjectedBundleTest):
(TestWebKitAPI::Util::createContextForInjectedBundleTest):
(TestWebKitAPI::Util::toWK):

  • TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/CloseFromWithinCreatePage.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/CloseThenTerminate.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp:

(TestWebKitAPI::DOMWindowExtensionBasic::initialize):

  • TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp:

(TestWebKitAPI::DOMWindowExtensionNoCache::initialize):

  • TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/DidNotHandleKeyDown.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp:

(TestWebKitAPI::didRemoveFrameFromHierarchyCallback):

  • TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp:

(TestWebKitAPI::DocumentStartUserScriptAlertCrashTest::initialize):

  • TestWebKitAPI/Tests/WebKit/EnumerateMediaDevices.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/EvaluateJavaScript.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/EventModifiers.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/FailedLoad.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/Find.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/FindMatches.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/FirstMeaningfulPaintMilestone.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/ForceRepaint.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/FrameHandle.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/Geolocation.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/GetInjectedBundleInitializationUserDataCallback.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle_Bundle.cpp:

(TestWebKitAPI::HitTestResultNodeHandleTest::getContextMenuFromDefaultMenu):

  • TestWebKitAPI/Tests/WebKit/InjectedBundleBasic.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp:

(TestWebKitAPI::InjectedBundleNoDisableOverrideBuiltinsBehaviorTest::initialize):
(TestWebKitAPI::InjectedBundleDisableOverrideBuiltinsBehaviorTest::initialize):

  • TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest_Bundle.cpp:

(TestWebKitAPI::InjectedBundleFrameHitTestTest::frameLoadFinished):

  • TestWebKitAPI/Tests/WebKit/InjectedBundleInitializationUserDataCallbackWins.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp:

(TestWebKitAPI::InjectedBundleMakeAllShadowRootOpenTest::initialize):

  • TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/LoadAlternateHTMLStringWithNonDirectoryURL.cpp:

(TestWebKitAPI::loadAlternateHTMLString):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/LoadCanceledNoServerRedirectCallback.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/LoadPageOnCrash.cpp:

(TestWebKitAPI::WebKit2CrashLoader::WebKit2CrashLoader):

  • TestWebKitAPI/Tests/WebKit/MenuTypesForMouseEvents.cpp:

(TestWebKitAPI::buildAndPerformTest):

  • TestWebKitAPI/Tests/WebKit/ModalAlertsSPI.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/MouseMoveAfterCrash.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayout.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFails.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutForImages.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/PasteboardNotifications.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/PendingAPIRequestURL.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/PreventEmptyUserAgent.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/ProcessDidTerminate.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/ResizeReversePaginatedWebView.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/ResizeWindowAfterCrash.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/RestoreSessionStateContainingFormData.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/ScrollPinningBehaviors.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/ShouldKeepCurrentBackForwardListItemInList.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/SpacebarScrolling.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/StopLoadingDuringDidFailProvisionalLoad.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/TerminateTwice.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/UserMedia.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/WKPageCopySessionStateWithFiltering.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/WKPageGetScaleFactorNotZero.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/WKPreferences.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/WKThumbnailView.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/WillSendSubmitEvent.cpp:

(TestWebKitAPI::didReceiveMessageFromInjectedBundle):

  • TestWebKitAPI/Tests/WebKit/mac/AttributedSubstringForProposedRangeWithImage.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/mac/ContextMenuDownload.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/mac/EditorCommands.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/mac/GetPIDAfterAbortedProcessLaunch.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/mac/InjectedBundleAppleEvent.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSuspendMediaBuffering.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:

(TEST):

  • TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:

(TestWebKitAPI::FullscreenZoomInitialFrame::initializeView):

  • WebKitTestRunner/InjectedBundle/EventSendingController.cpp:

(WTR::getMenuItemTitleCallback):
(WTR::createMouseMessageBody):
(WTR::EventSendingController::mouseDown):
(WTR::EventSendingController::mouseUp):
(WTR::EventSendingController::mouseMoveTo):
(WTR::EventSendingController::mouseForceClick):
(WTR::EventSendingController::startAndCancelMouseForceClick):
(WTR::EventSendingController::mouseForceDown):
(WTR::EventSendingController::mouseForceUp):
(WTR::EventSendingController::mouseForceChanged):
(WTR::EventSendingController::leapForward):
(WTR::EventSendingController::scheduleAsynchronousClick):
(WTR::createKeyDownMessageBody):
(WTR::EventSendingController::keyDown):
(WTR::EventSendingController::scheduleAsynchronousKeyDown):
(WTR::EventSendingController::mouseScrollBy):
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::continuousMouseScrollBy):
(WTR::EventSendingController::addTouchPoint):
(WTR::EventSendingController::updateTouchPoint):
(WTR::EventSendingController::setTouchModifier):
(WTR::EventSendingController::setTouchPointRadius):
(WTR::EventSendingController::touchStart):
(WTR::EventSendingController::touchMove):
(WTR::EventSendingController::touchEnd):
(WTR::EventSendingController::touchCancel):
(WTR::EventSendingController::clearTouchPoints):
(WTR::EventSendingController::releaseTouchPoint):
(WTR::EventSendingController::cancelTouchPoint):

  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:

(WTR::InjectedBundle::didCreatePage):
(WTR::InjectedBundle::didReceiveMessage):
(WTR::InjectedBundle::didReceiveMessageToPage):
(WTR::InjectedBundle::booleanForKey):
(WTR::InjectedBundle::done):
(WTR::InjectedBundle::dumpToStdErr):
(WTR::InjectedBundle::outputText):
(WTR::InjectedBundle::postNewBeforeUnloadReturnValue):
(WTR::InjectedBundle::postAddChromeInputField):
(WTR::InjectedBundle::postRemoveChromeInputField):
(WTR::InjectedBundle::postFocusWebView):
(WTR::InjectedBundle::postSetBackingScaleFactor):
(WTR::InjectedBundle::postSetWindowIsKey):
(WTR::InjectedBundle::postSetViewSize):
(WTR::InjectedBundle::postSimulateWebNotificationClick):
(WTR::InjectedBundle::postSetAddsVisitedLinks):
(WTR::InjectedBundle::setGeolocationPermission):
(WTR::InjectedBundle::setMockGeolocationPosition):
(WTR::InjectedBundle::setMockGeolocationPositionUnavailableError):
(WTR::InjectedBundle::isGeolocationProviderActive const):
(WTR::InjectedBundle::imageCountInGeneralPasteboard const):
(WTR::InjectedBundle::setUserMediaPersistentPermissionForOrigin):
(WTR::InjectedBundle::userMediaPermissionRequestCountForOrigin const):
(WTR::InjectedBundle::resetUserMediaPermissionRequestCountForOrigin):
(WTR::InjectedBundle::setCustomPolicyDelegate):
(WTR::InjectedBundle::setHidden):
(WTR::InjectedBundle::setCacheModel):
(WTR::InjectedBundle::shouldProcessWorkQueue const):
(WTR::InjectedBundle::processWorkQueue):
(WTR::InjectedBundle::queueBackNavigation):
(WTR::InjectedBundle::queueForwardNavigation):
(WTR::InjectedBundle::queueLoad):
(WTR::InjectedBundle::queueLoadHTMLString):
(WTR::InjectedBundle::queueReload):
(WTR::InjectedBundle::queueLoadingScript):
(WTR::InjectedBundle::queueNonLoadingScript):

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::frameToStr):
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::dumpFrameDescriptionSuitableForTestResult):
(WTR::dumpFrameScrollPosition):
(WTR::dumpDescendantFrameScrollPositions):
(WTR::dumpFrameText):
(WTR::dumpDescendantFramesText):

  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::shouldDumpPixels const):
(WTR::TestRunner::setDumpPixels):
(WTR::TestRunner::whatToDump const):
(WTR::TestRunner::setWhatToDump):
(WTR::TestRunner::setWaitUntilDone):
(WTR::TestRunner::shouldWaitUntilDone const):
(WTR::TestRunner::setShouldDumpFrameLoadCallbacks):
(WTR::TestRunner::shouldDumpFrameLoadCallbacks):
(WTR::TestRunner::clearAllDatabases):
(WTR::TestRunner::setIDBPerOriginQuota):
(WTR::TestRunner::originsWithApplicationCache):
(WTR::TestRunner::setCanOpenWindows):
(WTR::TestRunner::setXSSAuditorEnabled):
(WTR::TestRunner::setMediaDevicesEnabled):
(WTR::TestRunner::setWebRTCMDNSICECandidatesEnabled):
(WTR::TestRunner::setWebRTCUnifiedPlanEnabled):
(WTR::TestRunner::setCustomUserAgent):
(WTR::TestRunner::setWebAPIStatisticsEnabled):
(WTR::TestRunner::setModernMediaControlsEnabled):
(WTR::TestRunner::setWebGL2Enabled):
(WTR::TestRunner::setWritableStreamAPIEnabled):
(WTR::TestRunner::setReadableByteStreamAPIEnabled):
(WTR::TestRunner::setEncryptedMediaAPIEnabled):
(WTR::TestRunner::setAllowsAnySSLCertificate):
(WTR::TestRunner::setPluginsEnabled):
(WTR::TestRunner::setValueForUser):
(WTR::TestRunner::setAudioResult):
(WTR::TestRunner::didReceiveServerRedirectForProvisionalNavigation const):
(WTR::TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation):
(WTR::TestRunner::setAlwaysAcceptCookies):
(WTR::TestRunner::setOnlyAcceptFirstPartyCookies):
(WTR::TestRunner::isDoingMediaCapture const):
(WTR::TestRunner::queueLoad):
(WTR::TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges):
(WTR::TestRunner::setHandlesAuthenticationChallenges):
(WTR::TestRunner::setShouldLogCanAuthenticateAgainstProtectionSpace):
(WTR::TestRunner::setShouldLogDownloadCallbacks):
(WTR::TestRunner::setAuthenticationUsername):
(WTR::TestRunner::setAuthenticationPassword):
(WTR::TestRunner::secureEventInputIsEnabled const):
(WTR::TestRunner::setBlockAllPlugins):
(WTR::TestRunner::setPluginSupportedMode):
(WTR::TestRunner::setShouldDecideNavigationPolicyAfterDelay):
(WTR::TestRunner::setShouldDecideResponsePolicyAfterDelay):
(WTR::TestRunner::setNavigationGesturesEnabled):
(WTR::TestRunner::setIgnoresViewportScaleLimits):
(WTR::TestRunner::setShouldDownloadUndisplayableMIMETypes):
(WTR::TestRunner::setShouldAllowDeviceOrientationAndMotionAccess):
(WTR::TestRunner::terminateNetworkProcess):
(WTR::TestRunner::terminateServiceWorkerProcess):
(WTR::TestRunner::runUIScript):
(WTR::TestRunner::setStatisticsDebugMode):
(WTR::TestRunner::setStatisticsPrevalentResourceForDebugMode):
(WTR::TestRunner::setStatisticsLastSeen):
(WTR::TestRunner::setStatisticsPrevalentResource):
(WTR::TestRunner::setStatisticsVeryPrevalentResource):
(WTR::TestRunner::dumpResourceLoadStatistics):
(WTR::TestRunner::isStatisticsPrevalentResource):
(WTR::TestRunner::isStatisticsVeryPrevalentResource):
(WTR::TestRunner::isStatisticsRegisteredAsSubresourceUnder):
(WTR::TestRunner::isStatisticsRegisteredAsSubFrameUnder):
(WTR::TestRunner::isStatisticsRegisteredAsRedirectingTo):
(WTR::TestRunner::setStatisticsHasHadUserInteraction):
(WTR::TestRunner::isStatisticsHasHadUserInteraction):
(WTR::TestRunner::setStatisticsGrandfathered):
(WTR::TestRunner::isStatisticsGrandfathered):
(WTR::TestRunner::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUniqueRedirectTo):
(WTR::TestRunner::setStatisticsSubresourceUniqueRedirectFrom):
(WTR::TestRunner::setStatisticsTopFrameUniqueRedirectTo):
(WTR::TestRunner::setStatisticsTopFrameUniqueRedirectFrom):
(WTR::TestRunner::setStatisticsCrossSiteLoadWithLinkDecoration):
(WTR::TestRunner::setStatisticsTimeToLiveUserInteraction):
(WTR::TestRunner::installStatisticsDidScanDataRecordsCallback):
(WTR::TestRunner::statisticsProcessStatisticsAndDataRecords):
(WTR::TestRunner::statisticsUpdateCookieBlocking):
(WTR::TestRunner::statisticsSubmitTelemetry):
(WTR::TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WTR::TestRunner::setStatisticsIsRunningTest):
(WTR::TestRunner::setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WTR::TestRunner::setStatisticsNotifyPagesWhenTelemetryWasCaptured):
(WTR::TestRunner::setStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WTR::TestRunner::setStatisticsGrandfatheringTime):
(WTR::TestRunner::setStatisticsMaxStatisticsEntries):
(WTR::TestRunner::setStatisticsPruneEntriesDownTo):
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStore):
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WTR::TestRunner::statisticsClearThroughWebsiteDataRemoval):
(WTR::TestRunner::statisticsDeleteCookiesForHost):
(WTR::TestRunner::setStatisticsCacheMaxAgeCap):
(WTR::TestRunner::statisticsResetToConsistentState):
(WTR::TestRunner::setStorageAccessAPIEnabled):
(WTR::TestRunner::getAllStorageAccessEntries):
(WTR::TestRunner::addMockMediaDevice):
(WTR::TestRunner::clearMockMediaDevices):
(WTR::TestRunner::removeMockMediaDevice):
(WTR::TestRunner::resetMockMediaDevices):
(WTR::TestRunner::connectMockGamepad):
(WTR::TestRunner::disconnectMockGamepad):
(WTR::TestRunner::setMockGamepadDetails):
(WTR::TestRunner::setMockGamepadAxisValue):
(WTR::TestRunner::setMockGamepadButtonValue):
(WTR::TestRunner::removeAllSessionCredentials):
(WTR::TestRunner::clearDOMCache):
(WTR::TestRunner::clearDOMCaches):
(WTR::TestRunner::hasDOMCache):
(WTR::TestRunner::domCacheSize):
(WTR::TestRunner::setAllowStorageQuotaIncrease):
(WTR::TestRunner::getApplicationManifestThen):
(WTR::TestRunner::injectUserScript):
(WTR::TestRunner::sendDisplayConfigurationChangedMessageForTesting):
(WTR::TestRunner::setWebAuthenticationMockConfiguration):
(WTR::TestRunner::addTestKeyToKeychain):
(WTR::TestRunner::cleanUpKeychain):
(WTR::TestRunner::keyExistsInKeychain):
(WTR::TestRunner::setCanHandleHTTPSServerTrustEvaluation):
(WTR::TestRunner::canDoServerTrustEvaluationInNetworkProcess):
(WTR::TestRunner::serverTrustEvaluationCallbackCallsCount):
(WTR::TestRunner::setShouldDismissJavaScriptAlertsAsynchronously):
(WTR::TestRunner::setAdClickAttributionOverrideTimerForTesting):
(WTR::TestRunner::setAdClickAttributionConversionURLForTesting):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::initialize):
(WTR::parseStringTestHeaderValueAsRelativePath):
(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::runTest):
(WTR::TestController::didReceiveLiveDocumentsList):
(WTR::TestController::didReceiveMessageFromInjectedBundle):
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestController::didFinishNavigation):
(WTR::TestController::didReceiveAuthenticationChallenge):

  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::uiScriptDidComplete):
(WTR::TestInvocation::didReceiveAllStorageAccessEntries):

  • WebKitTestRunner/WebNotificationProvider.cpp:

(WTR::WebNotificationProvider::closeWebNotification):

  • WebKitTestRunner/WorkQueueManager.cpp:

(WTR::ScriptItem::ScriptItem):
(WTR::WorkQueueManager::queueLoad):
(WTR::WorkQueueManager::queueLoadHTMLString):

Location:
trunk
Files:
107 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244389 r244390  
     12019-04-17  Alex Christensen  <achristensen@webkit.org>
     2
     3        WKRetainPtr's adoption constructor should be private
     4        https://bugs.webkit.org/show_bug.cgi?id=197019
     5
     6        Reviewed by Tim Horton.
     7
     8        RefPtr and RetainPtr have already done this.  It makes us use nicer syntax.
     9
     10        * UIProcess/API/C/WKContext.cpp:
     11        (WKContextSetDownloadClient):
     12        * UIProcess/API/cpp/WKRetainPtr.h:
     13        (WebKit::WKRetainPtr::WKRetainPtr):
     14        (WebKit::adoptWK):
     15
    1162019-04-17  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp

    r243384 r244390  
    213213
    214214            bool allowOverwrite = false;
    215             WKRetainPtr<WKStringRef> destination(AdoptWK, m_client.decideDestinationWithSuggestedFilename(WebKit::toAPI(&processPool), WebKit::toAPI(&downloadProxy), WebKit::toAPI(filename.impl()), &allowOverwrite, m_client.base.clientInfo));
     215            auto destination = adoptWK(m_client.decideDestinationWithSuggestedFilename(WebKit::toAPI(&processPool), WebKit::toAPI(&downloadProxy), WebKit::toAPI(filename.impl()), &allowOverwrite, m_client.base.clientInfo));
    216216            completionHandler(allowOverwrite ? WebKit::AllowOverwrite::Yes : WebKit::AllowOverwrite::No, WebKit::toWTFString(destination.get()));
    217217        }
  • trunk/Source/WebKit/UIProcess/API/cpp/WKRetainPtr.h

    r228751 r244390  
    3636namespace WebKit {
    3737
    38 enum WKAdoptTag { AdoptWK };
    39 
    4038template<typename T> class WKRetainPtr {
    4139public:
     
    5452    }
    5553
    56     WKRetainPtr(WKAdoptTag, PtrType ptr)
    57         : m_ptr(ptr)
    58     {
    59     }
    60    
    6154    template<typename U> WKRetainPtr(const WKRetainPtr<U>& o)
    6255        : m_ptr(o.get())
     
    134127
    135128private:
     129    template<typename U> friend WKRetainPtr<U> adoptWK(U);
     130    enum WKAdoptTag { AdoptWK };
     131    WKRetainPtr(WKAdoptTag, PtrType ptr)
     132        : m_ptr(ptr) { }
     133
    136134    PtrType m_ptr;
    137135};
     
    250248template<typename T> inline WKRetainPtr<T> adoptWK(T o)
    251249{
    252     return WKRetainPtr<T>(AdoptWK, o);
     250    return WKRetainPtr<T>(WKRetainPtr<T>::AdoptWK, o);
    253251}
    254252
     
    261259
    262260using WebKit::WKRetainPtr;
    263 using WebKit::AdoptWK;
    264261using WebKit::adoptWK;
    265262using WebKit::retainWK;
  • trunk/Tools/ChangeLog

    r244384 r244390  
     12019-04-17  Alex Christensen  <achristensen@webkit.org>
     2
     3        WKRetainPtr's adoption constructor should be private
     4        https://bugs.webkit.org/show_bug.cgi?id=197019
     5
     6        Reviewed by Tim Horton.
     7
     8        * DumpRenderTree/mac/DumpRenderTree.mm:
     9        (dumpFramesAsText):
     10        * TestWebKitAPI/InjectedBundleController.cpp:
     11        (TestWebKitAPI::InjectedBundleController::initialize):
     12        * TestWebKitAPI/PlatformUtilities.cpp:
     13        (TestWebKitAPI::Util::createContextWithInjectedBundle):
     14        (TestWebKitAPI::Util::createInitializationDictionaryForInjectedBundleTest):
     15        (TestWebKitAPI::Util::createContextForInjectedBundleTest):
     16        (TestWebKitAPI::Util::toWK):
     17        * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
     18        (TestWebKitAPI::TEST):
     19        * TestWebKitAPI/Tests/WebKit/CloseFromWithinCreatePage.cpp:
     20        (TestWebKitAPI::TEST):
     21        * TestWebKitAPI/Tests/WebKit/CloseThenTerminate.cpp:
     22        (TestWebKitAPI::TEST):
     23        * TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic.cpp:
     24        (TestWebKitAPI::TEST):
     25        * TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp:
     26        (TestWebKitAPI::DOMWindowExtensionBasic::initialize):
     27        * TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache.cpp:
     28        (TestWebKitAPI::TEST):
     29        * TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp:
     30        (TestWebKitAPI::DOMWindowExtensionNoCache::initialize):
     31        * TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm:
     32        (TestWebKitAPI::TEST):
     33        * TestWebKitAPI/Tests/WebKit/DidNotHandleKeyDown.cpp:
     34        (TestWebKitAPI::TEST):
     35        * TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp:
     36        (TestWebKitAPI::didRemoveFrameFromHierarchyCallback):
     37        * TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash.cpp:
     38        (TestWebKitAPI::TEST):
     39        * TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp:
     40        (TestWebKitAPI::DocumentStartUserScriptAlertCrashTest::initialize):
     41        * TestWebKitAPI/Tests/WebKit/EnumerateMediaDevices.cpp:
     42        (TestWebKitAPI::TEST):
     43        * TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp:
     44        (TestWebKitAPI::TEST):
     45        * TestWebKitAPI/Tests/WebKit/EvaluateJavaScript.cpp:
     46        (TestWebKitAPI::TEST):
     47        * TestWebKitAPI/Tests/WebKit/EventModifiers.cpp:
     48        (TestWebKitAPI::TEST):
     49        * TestWebKitAPI/Tests/WebKit/FailedLoad.cpp:
     50        (TestWebKitAPI::TEST):
     51        * TestWebKitAPI/Tests/WebKit/Find.cpp:
     52        (TestWebKitAPI::TEST):
     53        * TestWebKitAPI/Tests/WebKit/FindMatches.mm:
     54        (TestWebKitAPI::TEST):
     55        * TestWebKitAPI/Tests/WebKit/FirstMeaningfulPaintMilestone.cpp:
     56        (TestWebKitAPI::TEST):
     57        * TestWebKitAPI/Tests/WebKit/ForceRepaint.cpp:
     58        (TestWebKitAPI::TEST):
     59        * TestWebKitAPI/Tests/WebKit/FrameHandle.cpp:
     60        (TestWebKitAPI::TEST):
     61        * TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp:
     62        (TestWebKitAPI::TEST):
     63        * TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp:
     64        (TestWebKitAPI::TEST):
     65        * TestWebKitAPI/Tests/WebKit/Geolocation.cpp:
     66        (TestWebKitAPI::TEST):
     67        * TestWebKitAPI/Tests/WebKit/GetInjectedBundleInitializationUserDataCallback.cpp:
     68        (TestWebKitAPI::TEST):
     69        * TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle.cpp:
     70        (TestWebKitAPI::TEST):
     71        * TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle_Bundle.cpp:
     72        (TestWebKitAPI::HitTestResultNodeHandleTest::getContextMenuFromDefaultMenu):
     73        * TestWebKitAPI/Tests/WebKit/InjectedBundleBasic.cpp:
     74        (TestWebKitAPI::TEST):
     75        * TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior.cpp:
     76        (TestWebKitAPI::TEST):
     77        * TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp:
     78        (TestWebKitAPI::InjectedBundleNoDisableOverrideBuiltinsBehaviorTest::initialize):
     79        (TestWebKitAPI::InjectedBundleDisableOverrideBuiltinsBehaviorTest::initialize):
     80        * TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest.cpp:
     81        (TestWebKitAPI::TEST):
     82        * TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest_Bundle.cpp:
     83        (TestWebKitAPI::InjectedBundleFrameHitTestTest::frameLoadFinished):
     84        * TestWebKitAPI/Tests/WebKit/InjectedBundleInitializationUserDataCallbackWins.cpp:
     85        (TestWebKitAPI::TEST):
     86        * TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen.cpp:
     87        (TestWebKitAPI::TEST):
     88        * TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp:
     89        (TestWebKitAPI::InjectedBundleMakeAllShadowRootOpenTest::initialize):
     90        * TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:
     91        (TestWebKitAPI::TEST):
     92        * TestWebKitAPI/Tests/WebKit/LoadAlternateHTMLStringWithNonDirectoryURL.cpp:
     93        (TestWebKitAPI::loadAlternateHTMLString):
     94        (TestWebKitAPI::TEST):
     95        * TestWebKitAPI/Tests/WebKit/LoadCanceledNoServerRedirectCallback.cpp:
     96        (TestWebKitAPI::TEST):
     97        * TestWebKitAPI/Tests/WebKit/LoadPageOnCrash.cpp:
     98        (TestWebKitAPI::WebKit2CrashLoader::WebKit2CrashLoader):
     99        * TestWebKitAPI/Tests/WebKit/MenuTypesForMouseEvents.cpp:
     100        (TestWebKitAPI::buildAndPerformTest):
     101        * TestWebKitAPI/Tests/WebKit/ModalAlertsSPI.cpp:
     102        (TestWebKitAPI::TEST):
     103        * TestWebKitAPI/Tests/WebKit/MouseMoveAfterCrash.cpp:
     104        (TestWebKitAPI::TEST):
     105        * TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayout.cpp:
     106        (TestWebKitAPI::TEST):
     107        * TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFails.cpp:
     108        (TestWebKitAPI::TEST):
     109        * TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutForImages.cpp:
     110        (TestWebKitAPI::TEST):
     111        * TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp:
     112        (TestWebKitAPI::TEST):
     113        * TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp:
     114        (TestWebKitAPI::TEST):
     115        * TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp:
     116        (TestWebKitAPI::TEST):
     117        * TestWebKitAPI/Tests/WebKit/PasteboardNotifications.mm:
     118        (TestWebKitAPI::TEST):
     119        * TestWebKitAPI/Tests/WebKit/PendingAPIRequestURL.cpp:
     120        (TestWebKitAPI::TEST):
     121        * TestWebKitAPI/Tests/WebKit/PreventEmptyUserAgent.cpp:
     122        (TestWebKitAPI::TEST):
     123        * TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp:
     124        (TestWebKitAPI::TEST):
     125        * TestWebKitAPI/Tests/WebKit/ProcessDidTerminate.cpp:
     126        (TestWebKitAPI::TEST):
     127        * TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp:
     128        (TestWebKitAPI::TEST):
     129        * TestWebKitAPI/Tests/WebKit/ResizeReversePaginatedWebView.cpp:
     130        (TestWebKitAPI::TEST):
     131        * TestWebKitAPI/Tests/WebKit/ResizeWindowAfterCrash.cpp:
     132        (TestWebKitAPI::TEST):
     133        * TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp:
     134        (TestWebKitAPI::TEST):
     135        * TestWebKitAPI/Tests/WebKit/RestoreSessionStateContainingFormData.cpp:
     136        (TestWebKitAPI::TEST):
     137        * TestWebKitAPI/Tests/WebKit/ScrollPinningBehaviors.cpp:
     138        (TestWebKitAPI::TEST):
     139        * TestWebKitAPI/Tests/WebKit/ShouldKeepCurrentBackForwardListItemInList.cpp:
     140        (TestWebKitAPI::TEST):
     141        * TestWebKitAPI/Tests/WebKit/SpacebarScrolling.cpp:
     142        (TestWebKitAPI::TEST):
     143        * TestWebKitAPI/Tests/WebKit/StopLoadingDuringDidFailProvisionalLoad.cpp:
     144        (TestWebKitAPI::TEST):
     145        * TestWebKitAPI/Tests/WebKit/TerminateTwice.cpp:
     146        (TestWebKitAPI::TEST):
     147        * TestWebKitAPI/Tests/WebKit/UserMedia.cpp:
     148        (TestWebKitAPI::TEST):
     149        * TestWebKitAPI/Tests/WebKit/WKPageCopySessionStateWithFiltering.cpp:
     150        (TestWebKitAPI::TEST):
     151        * TestWebKitAPI/Tests/WebKit/WKPageGetScaleFactorNotZero.cpp:
     152        (TestWebKitAPI::TEST):
     153        * TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp:
     154        (TestWebKitAPI::TEST):
     155        * TestWebKitAPI/Tests/WebKit/WKPreferences.cpp:
     156        (TestWebKitAPI::TEST):
     157        * TestWebKitAPI/Tests/WebKit/WKThumbnailView.mm:
     158        (TestWebKitAPI::TEST):
     159        * TestWebKitAPI/Tests/WebKit/WillSendSubmitEvent.cpp:
     160        (TestWebKitAPI::didReceiveMessageFromInjectedBundle):
     161        * TestWebKitAPI/Tests/WebKit/mac/AttributedSubstringForProposedRangeWithImage.mm:
     162        (TestWebKitAPI::TEST):
     163        * TestWebKitAPI/Tests/WebKit/mac/ContextMenuDownload.mm:
     164        (TestWebKitAPI::TEST):
     165        * TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter.mm:
     166        (TestWebKitAPI::TEST):
     167        * TestWebKitAPI/Tests/WebKit/mac/EditorCommands.mm:
     168        (TestWebKitAPI::TEST):
     169        * TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm:
     170        (TestWebKitAPI::TEST):
     171        * TestWebKitAPI/Tests/WebKit/mac/GetPIDAfterAbortedProcessLaunch.cpp:
     172        (TestWebKitAPI::TEST):
     173        * TestWebKitAPI/Tests/WebKit/mac/InjectedBundleAppleEvent.cpp:
     174        (TestWebKitAPI::TEST):
     175        * TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm:
     176        (TestWebKitAPI::TEST):
     177        * TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm:
     178        (TestWebKitAPI::TEST):
     179        * TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:
     180        (TestWebKitAPI::TEST):
     181        * TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm:
     182        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSuspendMediaBuffering.mm:
     183        (TEST):
     184        * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
     185        (TEST):
     186        * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
     187        * TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
     188        (TEST):
     189        * TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm:
     190        (TestWebKitAPI::TEST):
     191        * TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
     192        (TestWebKitAPI::FullscreenZoomInitialFrame::initializeView):
     193        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
     194        (WTR::getMenuItemTitleCallback):
     195        (WTR::createMouseMessageBody):
     196        (WTR::EventSendingController::mouseDown):
     197        (WTR::EventSendingController::mouseUp):
     198        (WTR::EventSendingController::mouseMoveTo):
     199        (WTR::EventSendingController::mouseForceClick):
     200        (WTR::EventSendingController::startAndCancelMouseForceClick):
     201        (WTR::EventSendingController::mouseForceDown):
     202        (WTR::EventSendingController::mouseForceUp):
     203        (WTR::EventSendingController::mouseForceChanged):
     204        (WTR::EventSendingController::leapForward):
     205        (WTR::EventSendingController::scheduleAsynchronousClick):
     206        (WTR::createKeyDownMessageBody):
     207        (WTR::EventSendingController::keyDown):
     208        (WTR::EventSendingController::scheduleAsynchronousKeyDown):
     209        (WTR::EventSendingController::mouseScrollBy):
     210        (WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
     211        (WTR::EventSendingController::continuousMouseScrollBy):
     212        (WTR::EventSendingController::addTouchPoint):
     213        (WTR::EventSendingController::updateTouchPoint):
     214        (WTR::EventSendingController::setTouchModifier):
     215        (WTR::EventSendingController::setTouchPointRadius):
     216        (WTR::EventSendingController::touchStart):
     217        (WTR::EventSendingController::touchMove):
     218        (WTR::EventSendingController::touchEnd):
     219        (WTR::EventSendingController::touchCancel):
     220        (WTR::EventSendingController::clearTouchPoints):
     221        (WTR::EventSendingController::releaseTouchPoint):
     222        (WTR::EventSendingController::cancelTouchPoint):
     223        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
     224        (WTR::InjectedBundle::didCreatePage):
     225        (WTR::InjectedBundle::didReceiveMessage):
     226        (WTR::InjectedBundle::didReceiveMessageToPage):
     227        (WTR::InjectedBundle::booleanForKey):
     228        (WTR::InjectedBundle::done):
     229        (WTR::InjectedBundle::dumpToStdErr):
     230        (WTR::InjectedBundle::outputText):
     231        (WTR::InjectedBundle::postNewBeforeUnloadReturnValue):
     232        (WTR::InjectedBundle::postAddChromeInputField):
     233        (WTR::InjectedBundle::postRemoveChromeInputField):
     234        (WTR::InjectedBundle::postFocusWebView):
     235        (WTR::InjectedBundle::postSetBackingScaleFactor):
     236        (WTR::InjectedBundle::postSetWindowIsKey):
     237        (WTR::InjectedBundle::postSetViewSize):
     238        (WTR::InjectedBundle::postSimulateWebNotificationClick):
     239        (WTR::InjectedBundle::postSetAddsVisitedLinks):
     240        (WTR::InjectedBundle::setGeolocationPermission):
     241        (WTR::InjectedBundle::setMockGeolocationPosition):
     242        (WTR::InjectedBundle::setMockGeolocationPositionUnavailableError):
     243        (WTR::InjectedBundle::isGeolocationProviderActive const):
     244        (WTR::InjectedBundle::imageCountInGeneralPasteboard const):
     245        (WTR::InjectedBundle::setUserMediaPersistentPermissionForOrigin):
     246        (WTR::InjectedBundle::userMediaPermissionRequestCountForOrigin const):
     247        (WTR::InjectedBundle::resetUserMediaPermissionRequestCountForOrigin):
     248        (WTR::InjectedBundle::setCustomPolicyDelegate):
     249        (WTR::InjectedBundle::setHidden):
     250        (WTR::InjectedBundle::setCacheModel):
     251        (WTR::InjectedBundle::shouldProcessWorkQueue const):
     252        (WTR::InjectedBundle::processWorkQueue):
     253        (WTR::InjectedBundle::queueBackNavigation):
     254        (WTR::InjectedBundle::queueForwardNavigation):
     255        (WTR::InjectedBundle::queueLoad):
     256        (WTR::InjectedBundle::queueLoadHTMLString):
     257        (WTR::InjectedBundle::queueReload):
     258        (WTR::InjectedBundle::queueLoadingScript):
     259        (WTR::InjectedBundle::queueNonLoadingScript):
     260        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     261        (WTR::frameToStr):
     262        (WTR::InjectedBundlePage::InjectedBundlePage):
     263        (WTR::dumpFrameDescriptionSuitableForTestResult):
     264        (WTR::dumpFrameScrollPosition):
     265        (WTR::dumpDescendantFrameScrollPositions):
     266        (WTR::dumpFrameText):
     267        (WTR::dumpDescendantFramesText):
     268        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     269        (WTR::TestRunner::shouldDumpPixels const):
     270        (WTR::TestRunner::setDumpPixels):
     271        (WTR::TestRunner::whatToDump const):
     272        (WTR::TestRunner::setWhatToDump):
     273        (WTR::TestRunner::setWaitUntilDone):
     274        (WTR::TestRunner::shouldWaitUntilDone const):
     275        (WTR::TestRunner::setShouldDumpFrameLoadCallbacks):
     276        (WTR::TestRunner::shouldDumpFrameLoadCallbacks):
     277        (WTR::TestRunner::clearAllDatabases):
     278        (WTR::TestRunner::setIDBPerOriginQuota):
     279        (WTR::TestRunner::originsWithApplicationCache):
     280        (WTR::TestRunner::setCanOpenWindows):
     281        (WTR::TestRunner::setXSSAuditorEnabled):
     282        (WTR::TestRunner::setMediaDevicesEnabled):
     283        (WTR::TestRunner::setWebRTCMDNSICECandidatesEnabled):
     284        (WTR::TestRunner::setWebRTCUnifiedPlanEnabled):
     285        (WTR::TestRunner::setCustomUserAgent):
     286        (WTR::TestRunner::setWebAPIStatisticsEnabled):
     287        (WTR::TestRunner::setModernMediaControlsEnabled):
     288        (WTR::TestRunner::setWebGL2Enabled):
     289        (WTR::TestRunner::setWritableStreamAPIEnabled):
     290        (WTR::TestRunner::setReadableByteStreamAPIEnabled):
     291        (WTR::TestRunner::setEncryptedMediaAPIEnabled):
     292        (WTR::TestRunner::setAllowsAnySSLCertificate):
     293        (WTR::TestRunner::setPluginsEnabled):
     294        (WTR::TestRunner::setValueForUser):
     295        (WTR::TestRunner::setAudioResult):
     296        (WTR::TestRunner::didReceiveServerRedirectForProvisionalNavigation const):
     297        (WTR::TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation):
     298        (WTR::TestRunner::setAlwaysAcceptCookies):
     299        (WTR::TestRunner::setOnlyAcceptFirstPartyCookies):
     300        (WTR::TestRunner::isDoingMediaCapture const):
     301        (WTR::TestRunner::queueLoad):
     302        (WTR::TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges):
     303        (WTR::TestRunner::setHandlesAuthenticationChallenges):
     304        (WTR::TestRunner::setShouldLogCanAuthenticateAgainstProtectionSpace):
     305        (WTR::TestRunner::setShouldLogDownloadCallbacks):
     306        (WTR::TestRunner::setAuthenticationUsername):
     307        (WTR::TestRunner::setAuthenticationPassword):
     308        (WTR::TestRunner::secureEventInputIsEnabled const):
     309        (WTR::TestRunner::setBlockAllPlugins):
     310        (WTR::TestRunner::setPluginSupportedMode):
     311        (WTR::TestRunner::setShouldDecideNavigationPolicyAfterDelay):
     312        (WTR::TestRunner::setShouldDecideResponsePolicyAfterDelay):
     313        (WTR::TestRunner::setNavigationGesturesEnabled):
     314        (WTR::TestRunner::setIgnoresViewportScaleLimits):
     315        (WTR::TestRunner::setShouldDownloadUndisplayableMIMETypes):
     316        (WTR::TestRunner::setShouldAllowDeviceOrientationAndMotionAccess):
     317        (WTR::TestRunner::terminateNetworkProcess):
     318        (WTR::TestRunner::terminateServiceWorkerProcess):
     319        (WTR::TestRunner::runUIScript):
     320        (WTR::TestRunner::setStatisticsDebugMode):
     321        (WTR::TestRunner::setStatisticsPrevalentResourceForDebugMode):
     322        (WTR::TestRunner::setStatisticsLastSeen):
     323        (WTR::TestRunner::setStatisticsPrevalentResource):
     324        (WTR::TestRunner::setStatisticsVeryPrevalentResource):
     325        (WTR::TestRunner::dumpResourceLoadStatistics):
     326        (WTR::TestRunner::isStatisticsPrevalentResource):
     327        (WTR::TestRunner::isStatisticsVeryPrevalentResource):
     328        (WTR::TestRunner::isStatisticsRegisteredAsSubresourceUnder):
     329        (WTR::TestRunner::isStatisticsRegisteredAsSubFrameUnder):
     330        (WTR::TestRunner::isStatisticsRegisteredAsRedirectingTo):
     331        (WTR::TestRunner::setStatisticsHasHadUserInteraction):
     332        (WTR::TestRunner::isStatisticsHasHadUserInteraction):
     333        (WTR::TestRunner::setStatisticsGrandfathered):
     334        (WTR::TestRunner::isStatisticsGrandfathered):
     335        (WTR::TestRunner::setStatisticsSubframeUnderTopFrameOrigin):
     336        (WTR::TestRunner::setStatisticsSubresourceUnderTopFrameOrigin):
     337        (WTR::TestRunner::setStatisticsSubresourceUniqueRedirectTo):
     338        (WTR::TestRunner::setStatisticsSubresourceUniqueRedirectFrom):
     339        (WTR::TestRunner::setStatisticsTopFrameUniqueRedirectTo):
     340        (WTR::TestRunner::setStatisticsTopFrameUniqueRedirectFrom):
     341        (WTR::TestRunner::setStatisticsCrossSiteLoadWithLinkDecoration):
     342        (WTR::TestRunner::setStatisticsTimeToLiveUserInteraction):
     343        (WTR::TestRunner::installStatisticsDidScanDataRecordsCallback):
     344        (WTR::TestRunner::statisticsProcessStatisticsAndDataRecords):
     345        (WTR::TestRunner::statisticsUpdateCookieBlocking):
     346        (WTR::TestRunner::statisticsSubmitTelemetry):
     347        (WTR::TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned):
     348        (WTR::TestRunner::setStatisticsIsRunningTest):
     349        (WTR::TestRunner::setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
     350        (WTR::TestRunner::setStatisticsNotifyPagesWhenTelemetryWasCaptured):
     351        (WTR::TestRunner::setStatisticsMinimumTimeBetweenDataRecordsRemoval):
     352        (WTR::TestRunner::setStatisticsGrandfatheringTime):
     353        (WTR::TestRunner::setStatisticsMaxStatisticsEntries):
     354        (WTR::TestRunner::setStatisticsPruneEntriesDownTo):
     355        (WTR::TestRunner::statisticsClearInMemoryAndPersistentStore):
     356        (WTR::TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
     357        (WTR::TestRunner::statisticsClearThroughWebsiteDataRemoval):
     358        (WTR::TestRunner::statisticsDeleteCookiesForHost):
     359        (WTR::TestRunner::setStatisticsCacheMaxAgeCap):
     360        (WTR::TestRunner::statisticsResetToConsistentState):
     361        (WTR::TestRunner::setStorageAccessAPIEnabled):
     362        (WTR::TestRunner::getAllStorageAccessEntries):
     363        (WTR::TestRunner::addMockMediaDevice):
     364        (WTR::TestRunner::clearMockMediaDevices):
     365        (WTR::TestRunner::removeMockMediaDevice):
     366        (WTR::TestRunner::resetMockMediaDevices):
     367        (WTR::TestRunner::connectMockGamepad):
     368        (WTR::TestRunner::disconnectMockGamepad):
     369        (WTR::TestRunner::setMockGamepadDetails):
     370        (WTR::TestRunner::setMockGamepadAxisValue):
     371        (WTR::TestRunner::setMockGamepadButtonValue):
     372        (WTR::TestRunner::removeAllSessionCredentials):
     373        (WTR::TestRunner::clearDOMCache):
     374        (WTR::TestRunner::clearDOMCaches):
     375        (WTR::TestRunner::hasDOMCache):
     376        (WTR::TestRunner::domCacheSize):
     377        (WTR::TestRunner::setAllowStorageQuotaIncrease):
     378        (WTR::TestRunner::getApplicationManifestThen):
     379        (WTR::TestRunner::injectUserScript):
     380        (WTR::TestRunner::sendDisplayConfigurationChangedMessageForTesting):
     381        (WTR::TestRunner::setWebAuthenticationMockConfiguration):
     382        (WTR::TestRunner::addTestKeyToKeychain):
     383        (WTR::TestRunner::cleanUpKeychain):
     384        (WTR::TestRunner::keyExistsInKeychain):
     385        (WTR::TestRunner::setCanHandleHTTPSServerTrustEvaluation):
     386        (WTR::TestRunner::canDoServerTrustEvaluationInNetworkProcess):
     387        (WTR::TestRunner::serverTrustEvaluationCallbackCallsCount):
     388        (WTR::TestRunner::setShouldDismissJavaScriptAlertsAsynchronously):
     389        (WTR::TestRunner::setAdClickAttributionOverrideTimerForTesting):
     390        (WTR::TestRunner::setAdClickAttributionConversionURLForTesting):
     391        * WebKitTestRunner/TestController.cpp:
     392        (WTR::TestController::initialize):
     393        (WTR::parseStringTestHeaderValueAsRelativePath):
     394        (WTR::updateTestOptionsFromTestHeader):
     395        (WTR::TestController::runTest):
     396        (WTR::TestController::didReceiveLiveDocumentsList):
     397        (WTR::TestController::didReceiveMessageFromInjectedBundle):
     398        (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
     399        (WTR::TestController::didFinishNavigation):
     400        (WTR::TestController::didReceiveAuthenticationChallenge):
     401        * WebKitTestRunner/TestInvocation.cpp:
     402        (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
     403        (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
     404        (WTR::TestInvocation::uiScriptDidComplete):
     405        (WTR::TestInvocation::didReceiveAllStorageAccessEntries):
     406        * WebKitTestRunner/WebNotificationProvider.cpp:
     407        (WTR::WebNotificationProvider::closeWebNotification):
     408        * WebKitTestRunner/WorkQueueManager.cpp:
     409        (WTR::ScriptItem::ScriptItem):
     410        (WTR::WorkQueueManager::queueLoad):
     411        (WTR::WorkQueueManager::queueLoadHTMLString):
     412
    14132019-04-17  Alex Christensen  <achristensen@webkit.org>
    2414
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r244078 r244390  
    15271527    // a CFString via fromUTF8WithLatin1Fallback().createCFString() which can be appended to
    15281528    // the result without any conversion.
    1529     WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKStringCreateWithCFString((__bridge CFStringRef)innerText));
     1529    WKRetainPtr<WKStringRef> stringRef = adoptWK(WKStringCreateWithCFString((__bridge CFStringRef)innerText));
    15301530    size_t bufferSize = WKStringGetMaximumUTF8CStringSize(stringRef.get());
    15311531    auto buffer = std::make_unique<char[]>(bufferSize);
  • trunk/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp

    r244106 r244390  
    321321            WKRetainPtr<WKStringRef> username = createWKString("accept server trust");
    322322            WKRetainPtr<WKStringRef> password = createWKString("");
    323             WKRetainPtr<WKCredentialRef> wkCredential(AdoptWK, WKCredentialCreate(username.get(), password.get(), kWKCredentialPersistenceForSession));
     323            WKRetainPtr<WKCredentialRef> wkCredential = adoptWK(WKCredentialCreate(username.get(), password.get(), kWKCredentialPersistenceForSession));
    324324            WKAuthenticationDecisionListenerUseCredential(decisionListener, wkCredential.get());
    325325            return;
     
    331331            WKRetainPtr<WKStringRef> username = createWKString(credential->username);
    332332            WKRetainPtr<WKStringRef> password = createWKString(credential->password);
    333             WKRetainPtr<WKCredentialRef> wkCredential(AdoptWK, WKCredentialCreate(username.get(), password.get(), kWKCredentialPersistenceForSession));
     333            WKRetainPtr<WKCredentialRef> wkCredential = adoptWK(WKCredentialCreate(username.get(), password.get(), kWKCredentialPersistenceForSession));
    334334            WKAuthenticationDecisionListenerUseCredential(decisionListener, wkCredential.get());
    335335            return;
  • trunk/Tools/TestWebKitAPI/InjectedBundleController.cpp

    r179409 r244390  
    7373    WKDictionaryRef initializationDictionary = static_cast<WKDictionaryRef>(initializationUserData);
    7474
    75     WKRetainPtr<WKStringRef> testNameKey(AdoptWK, WKStringCreateWithUTF8CString("TestName"));
     75    WKRetainPtr<WKStringRef> testNameKey = adoptWK(WKStringCreateWithUTF8CString("TestName"));
    7676    WKStringRef testName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(initializationDictionary, testNameKey.get()));
    7777
    78     WKRetainPtr<WKStringRef> userDataKey(AdoptWK, WKStringCreateWithUTF8CString("UserData"));
     78    WKRetainPtr<WKStringRef> userDataKey = adoptWK(WKStringCreateWithUTF8CString("UserData"));
    7979    WKTypeRef userData = WKDictionaryGetItemForKey(initializationDictionary, userDataKey.get());
    8080    initializeTestNamed(bundle, Util::toSTD(testName), userData);
  • trunk/Tools/TestWebKitAPI/PlatformUtilities.cpp

    r198141 r244390  
    3636WKContextRef createContextWithInjectedBundle()
    3737{
    38     WKRetainPtr<WKStringRef> injectedBundlePath(AdoptWK, createInjectedBundlePath());
     38    WKRetainPtr<WKStringRef> injectedBundlePath = adoptWK(createInjectedBundlePath());
    3939    WKContextRef context = WKContextCreateWithInjectedBundlePath(injectedBundlePath.get());
    4040
     
    4646    WKMutableDictionaryRef initializationDictionary = WKMutableDictionaryCreate();
    4747
    48     WKRetainPtr<WKStringRef> testNameKey(AdoptWK, WKStringCreateWithUTF8CString("TestName"));
    49     WKRetainPtr<WKStringRef> testNameString(AdoptWK, WKStringCreateWithUTF8CString(testName.c_str()));
     48    WKRetainPtr<WKStringRef> testNameKey = adoptWK(WKStringCreateWithUTF8CString("TestName"));
     49    WKRetainPtr<WKStringRef> testNameString = adoptWK(WKStringCreateWithUTF8CString(testName.c_str()));
    5050    WKDictionarySetItem(initializationDictionary, testNameKey.get(), testNameString.get());
    5151
    52     WKRetainPtr<WKStringRef> userDataKey(AdoptWK, WKStringCreateWithUTF8CString("UserData"));
     52    WKRetainPtr<WKStringRef> userDataKey = adoptWK(WKStringCreateWithUTF8CString("UserData"));
    5353    WKDictionarySetItem(initializationDictionary, userDataKey.get(), userData);
    5454
     
    6060    WKContextRef context = createContextWithInjectedBundle();
    6161
    62     WKRetainPtr<WKDictionaryRef> initializationDictionary(AdoptWK, createInitializationDictionaryForInjectedBundleTest(testName, userData));
     62    WKRetainPtr<WKDictionaryRef> initializationDictionary = adoptWK(createInitializationDictionaryForInjectedBundleTest(testName, userData));
    6363    WKContextSetInitializationUserDataForInjectedBundle(context, initializationDictionary.get());
    6464
     
    8181WKRetainPtr<WKStringRef> toWK(const char* utf8String)
    8282{
    83     return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithUTF8CString(utf8String));
     83    return adoptWK(WKStringCreateWithUTF8CString(utf8String));
    8484}
    8585
  • trunk/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm

    r242339 r244390  
    5353
    5454    // Allow file URLs to load non-file resources
    55     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     55    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    5656    WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true);
    5757    WKPageGroupSetPreferences(browsingContextGroup.get()._pageGroupRef, preferences.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/CloseFromWithinCreatePage.cpp

    r239631 r244390  
    6464TEST(WebKit, CloseFromWithinCreatePage)
    6565{
    66     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     66    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    6767
    6868    PlatformWebView webView(context.get());
     
    7777
    7878    // Allow file URLs to load non-file resources
    79     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     79    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    8080    WKPageGroupRef pageGroup = WKPageGetPageGroup(webView.page());
    8181    WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true);
    8282    WKPageGroupSetPreferences(pageGroup, preferences.get());
    8383   
    84     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("close-from-within-create-page", "html"));
     84    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("close-from-within-create-page", "html"));
    8585    WKPageLoadURL(webView.page(), url.get());
    8686
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/CloseThenTerminate.cpp

    r239631 r244390  
    5656    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    5757
    58     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     58    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    5959    WKPageLoadURL(webView.page(), url.get());
    6060
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic.cpp

    r236888 r244390  
    8383TEST(WebKit, DISABLED_DOMWindowExtensionBasic)
    8484{
    85     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup")));
     85    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup")));
    8686
    87     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("DOMWindowExtensionBasic", pageGroup.get()));
     87    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DOMWindowExtensionBasic", pageGroup.get()));
    8888
    8989    WKContextInjectedBundleClientV0 injectedBundleClient;
     
    102102   
    103103    // Make sure the extensions for each frame are installed in each world.
    104     WKRetainPtr<WKURLRef> url1(AdoptWK, Util::createURLForResource("simple-iframe", "html"));
     104    WKRetainPtr<WKURLRef> url1 = adoptWK(Util::createURLForResource("simple-iframe", "html"));
    105105    WKPageLoadURL(webView.page(), url1.get());
    106106
     
    109109   
    110110    // Make sure those first 4 extensions are disconnected, and 2 new ones are installed.
    111     WKRetainPtr<WKURLRef> url2(AdoptWK, Util::createURLForResource("simple", "html"));
     111    WKRetainPtr<WKURLRef> url2 = adoptWK(Util::createURLForResource("simple", "html"));
    112112    WKPageLoadURL(webView.page(), url2.get());
    113113
     
    138138TEST(WebKit, DOMWindowExtensionCrashOnReload)
    139139{
    140     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup")));
     140    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup")));
    141141
    142     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("DOMWindowExtensionBasic", pageGroup.get()));
     142    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DOMWindowExtensionBasic", pageGroup.get()));
    143143
    144144    WKContextInjectedBundleClientV0 injectedBundleClient;
     
    159159
    160160    // Make sure the extensions for each frame are installed in each world.
    161     WKRetainPtr<WKURLRef> url1(AdoptWK, Util::createURLForResource("simple-iframe", "html"));
     161    WKRetainPtr<WKURLRef> url1 = adoptWK(Util::createURLForResource("simple-iframe", "html"));
    162162    WKPageLoadURL(webView.page(), url1.get());
    163163
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp

    r236888 r244390  
    148148    WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData);
    149149
    150     WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString("alert('Unimportant alert');"));
     150    WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString("alert('Unimportant alert');"));
    151151    WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldCreateWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames);
    152152}
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache.cpp

    r221505 r244390  
    8484TEST(WebKit, DISABLED_DOMWindowExtensionNoCache)
    8585{
    86     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionNoCachePageGroup")));
     86    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionNoCachePageGroup")));
    8787
    88     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("DOMWindowExtensionNoCache", pageGroup.get()));
     88    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DOMWindowExtensionNoCache", pageGroup.get()));
    8989
    9090    WKContextInjectedBundleClientV1 injectedBundleClient;
     
    102102
    103103    // Make sure the extensions for each frame are installed in each world.
    104     WKRetainPtr<WKURLRef> url1(AdoptWK, Util::createURLForResource("simple-iframe", "html"));
     104    WKRetainPtr<WKURLRef> url1 = adoptWK(Util::createURLForResource("simple-iframe", "html"));
    105105    WKPageLoadURL(webView.page(), url1.get());
    106106
     
    109109
    110110    // Make sure those first 4 extensions are destroyed, and 2 new ones are installed.
    111     WKRetainPtr<WKURLRef> url2(AdoptWK, Util::createURLForResource("simple", "html"));
     111    WKRetainPtr<WKURLRef> url2 = adoptWK(Util::createURLForResource("simple", "html"));
    112112    WKPageLoadURL(webView.page(), url2.get());
    113113
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp

    r177506 r244390  
    155155    WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData);
    156156
    157     WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString("alert('Unimportant alert');"));
     157    WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString("alert('Unimportant alert');"));
    158158    WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldCreateWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames);
    159159}
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm

    r235117 r244390  
    6161    setPageLoaderClient(webView.page());
    6262
    63     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("lots-of-text", "html"));
     63    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("lots-of-text", "html"));
    6464    WKPageLoadURL(webView.page(), url.get());
    6565    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DidNotHandleKeyDown.cpp

    r235117 r244390  
    4747TEST(WebKit, DidNotHandleKeyDown)
    4848{
    49     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
     49    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
    5050    PlatformWebView webView(context.get());
    5151
     
    5858    WKPageSetPageUIClient(webView.page(), &uiClient.base);
    5959
    60     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     60    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    6161    WKPageLoadURL(webView.page(), url.get());
    6262
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp

    r241500 r244390  
    5353    RELEASE_ASSERT(!WKBundleFrameGetParentFrame(frame));
    5454
    55     WKRetainPtr<WKStringRef> message(AdoptWK, WKStringCreateWithUTF8CString("DidRemoveFrameFromHierarchy"));
     55    WKRetainPtr<WKStringRef> message = adoptWK(WKStringCreateWithUTF8CString("DidRemoveFrameFromHierarchy"));
    5656    WKBundlePagePostMessage(page, message.get(), message.get());
    5757}
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash.cpp

    r221505 r244390  
    4949TEST(WebKit, DocumentStartUserScriptAlertCrashTest)
    5050{
    51     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DocumentStartUserScriptAlertCrashTestPageGroup")));
     51    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DocumentStartUserScriptAlertCrashTestPageGroup")));
    5252
    53     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("DocumentStartUserScriptAlertCrashTest", pageGroup.get()));
     53    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DocumentStartUserScriptAlertCrashTest", pageGroup.get()));
    5454    PlatformWebView webView(context.get(), pageGroup.get());
    5555
     
    6262    WKPageSetPageUIClient(webView.page(), &uiClient.base);
    6363
    64     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     64    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    6565    WKPageLoadURL(webView.page(), url.get());
    6666
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp

    r177506 r244390  
    4949        WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData);
    5050
    51         WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString("alert('an alert');"));
     51        WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString("alert('an alert');"));
    5252        WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldNormalWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames);
    5353    }
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/EnumerateMediaDevices.cpp

    r239631 r244390  
    5252    auto context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5353
    54     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("EnumerateDevices").get()));
     54    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("EnumerateDevices").get()));
    5555    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    5656    WKPreferencesSetMediaDevicesEnabled(preferences, true);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp

    r239631 r244390  
    7878    WKPageSetPageNavigationClient(webView.page(), &pageLoaderClient.base);
    7979
    80     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     80    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    8181    WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true);
    8282
     
    8484    WKPageGroupSetPreferences(pageGroup, preferences.get());
    8585
    86     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("push-state", "html"));
     86    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("push-state", "html"));
    8787    WKPageLoadURL(webView.page(), url.get());
    8888
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/EvaluateJavaScript.cpp

    r239631 r244390  
    5252TEST(WebKit, EvaluateJavaScriptThatThrowsAnException)
    5353{
    54     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     54    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5555    PlatformWebView webView(context.get());
    5656
    57     WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("throw 'Hello'"));
     57    WKRetainPtr<WKStringRef> javaScriptString = adoptWK(WKStringCreateWithUTF8CString("throw 'Hello'"));
    5858    WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), reinterpret_cast<void*>(0x1234578), didRunJavaScript);
    5959
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/EventModifiers.cpp

    r239631 r244390  
    7070    setClients(webView.page());
    7171   
    72     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     72    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    7373    WKPageLoadURL(webView.page(), url.get());
    7474    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FailedLoad.cpp

    r239631 r244390  
    5252TEST(WebKit, FailedLoad)
    5353{
    54     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     54    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5555    PlatformWebView webView(context.get());
    5656
     
    6363    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    6464
    65     WKRetainPtr<WKURLRef> url(AdoptWK, Util::URLForNonExistentResource());
     65    WKRetainPtr<WKURLRef> url = adoptWK(Util::URLForNonExistentResource());
    6666    WKPageLoadURL(webView.page(), url.get());
    6767
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/Find.cpp

    r239631 r244390  
    5252TEST(WebKit, Find)
    5353{
    54     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     54    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5555    PlatformWebView webView(context.get());
    5656   
     
    7171    WKPageSetPageFindClient(webView.page(), &findClient.base);
    7272
    73     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("find", "html"));
     73    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("find", "html"));
    7474    WKPageLoadURL(webView.page(), url.get());
    7575
    7676    Util::run(&didFinishLoad);
    7777
    78     WKRetainPtr<WKStringRef> findString(AdoptWK, WKStringCreateWithUTF8CString("Hello"));
     78    WKRetainPtr<WKStringRef> findString = adoptWK(WKStringCreateWithUTF8CString("Hello"));
    7979    WKPageCountStringMatches(webView.page(), findString.get(), true, 100);
    8080
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm

    r239631 r244390  
    119119TEST(WebKit, FindMatches)
    120120{
    121     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     121    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    122122    PlatformWebView webView(context.get());
    123123   
     
    141141    // This HTML file contains 3 occurrences of the word Hello and has the second occurence of the word 'world' selected.
    142142    // It contains 1 occurrence of the word 'crazy' that is before the selected word.
    143     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("findRanges", "html"));
     143    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("findRanges", "html"));
    144144    WKPageLoadURL(webView.page(), url.get());
    145145
    146146    Util::run(&didFinishLoad);
    147147
    148     WKRetainPtr<WKStringRef> findString(AdoptWK, WKStringCreateWithUTF8CString("Hello"));
     148    WKRetainPtr<WKStringRef> findString = adoptWK(WKStringCreateWithUTF8CString("Hello"));
    149149
    150150    WKPageFindStringMatches(webView.page(), findString.get(), findOptions, 100);
     
    169169    didCallFindStringMatches = false;
    170170    findOptions &= ~kWKFindOptionsBackwards;
    171     WKRetainPtr<WKStringRef> findOtherString(AdoptWK, WKStringCreateWithUTF8CString("crazy"));
     171    WKRetainPtr<WKStringRef> findOtherString = adoptWK(WKStringCreateWithUTF8CString("crazy"));
    172172    WKPageFindStringMatches(webView.page(), findOtherString.get(), findOptions, 100);
    173173    Util::run(&didCallFindStringMatches);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FirstMeaningfulPaintMilestone.cpp

    r238306 r244390  
    5555TEST(WebKit, FirstMeaningfulPaint)
    5656{
    57     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("FirstMeaningfulPaintMilestoneTest"));
     57    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("FirstMeaningfulPaintMilestoneTest"));
    5858
    5959    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ForceRepaint.cpp

    r239631 r244390  
    5252TEST(WebKit, ForceRepaint)
    5353{
    54     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     54    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5555    PlatformWebView webView(context.get());
    5656
     
    6363    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    6464
    65     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple-accelerated-compositing", "html"));
     65    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple-accelerated-compositing", "html"));
    6666    WKPageLoadURL(webView.page(), url.get());
    6767
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameHandle.cpp

    r239631 r244390  
    4646TEST(WebKit, FrameHandle)
    4747{
    48     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     48    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    4949    PlatformWebView webView(context.get());
    5050
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp

    r239631 r244390  
    5959TEST(WebKit, FrameMIMETypeHTML)
    6060{
    61     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     61    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    6262    PlatformWebView webView(context.get());
    6363
     
    7272    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7373
    74     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     74    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    7575    WKPageLoadURL(webView.page(), url.get());
    7676
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp

    r239631 r244390  
    5858TEST(WebKit, FrameMIMETypePNG)
    5959{
    60     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     60    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    6161    PlatformWebView webView(context.get());
    6262
     
    7171    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7272
    73     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("icon", "png"));
     73    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("icon", "png"));
    7474    WKPageLoadURL(webView.page(), url.get());
    7575
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/Geolocation.cpp

    r243533 r244390  
    162162TEST(WebKit, GeolocationBasic)
    163163{
    164     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     164    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    165165
    166166    GeolocationBasicStateTracker stateTracker;
     
    170170    setupView(webView);
    171171
    172     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("geolocationGetCurrentPosition", "html"));
     172    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("geolocationGetCurrentPosition", "html"));
    173173    WKPageLoadURL(webView.page(), url.get());
    174174
     
    204204TEST(WebKit, GeolocationBasicWithHighAccuracy)
    205205{
    206     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     206    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    207207
    208208    GeolocationBasicWithHighAccuracyStateTracker stateTracker;
     
    212212    setupView(webView);
    213213
    214     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("geolocationGetCurrentPositionWithHighAccuracy", "html"));
     214    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("geolocationGetCurrentPositionWithHighAccuracy", "html"));
    215215    WKPageLoadURL(webView.page(), url.get());
    216216
     
    257257TEST(WebKit, GeolocationTransitionToHighAccuracy)
    258258{
    259     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     259    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    260260
    261261    GeolocationTransitionToHighAccuracyStateTracker stateTracker;
     
    264264    PlatformWebView lowAccuracyWebView(context.get());
    265265    setupView(lowAccuracyWebView);
    266     WKRetainPtr<WKURLRef> lowAccuracyURL(AdoptWK, Util::createURLForResource("geolocationWatchPosition", "html"));
     266    WKRetainPtr<WKURLRef> lowAccuracyURL = adoptWK(Util::createURLForResource("geolocationWatchPosition", "html"));
    267267    WKPageLoadURL(lowAccuracyWebView.page(), lowAccuracyURL.get());
    268268    Util::run(&stateTracker.finishedFirstStep);
     
    270270    PlatformWebView highAccuracyWebView(lowAccuracyWebView.page());
    271271    setupView(highAccuracyWebView);
    272     WKRetainPtr<WKURLRef> highAccuracyURL(AdoptWK, Util::createURLForResource("geolocationWatchPositionWithHighAccuracy", "html"));
     272    WKRetainPtr<WKURLRef> highAccuracyURL = adoptWK(Util::createURLForResource("geolocationWatchPositionWithHighAccuracy", "html"));
    273273    WKPageLoadURL(highAccuracyWebView.page(), highAccuracyURL.get());
    274274    Util::run(&stateTracker.enabledHighAccuracy);
     
    330330TEST(WebKit, GeolocationTransitionToLowAccuracy)
    331331{
    332     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     332    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    333333
    334334    GeolocationTransitionToLowAccuracyStateTracker stateTracker;
     
    337337    PlatformWebView highAccuracyWebView(context.get());
    338338    setupView(highAccuracyWebView);
    339     WKRetainPtr<WKURLRef> highAccuracyURL(AdoptWK, Util::createURLForResource("geolocationWatchPositionWithHighAccuracy", "html"));
     339    WKRetainPtr<WKURLRef> highAccuracyURL = adoptWK(Util::createURLForResource("geolocationWatchPositionWithHighAccuracy", "html"));
    340340    WKPageLoadURL(highAccuracyWebView.page(), highAccuracyURL.get());
    341341    Util::run(&stateTracker.finishedFirstStep);
     
    354354    WKPageSetPageUIClient(lowAccuracyWebView.page(), &uiClient.base);
    355355
    356     WKRetainPtr<WKURLRef> lowAccuracyURL(AdoptWK, Util::createURLForResource("geolocationWatchPosition", "html"));
     356    WKRetainPtr<WKURLRef> lowAccuracyURL = adoptWK(Util::createURLForResource("geolocationWatchPosition", "html"));
    357357    WKPageLoadURL(lowAccuracyWebView.page(), lowAccuracyURL.get());
    358358    Util::run(&secondStepContext.didRun);
     
    372372TEST(WebKit, GeolocationWatchMultiprocess)
    373373{
    374     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     374    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    375375
    376376    GeolocationStateTracker stateTracker;
     
    388388    PlatformWebView view1(context.get());
    389389    WKPageSetPageUIClient(view1.page(), &uiClient.base);
    390     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("geolocationWatchPosition", "html"));
     390    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("geolocationWatchPosition", "html"));
    391391    WKPageLoadURL(view1.page(), url.get());
    392392    Util::run(&testContext.didRun);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/GetInjectedBundleInitializationUserDataCallback.cpp

    r221505 r244390  
    4949TEST(WebKit, GetInjectedBundleInitializationUserDataCallback)
    5050{
    51     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
     51    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
    5252
    5353    WKContextInjectedBundleClientV1 injectedBundleClient;
     
    6262    PlatformWebView webView(context.get());
    6363
    64     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     64    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    6565    WKPageLoadURL(webView.page(), url.get());
    6666
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle.cpp

    r235117 r244390  
    7474TEST(WebKit, HitTestResultNodeHandle)
    7575{
    76     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("HitTestResultNodeHandleTest"));
     76    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("HitTestResultNodeHandleTest"));
    7777   
    7878    setInjectedBundleClient(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle_Bundle.cpp

    r179409 r244390  
    4646    static void getContextMenuFromDefaultMenu(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKArrayRef defaultMenu, WKArrayRef* newMenu, WKTypeRef* userData, const void* clientInfo)
    4747    {
    48         WKRetainPtr<WKBundleNodeHandleRef> nodeHandle(AdoptWK, WKBundleHitTestResultCopyNodeHandle(hitTestResult));
     48        WKRetainPtr<WKBundleNodeHandleRef> nodeHandle = adoptWK(WKBundleHitTestResultCopyNodeHandle(hitTestResult));
    4949        if (!nodeHandle)
    5050            return;
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleBasic.cpp

    r235117 r244390  
    5454TEST(WebKit, InjectedBundleBasic)
    5555{
    56     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleBasicTest"));
     56    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleBasicTest"));
    5757
    5858    WKContextInjectedBundleClientV0 injectedBundleClient;
     
    7474    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7575
    76     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     76    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    7777    WKPageLoadURL(webView.page(), url.get());
    7878
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior.cpp

    r228309 r244390  
    5151TEST(WebKit, InjectedBundleNoDisableOverrideBuiltinsBehaviorTest)
    5252{
    53     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleNoDisableOverrideBuiltinsBehaviorTestPageGroup")));
     53    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleNoDisableOverrideBuiltinsBehaviorTestPageGroup")));
    5454
    55     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleNoDisableOverrideBuiltinsBehaviorTest", pageGroup.get()));
     55    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleNoDisableOverrideBuiltinsBehaviorTest", pageGroup.get()));
    5656    PlatformWebView webView(context.get(), pageGroup.get());
    5757
     
    6666    testNumber = 0;
    6767    done = false;
    68     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("override-builtins-test", "html"));
     68    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("override-builtins-test", "html"));
    6969    WKPageLoadURL(webView.page(), url.get());
    7070
     
    8585TEST(WebKit, InjectedBundleDisableOverrideBuiltinsBehaviorTest)
    8686{
    87     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleDisableOverrideBuiltinsBehaviorTestPageGroup")));
     87    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleDisableOverrideBuiltinsBehaviorTestPageGroup")));
    8888
    89     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleDisableOverrideBuiltinsBehaviorTest", pageGroup.get()));
     89    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleDisableOverrideBuiltinsBehaviorTest", pageGroup.get()));
    9090    PlatformWebView webView(context.get(), pageGroup.get());
    9191
     
    100100    testNumber = 0;
    101101    done = false;
    102     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("override-builtins-test", "html"));
     102    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("override-builtins-test", "html"));
    103103    WKPageLoadURL(webView.page(), url.get());
    104104
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp

    r228309 r244390  
    4848        WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData);
    4949
    50         WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString(
     50        WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString(
    5151            "window.onload = function () {\n"
    5252            "    const form = document.getElementById('test').parentNode;\n"
     
    7373        WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData);
    7474
    75         WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString(
     75        WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString(
    7676            "window.onload = function () {\n"
    7777            "    const form = document.getElementById('test').parentNode;\n"
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest.cpp

    r221505 r244390  
    5858TEST(WebKit, InjectedBundleFrameHitTest)
    5959{
    60     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleFrameHitTestTest"));
     60    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleFrameHitTestTest"));
    6161   
    6262    setInjectedBundleClient(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest_Bundle.cpp

    r197563 r244390  
    7575{
    7676    WKBundleHitTestResultRef hitTestResult = WKBundleFrameCreateHitTestResult(frame, WKPointMake(50, 50));
    77     WKRetainPtr<WKStringRef> linkTitle(AdoptWK, WKBundleHitTestResultCopyLinkTitle(hitTestResult));
     77    WKRetainPtr<WKStringRef> linkTitle = adoptWK(WKBundleHitTestResultCopyLinkTitle(hitTestResult));
    7878    WKBundlePostMessage(m_bundle, Util::toWK("InjectedBundleFrameHitTestDone").get(), linkTitle.get());
    7979}
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleInitializationUserDataCallbackWins.cpp

    r221505 r244390  
    4949TEST(WebKit, InjectedBundleInitializationUserDataCallbackWins)
    5050{
    51     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
    52     WKRetainPtr<WKDictionaryRef> initializationDictionary(AdoptWK, Util::createInitializationDictionaryForInjectedBundleTest("InjectedBundleInitializationUserDataCallbackWinsTest",  Util::toWK("Set with WKContextSetInitializationUserDataForInjectedBundle").get()));
     51    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
     52    WKRetainPtr<WKDictionaryRef> initializationDictionary = adoptWK(Util::createInitializationDictionaryForInjectedBundleTest("InjectedBundleInitializationUserDataCallbackWinsTest",  Util::toWK("Set with WKContextSetInitializationUserDataForInjectedBundle").get()));
    5353    WKContextSetInitializationUserDataForInjectedBundle(context.get(), initializationDictionary.get());
    5454
     
    6464    PlatformWebView webView(context.get());
    6565
    66     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     66    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    6767    WKPageLoadURL(webView.page(), url.get());
    6868
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen.cpp

    r221505 r244390  
    8686TEST(WebKit, InjectedBundleMakeAllShadowRootOpenTest)
    8787{
    88     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleMakeAllShadowRootOpenTestPageGroup")));
     88    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleMakeAllShadowRootOpenTestPageGroup")));
    8989
    90     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleMakeAllShadowRootOpenTest", pageGroup.get()));
     90    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleMakeAllShadowRootOpenTest", pageGroup.get()));
    9191    PlatformWebView webView(context.get(), pageGroup.get());
    9292
     
    9999    WKPageSetPageUIClient(webView.page(), &uiClient.base);
    100100
    101     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("closed-shadow-tree-test", "html"));
     101    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("closed-shadow-tree-test", "html"));
    102102    WKPageLoadURL(webView.page(), url.get());
    103103
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp

    r211139 r244390  
    5151        WKBundleScriptWorldMakeAllShadowRootsOpen(world);
    5252
    53         WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString(
     53        WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString(
    5454            "window.onload = function () {\n"
    5555            "    const element = document.createElement('div');\n"
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp

    r240450 r244390  
    5454TEST(WebKit, LayoutMilestonesWithAllContentInFrame)
    5555{
    56     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     56    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5757    PlatformWebView webView(context.get());
    5858
     
    7575TEST(WebKit, FirstVisuallyNonEmptyLayoutAfterPageCacheRestore)
    7676{
    77     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     77    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    7878
    7979    WKContextSetCacheModel(context.get(), kWKCacheModelPrimaryWebBrowser); // Enables the Page Cache.
     
    120120TEST(WebKit, FirstVisuallyNonEmptyMilestoneWithLoadComplete)
    121121{
    122     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     122    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    123123    PlatformWebView webView(context.get());
    124124
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/LoadAlternateHTMLStringWithNonDirectoryURL.cpp

    r239631 r244390  
    4848static void loadAlternateHTMLString(WKURLRef baseURL, WKURLRef unreachableURL)
    4949{
    50     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     50    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5151    PlatformWebView webView(context.get());
    5252
     
    5858    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    5959
    60     WKRetainPtr<WKStringRef> alternateHTMLString(AdoptWK, WKStringCreateWithUTF8CString("<html><body><img src='icon.png'></body></html>"));
     60    WKRetainPtr<WKStringRef> alternateHTMLString = adoptWK(WKStringCreateWithUTF8CString("<html><body><img src='icon.png'></body></html>"));
    6161    WKPageLoadAlternateHTMLString(webView.page(), alternateHTMLString.get(), baseURL, unreachableURL);
    6262
     
    6868{
    6969    // Call WKPageLoadAlternateHTMLString() with fileURL which does not point to a directory.
    70     WKRetainPtr<WKURLRef> fileURL(AdoptWK, Util::createURLForResource("simple", "html"));
     70    WKRetainPtr<WKURLRef> fileURL = adoptWK(Util::createURLForResource("simple", "html"));
    7171    loadAlternateHTMLString(fileURL.get(), fileURL.get());
    7272}
     
    7777    // when baseURL does not grant read access to the unreachableURL. We use a separate test
    7878    // to ensure the previous test does not pollute the result.
    79     WKRetainPtr<WKURLRef> unreachableURL(AdoptWK, Util::URLForNonExistentResource());
     79    WKRetainPtr<WKURLRef> unreachableURL = adoptWK(Util::URLForNonExistentResource());
    8080    loadAlternateHTMLString(nullptr, unreachableURL.get());
    8181}
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/LoadCanceledNoServerRedirectCallback.cpp

    r235117 r244390  
    5454TEST(WebKit, LoadCanceledNoServerRedirectCallback)
    5555{
    56     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("LoadCanceledNoServerRedirectCallbackTest"));
     56    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("LoadCanceledNoServerRedirectCallbackTest"));
    5757   
    5858    WKContextInjectedBundleClientV0 injectedBundleClient;
     
    8181    WKContextSetHistoryClient(context.get(), &historyClient.base);
    8282
    83     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple-iframe", "html"));
     83    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple-iframe", "html"));
    8484    WKPageLoadURL(webView.page(), url.get());
    8585    Util::run(&loadedAllFrames);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/LoadPageOnCrash.cpp

    r239631 r244390  
    4040public:
    4141    WebKit2CrashLoader()
    42         : context(AdoptWK, WKContextCreateWithConfiguration(nullptr))
     42        : context(adoptWK(WKContextCreateWithConfiguration(nullptr)))
    4343        , webView(context.get())
    4444        , url(adoptWK(WKURLCreateWithUTF8CString("about:blank")))
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/MenuTypesForMouseEvents.cpp

    r239631 r244390  
    5454static void buildAndPerformTest(WKEventMouseButton button, WKEventModifiers modifiers, const char* expectedButton, const char* expectedMenuType)
    5555{
    56     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     56    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5757    PlatformWebView webView(context.get());
    5858    setPageLoaderClient(webView.page());
    5959
    60     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("mouse-button-listener", "html"));
     60    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("mouse-button-listener", "html"));
    6161    WKPageLoadURL(webView.page(), url.get());
    6262    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ModalAlertsSPI.cpp

    r239631 r244390  
    134134    WKPageSetPageUIClient(webView.page(), &uiClient.base);
    135135
    136     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("modal-alerts-in-new-about-blank-window", "html"));
     136    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("modal-alerts-in-new-about-blank-window", "html"));
    137137    WKPageLoadURL(webView.page(), url.get());
    138138
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/MouseMoveAfterCrash.cpp

    r235117 r244390  
    5959    setPageLoaderClient(webView.page());
    6060
    61     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("mouse-move-listener", "html"));
     61    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("mouse-move-listener", "html"));
    6262    WKPageLoadURL(webView.page(), url.get());
    6363    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayout.cpp

    r235138 r244390  
    7676TEST(WebKit, DISABLED_NewFirstVisuallyNonEmptyLayout)
    7777{
    78     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutTest"));
     78    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutTest"));
    7979
    8080    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFails.cpp

    r235138 r244390  
    7272TEST(WebKit, NewFirstVisuallyNonEmptyLayoutFails)
    7373{
    74     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFailsTest"));
     74    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFailsTest"));
    7575
    7676    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutForImages.cpp

    r235138 r244390  
    7676TEST(WebKit, DISABLED_NewFirstVisuallyNonEmptyLayoutForImages)
    7777{
    78     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutForImagesTest"));
     78    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutForImagesTest"));
    7979
    8080    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp

    r235123 r244390  
    7878{
    7979    didHitRelevantRepaintedObjectsAreaThresholdCounter = 0;
    80     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFramesTest"));
     80    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFramesTest"));
    8181
    8282    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp

    r239631 r244390  
    109109    State state;
    110110
    111     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     111    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    112112    PlatformWebView webView(context.get());
    113113
     
    128128    EXPECT_NULL(WKPageCopyActiveURL(webView.page()));
    129129
    130     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     130    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    131131    WKPageLoadURL(webView.page(), url.get());
    132132
     
    141141TEST(WebKit, PageReload)
    142142{
    143     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     143    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    144144    PlatformWebView webView(context.get());
    145145
     
    148148    WKPageReload(webView.page());
    149149
    150     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     150    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    151151    WKPageLoadURL(webView.page(), url.get());
    152152
     
    161161TEST(WebKit, PageLoadTwiceAndReload)
    162162{
    163     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     163    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    164164    PlatformWebView webView(context.get());
    165165
     
    184184    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    185185
    186     WKRetainPtr<WKURLRef> url1(AdoptWK, Util::createURLForResource("simple", "html"));
    187     WKRetainPtr<WKURLRef> url2(AdoptWK, Util::createURLForResource("simple2", "html"));
     186    WKRetainPtr<WKURLRef> url1 = adoptWK(Util::createURLForResource("simple", "html"));
     187    WKRetainPtr<WKURLRef> url2 = adoptWK(Util::createURLForResource("simple2", "html"));
    188188    WKPageLoadURL(webView.page(), url1.get());
    189189    WKPageLoadURL(webView.page(), url2.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp

    r239631 r244390  
    5757TEST(WebKit, PageLoadDidChangeLocationWithinPage)
    5858{
    59     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     59    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    6060    PlatformWebView webView(context.get());
    6161
     
    7171    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7272
    73     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("file-with-anchor", "html"));
     73    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("file-with-anchor", "html"));
    7474    WKPageLoadURL(webView.page(), url.get());
    7575    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PasteboardNotifications.mm

    r221505 r244390  
    6868    PlatformWebView webView(context.get());
    6969
    70     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     70    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    7171    WKPreferencesSetJavaScriptCanAccessClipboard(preferences.get(), true);
    7272
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PendingAPIRequestURL.cpp

    r239631 r244390  
    3939TEST(WebKit, PendingAPIRequestURL)
    4040{
    41     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     41    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    4242    PlatformWebView webView(context.get());
    4343
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PreventEmptyUserAgent.cpp

    r239631 r244390  
    6161TEST(WebKit, PreventEmptyUserAgent)
    6262{
    63     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     63    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    6464    PlatformWebView webView(context.get());
    6565
    6666    WKPageSetCustomUserAgent(webView.page(), WKStringCreateWithUTF8CString(""));
    67     WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("navigator.userAgent"));
     67    WKRetainPtr<WKStringRef> javaScriptString = adoptWK(WKStringCreateWithUTF8CString("navigator.userAgent"));
    6868    WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), reinterpret_cast<void*>(0x1234578), didRunJavaScript);
    6969
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp

    r239631 r244390  
    5252TEST(WebKit, PrivateBrowsingPushStateNoHistoryCallback)
    5353{
    54     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     54    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    5555
    5656    WKContextHistoryClientV0 historyClient;
     
    7474    WKPageSetPageNavigationClient(webView.page(), &pageLoaderClient.base);
    7575
    76     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     76    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    7777    WKPreferencesSetPrivateBrowsingEnabled(preferences.get(), true);
    7878    WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true);
     
    8181    WKPageGroupSetPreferences(pageGroup, preferences.get());
    8282
    83     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("push-state", "html"));
     83    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("push-state", "html"));
    8484    WKPageLoadURL(webView.page(), url.get());
    8585
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ProcessDidTerminate.cpp

    r239631 r244390  
    7979TEST(WebKit, ProcessDidTerminateRequestedByClient)
    8080{
    81     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     81    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    8282    PlatformWebView webView(context.get());
    8383
     
    103103TEST(WebKit, ProcessDidTerminateWithReasonCrash)
    104104{
    105     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     105    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    106106    PlatformWebView webView(context.get());
    107107
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ProvisionalURLAfterWillSendRequestCallback.cpp

    r236833 r244390  
    5555    EXPECT_TRUE(WKURLIsEqual(committedURL.get(), static_cast<WKURLRef>(userData)));
    5656
    57     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple2", "html"));
     57    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple2", "html"));
    5858    EXPECT_TRUE(WKURLIsEqual(committedURL.get(), url.get()));
    5959
     
    6363TEST(WebKit2, ProvisionalURLAfterWillSendRequestCallback)
    6464{
    65     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("ProvisionalURLAfterWillSendRequestCallbackTest"));
     65    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("ProvisionalURLAfterWillSendRequestCallbackTest"));
    6666
    6767    WKContextInjectedBundleClientV0 injectedBundleClient;
     
    7979    WKPageSetPageNavigationClient(webView.page(), &navigationClient.base);
    8080
    81     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     81    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    8282    WKPageLoadURL(webView.page(), url.get());
    8383    Util::run(&committedLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ProvisionalURLAfterWillSendRequestCallback_Bundle.cpp

    r207325 r244390  
    5252
    5353        // Change the main frame URL.
    54         WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple2", "html"));
     54        WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple2", "html"));
    5555        return WKURLRequestCreateWithWKURL(url.get());
    5656    }
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp

    r243870 r244390  
    6969TEST(WebKit, ReloadPageAfterCrash)
    7070{
    71     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     71    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    7272    PlatformWebView webView(context.get());
    7373
     
    112112TEST(WebKit, FocusedFrameAfterCrash)
    113113{
    114     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     114    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    115115    PlatformWebView webView(context.get());
    116116
     
    130130    EXPECT_FALSE(!WKPageGetMainFrame(webView.page()));
    131131
    132     WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("frames[2].focus()"));
     132    WKRetainPtr<WKStringRef> javaScriptString = adoptWK(WKStringCreateWithUTF8CString("frames[2].focus()"));
    133133    WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), 0, nullJavaScriptCallback);
    134134
     
    143143TEST(WebKit, FrameSetLargestFrameAfterCrash)
    144144{
    145     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     145    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    146146    PlatformWebView webView(context.get());
    147147
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ResizeReversePaginatedWebView.cpp

    r239631 r244390  
    6262TEST(WebKit, ResizeReversePaginatedWebView)
    6363{
    64     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     64    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    6565    PlatformWebView webView(context.get());
    6666
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ResizeWindowAfterCrash.cpp

    r239631 r244390  
    7676TEST(WebKit, ResizeWindowAfterCrash)
    7777{
    78     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     78    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    7979    TestStatesData states(context.get());
    8080
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp

    r239631 r244390  
    8686TEST(WebKit, RestoreSessionStateContainingScrollRestorationDefault)
    8787{
    88     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     88    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    8989
    9090    PlatformWebView webView(context.get());
     
    104104TEST(WebKit, RestoreSessionStateContainingScrollRestorationDefaultWithAsyncPolicyDelegates)
    105105{
    106     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     106    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    107107
    108108    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/RestoreSessionStateContainingFormData.cpp

    r239631 r244390  
    7373TEST(WebKit, RestoreSessionStateContainingFormData)
    7474{
    75     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     75    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    7676
    7777    // FIXME: Once <rdar://problem/8708435> is fixed, we can move the creation of this
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ScrollPinningBehaviors.cpp

    r239631 r244390  
    7272TEST(WebKit, ScrollPinningBehaviors)
    7373{
    74     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     74    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    7575
    7676    // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to
    7777    // update using WKPageForceRepaint would be better, but for some reason doesn't block until
    7878    // it's updated after the initial WKPageSetScrollPinningBehavior above.
    79     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("NoThreadedScrollingPageGroup").get()));
     79    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("NoThreadedScrollingPageGroup").get()));
    8080    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    8181    WKPreferencesSetThreadedScrollingEnabled(preferences, false);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ShouldKeepCurrentBackForwardListItemInList.cpp

    r239631 r244390  
    124124TEST(WebKit, ShouldKeepCurrentBackForwardListItemInList)
    125125{
    126     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     126    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    127127
    128128    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/SpacebarScrolling.cpp

    r235117 r244390  
    5252TEST(WebKit, SpacebarScrolling)
    5353{
    54     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
     54    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
    5555
    5656    // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to
    5757    // update using WKPageForceRepaint would be better, but for some reason the test still fails occasionally.
    58     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("NoThreadedScrollingPageGroup").get()));
     58    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("NoThreadedScrollingPageGroup").get()));
    5959    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    6060    WKPreferencesSetThreadedScrollingEnabled(preferences, false);
     
    7878    WKPageSetPageUIClient(webView.page(), &uiClient.base);
    7979
    80     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("spacebar-scrolling", "html"));
     80    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("spacebar-scrolling", "html"));
    8181    WKPageLoadURL(webView.page(), url.get());
    8282    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/StopLoadingDuringDidFailProvisionalLoad.cpp

    r235117 r244390  
    6363TEST(WebKit, StopLoadingDuringDidFailProvisionalLoadTest)
    6464{
    65     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("StopLoadingDuringDidFailProvisionalLoadTest"));
     65    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("StopLoadingDuringDidFailProvisionalLoadTest"));
    6666    setInjectedBundleClient(context.get());
    6767
     
    7373    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7474
    75     WKRetainPtr<WKURLRef> url(AdoptWK, Util::URLForNonExistentResource());
     75    WKRetainPtr<WKURLRef> url = adoptWK(Util::URLForNonExistentResource());
    7676    WKPageLoadURL(webView.page(), url.get());
    7777
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/TerminateTwice.cpp

    r239631 r244390  
    4242TEST(WebKit, TerminateTwice)
    4343{
    44     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     44    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    4545    PlatformWebView webView(context.get());
    4646
     
    5353    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    5454
    55     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     55    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    5656    WKPageLoadURL(webView.page(), url.get());
    5757
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/UserMedia.cpp

    r240830 r244390  
    7272    auto context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    7373
    74     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
     74    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
    7575    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    7676    WKPreferencesSetMediaDevicesEnabled(preferences, true);
     
    108108    auto context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    109109
    110     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
     110    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
    111111    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    112112    WKPreferencesSetMediaDevicesEnabled(preferences, true);
     
    168168    auto context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    169169
    170     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
     170    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
    171171    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    172172    WKPreferencesSetMediaDevicesEnabled(preferences, true);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageCopySessionStateWithFiltering.cpp

    r239631 r244390  
    106106TEST(WebKit, WKPageCopySessionStateWithFiltering)
    107107{
    108     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     108    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    109109
    110110    createSessionStates(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageGetScaleFactorNotZero.cpp

    r239631 r244390  
    6666TEST(WebKit, WKPageGetScaleFactorNotZero)
    6767{
    68     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     68    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    6969
    7070    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp

    r239631 r244390  
    118118    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    119119
    120     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("MSEIsPlayingAudioPageGroup").get()));
     120    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("MSEIsPlayingAudioPageGroup").get()));
    121121    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    122122    WKPreferencesSetMediaSourceEnabled(preferences, true);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp

    r238264 r244390  
    107107TEST(WebKit, WKPreferencesCopying)
    108108{
    109     WKRetainPtr<WKStringRef> identifier(AdoptWK, WKStringCreateWithUTF8CString("identifier"));
     109    WKRetainPtr<WKStringRef> identifier = adoptWK(WKStringCreateWithUTF8CString("identifier"));
    110110
    111     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreateWithIdentifier(identifier.get()));
     111    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreateWithIdentifier(identifier.get()));
    112112    WKPreferencesSetDefaultFontSize(preferences.get(), 36);
    113113
    114     WKRetainPtr<WKPreferencesRef> copy(AdoptWK, WKPreferencesCreateCopy(preferences.get()));
     114    WKRetainPtr<WKPreferencesRef> copy = adoptWK(WKPreferencesCreateCopy(preferences.get()));
    115115
    116116    WKPreferencesSetDefaultFontSize(preferences.get(), 24);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/WKThumbnailView.mm

    r242339 r244390  
    103103    WKPageSetCustomBackingScaleFactor(webView.page(), 1);
    104104
    105     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("lots-of-text", "html"));
     105    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("lots-of-text", "html"));
    106106    WKPageLoadURL(webView.page(), url.get());
    107107    Util::run(&didFinishLoad);
     
    149149    WKPageSetCustomBackingScaleFactor(webView.page(), 1);
    150150
    151     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("lots-of-text", "html"));
     151    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("lots-of-text", "html"));
    152152    WKPageLoadURL(webView.page(), url.get());
    153153    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/WillSendSubmitEvent.cpp

    r224206 r244390  
    4545    WKDictionaryRef values = static_cast<WKDictionaryRef>(body);
    4646
    47     WKRetainPtr<WKStringRef> textFieldKey(AdoptWK, WKStringCreateWithUTF8CString("textField"));
     47    WKRetainPtr<WKStringRef> textFieldKey = adoptWK(WKStringCreateWithUTF8CString("textField"));
    4848    WKStringRef textFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, textFieldKey.get()));
    4949    EXPECT_WK_STREQ("text field", textFieldValueWK);
    5050
    51     WKRetainPtr<WKStringRef> passwordFieldKey(AdoptWK, WKStringCreateWithUTF8CString("passwordField"));
     51    WKRetainPtr<WKStringRef> passwordFieldKey = adoptWK(WKStringCreateWithUTF8CString("passwordField"));
    5252    WKStringRef passwordFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, passwordFieldKey.get()));
    5353    EXPECT_WK_STREQ("password field", passwordFieldValueWK);
    5454
    5555    // <input type="hidden"> fields are not sent.
    56     WKRetainPtr<WKStringRef> hiddenFieldKey(AdoptWK, WKStringCreateWithUTF8CString("hiddenField"));
     56    WKRetainPtr<WKStringRef> hiddenFieldKey = adoptWK(WKStringCreateWithUTF8CString("hiddenField"));
    5757    WKStringRef hiddenFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, hiddenFieldKey.get()));
    5858    EXPECT_NULL(hiddenFieldValueWK);
    5959
    60     WKRetainPtr<WKStringRef> targetFrameKey(AdoptWK, WKStringCreateWithUTF8CString("targetFrameIsMainFrame"));
     60    WKRetainPtr<WKStringRef> targetFrameKey = adoptWK(WKStringCreateWithUTF8CString("targetFrameIsMainFrame"));
    6161    WKBooleanRef targetFrameIsMainFrame = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(values, targetFrameKey.get()));
    6262    EXPECT_FALSE(WKBooleanGetValue(targetFrameIsMainFrame));
    6363
    64     WKRetainPtr<WKStringRef> sourceFrameKey(AdoptWK, WKStringCreateWithUTF8CString("sourceFrameIsMainFrame"));
     64    WKRetainPtr<WKStringRef> sourceFrameKey = adoptWK(WKStringCreateWithUTF8CString("sourceFrameIsMainFrame"));
    6565    WKBooleanRef sourceFrameIsMainFrame = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(values, sourceFrameKey.get()));
    6666    EXPECT_TRUE(WKBooleanGetValue(sourceFrameIsMainFrame));
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/AttributedSubstringForProposedRangeWithImage.mm

    r235117 r244390  
    5858TEST(WebKit, AttributedSubstringForProposedRangeWithImage)
    5959{
    60     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
    61     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("AttributedSubstringForProposedRangeWithImagePageGroup").get()));
     60    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
     61    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("AttributedSubstringForProposedRangeWithImagePageGroup").get()));
    6262    PlatformWebView webView(context.get(), pageGroup.get());
    6363
     
    7171    WKContextSetInvalidMessageFunction(invalidMessageFunction);
    7272
    73     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("chinese-character-with-image", "html"));
     73    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("chinese-character-with-image", "html"));
    7474    WKPageLoadURL(webView.page(), url.get());
    7575    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/ContextMenuDownload.mm

    r235117 r244390  
    8181TEST(WebKit, ContextMenuDownloadHTMLDownloadAttribute)
    8282{
    83     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
     83    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
    8484
    8585    WKContextDownloadClientV0 client;
     
    8989    WKContextSetDownloadClient(context.get(), &client.base);
    9090
    91     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("MyGroup").get()));
     91    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("MyGroup").get()));
    9292    PlatformWebView webView(context.get(), pageGroup.get());
    9393
     
    104104    WKPageSetPageContextMenuClient(webView.page(), &contextMenuClient.base);
    105105
    106     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("link-with-download-attribute", "html"));
     106    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("link-with-download-attribute", "html"));
    107107
    108108    expectedOriginatingPage = webView.page();
     
    128128TEST(WebKit, ContextMenuDownloadHTMLDownloadAttributeWithSlashes)
    129129{
    130     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
     130    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
    131131
    132132    WKContextDownloadClientV0 client;
     
    136136    WKContextSetDownloadClient(context.get(), &client.base);
    137137
    138     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("MyGroup").get()));
     138    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("MyGroup").get()));
    139139    PlatformWebView webView(context.get(), pageGroup.get());
    140140
     
    151151    WKPageSetPageContextMenuClient(webView.page(), &contextMenuClient.base);
    152152
    153     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("link-with-download-attribute-with-slashes", "html"));
     153    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("link-with-download-attribute-with-slashes", "html"));
    154154
    155155    expectedOriginatingPage = webView.page();
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter.mm

    r242339 r244390  
    7777TEST(WebKit, CustomBundleParameter)
    7878{
    79     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("CustomBundleParameterTest"));
     79    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("CustomBundleParameterTest"));
    8080   
    8181    WKContextInjectedBundleClientV0 injectedBundleClient;
     
    9797    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    9898   
    99     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     99    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    100100    WKPageLoadURL(webView.page(), url.get());
    101101   
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/EditorCommands.mm

    r235117 r244390  
    4343TEST(WebKit, ScrollByLineCommands)
    4444{
    45     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
     45    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
    4646
    4747    // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to
    4848    // update using WKPageForceRepaint would be better, but for some reason the test still fails occasionally.
    49     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("NoThreadedScrollingPageGroup").get()));
     49    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("NoThreadedScrollingPageGroup").get()));
    5050    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    5151    WKPreferencesSetThreadedScrollingEnabled(preferences, false);
     
    6161    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    6262
    63     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple-tall", "html"));
     63    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple-tall", "html"));
    6464    WKPageLoadURL(webView.page(), url.get());
    6565    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm

    r239904 r244390  
    5858TEST(WebKit, ForceLightAppearanceInBundle)
    5959{
    60     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("ForceLightAppearanceInBundleTest"));
     60    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("ForceLightAppearanceInBundleTest"));
    6161
    6262    PlatformWebView webView(context.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/GetPIDAfterAbortedProcessLaunch.cpp

    r239631 r244390  
    4343TEST(WebKit, GetPIDAfterAbortedProcessLaunch)
    4444{
    45     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     45    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    4646
    4747    PlatformWebView webView(context.get());
     
    5555    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    5656
    57     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     57    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    5858    WKPageLoadURL(webView.page(), url.get());
    5959
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/InjectedBundleAppleEvent.cpp

    r235117 r244390  
    6868TEST(WebKit, InjectedBundleAppleEvent)
    6969{
    70     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleAppleEventTest"));
     70    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleAppleEventTest"));
    7171
    7272    WKContextInjectedBundleClientV0 injectedBundleClient;
     
    8888    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    8989
    90     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
     90    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html"));
    9191    WKPageLoadURL(webView.page(), url.get());
    9292
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm

    r239631 r244390  
    7272TEST(WebKit, RestoreStateAfterTermination)
    7373{
    74     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     74    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    7575    PlatformWebView webView(context.get());
    7676
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm

    r242339 r244390  
    119119{
    120120    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    121     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("FullscreenDelegate").get()));
     121    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("FullscreenDelegate").get()));
    122122    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    123123    WKPreferencesSetFullScreenEnabled(preferences, true);
     
    136136
    137137    receivedLoadedMessage = false;
    138     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("FullscreenDelegate", "html"));
     138    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("FullscreenDelegate", "html"));
    139139    WKPageLoadURL(webView.page(), url.get());
    140140
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm

    r242339 r244390  
    202202{
    203203    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
    204     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("PictureInPicture").get()));
     204    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("PictureInPicture").get()));
    205205    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    206206    WKPreferencesSetFullScreenEnabled(preferences, true);
     
    227227   
    228228    receivedLoadedMessage = false;
    229     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("PictureInPictureDelegate", "html"));
     229    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("PictureInPictureDelegate", "html"));
    230230    WKPageLoadURL(webView.page(), url.get());
    231231    TestWebKitAPI::Util::run(&receivedLoadedMessage);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm

    r242339 r244390  
    4343    {
    4444        configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
    45         WKRetainPtr<WKContextRef> context(AdoptWK, TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
     45        WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
    4646        configuration.get().processPool = (WKProcessPool *)context.get();
    4747        configuration.get().preferences._lowPowerVideoAudioBufferSizeEnabled = YES;
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSuspendMediaBuffering.mm

    r242339 r244390  
    3737{
    3838    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
    39     WKRetainPtr<WKContextRef> context(AdoptWK, TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
     39    WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
    4040    configuration.get().processPool = (WKProcessPool *)context.get();
    4141    configuration.get()._mediaDataLoadsAutomatically = YES;
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm

    r243094 r244390  
    192192    // Test page requires window.internals.
    193193#if WK_HAVE_C_SPI
    194     WKRetainPtr<WKContextRef> context(AdoptWK, TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
     194    WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
    195195    configuration.get().processPool = (WKProcessPool *)context.get();
    196196#endif
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm

    r244097 r244390  
    965965void setConfigurationInjectedBundlePath(WKWebViewConfiguration* configuration)
    966966{
    967     WKRetainPtr<WKContextRef> context(AdoptWK, TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
     967    WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
    968968    configuration.processPool = (WKProcessPool *)context.get();
    969969    auto pool = configuration.processPool;
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm

    r243753 r244390  
    716716    [webView setNavigationDelegate:delegate.get()];
    717717
    718     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     718    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    719719    WKPreferencesSetNeedsSiteSpecificQuirks(preferences.get(), true);
    720720    WKPageGroupSetPreferences(WKPageGetPageGroup([webView _pageForTesting]), preferences.get());
     
    749749    [webView setNavigationDelegate:delegate.get()];
    750750
    751     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     751    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    752752    WKPreferencesSetNeedsSiteSpecificQuirks(preferences.get(), true);
    753753    WKPageGroupSetPreferences(WKPageGetPageGroup([webView _pageForTesting]), preferences.get());
     
    807807    [webView setNavigationDelegate:delegate.get()];
    808808
    809     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     809    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    810810    WKPreferencesSetNeedsSiteSpecificQuirks(preferences.get(), true);
    811811    WKPageGroupSetPreferences(WKPageGetPageGroup([webView _pageForTesting]), preferences.get());
     
    870870    [webView setNavigationDelegate:delegate.get()];
    871871
    872     WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
     872    WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate());
    873873    WKPreferencesSetNeedsSiteSpecificQuirks(preferences.get(), true);
    874874    WKPageGroupSetPreferences(WKPageGetPageGroup([webView _pageForTesting]), preferences.get());
  • trunk/Tools/TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm

    r235117 r244390  
    4444TEST(WebKit, FirstResponderScrollingPosition)
    4545{
    46     WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextWithInjectedBundle());
     46    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle());
    4747
    4848    // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to
    4949    // update using WKPageForceRepaint would be better, but for some reason the test still fails occasionally.
    50     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("NoThreadedScrollingPageGroup").get()));
     50    WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("NoThreadedScrollingPageGroup").get()));
    5151    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
    5252    WKPreferencesSetThreadedScrollingEnabled(preferences, false);
     
    6868    [window.get() makeFirstResponder:webView.platformView()];
    6969
    70     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple-tall", "html"));
     70    WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple-tall", "html"));
    7171    WKPageLoadURL(webView.page(), url.get());
    7272    Util::run(&didFinishLoad);
  • trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm

    r238348 r244390  
    121121    WKPageSetPageUIClient(wkView.pageRef, &uiClient.base);
    122122
    123     WKRetainPtr<WKStringRef> identifier(AdoptWK, WKStringCreateWithUTF8CString("FullscreenZoomInitialFramePreferences"));
    124     WKRetainPtr<WKPreferencesRef> customPreferences(AdoptWK, WKPreferencesCreateWithIdentifier(identifier.get()));
     123    WKRetainPtr<WKStringRef> identifier = adoptWK(WKStringCreateWithUTF8CString("FullscreenZoomInitialFramePreferences"));
     124    WKRetainPtr<WKPreferencesRef> customPreferences = adoptWK(WKPreferencesCreateWithIdentifier(identifier.get()));
    125125    WKPreferencesSetFullScreenEnabled(customPreferences.get(), true);
    126126    WKPageGroupSetPreferences(WKPageGetPageGroup(wkView.pageRef), customPreferences.get());
  • trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp

    r239719 r244390  
    6363{
    6464    MenuItemPrivateData* privateData = static_cast<MenuItemPrivateData*>(JSObjectGetPrivate(object));
    65     WKRetainPtr<WKStringRef> wkTitle(AdoptWK, WKContextMenuItemCopyTitle(privateData->m_item.get()));
     65    WKRetainPtr<WKStringRef> wkTitle = adoptWK(WKContextMenuItemCopyTitle(privateData->m_item.get()));
    6666    return JSValueMakeString(context, toJS(wkTitle).get());
    6767}
     
    194194    WKMutableDictionaryRef EventSenderMessageBody = WKMutableDictionaryCreate();
    195195
    196     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    197     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString(state == MouseUp ? "MouseUp" : "MouseDown"));
     196    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     197    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString(state == MouseUp ? "MouseUp" : "MouseDown"));
    198198    WKDictionarySetItem(EventSenderMessageBody, subMessageKey.get(), subMessageName.get());
    199199
     
    217217    WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
    218218
    219     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    220     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseDown, button, modifiers));
     219    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     220    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(createMouseMessageBody(MouseDown, button, modifiers));
    221221
    222222    WKBundlePagePostSynchronousMessageForTesting(page, EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     
    230230    WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
    231231
    232     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    233     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseUp, button, modifiers));
     232    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     233    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(createMouseMessageBody(MouseUp, button, modifiers));
    234234
    235235    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     
    238238void EventSendingController::mouseMoveTo(int x, int y)
    239239{
    240     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    241     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    242 
    243     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    244     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseMoveTo"));
    245     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    246 
    247     WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("X"));
    248     WKRetainPtr<WKDoubleRef> xRef(AdoptWK, WKDoubleCreate(x));
     240    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     241    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     242
     243    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     244    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("MouseMoveTo"));
     245    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     246
     247    WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
     248    WKRetainPtr<WKDoubleRef> xRef = adoptWK(WKDoubleCreate(x));
    249249    WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
    250250
    251     WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("Y"));
    252     WKRetainPtr<WKDoubleRef> yRef(AdoptWK, WKDoubleCreate(y));
     251    WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
     252    WKRetainPtr<WKDoubleRef> yRef = adoptWK(WKDoubleCreate(y));
    253253    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    254254
     
    260260void EventSendingController::mouseForceClick()
    261261{
    262     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    263     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    264 
    265     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    266     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseForceClick"));
     262    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     263    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     264
     265    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     266    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("MouseForceClick"));
    267267    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    268268
     
    272272void EventSendingController::startAndCancelMouseForceClick()
    273273{
    274     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    275     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    276 
    277     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    278     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("StartAndCancelMouseForceClick"));
     274    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     275    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     276
     277    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     278    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("StartAndCancelMouseForceClick"));
    279279    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    280280
     
    284284void EventSendingController::mouseForceDown()
    285285{
    286     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    287     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    288 
    289     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    290     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseForceDown"));
     286    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     287    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     288
     289    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     290    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("MouseForceDown"));
    291291    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    292292
     
    296296void EventSendingController::mouseForceUp()
    297297{
    298     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    299     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    300 
    301     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    302     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseForceUp"));
     298    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     299    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     300
     301    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     302    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("MouseForceUp"));
    303303    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    304304
     
    308308void EventSendingController::mouseForceChanged(double force)
    309309{
    310     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    311     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    312 
    313     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    314     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseForceChanged"));
    315     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    316 
    317     WKRetainPtr<WKStringRef> forceKey(AdoptWK, WKStringCreateWithUTF8CString("Force"));
    318     WKRetainPtr<WKDoubleRef> forceRef(AdoptWK, WKDoubleCreate(force));
     310    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     311    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     312
     313    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     314    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("MouseForceChanged"));
     315    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     316
     317    WKRetainPtr<WKStringRef> forceKey = adoptWK(WKStringCreateWithUTF8CString("Force"));
     318    WKRetainPtr<WKDoubleRef> forceRef = adoptWK(WKDoubleCreate(force));
    319319    WKDictionarySetItem(EventSenderMessageBody.get(), forceKey.get(), forceRef.get());
    320320
     
    324324void EventSendingController::leapForward(int milliseconds)
    325325{
    326     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    327     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    328 
    329     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    330     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("LeapForward"));
    331     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    332 
    333     WKRetainPtr<WKStringRef> timeKey(AdoptWK, WKStringCreateWithUTF8CString("TimeInMilliseconds"));
    334     WKRetainPtr<WKUInt64Ref> timeRef(AdoptWK, WKUInt64Create(milliseconds));
     326    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     327    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     328
     329    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     330    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("LeapForward"));
     331    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     332
     333    WKRetainPtr<WKStringRef> timeKey = adoptWK(WKStringCreateWithUTF8CString("TimeInMilliseconds"));
     334    WKRetainPtr<WKUInt64Ref> timeRef = adoptWK(WKUInt64Create(milliseconds));
    335335    WKDictionarySetItem(EventSenderMessageBody.get(), timeKey.get(), timeRef.get());
    336336
     
    343343    int button = 0;
    344344
    345     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
     345    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
    346346
    347347    // Asynchronous mouse down.
    348     WKRetainPtr<WKMutableDictionaryRef> mouseDownMessageBody(AdoptWK, createMouseMessageBody(MouseDown, button, modifiers));
     348    WKRetainPtr<WKMutableDictionaryRef> mouseDownMessageBody = adoptWK(createMouseMessageBody(MouseDown, button, modifiers));
    349349    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), mouseDownMessageBody.get());
    350350
    351351    // Asynchronous mouse up.
    352     WKRetainPtr<WKMutableDictionaryRef> mouseUpMessageBody(AdoptWK, createMouseMessageBody(MouseUp, button, modifiers));
     352    WKRetainPtr<WKMutableDictionaryRef> mouseUpMessageBody = adoptWK(createMouseMessageBody(MouseUp, button, modifiers));
    353353    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), mouseUpMessageBody.get());
    354354}
     
    356356static WKRetainPtr<WKMutableDictionaryRef> createKeyDownMessageBody(JSStringRef key, WKEventModifiers modifiers, int location)
    357357{
    358     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    359 
    360     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    361     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("KeyDown"));
    362     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    363 
    364     WKRetainPtr<WKStringRef> keyKey(AdoptWK, WKStringCreateWithUTF8CString("Key"));
     358    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     359
     360    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     361    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("KeyDown"));
     362    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     363
     364    WKRetainPtr<WKStringRef> keyKey = adoptWK(WKStringCreateWithUTF8CString("Key"));
    365365    WKDictionarySetItem(EventSenderMessageBody.get(), keyKey.get(), toWK(key).get());
    366366
    367     WKRetainPtr<WKStringRef> modifiersKey(AdoptWK, WKStringCreateWithUTF8CString("Modifiers"));
    368     WKRetainPtr<WKUInt64Ref> modifiersRef(AdoptWK, WKUInt64Create(modifiers));
     367    WKRetainPtr<WKStringRef> modifiersKey = adoptWK(WKStringCreateWithUTF8CString("Modifiers"));
     368    WKRetainPtr<WKUInt64Ref> modifiersRef = adoptWK(WKUInt64Create(modifiers));
    369369    WKDictionarySetItem(EventSenderMessageBody.get(), modifiersKey.get(), modifiersRef.get());
    370370
    371     WKRetainPtr<WKStringRef> locationKey(AdoptWK, WKStringCreateWithUTF8CString("Location"));
    372     WKRetainPtr<WKUInt64Ref> locationRef(AdoptWK, WKUInt64Create(location));
     371    WKRetainPtr<WKStringRef> locationKey = adoptWK(WKStringCreateWithUTF8CString("Location"));
     372    WKRetainPtr<WKUInt64Ref> locationRef = adoptWK(WKUInt64Create(location));
    373373    WKDictionarySetItem(EventSenderMessageBody.get(), locationKey.get(), locationRef.get());
    374374
     
    383383    WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
    384384
    385     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
     385    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
    386386    WKRetainPtr<WKMutableDictionaryRef> keyDownMessageBody = createKeyDownMessageBody(key, modifiers, location);
    387387
     
    391391void EventSendingController::scheduleAsynchronousKeyDown(JSStringRef key)
    392392{
    393     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
     393    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
    394394    WKRetainPtr<WKMutableDictionaryRef> keyDownMessageBody = createKeyDownMessageBody(key, 0 /* modifiers */, 0 /* location */);
    395395
     
    399399void EventSendingController::mouseScrollBy(int x, int y)
    400400{
    401     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    402     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    403 
    404     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    405     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseScrollBy"));
    406     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    407 
    408     WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("X"));
    409     WKRetainPtr<WKDoubleRef> xRef(AdoptWK, WKDoubleCreate(x));
     401    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     402    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     403
     404    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     405    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("MouseScrollBy"));
     406    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     407
     408    WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
     409    WKRetainPtr<WKDoubleRef> xRef = adoptWK(WKDoubleCreate(x));
    410410    WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
    411411
    412     WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("Y"));
    413     WKRetainPtr<WKDoubleRef> yRef(AdoptWK, WKDoubleCreate(y));
     412    WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
     413    WKRetainPtr<WKDoubleRef> yRef = adoptWK(WKDoubleCreate(y));
    414414    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    415415
     
    454454void EventSendingController::mouseScrollByWithWheelAndMomentumPhases(int x, int y, JSStringRef phaseStr, JSStringRef momentumStr)
    455455{
    456     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    457     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
     456    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     457    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
    458458   
    459     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    460     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseScrollByWithWheelAndMomentumPhases"));
     459    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     460    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("MouseScrollByWithWheelAndMomentumPhases"));
    461461    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    462462   
    463     WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("X"));
    464     WKRetainPtr<WKDoubleRef> xRef(AdoptWK, WKDoubleCreate(x));
     463    WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
     464    WKRetainPtr<WKDoubleRef> xRef = adoptWK(WKDoubleCreate(x));
    465465    WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
    466466   
    467     WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("Y"));
    468     WKRetainPtr<WKDoubleRef> yRef(AdoptWK, WKDoubleCreate(y));
     467    WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
     468    WKRetainPtr<WKDoubleRef> yRef = adoptWK(WKDoubleCreate(y));
    469469    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    470470
     
    472472    uint64_t momentum = cgEventMomentumPhaseFromString(momentumStr);
    473473
    474     WKRetainPtr<WKStringRef> phaseKey(AdoptWK, WKStringCreateWithUTF8CString("Phase"));
    475     WKRetainPtr<WKUInt64Ref> phaseRef(AdoptWK, WKUInt64Create(phase));
     474    WKRetainPtr<WKStringRef> phaseKey = adoptWK(WKStringCreateWithUTF8CString("Phase"));
     475    WKRetainPtr<WKUInt64Ref> phaseRef = adoptWK(WKUInt64Create(phase));
    476476    WKDictionarySetItem(EventSenderMessageBody.get(), phaseKey.get(), phaseRef.get());
    477477
    478     WKRetainPtr<WKStringRef> momentumKey(AdoptWK, WKStringCreateWithUTF8CString("Momentum"));
    479     WKRetainPtr<WKUInt64Ref> momentumRef(AdoptWK, WKUInt64Create(momentum));
     478    WKRetainPtr<WKStringRef> momentumKey = adoptWK(WKStringCreateWithUTF8CString("Momentum"));
     479    WKRetainPtr<WKUInt64Ref> momentumRef = adoptWK(WKUInt64Create(momentum));
    480480    WKDictionarySetItem(EventSenderMessageBody.get(), momentumKey.get(), momentumRef.get());
    481481
     
    486486void EventSendingController::continuousMouseScrollBy(int x, int y, bool paged)
    487487{
    488     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    489     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    490 
    491     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    492     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("ContinuousMouseScrollBy"));
    493     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    494 
    495     WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("X"));
    496     WKRetainPtr<WKDoubleRef> xRef(AdoptWK, WKDoubleCreate(x));
     488    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     489    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     490
     491    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     492    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("ContinuousMouseScrollBy"));
     493    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     494
     495    WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
     496    WKRetainPtr<WKDoubleRef> xRef = adoptWK(WKDoubleCreate(x));
    497497    WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
    498498
    499     WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("Y"));
    500     WKRetainPtr<WKDoubleRef> yRef(AdoptWK, WKDoubleCreate(y));
     499    WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
     500    WKRetainPtr<WKDoubleRef> yRef = adoptWK(WKDoubleCreate(y));
    501501    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    502502
    503     WKRetainPtr<WKStringRef> pagedKey(AdoptWK, WKStringCreateWithUTF8CString("Paged"));
    504     WKRetainPtr<WKUInt64Ref> pagedRef(AdoptWK, WKUInt64Create(paged));
     503    WKRetainPtr<WKStringRef> pagedKey = adoptWK(WKStringCreateWithUTF8CString("Paged"));
     504    WKRetainPtr<WKUInt64Ref> pagedRef = adoptWK(WKUInt64Create(paged));
    505505    WKDictionarySetItem(EventSenderMessageBody.get(), pagedKey.get(), pagedRef.get());
    506506
     
    638638void EventSendingController::addTouchPoint(int x, int y)
    639639{
    640     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    641     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    642 
    643     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    644     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("AddTouchPoint"));
    645     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    646 
    647     WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("X"));
    648     WKRetainPtr<WKUInt64Ref> xRef(AdoptWK, WKUInt64Create(x));
     640    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     641    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     642
     643    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     644    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("AddTouchPoint"));
     645    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     646
     647    WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
     648    WKRetainPtr<WKUInt64Ref> xRef = adoptWK(WKUInt64Create(x));
    649649    WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
    650650
    651     WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("Y"));
    652     WKRetainPtr<WKUInt64Ref> yRef(AdoptWK, WKUInt64Create(y));
     651    WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
     652    WKRetainPtr<WKUInt64Ref> yRef = adoptWK(WKUInt64Create(y));
    653653    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    654654
     
    658658void EventSendingController::updateTouchPoint(int index, int x, int y)
    659659{
    660     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    661     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    662 
    663     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    664     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("UpdateTouchPoint"));
    665     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    666 
    667     WKRetainPtr<WKStringRef> indexKey(AdoptWK, WKStringCreateWithUTF8CString("Index"));
    668     WKRetainPtr<WKUInt64Ref> indexRef(AdoptWK, WKUInt64Create(index));
     660    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     661    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     662
     663    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     664    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("UpdateTouchPoint"));
     665    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     666
     667    WKRetainPtr<WKStringRef> indexKey = adoptWK(WKStringCreateWithUTF8CString("Index"));
     668    WKRetainPtr<WKUInt64Ref> indexRef = adoptWK(WKUInt64Create(index));
    669669    WKDictionarySetItem(EventSenderMessageBody.get(), indexKey.get(), indexRef.get());
    670670
    671     WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("X"));
    672     WKRetainPtr<WKUInt64Ref> xRef(AdoptWK, WKUInt64Create(x));
     671    WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
     672    WKRetainPtr<WKUInt64Ref> xRef = adoptWK(WKUInt64Create(x));
    673673    WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
    674674
    675     WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("Y"));
    676     WKRetainPtr<WKUInt64Ref> yRef(AdoptWK, WKUInt64Create(y));
     675    WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
     676    WKRetainPtr<WKUInt64Ref> yRef = adoptWK(WKUInt64Create(y));
    677677    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    678678
     
    682682void EventSendingController::setTouchModifier(const JSStringRef &modifier, bool enable)
    683683{
    684     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    685     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    686 
    687     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    688     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("SetTouchModifier"));
     684    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     685    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     686
     687    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     688    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("SetTouchModifier"));
    689689    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    690690
     
    699699        mod = kWKEventModifiersMetaKey;
    700700
    701     WKRetainPtr<WKStringRef> modifierKey(AdoptWK, WKStringCreateWithUTF8CString("Modifier"));
    702     WKRetainPtr<WKUInt64Ref> modifierRef(AdoptWK, WKUInt64Create(mod));
     701    WKRetainPtr<WKStringRef> modifierKey = adoptWK(WKStringCreateWithUTF8CString("Modifier"));
     702    WKRetainPtr<WKUInt64Ref> modifierRef = adoptWK(WKUInt64Create(mod));
    703703    WKDictionarySetItem(EventSenderMessageBody.get(), modifierKey.get(), modifierRef.get());
    704704
    705     WKRetainPtr<WKStringRef> enableKey(AdoptWK, WKStringCreateWithUTF8CString("Enable"));
    706     WKRetainPtr<WKUInt64Ref> enableRef(AdoptWK, WKUInt64Create(enable));
     705    WKRetainPtr<WKStringRef> enableKey = adoptWK(WKStringCreateWithUTF8CString("Enable"));
     706    WKRetainPtr<WKUInt64Ref> enableRef = adoptWK(WKUInt64Create(enable));
    707707    WKDictionarySetItem(EventSenderMessageBody.get(), enableKey.get(), enableRef.get());
    708708
     
    713713void EventSendingController::setTouchPointRadius(int radiusX, int radiusY)
    714714{
    715     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    716     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    717 
    718     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    719     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("SetTouchPointRadius"));
    720     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    721 
    722     WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("RadiusX"));
    723     WKRetainPtr<WKUInt64Ref> xRef(AdoptWK, WKUInt64Create(radiusX));
     715    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     716    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     717
     718    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     719    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("SetTouchPointRadius"));
     720    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     721
     722    WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("RadiusX"));
     723    WKRetainPtr<WKUInt64Ref> xRef = adoptWK(WKUInt64Create(radiusX));
    724724    WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
    725725
    726     WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("RadiusY"));
    727     WKRetainPtr<WKUInt64Ref> yRef(AdoptWK, WKUInt64Create(radiusY));
     726    WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("RadiusY"));
     727    WKRetainPtr<WKUInt64Ref> yRef = adoptWK(WKUInt64Create(radiusY));
    728728    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    729729
     
    733733void EventSendingController::touchStart()
    734734{
    735     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    736     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    737 
    738     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    739     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("TouchStart"));
     735    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     736    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     737
     738    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     739    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("TouchStart"));
    740740    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    741741
     
    745745void EventSendingController::touchMove()
    746746{
    747     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    748     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    749 
    750     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    751     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("TouchMove"));
     747    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     748    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     749
     750    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     751    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("TouchMove"));
    752752    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    753753
     
    757757void EventSendingController::touchEnd()
    758758{
    759     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    760     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    761 
    762     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    763     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("TouchEnd"));
     759    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     760    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     761
     762    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     763    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("TouchEnd"));
    764764    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    765765
     
    769769void EventSendingController::touchCancel()
    770770{
    771     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    772     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    773 
    774     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    775     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("TouchCancel"));
     771    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     772    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     773
     774    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     775    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("TouchCancel"));
    776776    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    777777
     
    781781void EventSendingController::clearTouchPoints()
    782782{
    783     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    784     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    785 
    786     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    787     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("ClearTouchPoints"));
     783    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     784    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     785
     786    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     787    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("ClearTouchPoints"));
    788788    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    789789
     
    793793void EventSendingController::releaseTouchPoint(int index)
    794794{
    795     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    796     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    797 
    798     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    799     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("ReleaseTouchPoint"));
    800     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    801 
    802     WKRetainPtr<WKStringRef> indexKey(AdoptWK, WKStringCreateWithUTF8CString("Index"));
    803     WKRetainPtr<WKUInt64Ref> indexRef(AdoptWK, WKUInt64Create(index));
     795    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     796    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     797
     798    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     799    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("ReleaseTouchPoint"));
     800    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     801
     802    WKRetainPtr<WKStringRef> indexKey = adoptWK(WKStringCreateWithUTF8CString("Index"));
     803    WKRetainPtr<WKUInt64Ref> indexRef = adoptWK(WKUInt64Create(index));
    804804    WKDictionarySetItem(EventSenderMessageBody.get(), indexKey.get(), indexRef.get());
    805805
     
    809809void EventSendingController::cancelTouchPoint(int index)
    810810{
    811     WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    812     WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
    813 
    814     WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
    815     WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("CancelTouchPoint"));
    816     WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    817 
    818     WKRetainPtr<WKStringRef> indexKey(AdoptWK, WKStringCreateWithUTF8CString("Index"));
    819     WKRetainPtr<WKUInt64Ref> indexRef(AdoptWK, WKUInt64Create(index));
     811    WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender"));
     812    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody = adoptWK(WKMutableDictionaryCreate());
     813
     814    WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
     815    WKRetainPtr<WKStringRef> subMessageName = adoptWK(WKStringCreateWithUTF8CString("CancelTouchPoint"));
     816    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     817
     818    WKRetainPtr<WKStringRef> indexKey = adoptWK(WKStringCreateWithUTF8CString("Index"));
     819    WKRetainPtr<WKUInt64Ref> indexRef = adoptWK(WKUInt64Create(index));
    820820    WKDictionarySetItem(EventSenderMessageBody.get(), indexKey.get(), indexRef.get());
    821821
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r244370 r244390  
    119119        return;
    120120
    121     WKRetainPtr<WKStringRef> messsageName(AdoptWK, WKStringCreateWithUTF8CString("Initialization"));
     121    WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("Initialization"));
    122122    WKTypeRef result = nullptr;
    123123    WKBundlePostSynchronousMessage(m_bundle, messsageName.get(), nullptr, &result);
    124124    ASSERT(WKGetTypeID(result) == WKDictionaryGetTypeID());
    125     WKRetainPtr<WKDictionaryRef> initializationDictionary(AdoptWK, static_cast<WKDictionaryRef>(result));
    126 
    127     WKRetainPtr<WKStringRef> resumeTestingKey(AdoptWK, WKStringCreateWithUTF8CString("ResumeTesting"));
     125    WKRetainPtr<WKDictionaryRef> initializationDictionary = adoptWK(static_cast<WKDictionaryRef>(result));
     126
     127    WKRetainPtr<WKStringRef> resumeTestingKey = adoptWK(WKStringCreateWithUTF8CString("ResumeTesting"));
    128128    WKTypeRef resumeTestingValue = WKDictionaryGetItemForKey(initializationDictionary.get(), resumeTestingKey.get());
    129129    ASSERT(WKGetTypeID(resumeTestingValue) == WKBooleanGetTypeID());
     
    176176void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
    177177{
    178     WKRetainPtr<WKStringRef> errorMessageName(AdoptWK, WKStringCreateWithUTF8CString("Error"));
    179     WKRetainPtr<WKStringRef> errorMessageBody(AdoptWK, WKStringCreateWithUTF8CString("Unknown"));
     178    WKRetainPtr<WKStringRef> errorMessageName = adoptWK(WKStringCreateWithUTF8CString("Error"));
     179    WKRetainPtr<WKStringRef> errorMessageBody = adoptWK(WKStringCreateWithUTF8CString("Unknown"));
    180180    WKBundlePostMessage(m_bundle, errorMessageName.get(), errorMessageBody.get());
    181181}
     
    206206        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    207207
    208         WKRetainPtr<WKStringRef> dumpPixelsKey(AdoptWK, WKStringCreateWithUTF8CString("DumpPixels"));
     208        WKRetainPtr<WKStringRef> dumpPixelsKey = adoptWK(WKStringCreateWithUTF8CString("DumpPixels"));
    209209        m_dumpPixels = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dumpPixelsKey.get())));
    210210
    211         WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey(AdoptWK, WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer"));
     211        WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey = adoptWK(WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer"));
    212212        m_useWaitToDumpWatchdogTimer = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, useWaitToDumpWatchdogTimerKey.get())));
    213213
    214         WKRetainPtr<WKStringRef> timeoutKey(AdoptWK, WKStringCreateWithUTF8CString("Timeout"));
     214        WKRetainPtr<WKStringRef> timeoutKey = adoptWK(WKStringCreateWithUTF8CString("Timeout"));
    215215        m_timeout = Seconds::fromMilliseconds(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, timeoutKey.get()))));
    216216
    217         WKRetainPtr<WKStringRef> dumpJSConsoleLogInStdErrKey(AdoptWK, WKStringCreateWithUTF8CString("DumpJSConsoleLogInStdErr"));
     217        WKRetainPtr<WKStringRef> dumpJSConsoleLogInStdErrKey = adoptWK(WKStringCreateWithUTF8CString("DumpJSConsoleLogInStdErr"));
    218218        m_dumpJSConsoleLogInStdErr = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dumpJSConsoleLogInStdErrKey.get())));
    219219
    220         WKRetainPtr<WKStringRef> ackMessageName(AdoptWK, WKStringCreateWithUTF8CString("Ack"));
    221         WKRetainPtr<WKStringRef> ackMessageBody(AdoptWK, WKStringCreateWithUTF8CString("BeginTest"));
     220        WKRetainPtr<WKStringRef> ackMessageName = adoptWK(WKStringCreateWithUTF8CString("Ack"));
     221        WKRetainPtr<WKStringRef> ackMessageBody = adoptWK(WKStringCreateWithUTF8CString("BeginTest"));
    222222        WKBundlePagePostMessage(page, ackMessageName.get(), ackMessageBody.get());
    223223
     
    230230        ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
    231231        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    232         WKRetainPtr<WKStringRef> jscOptionsKey(AdoptWK, WKStringCreateWithUTF8CString("JSCOptions"));
     232        WKRetainPtr<WKStringRef> jscOptionsKey = adoptWK(WKStringCreateWithUTF8CString("JSCOptions"));
    233233        WKRetainPtr<WKStringRef> jscOptionsString = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, jscOptionsKey.get()));
    234234        if (jscOptionsString) {
     
    237237        }
    238238
    239         WKRetainPtr<WKStringRef> shouldGCKey(AdoptWK, WKStringCreateWithUTF8CString("ShouldGC"));
     239        WKRetainPtr<WKStringRef> shouldGCKey = adoptWK(WKStringCreateWithUTF8CString("ShouldGC"));
    240240        bool shouldGC = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, shouldGCKey.get())));
    241241        if (shouldGC)
    242242            WKBundleGarbageCollectJavaScriptObjects(m_bundle);
    243243
    244         WKRetainPtr<WKStringRef> allowedHostsKey(AdoptWK, WKStringCreateWithUTF8CString("AllowedHosts"));
     244        WKRetainPtr<WKStringRef> allowedHostsKey = adoptWK(WKStringCreateWithUTF8CString("AllowedHosts"));
    245245        WKTypeRef allowedHostsValue = WKDictionaryGetItemForKey(messageBodyDictionary, allowedHostsKey.get());
    246246        if (allowedHostsValue && WKGetTypeID(allowedHostsValue) == WKArrayGetTypeID()) {
     
    399399        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    400400
    401         WKRetainPtr<WKStringRef> resultKey(AdoptWK, WKStringCreateWithUTF8CString("Result"));
    402         WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID"));
     401        WKRetainPtr<WKStringRef> resultKey = adoptWK(WKStringCreateWithUTF8CString("Result"));
     402        WKRetainPtr<WKStringRef> callbackIDKey = adoptWK(WKStringCreateWithUTF8CString("CallbackID"));
    403403
    404404        unsigned callbackID = (unsigned)WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, callbackIDKey.get())));
     
    430430        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    431431
    432         WKRetainPtr<WKStringRef> totalPrevalentResourcesKey(AdoptWK, WKStringCreateWithUTF8CString("TotalPrevalentResources"));
    433         WKRetainPtr<WKStringRef> totalPrevalentResourcesWithUserInteractionKey(AdoptWK, WKStringCreateWithUTF8CString("TotalPrevalentResourcesWithUserInteraction"));
    434         WKRetainPtr<WKStringRef> top3SubframeUnderTopFrameOriginsKey(AdoptWK, WKStringCreateWithUTF8CString("Top3SubframeUnderTopFrameOrigins"));
     432        WKRetainPtr<WKStringRef> totalPrevalentResourcesKey = adoptWK(WKStringCreateWithUTF8CString("TotalPrevalentResources"));
     433        WKRetainPtr<WKStringRef> totalPrevalentResourcesWithUserInteractionKey = adoptWK(WKStringCreateWithUTF8CString("TotalPrevalentResourcesWithUserInteraction"));
     434        WKRetainPtr<WKStringRef> top3SubframeUnderTopFrameOriginsKey = adoptWK(WKStringCreateWithUTF8CString("Top3SubframeUnderTopFrameOrigins"));
    435435
    436436        unsigned totalPrevalentResources = (unsigned)WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, totalPrevalentResourcesKey.get())));
     
    452452    }
    453453   
    454     WKRetainPtr<WKStringRef> errorMessageName(AdoptWK, WKStringCreateWithUTF8CString("Error"));
    455     WKRetainPtr<WKStringRef> errorMessageBody(AdoptWK, WKStringCreateWithUTF8CString("Unknown"));
     454    WKRetainPtr<WKStringRef> errorMessageName = adoptWK(WKStringCreateWithUTF8CString("Error"));
     455    WKRetainPtr<WKStringRef> errorMessageBody = adoptWK(WKStringCreateWithUTF8CString("Unknown"));
    456456    WKBundlePagePostMessage(page, errorMessageName.get(), errorMessageBody.get());
    457457}
     
    459459bool InjectedBundle::booleanForKey(WKDictionaryRef dictionary, const char* key)
    460460{
    461     WKRetainPtr<WKStringRef> wkKey(AdoptWK, WKStringCreateWithUTF8CString(key));
     461    WKRetainPtr<WKStringRef> wkKey = adoptWK(WKStringCreateWithUTF8CString(key));
    462462    WKTypeRef value = WKDictionaryGetItemForKey(dictionary, wkKey.get());
    463463    if (WKGetTypeID(value) != WKBooleanGetTypeID()) {
     
    550550#endif
    551551
    552     WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithUTF8CString("Done"));
    553     WKRetainPtr<WKMutableDictionaryRef> doneMessageBody(AdoptWK, WKMutableDictionaryCreate());
     552    WKRetainPtr<WKStringRef> doneMessageName = adoptWK(WKStringCreateWithUTF8CString("Done"));
     553    WKRetainPtr<WKMutableDictionaryRef> doneMessageBody = adoptWK(WKMutableDictionaryCreate());
    554554
    555555    WKRetainPtr<WKStringRef> pixelResultIsPendingKey = adoptWK(WKStringCreateWithUTF8CString("PixelResultIsPending"));
    556     WKRetainPtr<WKBooleanRef> pixelResultIsPending(AdoptWK, WKBooleanCreate(m_pixelResultIsPending));
     556    WKRetainPtr<WKBooleanRef> pixelResultIsPending = adoptWK(WKBooleanCreate(m_pixelResultIsPending));
    557557    WKDictionarySetItem(doneMessageBody.get(), pixelResultIsPendingKey.get(), pixelResultIsPending.get());
    558558
     
    599599    if (output.isEmpty())
    600600        return;
    601     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DumpToStdErr"));
    602     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithUTF8CString(output.utf8().data()));
     601    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("DumpToStdErr"));
     602    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithUTF8CString(output.utf8().data()));
    603603    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    604604}
     
    610610    if (output.isEmpty())
    611611        return;
    612     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("TextOutput"));
    613     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithUTF8CString(output.utf8().data()));
     612    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("TextOutput"));
     613    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithUTF8CString(output.utf8().data()));
    614614    // We use WKBundlePagePostMessageIgnoringFullySynchronousMode() instead of WKBundlePagePostMessage() to make sure that all text output
    615615    // is done via asynchronous IPC, even if the connection is in fully synchronous mode due to a WKBundlePagePostSynchronousMessageForTesting()
     
    620620void InjectedBundle::postNewBeforeUnloadReturnValue(bool value)
    621621{
    622     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("BeforeUnloadReturnValue"));
    623     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     622    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("BeforeUnloadReturnValue"));
     623    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    624624    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    625625}
     
    627627void InjectedBundle::postAddChromeInputField()
    628628{
    629     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("AddChromeInputField"));
     629    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("AddChromeInputField"));
    630630    WKBundlePagePostMessage(page()->page(), messageName.get(), 0);
    631631}
     
    633633void InjectedBundle::postRemoveChromeInputField()
    634634{
    635     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("RemoveChromeInputField"));
     635    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("RemoveChromeInputField"));
    636636    WKBundlePagePostMessage(page()->page(), messageName.get(), 0);
    637637}
     
    639639void InjectedBundle::postFocusWebView()
    640640{
    641     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("FocusWebView"));
     641    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("FocusWebView"));
    642642    WKBundlePagePostMessage(page()->page(), messageName.get(), 0);
    643643}
     
    645645void InjectedBundle::postSetBackingScaleFactor(double backingScaleFactor)
    646646{
    647     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetBackingScaleFactor"));
    648     WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(backingScaleFactor));
     647    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetBackingScaleFactor"));
     648    WKRetainPtr<WKDoubleRef> messageBody = adoptWK(WKDoubleCreate(backingScaleFactor));
    649649    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    650650}
     
    652652void InjectedBundle::postSetWindowIsKey(bool isKey)
    653653{
    654     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetWindowIsKey"));
    655     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(isKey));
     654    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetWindowIsKey"));
     655    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(isKey));
    656656    WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), messageBody.get(), 0);
    657657}
     
    659659void InjectedBundle::postSetViewSize(double width, double height)
    660660{
    661     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetViewSize"));
    662 
    663     WKRetainPtr<WKStringRef> widthKey(AdoptWK, WKStringCreateWithUTF8CString("width"));
    664     WKRetainPtr<WKStringRef> heightKey(AdoptWK, WKStringCreateWithUTF8CString("height"));
    665 
    666     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    667 
    668     WKRetainPtr<WKDoubleRef> widthWK(AdoptWK, WKDoubleCreate(width));
     661    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetViewSize"));
     662
     663    WKRetainPtr<WKStringRef> widthKey = adoptWK(WKStringCreateWithUTF8CString("width"));
     664    WKRetainPtr<WKStringRef> heightKey = adoptWK(WKStringCreateWithUTF8CString("height"));
     665
     666    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     667
     668    WKRetainPtr<WKDoubleRef> widthWK = adoptWK(WKDoubleCreate(width));
    669669    WKDictionarySetItem(messageBody.get(), widthKey.get(), widthWK.get());
    670670
    671     WKRetainPtr<WKDoubleRef> heightWK(AdoptWK, WKDoubleCreate(height));
     671    WKRetainPtr<WKDoubleRef> heightWK = adoptWK(WKDoubleCreate(height));
    672672    WKDictionarySetItem(messageBody.get(), heightKey.get(), heightWK.get());
    673673
     
    677677void InjectedBundle::postSimulateWebNotificationClick(uint64_t notificationID)
    678678{
    679     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SimulateWebNotificationClick"));
    680     WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(notificationID));
     679    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SimulateWebNotificationClick"));
     680    WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(notificationID));
    681681    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    682682}
     
    684684void InjectedBundle::postSetAddsVisitedLinks(bool addsVisitedLinks)
    685685{
    686     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAddsVisitedLinks"));
    687     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(addsVisitedLinks));
     686    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAddsVisitedLinks"));
     687    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(addsVisitedLinks));
    688688    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    689689}
     
    691691void InjectedBundle::setGeolocationPermission(bool enabled)
    692692{
    693     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetGeolocationPermission"));
    694     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(enabled));
     693    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetGeolocationPermission"));
     694    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(enabled));
    695695    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    696696}
     
    698698void InjectedBundle::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, bool providesFloorLevel, double floorLevel)
    699699{
    700     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGeolocationPosition"));
    701 
    702     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    703 
    704     WKRetainPtr<WKStringRef> latitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("latitude"));
    705     WKRetainPtr<WKDoubleRef> latitudeWK(AdoptWK, WKDoubleCreate(latitude));
     700    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetMockGeolocationPosition"));
     701
     702    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     703
     704    WKRetainPtr<WKStringRef> latitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("latitude"));
     705    WKRetainPtr<WKDoubleRef> latitudeWK = adoptWK(WKDoubleCreate(latitude));
    706706    WKDictionarySetItem(messageBody.get(), latitudeKeyWK.get(), latitudeWK.get());
    707707
    708     WKRetainPtr<WKStringRef> longitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("longitude"));
    709     WKRetainPtr<WKDoubleRef> longitudeWK(AdoptWK, WKDoubleCreate(longitude));
     708    WKRetainPtr<WKStringRef> longitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("longitude"));
     709    WKRetainPtr<WKDoubleRef> longitudeWK = adoptWK(WKDoubleCreate(longitude));
    710710    WKDictionarySetItem(messageBody.get(), longitudeKeyWK.get(), longitudeWK.get());
    711711
    712     WKRetainPtr<WKStringRef> accuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("accuracy"));
    713     WKRetainPtr<WKDoubleRef> accuracyWK(AdoptWK, WKDoubleCreate(accuracy));
     712    WKRetainPtr<WKStringRef> accuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("accuracy"));
     713    WKRetainPtr<WKDoubleRef> accuracyWK = adoptWK(WKDoubleCreate(accuracy));
    714714    WKDictionarySetItem(messageBody.get(), accuracyKeyWK.get(), accuracyWK.get());
    715715
    716     WKRetainPtr<WKStringRef> providesAltitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesAltitude"));
    717     WKRetainPtr<WKBooleanRef> providesAltitudeWK(AdoptWK, WKBooleanCreate(providesAltitude));
     716    WKRetainPtr<WKStringRef> providesAltitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesAltitude"));
     717    WKRetainPtr<WKBooleanRef> providesAltitudeWK = adoptWK(WKBooleanCreate(providesAltitude));
    718718    WKDictionarySetItem(messageBody.get(), providesAltitudeKeyWK.get(), providesAltitudeWK.get());
    719719
    720     WKRetainPtr<WKStringRef> altitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("altitude"));
    721     WKRetainPtr<WKDoubleRef> altitudeWK(AdoptWK, WKDoubleCreate(altitude));
     720    WKRetainPtr<WKStringRef> altitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("altitude"));
     721    WKRetainPtr<WKDoubleRef> altitudeWK = adoptWK(WKDoubleCreate(altitude));
    722722    WKDictionarySetItem(messageBody.get(), altitudeKeyWK.get(), altitudeWK.get());
    723723
    724     WKRetainPtr<WKStringRef> providesAltitudeAccuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesAltitudeAccuracy"));
    725     WKRetainPtr<WKBooleanRef> providesAltitudeAccuracyWK(AdoptWK, WKBooleanCreate(providesAltitudeAccuracy));
     724    WKRetainPtr<WKStringRef> providesAltitudeAccuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesAltitudeAccuracy"));
     725    WKRetainPtr<WKBooleanRef> providesAltitudeAccuracyWK = adoptWK(WKBooleanCreate(providesAltitudeAccuracy));
    726726    WKDictionarySetItem(messageBody.get(), providesAltitudeAccuracyKeyWK.get(), providesAltitudeAccuracyWK.get());
    727727
    728     WKRetainPtr<WKStringRef> altitudeAccuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("altitudeAccuracy"));
    729     WKRetainPtr<WKDoubleRef> altitudeAccuracyWK(AdoptWK, WKDoubleCreate(altitudeAccuracy));
     728    WKRetainPtr<WKStringRef> altitudeAccuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("altitudeAccuracy"));
     729    WKRetainPtr<WKDoubleRef> altitudeAccuracyWK = adoptWK(WKDoubleCreate(altitudeAccuracy));
    730730    WKDictionarySetItem(messageBody.get(), altitudeAccuracyKeyWK.get(), altitudeAccuracyWK.get());
    731731
    732     WKRetainPtr<WKStringRef> providesHeadingKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesHeading"));
    733     WKRetainPtr<WKBooleanRef> providesHeadingWK(AdoptWK, WKBooleanCreate(providesHeading));
     732    WKRetainPtr<WKStringRef> providesHeadingKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesHeading"));
     733    WKRetainPtr<WKBooleanRef> providesHeadingWK = adoptWK(WKBooleanCreate(providesHeading));
    734734    WKDictionarySetItem(messageBody.get(), providesHeadingKeyWK.get(), providesHeadingWK.get());
    735735
    736     WKRetainPtr<WKStringRef> headingKeyWK(AdoptWK, WKStringCreateWithUTF8CString("heading"));
    737     WKRetainPtr<WKDoubleRef> headingWK(AdoptWK, WKDoubleCreate(heading));
     736    WKRetainPtr<WKStringRef> headingKeyWK = adoptWK(WKStringCreateWithUTF8CString("heading"));
     737    WKRetainPtr<WKDoubleRef> headingWK = adoptWK(WKDoubleCreate(heading));
    738738    WKDictionarySetItem(messageBody.get(), headingKeyWK.get(), headingWK.get());
    739739
    740     WKRetainPtr<WKStringRef> providesSpeedKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesSpeed"));
    741     WKRetainPtr<WKBooleanRef> providesSpeedWK(AdoptWK, WKBooleanCreate(providesSpeed));
     740    WKRetainPtr<WKStringRef> providesSpeedKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesSpeed"));
     741    WKRetainPtr<WKBooleanRef> providesSpeedWK = adoptWK(WKBooleanCreate(providesSpeed));
    742742    WKDictionarySetItem(messageBody.get(), providesSpeedKeyWK.get(), providesSpeedWK.get());
    743743
    744     WKRetainPtr<WKStringRef> speedKeyWK(AdoptWK, WKStringCreateWithUTF8CString("speed"));
    745     WKRetainPtr<WKDoubleRef> speedWK(AdoptWK, WKDoubleCreate(speed));
     744    WKRetainPtr<WKStringRef> speedKeyWK = adoptWK(WKStringCreateWithUTF8CString("speed"));
     745    WKRetainPtr<WKDoubleRef> speedWK = adoptWK(WKDoubleCreate(speed));
    746746    WKDictionarySetItem(messageBody.get(), speedKeyWK.get(), speedWK.get());
    747747
    748     WKRetainPtr<WKStringRef> providesFloorLevelKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesFloorLevel"));
    749     WKRetainPtr<WKBooleanRef> providesFloorLevelWK(AdoptWK, WKBooleanCreate(providesFloorLevel));
     748    WKRetainPtr<WKStringRef> providesFloorLevelKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesFloorLevel"));
     749    WKRetainPtr<WKBooleanRef> providesFloorLevelWK = adoptWK(WKBooleanCreate(providesFloorLevel));
    750750    WKDictionarySetItem(messageBody.get(), providesFloorLevelKeyWK.get(), providesFloorLevelWK.get());
    751751
    752     WKRetainPtr<WKStringRef> floorLevelKeyWK(AdoptWK, WKStringCreateWithUTF8CString("floorLevel"));
    753     WKRetainPtr<WKDoubleRef> floorLevelWK(AdoptWK, WKDoubleCreate(floorLevel));
     752    WKRetainPtr<WKStringRef> floorLevelKeyWK = adoptWK(WKStringCreateWithUTF8CString("floorLevel"));
     753    WKRetainPtr<WKDoubleRef> floorLevelWK = adoptWK(WKDoubleCreate(floorLevel));
    754754    WKDictionarySetItem(messageBody.get(), floorLevelKeyWK.get(), floorLevelWK.get());
    755755
     
    759759void InjectedBundle::setMockGeolocationPositionUnavailableError(WKStringRef errorMessage)
    760760{
    761     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGeolocationPositionUnavailableError"));
     761    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetMockGeolocationPositionUnavailableError"));
    762762    WKBundlePagePostMessage(page()->page(), messageName.get(), errorMessage);
    763763}
     
    765765bool InjectedBundle::isGeolocationProviderActive() const
    766766{
    767     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsGeolocationClientActive"));
     767    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsGeolocationClientActive"));
    768768    WKTypeRef resultToPass = 0;
    769769    WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), 0, &resultToPass);
    770     WKRetainPtr<WKBooleanRef> isActive(AdoptWK, static_cast<WKBooleanRef>(resultToPass));
     770    WKRetainPtr<WKBooleanRef> isActive = adoptWK(static_cast<WKBooleanRef>(resultToPass));
    771771
    772772    return WKBooleanGetValue(isActive.get());
     
    775775unsigned InjectedBundle::imageCountInGeneralPasteboard() const
    776776{
    777     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ImageCountInGeneralPasteboard"));
     777    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ImageCountInGeneralPasteboard"));
    778778    WKTypeRef resultToPass = 0;
    779779    WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), 0, &resultToPass);
    780     WKRetainPtr<WKUInt64Ref> imageCount(AdoptWK, static_cast<WKUInt64Ref>(resultToPass));
     780    WKRetainPtr<WKUInt64Ref> imageCount = adoptWK(static_cast<WKUInt64Ref>(resultToPass));
    781781   
    782782    return static_cast<unsigned>(WKUInt64GetValue(imageCount.get()));
     
    799799{
    800800    auto messageName = adoptWK(WKStringCreateWithUTF8CString("SetUserMediaPersistentPermissionForOrigin"));
    801     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    802 
    803     WKRetainPtr<WKStringRef> permissionKeyWK(AdoptWK, WKStringCreateWithUTF8CString("permission"));
    804     WKRetainPtr<WKBooleanRef> permissionWK(AdoptWK, WKBooleanCreate(permission));
     801    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     802
     803    WKRetainPtr<WKStringRef> permissionKeyWK = adoptWK(WKStringCreateWithUTF8CString("permission"));
     804    WKRetainPtr<WKBooleanRef> permissionWK = adoptWK(WKBooleanCreate(permission));
    805805    WKDictionarySetItem(messageBody.get(), permissionKeyWK.get(), permissionWK.get());
    806806
    807     WKRetainPtr<WKStringRef> originKeyWK(AdoptWK, WKStringCreateWithUTF8CString("origin"));
     807    WKRetainPtr<WKStringRef> originKeyWK = adoptWK(WKStringCreateWithUTF8CString("origin"));
    808808    WKDictionarySetItem(messageBody.get(), originKeyWK.get(), origin);
    809809
    810     WKRetainPtr<WKStringRef> parentOriginKeyWK(AdoptWK, WKStringCreateWithUTF8CString("parentOrigin"));
     810    WKRetainPtr<WKStringRef> parentOriginKeyWK = adoptWK(WKStringCreateWithUTF8CString("parentOrigin"));
    811811    WKDictionarySetItem(messageBody.get(), parentOriginKeyWK.get(), parentOrigin);
    812812
     
    816816unsigned InjectedBundle::userMediaPermissionRequestCountForOrigin(WKStringRef origin, WKStringRef parentOrigin) const
    817817{
    818     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("UserMediaPermissionRequestCountForOrigin"));
    819     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    820 
    821     WKRetainPtr<WKStringRef> originKeyWK(AdoptWK, WKStringCreateWithUTF8CString("origin"));
     818    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("UserMediaPermissionRequestCountForOrigin"));
     819    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     820
     821    WKRetainPtr<WKStringRef> originKeyWK = adoptWK(WKStringCreateWithUTF8CString("origin"));
    822822    WKDictionarySetItem(messageBody.get(), originKeyWK.get(), origin);
    823823
    824     WKRetainPtr<WKStringRef> parentOriginKeyWK(AdoptWK, WKStringCreateWithUTF8CString("parentOrigin"));
     824    WKRetainPtr<WKStringRef> parentOriginKeyWK = adoptWK(WKStringCreateWithUTF8CString("parentOrigin"));
    825825    WKDictionarySetItem(messageBody.get(), parentOriginKeyWK.get(), parentOrigin);
    826826
    827827    WKTypeRef resultToPass = 0;
    828828    WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), messageBody.get(), &resultToPass);
    829     WKRetainPtr<WKUInt64Ref> count(AdoptWK, static_cast<WKUInt64Ref>(resultToPass));
     829    WKRetainPtr<WKUInt64Ref> count = adoptWK(static_cast<WKUInt64Ref>(resultToPass));
    830830
    831831    return static_cast<unsigned>(WKUInt64GetValue(count.get()));
     
    834834void InjectedBundle::resetUserMediaPermissionRequestCountForOrigin(WKStringRef origin, WKStringRef parentOrigin)
    835835{
    836     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ResetUserMediaPermissionRequestCountForOrigin"));
    837     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    838 
    839     WKRetainPtr<WKStringRef> originKeyWK(AdoptWK, WKStringCreateWithUTF8CString("origin"));
     836    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ResetUserMediaPermissionRequestCountForOrigin"));
     837    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     838
     839    WKRetainPtr<WKStringRef> originKeyWK = adoptWK(WKStringCreateWithUTF8CString("origin"));
    840840    WKDictionarySetItem(messageBody.get(), originKeyWK.get(), origin);
    841841
    842     WKRetainPtr<WKStringRef> parentOriginKeyWK(AdoptWK, WKStringCreateWithUTF8CString("parentOrigin"));
     842    WKRetainPtr<WKStringRef> parentOriginKeyWK = adoptWK(WKStringCreateWithUTF8CString("parentOrigin"));
    843843    WKDictionarySetItem(messageBody.get(), parentOriginKeyWK.get(), parentOrigin);
    844844
     
    848848void InjectedBundle::setCustomPolicyDelegate(bool enabled, bool permissive)
    849849{
    850     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetCustomPolicyDelegate"));
    851 
    852     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    853 
    854     WKRetainPtr<WKStringRef> enabledKeyWK(AdoptWK, WKStringCreateWithUTF8CString("enabled"));
    855     WKRetainPtr<WKBooleanRef> enabledWK(AdoptWK, WKBooleanCreate(enabled));
     850    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetCustomPolicyDelegate"));
     851
     852    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     853
     854    WKRetainPtr<WKStringRef> enabledKeyWK = adoptWK(WKStringCreateWithUTF8CString("enabled"));
     855    WKRetainPtr<WKBooleanRef> enabledWK = adoptWK(WKBooleanCreate(enabled));
    856856    WKDictionarySetItem(messageBody.get(), enabledKeyWK.get(), enabledWK.get());
    857857
    858     WKRetainPtr<WKStringRef> permissiveKeyWK(AdoptWK, WKStringCreateWithUTF8CString("permissive"));
    859     WKRetainPtr<WKBooleanRef> permissiveWK(AdoptWK, WKBooleanCreate(permissive));
     858    WKRetainPtr<WKStringRef> permissiveKeyWK = adoptWK(WKStringCreateWithUTF8CString("permissive"));
     859    WKRetainPtr<WKBooleanRef> permissiveWK = adoptWK(WKBooleanCreate(permissive));
    860860    WKDictionarySetItem(messageBody.get(), permissiveKeyWK.get(), permissiveWK.get());
    861861
     
    865865void InjectedBundle::setHidden(bool hidden)
    866866{
    867     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetHidden"));
    868     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    869 
    870     WKRetainPtr<WKStringRef> isInitialKeyWK(AdoptWK, WKStringCreateWithUTF8CString("hidden"));
    871     WKRetainPtr<WKBooleanRef> isInitialWK(AdoptWK, WKBooleanCreate(hidden));
     867    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetHidden"));
     868    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     869
     870    WKRetainPtr<WKStringRef> isInitialKeyWK = adoptWK(WKStringCreateWithUTF8CString("hidden"));
     871    WKRetainPtr<WKBooleanRef> isInitialWK = adoptWK(WKBooleanCreate(hidden));
    872872    WKDictionarySetItem(messageBody.get(), isInitialKeyWK.get(), isInitialWK.get());
    873873
     
    877877void InjectedBundle::setCacheModel(int model)
    878878{
    879     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetCacheModel"));
    880     WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(model));
     879    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetCacheModel"));
     880    WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(model));
    881881    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    882882}
     
    887887        return false;
    888888
    889     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsWorkQueueEmpty"));
     889    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsWorkQueueEmpty"));
    890890    WKTypeRef resultToPass = 0;
    891891    WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), 0, &resultToPass);
    892     WKRetainPtr<WKBooleanRef> isEmpty(AdoptWK, static_cast<WKBooleanRef>(resultToPass));
     892    WKRetainPtr<WKBooleanRef> isEmpty = adoptWK(static_cast<WKBooleanRef>(resultToPass));
    893893
    894894    // The IPC failed. This happens when swapping processes on navigation because the WebPageProxy unregisters itself
     
    902902void InjectedBundle::processWorkQueue()
    903903{
    904     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ProcessWorkQueue"));
     904    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ProcessWorkQueue"));
    905905    WKBundlePagePostMessage(page()->page(), messageName.get(), 0);
    906906}
     
    910910    m_useWorkQueue = true;
    911911
    912     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueBackNavigation"));
    913     WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(howFarBackward));
     912    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueBackNavigation"));
     913    WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(howFarBackward));
    914914    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    915915}
     
    919919    m_useWorkQueue = true;
    920920
    921     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueForwardNavigation"));
    922     WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(howFarForward));
     921    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueForwardNavigation"));
     922    WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(howFarForward));
    923923    WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get());
    924924}
     
    928928    m_useWorkQueue = true;
    929929
    930     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueLoad"));
    931 
    932     WKRetainPtr<WKMutableDictionaryRef> loadData(AdoptWK, WKMutableDictionaryCreate());
    933 
    934     WKRetainPtr<WKStringRef> urlKey(AdoptWK, WKStringCreateWithUTF8CString("url"));
     930    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueLoad"));
     931
     932    WKRetainPtr<WKMutableDictionaryRef> loadData = adoptWK(WKMutableDictionaryCreate());
     933
     934    WKRetainPtr<WKStringRef> urlKey = adoptWK(WKStringCreateWithUTF8CString("url"));
    935935    WKDictionarySetItem(loadData.get(), urlKey.get(), url);
    936936
    937     WKRetainPtr<WKStringRef> targetKey(AdoptWK, WKStringCreateWithUTF8CString("target"));
     937    WKRetainPtr<WKStringRef> targetKey = adoptWK(WKStringCreateWithUTF8CString("target"));
    938938    WKDictionarySetItem(loadData.get(), targetKey.get(), target);
    939939
    940     WKRetainPtr<WKStringRef> shouldOpenExternalURLsKey(AdoptWK, WKStringCreateWithUTF8CString("shouldOpenExternalURLs"));
    941     WKRetainPtr<WKBooleanRef> shouldOpenExternalURLsValue(AdoptWK, WKBooleanCreate(shouldOpenExternalURLs));
     940    WKRetainPtr<WKStringRef> shouldOpenExternalURLsKey = adoptWK(WKStringCreateWithUTF8CString("shouldOpenExternalURLs"));
     941    WKRetainPtr<WKBooleanRef> shouldOpenExternalURLsValue = adoptWK(WKBooleanCreate(shouldOpenExternalURLs));
    942942    WKDictionarySetItem(loadData.get(), shouldOpenExternalURLsKey.get(), shouldOpenExternalURLsValue.get());
    943943
     
    949949    m_useWorkQueue = true;
    950950
    951     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueLoadHTMLString"));
    952 
    953     WKRetainPtr<WKMutableDictionaryRef> loadData(AdoptWK, WKMutableDictionaryCreate());
    954 
    955     WKRetainPtr<WKStringRef> contentKey(AdoptWK, WKStringCreateWithUTF8CString("content"));
     951    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueLoadHTMLString"));
     952
     953    WKRetainPtr<WKMutableDictionaryRef> loadData = adoptWK(WKMutableDictionaryCreate());
     954
     955    WKRetainPtr<WKStringRef> contentKey = adoptWK(WKStringCreateWithUTF8CString("content"));
    956956    WKDictionarySetItem(loadData.get(), contentKey.get(), content);
    957957
    958958    if (baseURL) {
    959         WKRetainPtr<WKStringRef> baseURLKey(AdoptWK, WKStringCreateWithUTF8CString("baseURL"));
     959        WKRetainPtr<WKStringRef> baseURLKey = adoptWK(WKStringCreateWithUTF8CString("baseURL"));
    960960        WKDictionarySetItem(loadData.get(), baseURLKey.get(), baseURL);
    961961    }
    962962
    963963    if (unreachableURL) {
    964         WKRetainPtr<WKStringRef> unreachableURLKey(AdoptWK, WKStringCreateWithUTF8CString("unreachableURL"));
     964        WKRetainPtr<WKStringRef> unreachableURLKey = adoptWK(WKStringCreateWithUTF8CString("unreachableURL"));
    965965        WKDictionarySetItem(loadData.get(), unreachableURLKey.get(), unreachableURL);
    966966    }
     
    973973    m_useWorkQueue = true;
    974974
    975     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueReload"));
     975    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueReload"));
    976976    WKBundlePagePostMessage(page()->page(), messageName.get(), 0);
    977977}
     
    981981    m_useWorkQueue = true;
    982982
    983     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueLoadingScript"));
     983    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueLoadingScript"));
    984984    WKBundlePagePostMessage(page()->page(), messageName.get(), script);
    985985}
     
    989989    m_useWorkQueue = true;
    990990
    991     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueNonLoadingScript"));
     991    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueNonLoadingScript"));
    992992    WKBundlePagePostMessage(page()->page(), messageName.get(), script);
    993993}
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r241749 r244390  
    200200static WTF::String frameToStr(WKBundleFrameRef frame)
    201201{
    202     WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
     202    WKRetainPtr<WKStringRef> name = adoptWK(WKBundleFrameCopyName(frame));
    203203    StringBuilder stringBuilder;
    204204    if (WKBundleFrameIsMainFrame(frame)) {
     
    268268InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
    269269    : m_page(page)
    270     , m_world(AdoptWK, WKBundleScriptWorldCreateWorld())
     270    , m_world(adoptWK(WKBundleScriptWorldCreateWorld()))
    271271{
    272272    WKBundlePageLoaderClientV9 loaderClient = {
     
    452452static void dumpFrameDescriptionSuitableForTestResult(WKBundleFrameRef frame, StringBuilder& stringBuilder)
    453453{
    454     WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
     454    WKRetainPtr<WKStringRef> name = adoptWK(WKBundleFrameCopyName(frame));
    455455    if (WKBundleFrameIsMainFrame(frame)) {
    456456        if (WKStringIsEmpty(name.get())) {
     
    781781
    782782    if (shouldIncludeFrameName) {
    783         WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
     783        WKRetainPtr<WKStringRef> name = adoptWK(WKBundleFrameCopyName(frame));
    784784        stringBuilder.appendLiteral("frame '");
    785785        stringBuilder.append(toWTFString(name));
     
    795795static void dumpDescendantFrameScrollPositions(WKBundleFrameRef frame, StringBuilder& stringBuilder)
    796796{
    797     WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame));
     797    WKRetainPtr<WKArrayRef> childFrames = adoptWK(WKBundleFrameCopyChildFrames(frame));
    798798    size_t size = WKArrayGetSize(childFrames.get());
    799799    for (size_t i = 0; i < size; ++i) {
     
    843843        return;
    844844
    845     WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyInnerText(frame));
     845    WKRetainPtr<WKStringRef> text = adoptWK(WKBundleFrameCopyInnerText(frame));
    846846    stringBuilder.append(toWTFString(text));
    847847    stringBuilder.append('\n');
     
    850850static void dumpDescendantFramesText(WKBundleFrameRef frame, StringBuilder& stringBuilder)
    851851{
    852     WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame));
     852    WKRetainPtr<WKArrayRef> childFrames = adoptWK(WKBundleFrameCopyChildFrames(frame));
    853853    size_t size = WKArrayGetSize(childFrames.get());
    854854    for (size_t i = 0; i < size; ++i) {
    855855        WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(WKArrayGetItemAtIndex(childFrames.get(), i));
    856         WKRetainPtr<WKStringRef> subframeName(AdoptWK, WKBundleFrameCopyName(subframe));
     856        WKRetainPtr<WKStringRef> subframeName = adoptWK(WKBundleFrameCopyName(subframe));
    857857
    858858        // DumpRenderTree ignores empty frames, so do the same thing here.
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r244370 r244390  
    129129bool TestRunner::shouldDumpPixels() const
    130130{
    131     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("GetDumpPixels"));
     131    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetDumpPixels"));
    132132    WKTypeRef returnData = nullptr;
    133133    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, &returnData);
     
    138138void TestRunner::setDumpPixels(bool dumpPixels)
    139139{
    140     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetDumpPixels"));
    141     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(dumpPixels));
     140    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetDumpPixels"));
     141    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(dumpPixels));
    142142    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    143143}
     
    152152WhatToDump TestRunner::whatToDump() const
    153153{
    154     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("GetWhatToDump"));
     154    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetWhatToDump"));
    155155    WKTypeRef returnData = nullptr;
    156156    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, &returnData);
     
    161161void TestRunner::setWhatToDump(WhatToDump whatToDump)
    162162{
    163     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetWhatToDump"));
    164     WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(static_cast<uint64_t>(whatToDump)));
     163    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetWhatToDump"));
     164    WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(static_cast<uint64_t>(whatToDump)));
    165165    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    166166}
     
    199199void TestRunner::setWaitUntilDone(bool value)
    200200{
    201     WKRetainPtr<WKStringRef> messsageName(AdoptWK, WKStringCreateWithUTF8CString("SetWaitUntilDone"));
    202     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     201    WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("SetWaitUntilDone"));
     202    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    203203    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), messageBody.get(), nullptr);
    204204}
     
    206206bool TestRunner::shouldWaitUntilDone() const
    207207{
    208     WKRetainPtr<WKStringRef> messsageName(AdoptWK, WKStringCreateWithUTF8CString("GetWaitUntilDone"));
     208    WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("GetWaitUntilDone"));
    209209    WKTypeRef returnData = nullptr;
    210210    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), nullptr, &returnData);
     
    256256void TestRunner::setShouldDumpFrameLoadCallbacks(bool value)
    257257{
    258     WKRetainPtr<WKStringRef> messsageName(AdoptWK, WKStringCreateWithUTF8CString("SetDumpFrameLoadCallbacks"));
    259     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     258    WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("SetDumpFrameLoadCallbacks"));
     259    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    260260    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), messageBody.get(), nullptr);
    261261}
     
    263263bool TestRunner::shouldDumpFrameLoadCallbacks()
    264264{
    265     WKRetainPtr<WKStringRef> messsageName(AdoptWK, WKStringCreateWithUTF8CString("GetDumpFrameLoadCallbacks"));
     265    WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("GetDumpFrameLoadCallbacks"));
    266266    WKTypeRef returnData = nullptr;
    267267    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), nullptr, &returnData);
     
    381381    WKBundleClearAllDatabases(InjectedBundle::singleton().bundle());
    382382
    383     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DeleteAllIndexedDatabases"));
    384     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(true));
     383    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("DeleteAllIndexedDatabases"));
     384    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(true));
    385385
    386386    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    419419void TestRunner::setIDBPerOriginQuota(uint64_t quota)
    420420{
    421     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetIDBPerOriginQuota"));
    422     WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(quota));
     421    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetIDBPerOriginQuota"));
     422    WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(quota));
    423423    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    424424}
     
    443443    WKBundlePageRef page = InjectedBundle::singleton().page()->page();
    444444
    445     WKRetainPtr<WKArrayRef> origins(AdoptWK, WKBundlePageCopyOriginsWithApplicationCache(page));
     445    WKRetainPtr<WKArrayRef> origins = adoptWK(WKBundlePageCopyOriginsWithApplicationCache(page));
    446446
    447447    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(page);
     
    458458void TestRunner::setCanOpenWindows()
    459459{
    460     WKRetainPtr<WKStringRef> messsageName(AdoptWK, WKStringCreateWithUTF8CString("SetCanOpenWindows"));
    461     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(true));
     460    WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("SetCanOpenWindows"));
     461    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(true));
    462462    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), messageBody.get(), nullptr);
    463463}
     
    465465void TestRunner::setXSSAuditorEnabled(bool enabled)
    466466{
    467     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitXSSAuditorEnabled"));
     467    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitXSSAuditorEnabled"));
    468468    auto& injectedBundle = InjectedBundle::singleton();
    469469    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    472472void TestRunner::setMediaDevicesEnabled(bool enabled)
    473473{
    474     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitMediaDevicesEnabled"));
     474    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitMediaDevicesEnabled"));
    475475    auto& injectedBundle = InjectedBundle::singleton();
    476476    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    479479void TestRunner::setWebRTCMDNSICECandidatesEnabled(bool enabled)
    480480{
    481     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebRTCMDNSICECandidatesEnabled"));
     481    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebRTCMDNSICECandidatesEnabled"));
    482482    auto& injectedBundle = InjectedBundle::singleton();
    483483    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    486486void TestRunner::setWebRTCUnifiedPlanEnabled(bool enabled)
    487487{
    488     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebRTCUnifiedPlanEnabled"));
     488    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebRTCUnifiedPlanEnabled"));
    489489    auto& injectedBundle = InjectedBundle::singleton();
    490490    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    493493void TestRunner::setCustomUserAgent(JSStringRef userAgent)
    494494{
    495     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetCustomUserAgent"));
     495    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetCustomUserAgent"));
    496496    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), toWK(userAgent).get(), nullptr);
    497497}
     
    499499void TestRunner::setWebAPIStatisticsEnabled(bool enabled)
    500500{
    501     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebAPIStatisticsEnabled"));
     501    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebAPIStatisticsEnabled"));
    502502    auto& injectedBundle = InjectedBundle::singleton();
    503503    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    506506void TestRunner::setModernMediaControlsEnabled(bool enabled)
    507507{
    508     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitModernMediaControlsEnabled"));
     508    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitModernMediaControlsEnabled"));
    509509    auto& injectedBundle = InjectedBundle::singleton();
    510510    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    513513void TestRunner::setWebGL2Enabled(bool enabled)
    514514{
    515     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebGL2Enabled"));
     515    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebGL2Enabled"));
    516516    auto& injectedBundle = InjectedBundle::singleton();
    517517    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    520520void TestRunner::setWritableStreamAPIEnabled(bool enabled)
    521521{
    522     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWritableStreamAPIEnabled"));
     522    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWritableStreamAPIEnabled"));
    523523    auto& injectedBundle = InjectedBundle::singleton();
    524524    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    527527void TestRunner::setReadableByteStreamAPIEnabled(bool enabled)
    528528{
    529     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitReadableByteStreamAPIEnabled"));
     529    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitReadableByteStreamAPIEnabled"));
    530530    auto& injectedBundle = InjectedBundle::singleton();
    531531    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    534534void TestRunner::setEncryptedMediaAPIEnabled(bool enabled)
    535535{
    536     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitEncryptedMediaAPIEnabled"));
     536    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitEncryptedMediaAPIEnabled"));
    537537    auto& injectedBundle = InjectedBundle::singleton();
    538538    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    544544    injectedBundle.setAllowsAnySSLCertificate(enabled);
    545545
    546     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAllowsAnySSLCertificate"));
    547     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(enabled));
     546    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAllowsAnySSLCertificate"));
     547    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(enabled));
    548548    WKBundlePagePostSynchronousMessageForTesting(injectedBundle.page()->page(), messageName.get(), messageBody.get(), nullptr);
    549549}
     
    569569void TestRunner::setPluginsEnabled(bool enabled)
    570570{
    571     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitPluginsEnabled"));
     571    WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitPluginsEnabled"));
    572572    auto& injectedBundle = InjectedBundle::singleton();
    573573    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
     
    630630        return;
    631631
    632     WKRetainPtr<WKBundleNodeHandleRef> nodeHandle(AdoptWK, WKBundleNodeHandleCreate(context, const_cast<JSObjectRef>(element)));
     632    WKRetainPtr<WKBundleNodeHandleRef> nodeHandle = adoptWK(WKBundleNodeHandleCreate(context, const_cast<JSObjectRef>(element)));
    633633    WKBundleNodeHandleSetHTMLInputElementValueForUser(nodeHandle.get(), toWK(value).get());
    634634}
     
    638638    auto& injectedBundle = InjectedBundle::singleton();
    639639    // FIXME (123058): Use a JSC API to get buffer contents once such is exposed.
    640     WKRetainPtr<WKDataRef> audioData(AdoptWK, WKBundleCreateWKDataFromUInt8Array(injectedBundle.bundle(), context, data));
     640    WKRetainPtr<WKDataRef> audioData = adoptWK(WKBundleCreateWKDataFromUInt8Array(injectedBundle.bundle(), context, data));
    641641    injectedBundle.setAudioResult(audioData.get());
    642642    setWhatToDump(WhatToDump::Audio);
     
    737737bool TestRunner::didReceiveServerRedirectForProvisionalNavigation() const
    738738{
    739     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DidReceiveServerRedirectForProvisionalNavigation"));
     739    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("DidReceiveServerRedirectForProvisionalNavigation"));
    740740    WKTypeRef returnData = nullptr;
    741741    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData);
     
    746746void TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation()
    747747{
    748     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ClearDidReceiveServerRedirectForProvisionalNavigation"));
     748    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ClearDidReceiveServerRedirectForProvisionalNavigation"));
    749749    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr);
    750750}
     
    910910void TestRunner::setAlwaysAcceptCookies(bool accept)
    911911{
    912     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAlwaysAcceptCookies"));
    913 
    914     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(accept));
     912    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAlwaysAcceptCookies"));
     913
     914    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(accept));
    915915
    916916    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    919919void TestRunner::setOnlyAcceptFirstPartyCookies(bool accept)
    920920{
    921     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetOnlyAcceptFirstPartyCookies"));
    922    
    923     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(accept));
     921    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetOnlyAcceptFirstPartyCookies"));
     922   
     923    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(accept));
    924924   
    925925    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    10861086bool TestRunner::isDoingMediaCapture() const
    10871087{
    1088     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsDoingMediaCapture"));
     1088    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsDoingMediaCapture"));
    10891089    WKTypeRef returnData = nullptr;
    10901090    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData);
     
    11331133{
    11341134    auto& injectedBundle = InjectedBundle::singleton();
    1135     WKRetainPtr<WKURLRef> baseURLWK(AdoptWK, WKBundleFrameCopyURL(WKBundlePageGetMainFrame(injectedBundle.page()->page())));
    1136     WKRetainPtr<WKURLRef> urlWK(AdoptWK, WKURLCreateWithBaseURL(baseURLWK.get(), toWTFString(toWK(url)).utf8().data()));
    1137     WKRetainPtr<WKStringRef> urlStringWK(AdoptWK, WKURLCopyString(urlWK.get()));
     1135    WKRetainPtr<WKURLRef> baseURLWK = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(injectedBundle.page()->page())));
     1136    WKRetainPtr<WKURLRef> urlWK = adoptWK(WKURLCreateWithBaseURL(baseURLWK.get(), toWTFString(toWK(url)).utf8().data()));
     1137    WKRetainPtr<WKStringRef> urlStringWK = adoptWK(WKURLCopyString(urlWK.get()));
    11381138
    11391139    injectedBundle.queueLoad(urlStringWK.get(), toWK(target).get(), shouldOpenExternalURLs);
     
    11681168void TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value)
    11691169{
    1170     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetRejectsProtectionSpaceAndContinueForAuthenticationChallenges"));
    1171     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1170    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetRejectsProtectionSpaceAndContinueForAuthenticationChallenges"));
     1171    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    11721172    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    11731173}
     
    11751175void TestRunner::setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges)
    11761176{
    1177     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetHandlesAuthenticationChallenges"));
    1178     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(handlesAuthenticationChallenges));
     1177    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetHandlesAuthenticationChallenges"));
     1178    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(handlesAuthenticationChallenges));
    11791179    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    11801180}
     
    11821182void TestRunner::setShouldLogCanAuthenticateAgainstProtectionSpace(bool value)
    11831183{
    1184     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetShouldLogCanAuthenticateAgainstProtectionSpace"));
    1185     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1184    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetShouldLogCanAuthenticateAgainstProtectionSpace"));
     1185    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    11861186    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    11871187}
     
    11891189void TestRunner::setShouldLogDownloadCallbacks(bool value)
    11901190{
    1191     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetShouldLogDownloadCallbacks"));
    1192     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1191    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetShouldLogDownloadCallbacks"));
     1192    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    11931193    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    11941194}
     
    11961196void TestRunner::setAuthenticationUsername(JSStringRef username)
    11971197{
    1198     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAuthenticationUsername"));
    1199     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(username));
     1198    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAuthenticationUsername"));
     1199    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(username));
    12001200    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12011201}
     
    12031203void TestRunner::setAuthenticationPassword(JSStringRef password)
    12041204{
    1205     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAuthenticationPassword"));
    1206     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(password));
     1205    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAuthenticationPassword"));
     1206    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(password));
    12071207    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12081208}
     
    12101210bool TestRunner::secureEventInputIsEnabled() const
    12111211{
    1212     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SecureEventInputIsEnabled"));
     1212    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SecureEventInputIsEnabled"));
    12131213    WKTypeRef returnData = nullptr;
    12141214    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData);
     
    12191219void TestRunner::setBlockAllPlugins(bool shouldBlock)
    12201220{
    1221     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetBlockAllPlugins"));
    1222     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(shouldBlock));
     1221    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetBlockAllPlugins"));
     1222    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(shouldBlock));
    12231223    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12241224}
     
    12261226void TestRunner::setPluginSupportedMode(JSStringRef mode)
    12271227{
    1228     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetPluginSupportedMode"));
    1229     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(mode));
     1228    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetPluginSupportedMode"));
     1229    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(mode));
    12301230    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12311231}
     
    12551255{
    12561256    m_shouldDecideNavigationPolicyAfterDelay = value;
    1257     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetShouldDecideNavigationPolicyAfterDelay"));
    1258     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1257    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetShouldDecideNavigationPolicyAfterDelay"));
     1258    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    12591259    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12601260}
     
    12631263{
    12641264    m_shouldDecideResponsePolicyAfterDelay = value;
    1265     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetShouldDecideResponsePolicyAfterDelay"));
    1266     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1265    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetShouldDecideResponsePolicyAfterDelay"));
     1266    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    12671267    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12681268}
     
    12701270void TestRunner::setNavigationGesturesEnabled(bool value)
    12711271{
    1272     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetNavigationGesturesEnabled"));
    1273     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1272    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetNavigationGesturesEnabled"));
     1273    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    12741274    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12751275}
     
    12771277void TestRunner::setIgnoresViewportScaleLimits(bool value)
    12781278{
    1279     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetIgnoresViewportScaleLimits"));
    1280     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1279    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetIgnoresViewportScaleLimits"));
     1280    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    12811281    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12821282}
     
    12841284void TestRunner::setShouldDownloadUndisplayableMIMETypes(bool value)
    12851285{
    1286     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetShouldDownloadUndisplayableMIMETypes"));
    1287     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1286    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetShouldDownloadUndisplayableMIMETypes"));
     1287    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    12881288    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12891289}
     
    12911291void TestRunner::setShouldAllowDeviceOrientationAndMotionAccess(bool value)
    12921292{
    1293     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetShouldAllowDeviceOrientationAndMotionAccess"));
    1294     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1293    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetShouldAllowDeviceOrientationAndMotionAccess"));
     1294    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    12951295    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
    12961296}
     
    12981298void TestRunner::terminateNetworkProcess()
    12991299{
    1300     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("TerminateNetworkProcess"));
     1300    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("TerminateNetworkProcess"));
    13011301    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr);
    13021302}
     
    13041304void TestRunner::terminateServiceWorkerProcess()
    13051305{
    1306     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("TerminateServiceWorkerProcess"));
     1306    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("TerminateServiceWorkerProcess"));
    13071307    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr);
    13081308}
     
    13191319    cacheTestRunnerCallback(callbackID, callback);
    13201320
    1321     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("RunUIProcessScript"));
    1322 
    1323     WKRetainPtr<WKMutableDictionaryRef> testDictionary(AdoptWK, WKMutableDictionaryCreate());
    1324 
    1325     WKRetainPtr<WKStringRef> scriptKey(AdoptWK, WKStringCreateWithUTF8CString("Script"));
    1326     WKRetainPtr<WKStringRef> scriptValue(AdoptWK, WKStringCreateWithJSString(script));
    1327 
    1328     WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID"));
     1321    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("RunUIProcessScript"));
     1322
     1323    WKRetainPtr<WKMutableDictionaryRef> testDictionary = adoptWK(WKMutableDictionaryCreate());
     1324
     1325    WKRetainPtr<WKStringRef> scriptKey = adoptWK(WKStringCreateWithUTF8CString("Script"));
     1326    WKRetainPtr<WKStringRef> scriptValue = adoptWK(WKStringCreateWithJSString(script));
     1327
     1328    WKRetainPtr<WKStringRef> callbackIDKey = adoptWK(WKStringCreateWithUTF8CString("CallbackID"));
    13291329    WKRetainPtr<WKUInt64Ref> callbackIDValue = adoptWK(WKUInt64Create(callbackID));
    13301330
     
    13461346void TestRunner::setAllowedMenuActions(JSValueRef actions)
    13471347{
    1348     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAllowedMenuActions"));
    1349     WKRetainPtr<WKMutableArrayRef> messageBody(AdoptWK, WKMutableArrayCreate());
     1348    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAllowedMenuActions"));
     1349    WKRetainPtr<WKMutableArrayRef> messageBody = adoptWK(WKMutableArrayCreate());
    13501350
    13511351    auto page = InjectedBundle::singleton().page()->page();
     
    13651365
    13661366        auto actionName = adopt(JSValueToStringCopy(context, value, 0));
    1367         WKRetainPtr<WKStringRef> action(AdoptWK, WKStringCreateWithJSString(actionName.get()));
     1367        WKRetainPtr<WKStringRef> action = adoptWK(WKStringCreateWithJSString(actionName.get()));
    13681368        WKArrayAppendItem(messageBody.get(), action.get());
    13691369    }
     
    13761376    cacheTestRunnerCallback(CustomMenuActionCallbackID, callback);
    13771377
    1378     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("InstallCustomMenuAction"));
    1379     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    1380 
    1381     WKRetainPtr<WKStringRef> nameKey(AdoptWK, WKStringCreateWithUTF8CString("name"));
    1382     WKRetainPtr<WKStringRef> nameValue(AdoptWK, WKStringCreateWithJSString(name));
     1378    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("InstallCustomMenuAction"));
     1379    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     1380
     1381    WKRetainPtr<WKStringRef> nameKey = adoptWK(WKStringCreateWithUTF8CString("name"));
     1382    WKRetainPtr<WKStringRef> nameValue = adoptWK(WKStringCreateWithJSString(name));
    13831383    WKDictionarySetItem(messageBody.get(), nameKey.get(), nameValue.get());
    13841384
    1385     WKRetainPtr<WKStringRef> dismissesAutomaticallyKey(AdoptWK, WKStringCreateWithUTF8CString("dismissesAutomatically"));
    1386     WKRetainPtr<WKBooleanRef> dismissesAutomaticallyValue(AdoptWK, WKBooleanCreate(dismissesAutomatically));
     1385    WKRetainPtr<WKStringRef> dismissesAutomaticallyKey = adoptWK(WKStringCreateWithUTF8CString("dismissesAutomatically"));
     1386    WKRetainPtr<WKBooleanRef> dismissesAutomaticallyValue = adoptWK(WKBooleanCreate(dismissesAutomatically));
    13871387    WKDictionarySetItem(messageBody.get(), dismissesAutomaticallyKey.get(), dismissesAutomaticallyValue.get());
    13881388
     
    14341434    cacheTestRunnerCallback(SetStatisticsDebugModeCallbackID, completionHandler);
    14351435
    1436     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsDebugMode"));
    1437     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1436    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsDebugMode"));
     1437    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    14381438    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    14391439
     
    14491449    cacheTestRunnerCallback(SetStatisticsPrevalentResourceForDebugModeCallbackID, completionHandler);
    14501450   
    1451     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsPrevalentResourceForDebugMode"));
    1452     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName));
     1451    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsPrevalentResourceForDebugMode"));
     1452    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(hostName));
    14531453    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    14541454}
     
    14661466    Vector<WKRetainPtr<WKTypeRef>> values;
    14671467   
    1468     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1469     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1470    
    1471     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    1472     values.append({ AdoptWK, WKDoubleCreate(seconds) });
     1468    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1469    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1470   
     1471    keys.append(adoptWK(WKStringCreateWithUTF8CString("Value")));
     1472    values.append(adoptWK(WKDoubleCreate(seconds)));
    14731473   
    14741474    Vector<WKStringRef> rawKeys(keys.size());
     
    14801480    }
    14811481   
    1482     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsLastSeen"));
    1483     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1482    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsLastSeen"));
     1483    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    14841484   
    14851485    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    14981498    Vector<WKRetainPtr<WKTypeRef>> values;
    14991499
    1500     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1501     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1502    
    1503     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    1504     values.append({ AdoptWK, WKBooleanCreate(value) });
     1500    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1501    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1502   
     1503    keys.append(adoptWK(WKStringCreateWithUTF8CString("Value")));
     1504    values.append(adoptWK(WKBooleanCreate(value)));
    15051505   
    15061506    Vector<WKStringRef> rawKeys;
     
    15141514    }
    15151515   
    1516     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsPrevalentResource"));
    1517     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1516    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsPrevalentResource"));
     1517    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    15181518
    15191519    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    15321532    Vector<WKRetainPtr<WKTypeRef>> values;
    15331533   
    1534     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1535     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1536    
    1537     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    1538     values.append({ AdoptWK, WKBooleanCreate(value) });
     1534    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1535    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1536   
     1537    keys.append(adoptWK(WKStringCreateWithUTF8CString("Value")));
     1538    values.append(adoptWK(WKBooleanCreate(value)));
    15391539   
    15401540    Vector<WKStringRef> rawKeys;
     
    15481548    }
    15491549   
    1550     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsVeryPrevalentResource"));
    1551     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1550    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsVeryPrevalentResource"));
     1551    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    15521552   
    15531553    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    15611561void TestRunner::dumpResourceLoadStatistics()
    15621562{
    1563     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("dumpResourceLoadStatistics"));
     1563    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("dumpResourceLoadStatistics"));
    15641564    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr);
    15651565}
     
    15671567bool TestRunner::isStatisticsPrevalentResource(JSStringRef hostName)
    15681568{
    1569     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsPrevalentResource"));
    1570     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName));
     1569    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsStatisticsPrevalentResource"));
     1570    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(hostName));
    15711571    WKTypeRef returnData = nullptr;
    15721572    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    15771577bool TestRunner::isStatisticsVeryPrevalentResource(JSStringRef hostName)
    15781578{
    1579     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsVeryPrevalentResource"));
    1580     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName));
     1579    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsStatisticsVeryPrevalentResource"));
     1580    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(hostName));
    15811581    WKTypeRef returnData = nullptr;
    15821582    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    15901590    Vector<WKRetainPtr<WKTypeRef>> values;
    15911591   
    1592     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("SubresourceHost") });
    1593     values.append({ AdoptWK, WKStringCreateWithJSString(subresourceHost) });
    1594    
    1595     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("TopFrameHost") });
    1596     values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHost) });
     1592    keys.append(adoptWK(WKStringCreateWithUTF8CString("SubresourceHost")));
     1593    values.append(adoptWK(WKStringCreateWithJSString(subresourceHost)));
     1594   
     1595    keys.append(adoptWK(WKStringCreateWithUTF8CString("TopFrameHost")));
     1596    values.append(adoptWK(WKStringCreateWithJSString(topFrameHost)));
    15971597   
    15981598    Vector<WKStringRef> rawKeys(keys.size());
     
    16041604    }
    16051605   
    1606     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsSubresourceUnder"));
    1607     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1606    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsSubresourceUnder"));
     1607    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    16081608    WKTypeRef returnData = nullptr;
    16091609    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    16171617    Vector<WKRetainPtr<WKTypeRef>> values;
    16181618
    1619     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("SubFrameHost") });
    1620     values.append({ AdoptWK, WKStringCreateWithJSString(subFrameHost) });
    1621    
    1622     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("TopFrameHost") });
    1623     values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHost) });
     1619    keys.append(adoptWK(WKStringCreateWithUTF8CString("SubFrameHost")));
     1620    values.append(adoptWK(WKStringCreateWithJSString(subFrameHost)));
     1621   
     1622    keys.append(adoptWK(WKStringCreateWithUTF8CString("TopFrameHost")));
     1623    values.append(adoptWK(WKStringCreateWithJSString(topFrameHost)));
    16241624   
    16251625    Vector<WKStringRef> rawKeys(keys.size());
     
    16311631    }
    16321632
    1633     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsSubFrameUnder"));
    1634     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1633    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsSubFrameUnder"));
     1634    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    16351635    WKTypeRef returnData = nullptr;
    16361636    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    16441644    Vector<WKRetainPtr<WKTypeRef>> values;
    16451645   
    1646     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostRedirectedFrom") });
    1647     values.append({ AdoptWK, WKStringCreateWithJSString(hostRedirectedFrom) });
    1648    
    1649     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostRedirectedTo") });
    1650     values.append({ AdoptWK, WKStringCreateWithJSString(hostRedirectedTo) });
     1646    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostRedirectedFrom")));
     1647    values.append(adoptWK(WKStringCreateWithJSString(hostRedirectedFrom)));
     1648   
     1649    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostRedirectedTo")));
     1650    values.append(adoptWK(WKStringCreateWithJSString(hostRedirectedTo)));
    16511651   
    16521652    Vector<WKStringRef> rawKeys(keys.size());
     
    16581658    }
    16591659   
    1660     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsRedirectingTo"));
    1661     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1660    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsRedirectingTo"));
     1661    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    16621662    WKTypeRef returnData = nullptr;
    16631663    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    16731673    Vector<WKRetainPtr<WKTypeRef>> values;
    16741674   
    1675     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1676     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1677    
    1678     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    1679     values.append({ AdoptWK, WKBooleanCreate(value) });
     1675    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1676    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1677   
     1678    keys.append(adoptWK(WKStringCreateWithUTF8CString("Value")));
     1679    values.append(adoptWK(WKBooleanCreate(value)));
    16801680   
    16811681    Vector<WKStringRef> rawKeys;
     
    16891689    }
    16901690   
    1691     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsHasHadUserInteraction"));
    1692     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1691    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsHasHadUserInteraction"));
     1692    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    16931693   
    16941694    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    17021702bool TestRunner::isStatisticsHasHadUserInteraction(JSStringRef hostName)
    17031703{
    1704     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsHasHadUserInteraction"));
    1705     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName));
     1704    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsStatisticsHasHadUserInteraction"));
     1705    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(hostName));
    17061706    WKTypeRef returnData = nullptr;
    17071707    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    17151715    Vector<WKRetainPtr<WKTypeRef>> values;
    17161716   
    1717     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1718     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1719    
    1720     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    1721     values.append({ AdoptWK, WKBooleanCreate(value) });
     1717    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1718    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1719   
     1720    keys.append(adoptWK(WKStringCreateWithUTF8CString("Value")));
     1721    values.append(adoptWK(WKBooleanCreate(value)));
    17221722   
    17231723    Vector<WKStringRef> rawKeys;
     
    17311731    }
    17321732   
    1733     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsGrandfathered"));
    1734     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1733    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsGrandfathered"));
     1734    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    17351735   
    17361736    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    17391739bool TestRunner::isStatisticsGrandfathered(JSStringRef hostName)
    17401740{
    1741     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsGrandfathered"));
    1742     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName));
     1741    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsStatisticsGrandfathered"));
     1742    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(hostName));
    17431743    WKTypeRef returnData = nullptr;
    17441744    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    17521752    Vector<WKRetainPtr<WKTypeRef>> values;
    17531753   
    1754     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1755     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1756    
    1757     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("TopFrameHostName") });
    1758     values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHostName) });
     1754    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1755    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1756   
     1757    keys.append(adoptWK(WKStringCreateWithUTF8CString("TopFrameHostName")));
     1758    values.append(adoptWK(WKStringCreateWithJSString(topFrameHostName)));
    17591759   
    17601760    Vector<WKStringRef> rawKeys(keys.size());
     
    17661766    }
    17671767   
    1768     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsSubframeUnderTopFrameOrigin"));
    1769     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1768    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsSubframeUnderTopFrameOrigin"));
     1769    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    17701770    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    17711771}
     
    17761776    Vector<WKRetainPtr<WKTypeRef>> values;
    17771777   
    1778     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1779     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1780    
    1781     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("TopFrameHostName") });
    1782     values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHostName) });
     1778    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1779    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1780   
     1781    keys.append(adoptWK(WKStringCreateWithUTF8CString("TopFrameHostName")));
     1782    values.append(adoptWK(WKStringCreateWithJSString(topFrameHostName)));
    17831783   
    17841784    Vector<WKStringRef> rawKeys(keys.size());
     
    17901790    }
    17911791   
    1792     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsSubresourceUnderTopFrameOrigin"));
    1793     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1792    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsSubresourceUnderTopFrameOrigin"));
     1793    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    17941794    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    17951795}
     
    18001800    Vector<WKRetainPtr<WKTypeRef>> values;
    18011801   
    1802     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1803     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1804    
    1805     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedTo") });
    1806     values.append({ AdoptWK, WKStringCreateWithJSString(hostNameRedirectedTo) });
     1802    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1803    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1804   
     1805    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostNameRedirectedTo")));
     1806    values.append(adoptWK(WKStringCreateWithJSString(hostNameRedirectedTo)));
    18071807   
    18081808    Vector<WKStringRef> rawKeys(keys.size());
     
    18141814    }
    18151815   
    1816     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsSubresourceUniqueRedirectTo"));
    1817     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1816    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsSubresourceUniqueRedirectTo"));
     1817    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    18181818    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    18191819}
     
    18251825    Vector<WKRetainPtr<WKTypeRef>> values;
    18261826   
    1827     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1828     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1829    
    1830     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedFrom") });
    1831     values.append({ AdoptWK, WKStringCreateWithJSString(hostNameRedirectedFrom) });
     1827    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1828    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1829   
     1830    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostNameRedirectedFrom")));
     1831    values.append(adoptWK(WKStringCreateWithJSString(hostNameRedirectedFrom)));
    18321832   
    18331833    Vector<WKStringRef> rawKeys(keys.size());
     
    18391839    }
    18401840   
    1841     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsSubresourceUniqueRedirectFrom"));
    1842     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1841    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsSubresourceUniqueRedirectFrom"));
     1842    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    18431843    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    18441844}
     
    18491849    Vector<WKRetainPtr<WKTypeRef>> values;
    18501850   
    1851     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1852     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1853    
    1854     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedTo") });
    1855     values.append({ AdoptWK, WKStringCreateWithJSString(hostNameRedirectedTo) });
     1851    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1852    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1853   
     1854    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostNameRedirectedTo")));
     1855    values.append(adoptWK(WKStringCreateWithJSString(hostNameRedirectedTo)));
    18561856   
    18571857    Vector<WKStringRef> rawKeys(keys.size());
     
    18631863    }
    18641864   
    1865     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsTopFrameUniqueRedirectTo"));
    1866     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1865    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsTopFrameUniqueRedirectTo"));
     1866    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    18671867    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    18681868}
     
    18731873    Vector<WKRetainPtr<WKTypeRef>> values;
    18741874   
    1875     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1876     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1877    
    1878     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedFrom") });
    1879     values.append({ AdoptWK, WKStringCreateWithJSString(hostNameRedirectedFrom) });
     1875    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     1876    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     1877   
     1878    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostNameRedirectedFrom")));
     1879    values.append(adoptWK(WKStringCreateWithJSString(hostNameRedirectedFrom)));
    18801880   
    18811881    Vector<WKStringRef> rawKeys(keys.size());
     
    18871887    }
    18881888   
    1889     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsTopFrameUniqueRedirectFrom"));
    1890     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1889    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsTopFrameUniqueRedirectFrom"));
     1890    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    18911891    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    18921892}
     
    18971897    Vector<WKRetainPtr<WKTypeRef>> values;
    18981898   
    1899     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("FromHost") });
    1900     values.append({ AdoptWK, WKStringCreateWithJSString(fromHost) });
    1901    
    1902     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ToHost") });
    1903     values.append({ AdoptWK, WKStringCreateWithJSString(toHost) });
     1899    keys.append(adoptWK(WKStringCreateWithUTF8CString("FromHost")));
     1900    values.append(adoptWK(WKStringCreateWithJSString(fromHost)));
     1901   
     1902    keys.append(adoptWK(WKStringCreateWithUTF8CString("ToHost")));
     1903    values.append(adoptWK(WKStringCreateWithJSString(toHost)));
    19041904   
    19051905    Vector<WKStringRef> rawKeys(keys.size());
     
    19111911    }
    19121912   
    1913     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsCrossSiteLoadWithLinkDecoration"));
    1914     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1913    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsCrossSiteLoadWithLinkDecoration"));
     1914    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    19151915    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    19161916}
     
    19181918void TestRunner::setStatisticsTimeToLiveUserInteraction(double seconds)
    19191919{
    1920     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsTimeToLiveUserInteraction"));
    1921     WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(seconds));
     1920    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsTimeToLiveUserInteraction"));
     1921    WKRetainPtr<WKDoubleRef> messageBody = adoptWK(WKDoubleCreate(seconds));
    19221922    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    19231923}
     
    19401940
    19411941    // Setting a callback implies we expect to receive callbacks. So register for them.
    1942     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsNotifyPagesWhenDataRecordsWereScanned"));
    1943     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(notifyPagesWhenDataRecordsWereScanned));
     1942    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsNotifyPagesWhenDataRecordsWereScanned"));
     1943    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(notifyPagesWhenDataRecordsWereScanned));
    19441944    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    19451945}
     
    19811981void TestRunner::statisticsProcessStatisticsAndDataRecords()
    19821982{
    1983     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsProcessStatisticsAndDataRecords"));
     1983    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsProcessStatisticsAndDataRecords"));
    19841984    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    19851985}
     
    19891989    cacheTestRunnerCallback(StatisticsDidSetBlockCookiesForHostCallbackID, completionHandler);
    19901990
    1991     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsUpdateCookieBlocking"));
     1991    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsUpdateCookieBlocking"));
    19921992    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    19931993}
     
    20002000void TestRunner::statisticsSubmitTelemetry()
    20012001{
    2002     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsSubmitTelemetry"));
     2002    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsSubmitTelemetry"));
    20032003    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    20042004}
     
    20062006void TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool value)
    20072007{
    2008     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsNotifyPagesWhenDataRecordsWereScanned"));
    2009     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     2008    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsNotifyPagesWhenDataRecordsWereScanned"));
     2009    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    20102010    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20112011}
     
    20132013void TestRunner::setStatisticsIsRunningTest(bool value)
    20142014{
    2015     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsSetIsRunningTest"));
    2016     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     2015    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsSetIsRunningTest"));
     2016    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    20172017    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20182018}
     
    20202020void TestRunner::setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(bool value)
    20212021{
    2022     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsShouldClassifyResourcesBeforeDataRecordsRemoval"));
    2023     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     2022    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsShouldClassifyResourcesBeforeDataRecordsRemoval"));
     2023    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    20242024    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20252025}
     
    20272027void TestRunner::setStatisticsNotifyPagesWhenTelemetryWasCaptured(bool value)
    20282028{
    2029     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsNotifyPagesWhenTelemetryWasCaptured"));
    2030     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     2029    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsNotifyPagesWhenTelemetryWasCaptured"));
     2030    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    20312031    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20322032}
     
    20342034void TestRunner::setStatisticsMinimumTimeBetweenDataRecordsRemoval(double seconds)
    20352035{
    2036     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsMinimumTimeBetweenDataRecordsRemoval"));
    2037     WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(seconds));
     2036    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsMinimumTimeBetweenDataRecordsRemoval"));
     2037    WKRetainPtr<WKDoubleRef> messageBody = adoptWK(WKDoubleCreate(seconds));
    20382038    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20392039}
     
    20412041void TestRunner::setStatisticsGrandfatheringTime(double seconds)
    20422042{
    2043     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsGrandfatheringTime"));
    2044     WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(seconds));
     2043    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsGrandfatheringTime"));
     2044    WKRetainPtr<WKDoubleRef> messageBody = adoptWK(WKDoubleCreate(seconds));
    20452045    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20462046}
     
    20482048void TestRunner::setStatisticsMaxStatisticsEntries(unsigned entries)
    20492049{
    2050     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMaxStatisticsEntries"));
    2051     WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(entries));
     2050    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetMaxStatisticsEntries"));
     2051    WKRetainPtr<WKTypeRef> messageBody = adoptWK(WKUInt64Create(entries));
    20522052    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20532053}
     
    20552055void TestRunner::setStatisticsPruneEntriesDownTo(unsigned entries)
    20562056{
    2057     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetPruneEntriesDownTo"));
    2058     WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(entries));
     2057    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetPruneEntriesDownTo"));
     2058    WKRetainPtr<WKTypeRef> messageBody = adoptWK(WKUInt64Create(entries));
    20592059    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20602060}
     
    20642064    cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback);
    20652065
    2066     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStore"));
     2066    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStore"));
    20672067    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    20682068}
     
    20722072    cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback);
    20732073
    2074     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStoreModifiedSinceHours"));
    2075     WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(hours));
     2074    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStoreModifiedSinceHours"));
     2075    WKRetainPtr<WKTypeRef> messageBody = adoptWK(WKUInt64Create(hours));
    20762076    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    20772077}
     
    20812081    cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback);
    20822082   
    2083     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsClearThroughWebsiteDataRemoval"));
     2083    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsClearThroughWebsiteDataRemoval"));
    20842084    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    20852085}
     
    20902090    Vector<WKRetainPtr<WKTypeRef>> values;
    20912091
    2092     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    2093     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    2094 
    2095     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("IncludeHttpOnlyCookies") });
    2096     values.append({ AdoptWK, WKBooleanCreate(includeHttpOnlyCookies) });
     2092    keys.append(adoptWK(WKStringCreateWithUTF8CString("HostName")));
     2093    values.append(adoptWK(WKStringCreateWithJSString(hostName)));
     2094
     2095    keys.append(adoptWK(WKStringCreateWithUTF8CString("IncludeHttpOnlyCookies")));
     2096    values.append(adoptWK(WKBooleanCreate(includeHttpOnlyCookies)));
    20972097
    20982098    Vector<WKStringRef> rawKeys;
     
    21062106    }
    21072107
    2108     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsDeleteCookiesForHost"));
    2109     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     2108    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsDeleteCookiesForHost"));
     2109    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    21102110    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    21112111}
     
    21232123void TestRunner::setStatisticsCacheMaxAgeCap(double seconds)
    21242124{
    2125     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsCacheMaxAgeCap"));
    2126     WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(seconds));
     2125    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStatisticsCacheMaxAgeCap"));
     2126    WKRetainPtr<WKDoubleRef> messageBody = adoptWK(WKDoubleCreate(seconds));
    21272127    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    21282128}
     
    21372137    cacheTestRunnerCallback(StatisticsDidResetToConsistentStateCallbackID, completionHandler);
    21382138   
    2139     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsResetToConsistentState"));
     2139    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsResetToConsistentState"));
    21402140    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    21412141}
     
    21782178void TestRunner::setStorageAccessAPIEnabled(bool enabled)
    21792179{
    2180     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStorageAccessAPIEnabled"));
    2181    
    2182     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(enabled));
     2180    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetStorageAccessAPIEnabled"));
     2181   
     2182    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(enabled));
    21832183   
    21842184    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    21892189    cacheTestRunnerCallback(AllStorageAccessEntriesCallbackID, callback);
    21902190   
    2191     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("GetAllStorageAccessEntries"));
     2191    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetAllStorageAccessEntries"));
    21922192    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    21932193}
     
    22222222    Vector<WKRetainPtr<WKTypeRef>> values;
    22232223
    2224     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("PersistentID") });
     2224    keys.append(adoptWK(WKStringCreateWithUTF8CString("PersistentID")));
    22252225    values.append(toWK(persistentId));
    22262226
    2227     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Label") });
     2227    keys.append(adoptWK(WKStringCreateWithUTF8CString("Label")));
    22282228    values.append(toWK(label));
    22292229
    2230     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Type") });
    2231     values.append({ AdoptWK, WKStringCreateWithUTF8CString(type) });
     2230    keys.append(adoptWK(WKStringCreateWithUTF8CString("Type")));
     2231    values.append(adoptWK(WKStringCreateWithUTF8CString(type)));
    22322232
    22332233    Vector<WKStringRef> rawKeys;
     
    22412241    }
    22422242
    2243     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("AddMockMediaDevice"));
    2244     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     2243    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("AddMockMediaDevice"));
     2244    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    22452245
    22462246    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    22642264void TestRunner::clearMockMediaDevices()
    22652265{
    2266     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ClearMockMediaDevices"));
     2266    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ClearMockMediaDevices"));
    22672267    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    22682268}
     
    22702270void TestRunner::removeMockMediaDevice(JSStringRef persistentId)
    22712271{
    2272     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("RemoveMockMediaDevice"));
     2272    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("RemoveMockMediaDevice"));
    22732273    WKRetainPtr<WKTypeRef> messageBody(toWK(persistentId));
    22742274
     
    22782278void TestRunner::resetMockMediaDevices()
    22792279{
    2280     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ResetMockMediaDevices"));
     2280    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ResetMockMediaDevices"));
    22812281    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    22822282}
     
    22852285void TestRunner::connectMockGamepad(unsigned index)
    22862286{
    2287     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ConnectMockGamepad"));
    2288     WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(index));
     2287    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ConnectMockGamepad"));
     2288    WKRetainPtr<WKTypeRef> messageBody = adoptWK(WKUInt64Create(index));
    22892289
    22902290    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    22932293void TestRunner::disconnectMockGamepad(unsigned index)
    22942294{
    2295     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DisconnectMockGamepad"));
    2296     WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(index));
     2295    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("DisconnectMockGamepad"));
     2296    WKRetainPtr<WKTypeRef> messageBody = adoptWK(WKUInt64Create(index));
    22972297
    22982298    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    23042304    Vector<WKRetainPtr<WKTypeRef>> values;
    23052305
    2306     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadID") });
     2306    keys.append(adoptWK(WKStringCreateWithUTF8CString("GamepadID")));
    23072307    values.append(toWK(gamepadID));
    23082308
    2309     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
    2310     values.append({ AdoptWK, WKUInt64Create(index) });
    2311 
    2312     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("AxisCount") });
    2313     values.append({ AdoptWK, WKUInt64Create(axisCount) });
    2314 
    2315     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ButtonCount") });
    2316     values.append({ AdoptWK, WKUInt64Create(buttonCount) });
     2309    keys.append(adoptWK(WKStringCreateWithUTF8CString("GamepadIndex")));
     2310    values.append(adoptWK(WKUInt64Create(index)));
     2311
     2312    keys.append(adoptWK(WKStringCreateWithUTF8CString("AxisCount")));
     2313    values.append(adoptWK(WKUInt64Create(axisCount)));
     2314
     2315    keys.append(adoptWK(WKStringCreateWithUTF8CString("ButtonCount")));
     2316    values.append(adoptWK(WKUInt64Create(buttonCount)));
    23172317
    23182318    Vector<WKStringRef> rawKeys;
     
    23262326    }
    23272327
    2328     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGamepadDetails"));
    2329     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     2328    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetMockGamepadDetails"));
     2329    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    23302330
    23312331    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    23372337    Vector<WKRetainPtr<WKTypeRef>> values;
    23382338
    2339     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
    2340     values.append({ AdoptWK, WKUInt64Create(index) });
    2341 
    2342     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("AxisIndex") });
    2343     values.append({ AdoptWK, WKUInt64Create(axisIndex) });
    2344 
    2345     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    2346     values.append({ AdoptWK, WKDoubleCreate(value) });
     2339    keys.append(adoptWK(WKStringCreateWithUTF8CString("GamepadIndex")));
     2340    values.append(adoptWK(WKUInt64Create(index)));
     2341
     2342    keys.append(adoptWK(WKStringCreateWithUTF8CString("AxisIndex")));
     2343    values.append(adoptWK(WKUInt64Create(axisIndex)));
     2344
     2345    keys.append(adoptWK(WKStringCreateWithUTF8CString("Value")));
     2346    values.append(adoptWK(WKDoubleCreate(value)));
    23472347
    23482348    Vector<WKStringRef> rawKeys;
     
    23562356    }
    23572357
    2358     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGamepadAxisValue"));
    2359     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     2358    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetMockGamepadAxisValue"));
     2359    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    23602360
    23612361    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    23672367    Vector<WKRetainPtr<WKTypeRef>> values;
    23682368
    2369     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
    2370     values.append({ AdoptWK, WKUInt64Create(index) });
    2371 
    2372     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ButtonIndex") });
    2373     values.append({ AdoptWK, WKUInt64Create(buttonIndex) });
    2374 
    2375     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    2376     values.append({ AdoptWK, WKDoubleCreate(value) });
     2369    keys.append(adoptWK(WKStringCreateWithUTF8CString("GamepadIndex")));
     2370    values.append(adoptWK(WKUInt64Create(index)));
     2371
     2372    keys.append(adoptWK(WKStringCreateWithUTF8CString("ButtonIndex")));
     2373    values.append(adoptWK(WKUInt64Create(buttonIndex)));
     2374
     2375    keys.append(adoptWK(WKStringCreateWithUTF8CString("Value")));
     2376    values.append(adoptWK(WKDoubleCreate(value)));
    23772377
    23782378    Vector<WKStringRef> rawKeys;
     
    23862386    }
    23872387
    2388     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGamepadButtonValue"));
    2389     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     2388    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetMockGamepadButtonValue"));
     2389    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    23902390
    23912391    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    24502450    cacheTestRunnerCallback(DidRemoveAllSessionCredentialsCallbackID, callback);
    24512451   
    2452     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("RemoveAllSessionCredentials"));
    2453     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(true));
     2452    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("RemoveAllSessionCredentials"));
     2453    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(true));
    24542454   
    24552455    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    24632463void TestRunner::clearDOMCache(JSStringRef origin)
    24642464{
    2465     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ClearDOMCache"));
    2466     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(origin));
     2465    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ClearDOMCache"));
     2466    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(origin));
    24672467    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    24682468}
     
    24702470void TestRunner::clearDOMCaches()
    24712471{
    2472     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ClearDOMCaches"));
     2472    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ClearDOMCaches"));
    24732473    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    24742474}
     
    24762476bool TestRunner::hasDOMCache(JSStringRef origin)
    24772477{
    2478     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("HasDOMCache"));
    2479     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(origin));
     2478    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("HasDOMCache"));
     2479    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(origin));
    24802480    WKTypeRef returnData = nullptr;
    24812481    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    24862486uint64_t TestRunner::domCacheSize(JSStringRef origin)
    24872487{
    2488     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DOMCacheSize"));
    2489     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(origin));
     2488    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("DOMCacheSize"));
     2489    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(origin));
    24902490    WKTypeRef returnData = nullptr;
    24912491    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
     
    24952495void TestRunner::setAllowStorageQuotaIncrease(bool willIncrease)
    24962496{
    2497     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAllowStorageQuotaIncrease"));
    2498     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(willIncrease));
     2497    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAllowStorageQuotaIncrease"));
     2498    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(willIncrease));
    24992499    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    25002500}
     
    25042504    cacheTestRunnerCallback(GetApplicationManifestCallbackID, callback);
    25052505   
    2506     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("GetApplicationManifest"));
     2506    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetApplicationManifest"));
    25072507    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    25082508}
     
    25252525void TestRunner::injectUserScript(JSStringRef script)
    25262526{
    2527     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("InjectUserScript"));
    2528     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(script));
     2527    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("InjectUserScript"));
     2528    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(script));
    25292529    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), nullptr);
    25302530}
     
    25322532void TestRunner::sendDisplayConfigurationChangedMessageForTesting()
    25332533{
    2534     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SendDisplayConfigurationChangedMessageForTesting"));
     2534    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SendDisplayConfigurationChangedMessageForTesting"));
    25352535    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
    25362536}
     
    25552555            return;
    25562556        bool silentFailure = JSValueToBoolean(context, silentFailureValue);
    2557         configurationKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("SilentFailure") });
     2557        configurationKeys.append(adoptWK(WKStringCreateWithUTF8CString("SilentFailure")));
    25582558        configurationValues.append(adoptWK(WKBooleanCreate(silentFailure)).get());
    25592559    }
     
    25802580        Vector<WKRetainPtr<WKStringRef>> localKeys;
    25812581        Vector<WKRetainPtr<WKTypeRef>> localValues;
    2582         localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("AcceptAuthentication") });
     2582        localKeys.append(adoptWK(WKStringCreateWithUTF8CString("AcceptAuthentication")));
    25832583        localValues.append(adoptWK(WKBooleanCreate(acceptAuthentication)).get());
    2584         localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("AcceptAttestation") });
     2584        localKeys.append(adoptWK(WKStringCreateWithUTF8CString("AcceptAttestation")));
    25852585        localValues.append(adoptWK(WKBooleanCreate(acceptAttestation)).get());
    25862586
     
    26012601            return;
    26022602
    2603             localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("PrivateKeyBase64") });
     2603            localKeys.append(adoptWK(WKStringCreateWithUTF8CString("PrivateKeyBase64")));
    26042604            localValues.append(toWK(adopt(JSValueToStringCopy(context, privateKeyBase64Value, 0)).get()));
    2605             localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("UserCertificateBase64") });
     2605            localKeys.append(adoptWK(WKStringCreateWithUTF8CString("UserCertificateBase64")));
    26062606            localValues.append(toWK(adopt(JSValueToStringCopy(context, userCertificateBase64Value, 0)).get()));
    2607             localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("IntermediateCACertificateBase64") });
     2607            localKeys.append(adoptWK(WKStringCreateWithUTF8CString("IntermediateCACertificateBase64")));
    26082608            localValues.append(toWK(adopt(JSValueToStringCopy(context, intermediateCACertificateBase64Value, 0)).get()));
    26092609        }
     
    26182618        }
    26192619
    2620         configurationKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("Local") });
    2621         configurationValues.append({ AdoptWK, WKDictionaryCreate(rawLocalKeys.data(), rawLocalValues.data(), rawLocalKeys.size()) });
     2620        configurationKeys.append(adoptWK(WKStringCreateWithUTF8CString("Local")));
     2621        configurationValues.append(adoptWK(WKDictionaryCreate(rawLocalKeys.data(), rawLocalValues.data(), rawLocalKeys.size())));
    26222622    }
    26232623
     
    26462646        Vector<WKRetainPtr<WKStringRef>> hidKeys;
    26472647        Vector<WKRetainPtr<WKTypeRef>> hidValues;
    2648         hidKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("Stage") });
     2648        hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("Stage")));
    26492649        hidValues.append(toWK(adopt(JSValueToStringCopy(context, stageValue, 0)).get()));
    2650         hidKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("SubStage") });
     2650        hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("SubStage")));
    26512651        hidValues.append(toWK(adopt(JSValueToStringCopy(context, subStageValue, 0)).get()));
    2652         hidKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("Error") });
     2652        hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("Error")));
    26532653        hidValues.append(toWK(adopt(JSValueToStringCopy(context, errorValue, 0)).get()));
    26542654
     
    26742674            }
    26752675
    2676             hidKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("PayloadBase64") });
     2676            hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("PayloadBase64")));
    26772677            hidValues.append(payloadBase64s);
    26782678        }
     
    26842684                return;
    26852685            bool isU2f = JSValueToBoolean(context, isU2fValue);
    2686             hidKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("IsU2f") });
     2686            hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("IsU2f")));
    26872687            hidValues.append(adoptWK(WKBooleanCreate(isU2f)).get());
    26882688        }
     
    26942694                return;
    26952695            bool keepAlive = JSValueToBoolean(context, keepAliveValue);
    2696             hidKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("KeepAlive") });
     2696            hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("KeepAlive")));
    26972697            hidValues.append(adoptWK(WKBooleanCreate(keepAlive)).get());
    26982698        }
     
    27042704                return;
    27052705            bool fastDataArrival = JSValueToBoolean(context, fastDataArrivalValue);
    2706             hidKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("FastDataArrival") });
     2706            hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("FastDataArrival")));
    27072707            hidValues.append(adoptWK(WKBooleanCreate(fastDataArrival)).get());
    27082708        }
     
    27142714                return;
    27152715            bool continueAfterErrorData = JSValueToBoolean(context, continueAfterErrorDataValue);
    2716             hidKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("ContinueAfterErrorData") });
     2716            hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("ContinueAfterErrorData")));
    27172717            hidValues.append(adoptWK(WKBooleanCreate(continueAfterErrorData)).get());
    27182718        }
     
    27272727        }
    27282728
    2729         configurationKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("Hid") });
    2730         configurationValues.append({ AdoptWK, WKDictionaryCreate(rawHidKeys.data(), rawHidValues.data(), rawHidKeys.size()) });
     2729        configurationKeys.append(adoptWK(WKStringCreateWithUTF8CString("Hid")));
     2730        configurationValues.append(adoptWK(WKDictionaryCreate(rawHidKeys.data(), rawHidValues.data(), rawHidKeys.size())));
    27312731    }
    27322732
     
    27402740    }
    27412741
    2742     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetWebAuthenticationMockConfiguration"));
    2743     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawConfigurationKeys.data(), rawConfigurationValues.data(), rawConfigurationKeys.size()));
     2742    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetWebAuthenticationMockConfiguration"));
     2743    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawConfigurationKeys.data(), rawConfigurationValues.data(), rawConfigurationKeys.size()));
    27442744   
    27452745    WKBundlePostSynchronousMessage(injectedBundle.bundle(), messageName.get(), messageBody.get(), nullptr);
     
    27512751    Vector<WKRetainPtr<WKTypeRef>> values;
    27522752
    2753     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("PrivateKey") });
     2753    keys.append(adoptWK(WKStringCreateWithUTF8CString("PrivateKey")));
    27542754    values.append(toWK(privateKeyBase64));
    27552755
    2756     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("AttrLabel") });
     2756    keys.append(adoptWK(WKStringCreateWithUTF8CString("AttrLabel")));
    27572757    values.append(toWK(attrLabel));
    27582758
    2759     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ApplicationTag") });
     2759    keys.append(adoptWK(WKStringCreateWithUTF8CString("ApplicationTag")));
    27602760    values.append(toWK(applicationTagBase64));
    27612761
     
    27702770    }
    27712771
    2772     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("AddTestKeyToKeychain"));
    2773     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     2772    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("AddTestKeyToKeychain"));
     2773    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    27742774
    27752775    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    27782778void TestRunner::cleanUpKeychain(JSStringRef attrLabel)
    27792779{
    2780     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("CleanUpKeychain"));
    2781     WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(attrLabel));
     2780    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CleanUpKeychain"));
     2781    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithJSString(attrLabel));
    27822782
    27832783    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     
    27892789    Vector<WKRetainPtr<WKTypeRef>> values;
    27902790
    2791     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("AttrLabel") });
     2791    keys.append(adoptWK(WKStringCreateWithUTF8CString("AttrLabel")));
    27922792    values.append(toWK(attrLabel));
    27932793
    2794     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ApplicationTag") });
     2794    keys.append(adoptWK(WKStringCreateWithUTF8CString("ApplicationTag")));
    27952795    values.append(toWK(applicationTagBase64));
    27962796
     
    28052805    }
    28062806
    2807     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("KeyExistsInKeychain"));
    2808     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     2807    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("KeyExistsInKeychain"));
     2808    WKRetainPtr<WKDictionaryRef> messageBody = adoptWK(WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    28092809
    28102810    WKTypeRef returnData = nullptr;
     
    28162816void TestRunner::setCanHandleHTTPSServerTrustEvaluation(bool canHandle)
    28172817{
    2818     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetCanHandleHTTPSServerTrustEvaluation"));
    2819     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(canHandle));
     2818    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetCanHandleHTTPSServerTrustEvaluation"));
     2819    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(canHandle));
    28202820    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    28212821}
     
    28232823bool TestRunner::canDoServerTrustEvaluationInNetworkProcess()
    28242824{
    2825     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("CanDoServerTrustEvaluationInNetworkProcess"));
     2825    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CanDoServerTrustEvaluationInNetworkProcess"));
    28262826    WKTypeRef returnData = nullptr;
    28272827    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData);
     
    28322832unsigned long TestRunner::serverTrustEvaluationCallbackCallsCount()
    28332833{
    2834     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ServerTrustEvaluationCallbackCallsCount"));
     2834    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ServerTrustEvaluationCallbackCallsCount"));
    28352835    WKTypeRef returnData = nullptr;
    28362836    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData);
     
    28412841void TestRunner::setShouldDismissJavaScriptAlertsAsynchronously(bool shouldDismissAsynchronously)
    28422842{
    2843     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ShouldDismissJavaScriptAlertsAsynchronously"));
    2844     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(shouldDismissAsynchronously));
     2843    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ShouldDismissJavaScriptAlertsAsynchronously"));
     2844    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(shouldDismissAsynchronously));
    28452845    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    28462846}
     
    28602860void TestRunner::setAdClickAttributionOverrideTimerForTesting(bool value)
    28612861{
    2862     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAdClickAttributionOverrideTimerForTesting"));
    2863     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     2862    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAdClickAttributionOverrideTimerForTesting"));
     2863    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
    28642864    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), nullptr);
    28652865}
     
    28672867void TestRunner::setAdClickAttributionConversionURLForTesting(JSStringRef urlString)
    28682868{
    2869     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAdClickAttributionConversionURLForTesting"));
     2869    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAdClickAttributionConversionURLForTesting"));
    28702870    auto wtfURLString = toWTFString(WKStringCreateWithJSString(urlString));
    2871     WKRetainPtr<WKURLRef> messageBody(AdoptWK, WKURLCreateWithUTF8CString(wtfURLString.utf8().data()));
     2871    WKRetainPtr<WKURLRef> messageBody = adoptWK(WKURLCreateWithUTF8CString(wtfURLString.utf8().data()));
    28722872    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), nullptr);
    28732873}
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r244382 r244390  
    463463#endif
    464464
    465     WKRetainPtr<WKStringRef> pageGroupIdentifier(AdoptWK, WKStringCreateWithUTF8CString("WebKitTestRunnerPageGroup"));
     465    WKRetainPtr<WKStringRef> pageGroupIdentifier = adoptWK(WKStringCreateWithUTF8CString("WebKitTestRunnerPageGroup"));
    466466    m_pageGroup.adopt(WKPageGroupCreateWithIdentifier(pageGroupIdentifier.get()));
    467467
     
    12401240static std::string parseStringTestHeaderValueAsRelativePath(const std::string& value, const std::string& pathOrURL)
    12411241{
    1242     WKRetainPtr<WKURLRef> baseURL(AdoptWK, createTestURL(pathOrURL.c_str()));
    1243     WKRetainPtr<WKURLRef> relativeURL(AdoptWK, WKURLCreateWithBaseURL(baseURL.get(), value.c_str()));
     1242    WKRetainPtr<WKURLRef> baseURL = adoptWK(createTestURL(pathOrURL.c_str()));
     1243    WKRetainPtr<WKURLRef> relativeURL = adoptWK(WKURLCreateWithBaseURL(baseURL.get(), value.c_str()));
    12441244    return toSTD(adoptWK(WKURLCopyPath(relativeURL.get())));
    12451245}
     
    12501250    if (filename.empty()) {
    12511251        // Gross. Need to reduce conversions between all the string types and URLs.
    1252         WKRetainPtr<WKURLRef> wkURL(AdoptWK, createTestURL(pathOrURL.c_str()));
     1252        WKRetainPtr<WKURLRef> wkURL = adoptWK(createTestURL(pathOrURL.c_str()));
    12531253        filename = testPath(wkURL.get());
    12541254    }
     
    16161616    TestOptions options = testOptionsForTest(command);
    16171617
    1618     WKRetainPtr<WKURLRef> wkURL(AdoptWK, createTestURL(command.pathOrURL.c_str()));
     1618    WKRetainPtr<WKURLRef> wkURL = adoptWK(createTestURL(command.pathOrURL.c_str()));
    16191619    m_currentInvocation = std::make_unique<TestInvocation>(wkURL.get(), options);
    16201620
     
    17601760            WKDictionaryRef liveDocumentItem = static_cast<WKDictionaryRef>(item);
    17611761
    1762             WKRetainPtr<WKStringRef> idKey(AdoptWK, WKStringCreateWithUTF8CString("id"));
     1762            WKRetainPtr<WKStringRef> idKey = adoptWK(WKStringCreateWithUTF8CString("id"));
    17631763            WKUInt64Ref documentID = static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(liveDocumentItem, idKey.get()));
    17641764
    1765             WKRetainPtr<WKStringRef> urlKey(AdoptWK, WKStringCreateWithUTF8CString("url"));
     1765            WKRetainPtr<WKStringRef> urlKey = adoptWK(WKStringCreateWithUTF8CString("url"));
    17661766            WKStringRef documentURL = static_cast<WKStringRef>(WKDictionaryGetItemForKey(liveDocumentItem, urlKey.get()));
    17671767
     
    18021802        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    18031803
    1804         WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
     1804        WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
    18051805        WKStringRef subMessageName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subMessageKey.get()));
    18061806
     
    18741874        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    18751875
    1876         WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
     1876        WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage"));
    18771877        WKStringRef subMessageName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subMessageKey.get()));
    18781878
     
    22572257        return;
    22582258
    2259     WKRetainPtr<WKURLRef> wkURL(AdoptWK, WKFrameCopyURL(WKPageGetMainFrame(page)));
     2259    WKRetainPtr<WKURLRef> wkURL = adoptWK(WKFrameCopyURL(WKPageGetMainFrame(page)));
    22602260    if (!WKURLIsEqual(wkURL.get(), blankURL()))
    22612261        return;
     
    23012301        return;
    23022302    }
    2303     WKRetainPtr<WKStringRef> username(AdoptWK, WKStringCreateWithUTF8CString(m_authenticationUsername.utf8().data()));
    2304     WKRetainPtr<WKStringRef> password(AdoptWK, WKStringCreateWithUTF8CString(m_authenticationPassword.utf8().data()));
    2305     WKRetainPtr<WKCredentialRef> credential(AdoptWK, WKCredentialCreate(username.get(), password.get(), kWKCredentialPersistenceForSession));
     2303    WKRetainPtr<WKStringRef> username = adoptWK(WKStringCreateWithUTF8CString(m_authenticationUsername.utf8().data()));
     2304    WKRetainPtr<WKStringRef> password = adoptWK(WKStringCreateWithUTF8CString(m_authenticationPassword.utf8().data()));
     2305    WKRetainPtr<WKCredentialRef> credential = adoptWK(WKCredentialCreate(username.get(), password.get(), kWKCredentialPersistenceForSession));
    23062306    WKAuthenticationDecisionListenerUseCredential(decisionListener, credential.get());
    23072307}
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r244370 r244390  
    440440        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    441441
    442         WKRetainPtr<WKStringRef> latitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("latitude"));
     442        WKRetainPtr<WKStringRef> latitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("latitude"));
    443443        WKDoubleRef latitudeWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, latitudeKeyWK.get()));
    444444        double latitude = WKDoubleGetValue(latitudeWK);
    445445
    446         WKRetainPtr<WKStringRef> longitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("longitude"));
     446        WKRetainPtr<WKStringRef> longitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("longitude"));
    447447        WKDoubleRef longitudeWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, longitudeKeyWK.get()));
    448448        double longitude = WKDoubleGetValue(longitudeWK);
    449449
    450         WKRetainPtr<WKStringRef> accuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("accuracy"));
     450        WKRetainPtr<WKStringRef> accuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("accuracy"));
    451451        WKDoubleRef accuracyWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, accuracyKeyWK.get()));
    452452        double accuracy = WKDoubleGetValue(accuracyWK);
    453453
    454         WKRetainPtr<WKStringRef> providesAltitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesAltitude"));
     454        WKRetainPtr<WKStringRef> providesAltitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesAltitude"));
    455455        WKBooleanRef providesAltitudeWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesAltitudeKeyWK.get()));
    456456        bool providesAltitude = WKBooleanGetValue(providesAltitudeWK);
    457457
    458         WKRetainPtr<WKStringRef> altitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("altitude"));
     458        WKRetainPtr<WKStringRef> altitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("altitude"));
    459459        WKDoubleRef altitudeWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, altitudeKeyWK.get()));
    460460        double altitude = WKDoubleGetValue(altitudeWK);
    461461
    462         WKRetainPtr<WKStringRef> providesAltitudeAccuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesAltitudeAccuracy"));
     462        WKRetainPtr<WKStringRef> providesAltitudeAccuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesAltitudeAccuracy"));
    463463        WKBooleanRef providesAltitudeAccuracyWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesAltitudeAccuracyKeyWK.get()));
    464464        bool providesAltitudeAccuracy = WKBooleanGetValue(providesAltitudeAccuracyWK);
    465465
    466         WKRetainPtr<WKStringRef> altitudeAccuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("altitudeAccuracy"));
     466        WKRetainPtr<WKStringRef> altitudeAccuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("altitudeAccuracy"));
    467467        WKDoubleRef altitudeAccuracyWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, altitudeAccuracyKeyWK.get()));
    468468        double altitudeAccuracy = WKDoubleGetValue(altitudeAccuracyWK);
    469469
    470         WKRetainPtr<WKStringRef> providesHeadingKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesHeading"));
     470        WKRetainPtr<WKStringRef> providesHeadingKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesHeading"));
    471471        WKBooleanRef providesHeadingWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesHeadingKeyWK.get()));
    472472        bool providesHeading = WKBooleanGetValue(providesHeadingWK);
    473473
    474         WKRetainPtr<WKStringRef> headingKeyWK(AdoptWK, WKStringCreateWithUTF8CString("heading"));
     474        WKRetainPtr<WKStringRef> headingKeyWK = adoptWK(WKStringCreateWithUTF8CString("heading"));
    475475        WKDoubleRef headingWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, headingKeyWK.get()));
    476476        double heading = WKDoubleGetValue(headingWK);
    477477
    478         WKRetainPtr<WKStringRef> providesSpeedKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesSpeed"));
     478        WKRetainPtr<WKStringRef> providesSpeedKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesSpeed"));
    479479        WKBooleanRef providesSpeedWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesSpeedKeyWK.get()));
    480480        bool providesSpeed = WKBooleanGetValue(providesSpeedWK);
    481481
    482         WKRetainPtr<WKStringRef> speedKeyWK(AdoptWK, WKStringCreateWithUTF8CString("speed"));
     482        WKRetainPtr<WKStringRef> speedKeyWK = adoptWK(WKStringCreateWithUTF8CString("speed"));
    483483        WKDoubleRef speedWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, speedKeyWK.get()));
    484484        double speed = WKDoubleGetValue(speedWK);
    485485
    486         WKRetainPtr<WKStringRef> providesFloorLevelKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesFloorLevel"));
     486        WKRetainPtr<WKStringRef> providesFloorLevelKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesFloorLevel"));
    487487        WKBooleanRef providesFloorLevelWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesFloorLevelKeyWK.get()));
    488488        bool providesFloorLevel = WKBooleanGetValue(providesFloorLevelWK);
    489489
    490         WKRetainPtr<WKStringRef> floorLevelKeyWK(AdoptWK, WKStringCreateWithUTF8CString("floorLevel"));
     490        WKRetainPtr<WKStringRef> floorLevelKeyWK = adoptWK(WKStringCreateWithUTF8CString("floorLevel"));
    491491        WKDoubleRef floorLevelWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, floorLevelKeyWK.get()));
    492492        double floorLevel = WKDoubleGetValue(floorLevelWK);
     
    519519        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    520520
    521         WKRetainPtr<WKStringRef> permissionKeyWK(AdoptWK, WKStringCreateWithUTF8CString("permission"));
     521        WKRetainPtr<WKStringRef> permissionKeyWK = adoptWK(WKStringCreateWithUTF8CString("permission"));
    522522        WKBooleanRef permissionWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, permissionKeyWK.get()));
    523523        bool permission = WKBooleanGetValue(permissionWK);
    524524
    525         WKRetainPtr<WKStringRef> originKey(AdoptWK, WKStringCreateWithUTF8CString("origin"));
     525        WKRetainPtr<WKStringRef> originKey = adoptWK(WKStringCreateWithUTF8CString("origin"));
    526526        WKStringRef originWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, originKey.get()));
    527527
    528         WKRetainPtr<WKStringRef> parentOriginKey(AdoptWK, WKStringCreateWithUTF8CString("parentOrigin"));
     528        WKRetainPtr<WKStringRef> parentOriginKey = adoptWK(WKStringCreateWithUTF8CString("parentOrigin"));
    529529        WKStringRef parentOriginWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, parentOriginKey.get()));
    530530
     
    537537        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    538538
    539         WKRetainPtr<WKStringRef> originKey(AdoptWK, WKStringCreateWithUTF8CString("origin"));
     539        WKRetainPtr<WKStringRef> originKey = adoptWK(WKStringCreateWithUTF8CString("origin"));
    540540        WKStringRef originWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, originKey.get()));
    541541
    542         WKRetainPtr<WKStringRef> parentOriginKey(AdoptWK, WKStringCreateWithUTF8CString("parentOrigin"));
     542        WKRetainPtr<WKStringRef> parentOriginKey = adoptWK(WKStringCreateWithUTF8CString("parentOrigin"));
    543543        WKStringRef parentOriginWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, parentOriginKey.get()));
    544544       
     
    558558        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    559559
    560         WKRetainPtr<WKStringRef> enabledKeyWK(AdoptWK, WKStringCreateWithUTF8CString("enabled"));
     560        WKRetainPtr<WKStringRef> enabledKeyWK = adoptWK(WKStringCreateWithUTF8CString("enabled"));
    561561        WKBooleanRef enabledWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, enabledKeyWK.get()));
    562562        bool enabled = WKBooleanGetValue(enabledWK);
    563563
    564         WKRetainPtr<WKStringRef> permissiveKeyWK(AdoptWK, WKStringCreateWithUTF8CString("permissive"));
     564        WKRetainPtr<WKStringRef> permissiveKeyWK = adoptWK(WKStringCreateWithUTF8CString("permissive"));
    565565        WKBooleanRef permissiveWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, permissiveKeyWK.get()));
    566566        bool permissive = WKBooleanGetValue(permissiveWK);
     
    574574        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    575575
    576         WKRetainPtr<WKStringRef> isInitialKeyWK(AdoptWK, WKStringCreateWithUTF8CString("hidden"));
     576        WKRetainPtr<WKStringRef> isInitialKeyWK = adoptWK(WKStringCreateWithUTF8CString("hidden"));
    577577        WKBooleanRef hiddenWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, isInitialKeyWK.get()));
    578578        bool hidden = WKBooleanGetValue(hiddenWK);
     
    608608        WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody);
    609609
    610         WKRetainPtr<WKStringRef> urlKey(AdoptWK, WKStringCreateWithUTF8CString("url"));
     610        WKRetainPtr<WKStringRef> urlKey = adoptWK(WKStringCreateWithUTF8CString("url"));
    611611        WKStringRef urlWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, urlKey.get()));
    612612
    613         WKRetainPtr<WKStringRef> targetKey(AdoptWK, WKStringCreateWithUTF8CString("target"));
     613        WKRetainPtr<WKStringRef> targetKey = adoptWK(WKStringCreateWithUTF8CString("target"));
    614614        WKStringRef targetWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, targetKey.get()));
    615615
    616         WKRetainPtr<WKStringRef> shouldOpenExternalURLsKey(AdoptWK, WKStringCreateWithUTF8CString("shouldOpenExternalURLs"));
     616        WKRetainPtr<WKStringRef> shouldOpenExternalURLsKey = adoptWK(WKStringCreateWithUTF8CString("shouldOpenExternalURLs"));
    617617        WKBooleanRef shouldOpenExternalURLsValueWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(loadDataDictionary, shouldOpenExternalURLsKey.get()));
    618618
     
    625625        WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody);
    626626
    627         WKRetainPtr<WKStringRef> contentKey(AdoptWK, WKStringCreateWithUTF8CString("content"));
     627        WKRetainPtr<WKStringRef> contentKey = adoptWK(WKStringCreateWithUTF8CString("content"));
    628628        WKStringRef contentWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, contentKey.get()));
    629629
    630         WKRetainPtr<WKStringRef> baseURLKey(AdoptWK, WKStringCreateWithUTF8CString("baseURL"));
     630        WKRetainPtr<WKStringRef> baseURLKey = adoptWK(WKStringCreateWithUTF8CString("baseURL"));
    631631        WKStringRef baseURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, baseURLKey.get()));
    632632
    633         WKRetainPtr<WKStringRef> unreachableURLKey(AdoptWK, WKStringCreateWithUTF8CString("unreachableURL"));
     633        WKRetainPtr<WKStringRef> unreachableURLKey = adoptWK(WKStringCreateWithUTF8CString("unreachableURL"));
    634634        WKStringRef unreachableURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, unreachableURLKey.get()));
    635635
     
    757757    if (WKStringIsEqualToUTF8CString(messageName, "RunUIProcessScript")) {
    758758        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    759         WKRetainPtr<WKStringRef> scriptKey(AdoptWK, WKStringCreateWithUTF8CString("Script"));
    760         WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID"));
     759        WKRetainPtr<WKStringRef> scriptKey = adoptWK(WKStringCreateWithUTF8CString("Script"));
     760        WKRetainPtr<WKStringRef> callbackIDKey = adoptWK(WKStringCreateWithUTF8CString("CallbackID"));
    761761
    762762        UIScriptInvocationData* invocationData = new UIScriptInvocationData();
     
    771771    if (WKStringIsEqualToUTF8CString(messageName, "InstallCustomMenuAction")) {
    772772        auto messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    773         WKRetainPtr<WKStringRef> nameKey(AdoptWK, WKStringCreateWithUTF8CString("name"));
     773        WKRetainPtr<WKStringRef> nameKey = adoptWK(WKStringCreateWithUTF8CString("name"));
    774774        WKRetainPtr<WKStringRef> name = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, nameKey.get()));
    775         WKRetainPtr<WKStringRef> dismissesAutomaticallyKey(AdoptWK, WKStringCreateWithUTF8CString("dismissesAutomatically"));
     775        WKRetainPtr<WKStringRef> dismissesAutomaticallyKey = adoptWK(WKStringCreateWithUTF8CString("dismissesAutomatically"));
    776776        auto dismissesAutomatically = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dismissesAutomaticallyKey.get()));
    777777        TestController::singleton().installCustomMenuAction(toWTFString(name.get()), WKBooleanGetValue(dismissesAutomatically));
     
    814814    }
    815815    if (WKStringIsEqualToUTF8CString(messageName, "GetDumpPixels"))
    816         return WKRetainPtr<WKTypeRef>(AdoptWK, WKBooleanCreate(m_dumpPixels));
     816        return adoptWK(WKBooleanCreate(m_dumpPixels));
    817817
    818818    if (WKStringIsEqualToUTF8CString(messageName, "SetWhatToDump")) {
     
    822822    }
    823823    if (WKStringIsEqualToUTF8CString(messageName, "GetWhatToDump"))
    824         return WKRetainPtr<WKTypeRef>(AdoptWK, WKUInt64Create(static_cast<uint64_t>(m_whatToDump)));
     824        return adoptWK(WKUInt64Create(static_cast<uint64_t>(m_whatToDump)));
    825825
    826826    if (WKStringIsEqualToUTF8CString(messageName, "SetWaitUntilDone")) {
     
    830830    }
    831831    if (WKStringIsEqualToUTF8CString(messageName, "GetWaitUntilDone"))
    832         return WKRetainPtr<WKTypeRef>(AdoptWK, WKBooleanCreate(m_waitUntilDone));
     832        return adoptWK(WKBooleanCreate(m_waitUntilDone));
    833833
    834834    if (WKStringIsEqualToUTF8CString(messageName, "SetDumpFrameLoadCallbacks")) {
     
    838838    }
    839839    if (WKStringIsEqualToUTF8CString(messageName, "GetDumpFrameLoadCallbacks"))
    840         return WKRetainPtr<WKTypeRef>(AdoptWK, WKBooleanCreate(m_dumpFrameLoadCallbacks));
     840        return adoptWK(WKBooleanCreate(m_dumpFrameLoadCallbacks));
    841841
    842842    if (WKStringIsEqualToUTF8CString(messageName, "SetCanOpenWindows")) {
     
    857857
    858858        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    859         WKRetainPtr<WKStringRef> widthKey(AdoptWK, WKStringCreateWithUTF8CString("width"));
    860         WKRetainPtr<WKStringRef> heightKey(AdoptWK, WKStringCreateWithUTF8CString("height"));
     859        WKRetainPtr<WKStringRef> widthKey = adoptWK(WKStringCreateWithUTF8CString("width"));
     860        WKRetainPtr<WKStringRef> heightKey = adoptWK(WKStringCreateWithUTF8CString("height"));
    861861
    862862        WKDoubleRef widthWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, widthKey.get()));
     
    869869    if (WKStringIsEqualToUTF8CString(messageName, "IsGeolocationClientActive")) {
    870870        bool isActive = TestController::singleton().isGeolocationProviderActive();
    871         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isActive));
     871        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isActive));
    872872        return result;
    873873    }
     
    875875    if (WKStringIsEqualToUTF8CString(messageName, "IsWorkQueueEmpty")) {
    876876        bool isEmpty = TestController::singleton().workQueueManager().isWorkQueueEmpty();
    877         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isEmpty));
     877        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isEmpty));
    878878        return result;
    879879    }
    880880
    881881    if (WKStringIsEqualToUTF8CString(messageName, "DidReceiveServerRedirectForProvisionalNavigation")) {
    882         WKRetainPtr<WKBooleanRef> result(AdoptWK, WKBooleanCreate(TestController::singleton().didReceiveServerRedirectForProvisionalNavigation()));
     882        WKRetainPtr<WKBooleanRef> result = adoptWK(WKBooleanCreate(TestController::singleton().didReceiveServerRedirectForProvisionalNavigation()));
    883883        return result;
    884884    }
     
    891891    if (WKStringIsEqualToUTF8CString(messageName, "SecureEventInputIsEnabled")) {
    892892#if PLATFORM(MAC) && !PLATFORM(IOS_FAMILY)
    893         WKRetainPtr<WKBooleanRef> result(AdoptWK, WKBooleanCreate(IsSecureEventInputEnabled()));
     893        WKRetainPtr<WKBooleanRef> result = adoptWK(WKBooleanCreate(IsSecureEventInputEnabled()));
    894894#else
    895         WKRetainPtr<WKBooleanRef> result(AdoptWK, WKBooleanCreate(false));
     895        WKRetainPtr<WKBooleanRef> result = adoptWK(WKBooleanCreate(false));
    896896#endif
    897897        return result;
     
    938938    if (WKStringIsEqualToUTF8CString(messageName, "ImageCountInGeneralPasteboard")) {
    939939        unsigned count = TestController::singleton().imageCountInGeneralPasteboard();
    940         WKRetainPtr<WKUInt64Ref> result(AdoptWK, WKUInt64Create(count));
     940        WKRetainPtr<WKUInt64Ref> result = adoptWK(WKUInt64Create(count));
    941941        return result;
    942942    }
     
    951951
    952952        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    953         WKRetainPtr<WKStringRef> persistentIDKey(AdoptWK, WKStringCreateWithUTF8CString("PersistentID"));
    954         WKRetainPtr<WKStringRef> labelKey(AdoptWK, WKStringCreateWithUTF8CString("Label"));
    955         WKRetainPtr<WKStringRef> typeKey(AdoptWK, WKStringCreateWithUTF8CString("Type"));
     953        WKRetainPtr<WKStringRef> persistentIDKey = adoptWK(WKStringCreateWithUTF8CString("PersistentID"));
     954        WKRetainPtr<WKStringRef> labelKey = adoptWK(WKStringCreateWithUTF8CString("Label"));
     955        WKRetainPtr<WKStringRef> typeKey = adoptWK(WKStringCreateWithUTF8CString("Type"));
    956956
    957957        auto persistentID = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, persistentIDKey.get()));
     
    10031003
    10041004        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1005         WKRetainPtr<WKStringRef> gamepadIndexKey(AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex"));
    1006         WKRetainPtr<WKStringRef> gamepadIDKey(AdoptWK, WKStringCreateWithUTF8CString("GamepadID"));
    1007         WKRetainPtr<WKStringRef> axisCountKey(AdoptWK, WKStringCreateWithUTF8CString("AxisCount"));
    1008         WKRetainPtr<WKStringRef> buttonCountKey(AdoptWK, WKStringCreateWithUTF8CString("ButtonCount"));
     1005        WKRetainPtr<WKStringRef> gamepadIndexKey = adoptWK(WKStringCreateWithUTF8CString("GamepadIndex"));
     1006        WKRetainPtr<WKStringRef> gamepadIDKey = adoptWK(WKStringCreateWithUTF8CString("GamepadID"));
     1007        WKRetainPtr<WKStringRef> axisCountKey = adoptWK(WKStringCreateWithUTF8CString("AxisCount"));
     1008        WKRetainPtr<WKStringRef> buttonCountKey = adoptWK(WKStringCreateWithUTF8CString("ButtonCount"));
    10091009
    10101010        WKUInt64Ref gamepadIndex = static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, gamepadIndexKey.get()));
     
    10211021
    10221022        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1023         WKRetainPtr<WKStringRef> gamepadIndexKey(AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex"));
    1024         WKRetainPtr<WKStringRef> axisIndexKey(AdoptWK, WKStringCreateWithUTF8CString("AxisIndex"));
    1025         WKRetainPtr<WKStringRef> valueKey(AdoptWK, WKStringCreateWithUTF8CString("Value"));
     1023        WKRetainPtr<WKStringRef> gamepadIndexKey = adoptWK(WKStringCreateWithUTF8CString("GamepadIndex"));
     1024        WKRetainPtr<WKStringRef> axisIndexKey = adoptWK(WKStringCreateWithUTF8CString("AxisIndex"));
     1025        WKRetainPtr<WKStringRef> valueKey = adoptWK(WKStringCreateWithUTF8CString("Value"));
    10261026
    10271027        WKUInt64Ref gamepadIndex = static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, gamepadIndexKey.get()));
     
    10381038
    10391039        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1040         WKRetainPtr<WKStringRef> gamepadIndexKey(AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex"));
    1041         WKRetainPtr<WKStringRef> buttonIndexKey(AdoptWK, WKStringCreateWithUTF8CString("ButtonIndex"));
    1042         WKRetainPtr<WKStringRef> valueKey(AdoptWK, WKStringCreateWithUTF8CString("Value"));
     1040        WKRetainPtr<WKStringRef> gamepadIndexKey = adoptWK(WKStringCreateWithUTF8CString("GamepadIndex"));
     1041        WKRetainPtr<WKStringRef> buttonIndexKey = adoptWK(WKStringCreateWithUTF8CString("ButtonIndex"));
     1042        WKRetainPtr<WKStringRef> valueKey = adoptWK(WKStringCreateWithUTF8CString("Value"));
    10431043
    10441044        WKUInt64Ref gamepadIndex = static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, gamepadIndexKey.get()));
     
    10561056        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    10571057
    1058         WKRetainPtr<WKStringRef> originKey(AdoptWK, WKStringCreateWithUTF8CString("origin"));
     1058        WKRetainPtr<WKStringRef> originKey = adoptWK(WKStringCreateWithUTF8CString("origin"));
    10591059        WKStringRef originWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, originKey.get()));
    10601060
    1061         WKRetainPtr<WKStringRef> parentOriginKey(AdoptWK, WKStringCreateWithUTF8CString("parentOrigin"));
     1061        WKRetainPtr<WKStringRef> parentOriginKey = adoptWK(WKStringCreateWithUTF8CString("parentOrigin"));
    10621062        WKStringRef parentOriginWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, parentOriginKey.get()));
    10631063       
    10641064        unsigned count = TestController::singleton().userMediaPermissionRequestCountForOrigin(originWK, parentOriginWK);
    1065         WKRetainPtr<WKUInt64Ref> result(AdoptWK, WKUInt64Create(count));
     1065        WKRetainPtr<WKUInt64Ref> result = adoptWK(WKUInt64Create(count));
    10661066        return result;
    10671067    }
    10681068    if (WKStringIsEqualToUTF8CString(messageName, "IsDoingMediaCapture")) {
    1069         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(TestController::singleton().isDoingMediaCapture()));
     1069        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(TestController::singleton().isDoingMediaCapture()));
    10701070        return result;
    10711071    }
     
    10891089       
    10901090        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1091         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1092         WKRetainPtr<WKStringRef> valueKey(AdoptWK, WKStringCreateWithUTF8CString("Value"));
     1091        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1092        WKRetainPtr<WKStringRef> valueKey = adoptWK(WKStringCreateWithUTF8CString("Value"));
    10931093       
    10941094        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    11041104
    11051105        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1106         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1107         WKRetainPtr<WKStringRef> valueKey(AdoptWK, WKStringCreateWithUTF8CString("Value"));
     1106        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1107        WKRetainPtr<WKStringRef> valueKey = adoptWK(WKStringCreateWithUTF8CString("Value"));
    11081108
    11091109        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    11181118       
    11191119        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1120         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1121         WKRetainPtr<WKStringRef> valueKey(AdoptWK, WKStringCreateWithUTF8CString("Value"));
     1120        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1121        WKRetainPtr<WKStringRef> valueKey = adoptWK(WKStringCreateWithUTF8CString("Value"));
    11221122       
    11231123        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    11381138        WKStringRef hostName = static_cast<WKStringRef>(messageBody);
    11391139        bool isPrevalent = TestController::singleton().isStatisticsPrevalentResource(hostName);
    1140         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isPrevalent));
     1140        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isPrevalent));
    11411141        return result;
    11421142    }
     
    11471147        WKStringRef hostName = static_cast<WKStringRef>(messageBody);
    11481148        bool isPrevalent = TestController::singleton().isStatisticsVeryPrevalentResource(hostName);
    1149         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isPrevalent));
     1149        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isPrevalent));
    11501150        return result;
    11511151    }
     
    11551155       
    11561156        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1157         WKRetainPtr<WKStringRef> subresourceHostKey(AdoptWK, WKStringCreateWithUTF8CString("SubresourceHost"));
    1158         WKRetainPtr<WKStringRef> topFrameHostKey(AdoptWK, WKStringCreateWithUTF8CString("TopFrameHost"));
     1157        WKRetainPtr<WKStringRef> subresourceHostKey = adoptWK(WKStringCreateWithUTF8CString("SubresourceHost"));
     1158        WKRetainPtr<WKStringRef> topFrameHostKey = adoptWK(WKStringCreateWithUTF8CString("TopFrameHost"));
    11591159       
    11601160        WKStringRef subresourceHost = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subresourceHostKey.get()));
     
    11621162       
    11631163        bool isRegisteredAsSubresourceUnder = TestController::singleton().isStatisticsRegisteredAsSubresourceUnder(subresourceHost, topFrameHost);
    1164         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isRegisteredAsSubresourceUnder));
     1164        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isRegisteredAsSubresourceUnder));
    11651165        return result;
    11661166    }
     
    11701170       
    11711171        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1172         WKRetainPtr<WKStringRef> subFrameHostKey(AdoptWK, WKStringCreateWithUTF8CString("SubFrameHost"));
    1173         WKRetainPtr<WKStringRef> topFrameHostKey(AdoptWK, WKStringCreateWithUTF8CString("TopFrameHost"));
     1172        WKRetainPtr<WKStringRef> subFrameHostKey = adoptWK(WKStringCreateWithUTF8CString("SubFrameHost"));
     1173        WKRetainPtr<WKStringRef> topFrameHostKey = adoptWK(WKStringCreateWithUTF8CString("TopFrameHost"));
    11741174       
    11751175        WKStringRef subFrameHost = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subFrameHostKey.get()));
     
    11771177
    11781178        bool isRegisteredAsSubFrameUnder = TestController::singleton().isStatisticsRegisteredAsSubFrameUnder(subFrameHost, topFrameHost);
    1179         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isRegisteredAsSubFrameUnder));
     1179        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isRegisteredAsSubFrameUnder));
    11801180        return result;
    11811181    }
     
    11851185       
    11861186        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1187         WKRetainPtr<WKStringRef> hostRedirectedFromKey(AdoptWK, WKStringCreateWithUTF8CString("HostRedirectedFrom"));
    1188         WKRetainPtr<WKStringRef> hostRedirectedToKey(AdoptWK, WKStringCreateWithUTF8CString("HostRedirectedTo"));
     1187        WKRetainPtr<WKStringRef> hostRedirectedFromKey = adoptWK(WKStringCreateWithUTF8CString("HostRedirectedFrom"));
     1188        WKRetainPtr<WKStringRef> hostRedirectedToKey = adoptWK(WKStringCreateWithUTF8CString("HostRedirectedTo"));
    11891189       
    11901190        WKStringRef hostRedirectedFrom = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostRedirectedFromKey.get()));
     
    11921192       
    11931193        bool isRegisteredAsRedirectingTo = TestController::singleton().isStatisticsRegisteredAsRedirectingTo(hostRedirectedFrom, hostRedirectedTo);
    1194         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isRegisteredAsRedirectingTo));
     1194        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isRegisteredAsRedirectingTo));
    11951195        return result;
    11961196    }
     
    12001200       
    12011201        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1202         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1203         WKRetainPtr<WKStringRef> valueKey(AdoptWK, WKStringCreateWithUTF8CString("Value"));
     1202        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1203        WKRetainPtr<WKStringRef> valueKey = adoptWK(WKStringCreateWithUTF8CString("Value"));
    12041204       
    12051205        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    12151215        WKStringRef hostName = static_cast<WKStringRef>(messageBody);
    12161216        bool hasHadUserInteraction = TestController::singleton().isStatisticsHasHadUserInteraction(hostName);
    1217         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(hasHadUserInteraction));
     1217        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(hasHadUserInteraction));
    12181218        return result;
    12191219    }
     
    12231223       
    12241224        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1225         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1226         WKRetainPtr<WKStringRef> valueKey(AdoptWK, WKStringCreateWithUTF8CString("Value"));
     1225        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1226        WKRetainPtr<WKStringRef> valueKey = adoptWK(WKStringCreateWithUTF8CString("Value"));
    12271227       
    12281228        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    12381238        WKStringRef hostName = static_cast<WKStringRef>(messageBody);
    12391239        bool isGrandfathered = TestController::singleton().isStatisticsGrandfathered(hostName);
    1240         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isGrandfathered));
     1240        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isGrandfathered));
    12411241        return result;
    12421242    }
     
    12461246       
    12471247        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1248         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1249         WKRetainPtr<WKStringRef> topFrameHostNameKey(AdoptWK, WKStringCreateWithUTF8CString("TopFrameHostName"));
     1248        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1249        WKRetainPtr<WKStringRef> topFrameHostNameKey = adoptWK(WKStringCreateWithUTF8CString("TopFrameHostName"));
    12501250       
    12511251        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    12601260       
    12611261        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1262         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1263         WKRetainPtr<WKStringRef> topFrameHostNameKey(AdoptWK, WKStringCreateWithUTF8CString("TopFrameHostName"));
     1262        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1263        WKRetainPtr<WKStringRef> topFrameHostNameKey = adoptWK(WKStringCreateWithUTF8CString("TopFrameHostName"));
    12641264       
    12651265        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    12741274       
    12751275        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1276         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1277         WKRetainPtr<WKStringRef> hostNameRedirectedToKey(AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedTo"));
     1276        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1277        WKRetainPtr<WKStringRef> hostNameRedirectedToKey = adoptWK(WKStringCreateWithUTF8CString("HostNameRedirectedTo"));
    12781278       
    12791279        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    12881288       
    12891289        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1290         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1291         WKRetainPtr<WKStringRef> hostNameRedirectedFromKey(AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedFrom"));
     1290        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1291        WKRetainPtr<WKStringRef> hostNameRedirectedFromKey = adoptWK(WKStringCreateWithUTF8CString("HostNameRedirectedFrom"));
    12921292       
    12931293        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    13021302       
    13031303        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1304         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1305         WKRetainPtr<WKStringRef> hostNameRedirectedToKey(AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedTo"));
     1304        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1305        WKRetainPtr<WKStringRef> hostNameRedirectedToKey = adoptWK(WKStringCreateWithUTF8CString("HostNameRedirectedTo"));
    13061306       
    13071307        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    13161316       
    13171317        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1318         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1319         WKRetainPtr<WKStringRef> hostNameRedirectedFromKey(AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedFrom"));
     1318        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1319        WKRetainPtr<WKStringRef> hostNameRedirectedFromKey = adoptWK(WKStringCreateWithUTF8CString("HostNameRedirectedFrom"));
    13201320       
    13211321        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    14391439       
    14401440        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    1441         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    1442         WKRetainPtr<WKStringRef> valueKey(AdoptWK, WKStringCreateWithUTF8CString("IncludeHttpOnlyCookies"));
     1441        WKRetainPtr<WKStringRef> hostNameKey = adoptWK(WKStringCreateWithUTF8CString("HostName"));
     1442        WKRetainPtr<WKStringRef> valueKey = adoptWK(WKStringCreateWithUTF8CString("IncludeHttpOnlyCookies"));
    14431443       
    14441444        WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
     
    14951495
    14961496        bool hasDOMCache = TestController::singleton().hasDOMCache(origin);
    1497         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(hasDOMCache));
     1497        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(hasDOMCache));
    14981498        return result;
    14991499    }
     
    15041504
    15051505        auto domCacheSize = TestController::singleton().domCacheSize(origin);
    1506         WKRetainPtr<WKTypeRef> result(AdoptWK, WKUInt64Create(domCacheSize));
     1506        WKRetainPtr<WKTypeRef> result = adoptWK(WKUInt64Create(domCacheSize));
    15071507        return result;
    15081508    }
     
    15701570        WKDictionaryRef testKeyDictionary = static_cast<WKDictionaryRef>(messageBody);
    15711571
    1572         WKRetainPtr<WKStringRef> privateKeyKey(AdoptWK, WKStringCreateWithUTF8CString("PrivateKey"));
     1572        WKRetainPtr<WKStringRef> privateKeyKey = adoptWK(WKStringCreateWithUTF8CString("PrivateKey"));
    15731573        WKStringRef privateKeyWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testKeyDictionary, privateKeyKey.get()));
    15741574
    1575         WKRetainPtr<WKStringRef> attrLabelKey(AdoptWK, WKStringCreateWithUTF8CString("AttrLabel"));
     1575        WKRetainPtr<WKStringRef> attrLabelKey = adoptWK(WKStringCreateWithUTF8CString("AttrLabel"));
    15761576        WKStringRef attrLabelWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testKeyDictionary, attrLabelKey.get()));
    15771577
    1578         WKRetainPtr<WKStringRef> applicationTagKey(AdoptWK, WKStringCreateWithUTF8CString("ApplicationTag"));
     1578        WKRetainPtr<WKStringRef> applicationTagKey = adoptWK(WKStringCreateWithUTF8CString("ApplicationTag"));
    15791579        WKStringRef applicationTagWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testKeyDictionary, applicationTagKey.get()));
    15801580
     
    15931593        WKDictionaryRef testDictionary = static_cast<WKDictionaryRef>(messageBody);
    15941594
    1595         WKRetainPtr<WKStringRef> attrLabelKey(AdoptWK, WKStringCreateWithUTF8CString("AttrLabel"));
     1595        WKRetainPtr<WKStringRef> attrLabelKey = adoptWK(WKStringCreateWithUTF8CString("AttrLabel"));
    15961596        WKStringRef attrLabelWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testDictionary, attrLabelKey.get()));
    15971597
    1598         WKRetainPtr<WKStringRef> applicationTagKey(AdoptWK, WKStringCreateWithUTF8CString("ApplicationTag"));
     1598        WKRetainPtr<WKStringRef> applicationTagKey = adoptWK(WKStringCreateWithUTF8CString("ApplicationTag"));
    15991599        WKStringRef applicationTagWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testDictionary, applicationTagKey.get()));
    16001600
    16011601        bool keyExistsInKeychain = TestController::singleton().keyExistsInKeychain(toWTFString(attrLabelWK), toWTFString(applicationTagWK));
    1602         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(keyExistsInKeychain));
     1602        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(keyExistsInKeychain));
    16031603        return result;
    16041604    }
     
    16121612
    16131613    if (WKStringIsEqualToUTF8CString(messageName, "CanDoServerTrustEvaluationInNetworkProcess")) {
    1614         WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(TestController::singleton().canDoServerTrustEvaluationInNetworkProcess()));
     1614        WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(TestController::singleton().canDoServerTrustEvaluationInNetworkProcess()));
    16151615        return result;
    16161616    }
    16171617
    16181618    if (WKStringIsEqualToUTF8CString(messageName, "ServerTrustEvaluationCallbackCallsCount")) {
    1619         WKRetainPtr<WKTypeRef> result(AdoptWK, WKUInt64Create(TestController::singleton().serverTrustEvaluationCallbackCallsCount()));
     1619        WKRetainPtr<WKTypeRef> result = adoptWK(WKUInt64Create(TestController::singleton().serverTrustEvaluationCallbackCallsCount()));
    16201620        return result;
    16211621    }
     
    16801680    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallUISideScriptCallback"));
    16811681
    1682     WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
    1683     WKRetainPtr<WKStringRef> resultKey(AdoptWK, WKStringCreateWithUTF8CString("Result"));
    1684     WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID"));
     1682    WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
     1683    WKRetainPtr<WKStringRef> resultKey = adoptWK(WKStringCreateWithUTF8CString("Result"));
     1684    WKRetainPtr<WKStringRef> callbackIDKey = adoptWK(WKStringCreateWithUTF8CString("CallbackID"));
    16851685    WKRetainPtr<WKUInt64Ref> callbackIDValue = adoptWK(WKUInt64Create(scriptCallbackID));
    16861686
     
    17841784    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidReceiveAllStorageAccessEntries"));
    17851785   
    1786     WKRetainPtr<WKMutableArrayRef> messageBody(AdoptWK, WKMutableArrayCreate());
     1786    WKRetainPtr<WKMutableArrayRef> messageBody = adoptWK(WKMutableArrayCreate());
    17871787    for (auto& domain : domains)
    17881788        WKArrayAppendItem(messageBody.get(), adoptWK(WKStringCreateWithUTF8CString(domain.utf8().data())).get());
  • trunk/Tools/WebKitTestRunner/WebNotificationProvider.cpp

    r239871 r244390  
    127127    removeGlobalIDFromIDMap(m_localToGlobalNotificationIDMap, id);
    128128
    129     WKRetainPtr<WKUInt64Ref> wkID(AdoptWK, WKUInt64Create(id));
    130     WKRetainPtr<WKMutableArrayRef> array(AdoptWK, WKMutableArrayCreate());
     129    WKRetainPtr<WKUInt64Ref> wkID = adoptWK(WKUInt64Create(id));
     130    WKRetainPtr<WKMutableArrayRef> array = adoptWK(WKMutableArrayCreate());
    131131    WKArrayAppendItem(array.get(), wkID.get());
    132132    WKNotificationManagerProviderDidCloseNotifications(notificationManager, array.get());
  • trunk/Tools/WebKitTestRunner/WorkQueueManager.cpp

    r185072 r244390  
    7676public:
    7777    explicit ScriptItem(const String& script)
    78         : m_script(AdoptWK, WKStringCreateWithUTF8CString(script.utf8().data()))
     78        : m_script(adoptWK(WKStringCreateWithUTF8CString(script.utf8().data())))
    7979    {
    8080    }
     
    132132    public:
    133133        LoadItem(const String& url, const String& target, bool shouldOpenExternalURLs)
    134             : m_url(AdoptWK, WKURLCreateWithUTF8CString(url.utf8().data()))
     134            : m_url(adoptWK(WKURLCreateWithUTF8CString(url.utf8().data())))
    135135            , m_target(target)
    136136            , m_shouldOpenExternalURLs(shouldOpenExternalURLs)
     
    162162    public:
    163163        LoadHTMLStringItem(const String& content, const String& baseURL, const String& unreachableURL)
    164             : m_content(AdoptWK, WKStringCreateWithUTF8CString(content.utf8().data()))
    165             , m_baseURL(AdoptWK, WKURLCreateWithUTF8CString(baseURL.utf8().data()))
    166             , m_unreachableURL(AdoptWK, WKURLCreateWithUTF8CString(unreachableURL.utf8().data()))
     164            : m_content(adoptWK(WKStringCreateWithUTF8CString(content.utf8().data())))
     165            , m_baseURL(adoptWK(WKURLCreateWithUTF8CString(baseURL.utf8().data())))
     166            , m_unreachableURL(adoptWK(WKURLCreateWithUTF8CString(unreachableURL.utf8().data())))
    167167        {
    168168        }
  • trunk/Tools/WebKitTestRunner/win/TestControllerWin.cpp

    r238098 r244390  
    127127static WKRetainPtr<WKStringRef> toWK(const char* string)
    128128{
    129     return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithUTF8CString(string));
     129    return adoptWK(WKStringCreateWithUTF8CString(string));
    130130}
    131131
Note: See TracChangeset for help on using the changeset viewer.