Changeset 244390 in webkit
- Timestamp:
- Apr 17, 2019, 11:28:56 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 107 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244389 r244390 1 2019-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 1 16 2019-04-17 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp
r243384 r244390 213 213 214 214 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)); 216 216 completionHandler(allowOverwrite ? WebKit::AllowOverwrite::Yes : WebKit::AllowOverwrite::No, WebKit::toWTFString(destination.get())); 217 217 } -
trunk/Source/WebKit/UIProcess/API/cpp/WKRetainPtr.h
r228751 r244390 36 36 namespace WebKit { 37 37 38 enum WKAdoptTag { AdoptWK };39 40 38 template<typename T> class WKRetainPtr { 41 39 public: … … 54 52 } 55 53 56 WKRetainPtr(WKAdoptTag, PtrType ptr)57 : m_ptr(ptr)58 {59 }60 61 54 template<typename U> WKRetainPtr(const WKRetainPtr<U>& o) 62 55 : m_ptr(o.get()) … … 134 127 135 128 private: 129 template<typename U> friend WKRetainPtr<U> adoptWK(U); 130 enum WKAdoptTag { AdoptWK }; 131 WKRetainPtr(WKAdoptTag, PtrType ptr) 132 : m_ptr(ptr) { } 133 136 134 PtrType m_ptr; 137 135 }; … … 250 248 template<typename T> inline WKRetainPtr<T> adoptWK(T o) 251 249 { 252 return WKRetainPtr<T>( AdoptWK, o);250 return WKRetainPtr<T>(WKRetainPtr<T>::AdoptWK, o); 253 251 } 254 252 … … 261 259 262 260 using WebKit::WKRetainPtr; 263 using WebKit::AdoptWK;264 261 using WebKit::adoptWK; 265 262 using WebKit::retainWK; -
trunk/Tools/ChangeLog
r244384 r244390 1 2019-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 1 413 2019-04-17 Alex Christensen <achristensen@webkit.org> 2 414 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r244078 r244390 1527 1527 // a CFString via fromUTF8WithLatin1Fallback().createCFString() which can be appended to 1528 1528 // the result without any conversion. 1529 WKRetainPtr<WKStringRef> stringRef (AdoptWK,WKStringCreateWithCFString((__bridge CFStringRef)innerText));1529 WKRetainPtr<WKStringRef> stringRef = adoptWK(WKStringCreateWithCFString((__bridge CFStringRef)innerText)); 1530 1530 size_t bufferSize = WKStringGetMaximumUTF8CStringSize(stringRef.get()); 1531 1531 auto buffer = std::make_unique<char[]>(bufferSize); -
trunk/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
r244106 r244390 321 321 WKRetainPtr<WKStringRef> username = createWKString("accept server trust"); 322 322 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)); 324 324 WKAuthenticationDecisionListenerUseCredential(decisionListener, wkCredential.get()); 325 325 return; … … 331 331 WKRetainPtr<WKStringRef> username = createWKString(credential->username); 332 332 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)); 334 334 WKAuthenticationDecisionListenerUseCredential(decisionListener, wkCredential.get()); 335 335 return; -
trunk/Tools/TestWebKitAPI/InjectedBundleController.cpp
r179409 r244390 73 73 WKDictionaryRef initializationDictionary = static_cast<WKDictionaryRef>(initializationUserData); 74 74 75 WKRetainPtr<WKStringRef> testNameKey (AdoptWK,WKStringCreateWithUTF8CString("TestName"));75 WKRetainPtr<WKStringRef> testNameKey = adoptWK(WKStringCreateWithUTF8CString("TestName")); 76 76 WKStringRef testName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(initializationDictionary, testNameKey.get())); 77 77 78 WKRetainPtr<WKStringRef> userDataKey (AdoptWK,WKStringCreateWithUTF8CString("UserData"));78 WKRetainPtr<WKStringRef> userDataKey = adoptWK(WKStringCreateWithUTF8CString("UserData")); 79 79 WKTypeRef userData = WKDictionaryGetItemForKey(initializationDictionary, userDataKey.get()); 80 80 initializeTestNamed(bundle, Util::toSTD(testName), userData); -
trunk/Tools/TestWebKitAPI/PlatformUtilities.cpp
r198141 r244390 36 36 WKContextRef createContextWithInjectedBundle() 37 37 { 38 WKRetainPtr<WKStringRef> injectedBundlePath (AdoptWK,createInjectedBundlePath());38 WKRetainPtr<WKStringRef> injectedBundlePath = adoptWK(createInjectedBundlePath()); 39 39 WKContextRef context = WKContextCreateWithInjectedBundlePath(injectedBundlePath.get()); 40 40 … … 46 46 WKMutableDictionaryRef initializationDictionary = WKMutableDictionaryCreate(); 47 47 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())); 50 50 WKDictionarySetItem(initializationDictionary, testNameKey.get(), testNameString.get()); 51 51 52 WKRetainPtr<WKStringRef> userDataKey (AdoptWK,WKStringCreateWithUTF8CString("UserData"));52 WKRetainPtr<WKStringRef> userDataKey = adoptWK(WKStringCreateWithUTF8CString("UserData")); 53 53 WKDictionarySetItem(initializationDictionary, userDataKey.get(), userData); 54 54 … … 60 60 WKContextRef context = createContextWithInjectedBundle(); 61 61 62 WKRetainPtr<WKDictionaryRef> initializationDictionary (AdoptWK,createInitializationDictionaryForInjectedBundleTest(testName, userData));62 WKRetainPtr<WKDictionaryRef> initializationDictionary = adoptWK(createInitializationDictionaryForInjectedBundleTest(testName, userData)); 63 63 WKContextSetInitializationUserDataForInjectedBundle(context, initializationDictionary.get()); 64 64 … … 81 81 WKRetainPtr<WKStringRef> toWK(const char* utf8String) 82 82 { 83 return WKRetainPtr<WKStringRef>(AdoptWK,WKStringCreateWithUTF8CString(utf8String));83 return adoptWK(WKStringCreateWithUTF8CString(utf8String)); 84 84 } 85 85 -
trunk/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm
r242339 r244390 53 53 54 54 // Allow file URLs to load non-file resources 55 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());55 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 56 56 WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true); 57 57 WKPageGroupSetPreferences(browsingContextGroup.get()._pageGroupRef, preferences.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/CloseFromWithinCreatePage.cpp
r239631 r244390 64 64 TEST(WebKit, CloseFromWithinCreatePage) 65 65 { 66 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));66 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 67 67 68 68 PlatformWebView webView(context.get()); … … 77 77 78 78 // Allow file URLs to load non-file resources 79 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());79 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 80 80 WKPageGroupRef pageGroup = WKPageGetPageGroup(webView.page()); 81 81 WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true); 82 82 WKPageGroupSetPreferences(pageGroup, preferences.get()); 83 83 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")); 85 85 WKPageLoadURL(webView.page(), url.get()); 86 86 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/CloseThenTerminate.cpp
r239631 r244390 56 56 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 57 57 58 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));58 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 59 59 WKPageLoadURL(webView.page(), url.get()); 60 60 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic.cpp
r236888 r244390 83 83 TEST(WebKit, DISABLED_DOMWindowExtensionBasic) 84 84 { 85 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup")));85 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup"))); 86 86 87 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("DOMWindowExtensionBasic", pageGroup.get()));87 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DOMWindowExtensionBasic", pageGroup.get())); 88 88 89 89 WKContextInjectedBundleClientV0 injectedBundleClient; … … 102 102 103 103 // 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")); 105 105 WKPageLoadURL(webView.page(), url1.get()); 106 106 … … 109 109 110 110 // 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")); 112 112 WKPageLoadURL(webView.page(), url2.get()); 113 113 … … 138 138 TEST(WebKit, DOMWindowExtensionCrashOnReload) 139 139 { 140 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup")));140 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup"))); 141 141 142 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("DOMWindowExtensionBasic", pageGroup.get()));142 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DOMWindowExtensionBasic", pageGroup.get())); 143 143 144 144 WKContextInjectedBundleClientV0 injectedBundleClient; … … 159 159 160 160 // 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")); 162 162 WKPageLoadURL(webView.page(), url1.get()); 163 163 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp
r236888 r244390 148 148 WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData); 149 149 150 WKRetainPtr<WKStringRef> source (AdoptWK,WKStringCreateWithUTF8CString("alert('Unimportant alert');"));150 WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString("alert('Unimportant alert');")); 151 151 WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldCreateWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames); 152 152 } -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache.cpp
r221505 r244390 84 84 TEST(WebKit, DISABLED_DOMWindowExtensionNoCache) 85 85 { 86 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionNoCachePageGroup")));86 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionNoCachePageGroup"))); 87 87 88 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("DOMWindowExtensionNoCache", pageGroup.get()));88 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DOMWindowExtensionNoCache", pageGroup.get())); 89 89 90 90 WKContextInjectedBundleClientV1 injectedBundleClient; … … 102 102 103 103 // 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")); 105 105 WKPageLoadURL(webView.page(), url1.get()); 106 106 … … 109 109 110 110 // 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")); 112 112 WKPageLoadURL(webView.page(), url2.get()); 113 113 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp
r177506 r244390 155 155 WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData); 156 156 157 WKRetainPtr<WKStringRef> source (AdoptWK,WKStringCreateWithUTF8CString("alert('Unimportant alert');"));157 WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString("alert('Unimportant alert');")); 158 158 WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldCreateWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames); 159 159 } -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm
r235117 r244390 61 61 setPageLoaderClient(webView.page()); 62 62 63 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("lots-of-text", "html"));63 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("lots-of-text", "html")); 64 64 WKPageLoadURL(webView.page(), url.get()); 65 65 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DidNotHandleKeyDown.cpp
r235117 r244390 47 47 TEST(WebKit, DidNotHandleKeyDown) 48 48 { 49 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextWithInjectedBundle());49 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle()); 50 50 PlatformWebView webView(context.get()); 51 51 … … 58 58 WKPageSetPageUIClient(webView.page(), &uiClient.base); 59 59 60 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));60 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 61 61 WKPageLoadURL(webView.page(), url.get()); 62 62 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp
r241500 r244390 53 53 RELEASE_ASSERT(!WKBundleFrameGetParentFrame(frame)); 54 54 55 WKRetainPtr<WKStringRef> message (AdoptWK,WKStringCreateWithUTF8CString("DidRemoveFrameFromHierarchy"));55 WKRetainPtr<WKStringRef> message = adoptWK(WKStringCreateWithUTF8CString("DidRemoveFrameFromHierarchy")); 56 56 WKBundlePagePostMessage(page, message.get(), message.get()); 57 57 } -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash.cpp
r221505 r244390 49 49 TEST(WebKit, DocumentStartUserScriptAlertCrashTest) 50 50 { 51 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DocumentStartUserScriptAlertCrashTestPageGroup")));51 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DocumentStartUserScriptAlertCrashTestPageGroup"))); 52 52 53 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("DocumentStartUserScriptAlertCrashTest", pageGroup.get()));53 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DocumentStartUserScriptAlertCrashTest", pageGroup.get())); 54 54 PlatformWebView webView(context.get(), pageGroup.get()); 55 55 … … 62 62 WKPageSetPageUIClient(webView.page(), &uiClient.base); 63 63 64 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));64 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 65 65 WKPageLoadURL(webView.page(), url.get()); 66 66 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp
r177506 r244390 49 49 WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData); 50 50 51 WKRetainPtr<WKStringRef> source (AdoptWK,WKStringCreateWithUTF8CString("alert('an alert');"));51 WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString("alert('an alert');")); 52 52 WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldNormalWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames); 53 53 } -
trunk/Tools/TestWebKitAPI/Tests/WebKit/EnumerateMediaDevices.cpp
r239631 r244390 52 52 auto context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 53 53 54 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(Util::toWK("EnumerateDevices").get()));54 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("EnumerateDevices").get())); 55 55 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 56 56 WKPreferencesSetMediaDevicesEnabled(preferences, true); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp
r239631 r244390 78 78 WKPageSetPageNavigationClient(webView.page(), &pageLoaderClient.base); 79 79 80 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());80 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 81 81 WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true); 82 82 … … 84 84 WKPageGroupSetPreferences(pageGroup, preferences.get()); 85 85 86 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("push-state", "html"));86 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("push-state", "html")); 87 87 WKPageLoadURL(webView.page(), url.get()); 88 88 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/EvaluateJavaScript.cpp
r239631 r244390 52 52 TEST(WebKit, EvaluateJavaScriptThatThrowsAnException) 53 53 { 54 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));54 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 55 55 PlatformWebView webView(context.get()); 56 56 57 WKRetainPtr<WKStringRef> javaScriptString (AdoptWK,WKStringCreateWithUTF8CString("throw 'Hello'"));57 WKRetainPtr<WKStringRef> javaScriptString = adoptWK(WKStringCreateWithUTF8CString("throw 'Hello'")); 58 58 WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), reinterpret_cast<void*>(0x1234578), didRunJavaScript); 59 59 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/EventModifiers.cpp
r239631 r244390 70 70 setClients(webView.page()); 71 71 72 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));72 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 73 73 WKPageLoadURL(webView.page(), url.get()); 74 74 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FailedLoad.cpp
r239631 r244390 52 52 TEST(WebKit, FailedLoad) 53 53 { 54 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));54 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 55 55 PlatformWebView webView(context.get()); 56 56 … … 63 63 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 64 64 65 WKRetainPtr<WKURLRef> url (AdoptWK,Util::URLForNonExistentResource());65 WKRetainPtr<WKURLRef> url = adoptWK(Util::URLForNonExistentResource()); 66 66 WKPageLoadURL(webView.page(), url.get()); 67 67 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/Find.cpp
r239631 r244390 52 52 TEST(WebKit, Find) 53 53 { 54 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));54 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 55 55 PlatformWebView webView(context.get()); 56 56 … … 71 71 WKPageSetPageFindClient(webView.page(), &findClient.base); 72 72 73 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("find", "html"));73 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("find", "html")); 74 74 WKPageLoadURL(webView.page(), url.get()); 75 75 76 76 Util::run(&didFinishLoad); 77 77 78 WKRetainPtr<WKStringRef> findString (AdoptWK,WKStringCreateWithUTF8CString("Hello"));78 WKRetainPtr<WKStringRef> findString = adoptWK(WKStringCreateWithUTF8CString("Hello")); 79 79 WKPageCountStringMatches(webView.page(), findString.get(), true, 100); 80 80 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm
r239631 r244390 119 119 TEST(WebKit, FindMatches) 120 120 { 121 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));121 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 122 122 PlatformWebView webView(context.get()); 123 123 … … 141 141 // This HTML file contains 3 occurrences of the word Hello and has the second occurence of the word 'world' selected. 142 142 // 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")); 144 144 WKPageLoadURL(webView.page(), url.get()); 145 145 146 146 Util::run(&didFinishLoad); 147 147 148 WKRetainPtr<WKStringRef> findString (AdoptWK,WKStringCreateWithUTF8CString("Hello"));148 WKRetainPtr<WKStringRef> findString = adoptWK(WKStringCreateWithUTF8CString("Hello")); 149 149 150 150 WKPageFindStringMatches(webView.page(), findString.get(), findOptions, 100); … … 169 169 didCallFindStringMatches = false; 170 170 findOptions &= ~kWKFindOptionsBackwards; 171 WKRetainPtr<WKStringRef> findOtherString (AdoptWK,WKStringCreateWithUTF8CString("crazy"));171 WKRetainPtr<WKStringRef> findOtherString = adoptWK(WKStringCreateWithUTF8CString("crazy")); 172 172 WKPageFindStringMatches(webView.page(), findOtherString.get(), findOptions, 100); 173 173 Util::run(&didCallFindStringMatches); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FirstMeaningfulPaintMilestone.cpp
r238306 r244390 55 55 TEST(WebKit, FirstMeaningfulPaint) 56 56 { 57 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("FirstMeaningfulPaintMilestoneTest"));57 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("FirstMeaningfulPaintMilestoneTest")); 58 58 59 59 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ForceRepaint.cpp
r239631 r244390 52 52 TEST(WebKit, ForceRepaint) 53 53 { 54 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));54 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 55 55 PlatformWebView webView(context.get()); 56 56 … … 63 63 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 64 64 65 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple-accelerated-compositing", "html"));65 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple-accelerated-compositing", "html")); 66 66 WKPageLoadURL(webView.page(), url.get()); 67 67 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameHandle.cpp
r239631 r244390 46 46 TEST(WebKit, FrameHandle) 47 47 { 48 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));48 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 49 49 PlatformWebView webView(context.get()); 50 50 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp
r239631 r244390 59 59 TEST(WebKit, FrameMIMETypeHTML) 60 60 { 61 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));61 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 62 62 PlatformWebView webView(context.get()); 63 63 … … 72 72 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 73 73 74 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));74 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 75 75 WKPageLoadURL(webView.page(), url.get()); 76 76 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp
r239631 r244390 58 58 TEST(WebKit, FrameMIMETypePNG) 59 59 { 60 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));60 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 61 61 PlatformWebView webView(context.get()); 62 62 … … 71 71 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 72 72 73 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("icon", "png"));73 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("icon", "png")); 74 74 WKPageLoadURL(webView.page(), url.get()); 75 75 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/Geolocation.cpp
r243533 r244390 162 162 TEST(WebKit, GeolocationBasic) 163 163 { 164 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));164 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 165 165 166 166 GeolocationBasicStateTracker stateTracker; … … 170 170 setupView(webView); 171 171 172 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("geolocationGetCurrentPosition", "html"));172 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("geolocationGetCurrentPosition", "html")); 173 173 WKPageLoadURL(webView.page(), url.get()); 174 174 … … 204 204 TEST(WebKit, GeolocationBasicWithHighAccuracy) 205 205 { 206 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));206 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 207 207 208 208 GeolocationBasicWithHighAccuracyStateTracker stateTracker; … … 212 212 setupView(webView); 213 213 214 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("geolocationGetCurrentPositionWithHighAccuracy", "html"));214 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("geolocationGetCurrentPositionWithHighAccuracy", "html")); 215 215 WKPageLoadURL(webView.page(), url.get()); 216 216 … … 257 257 TEST(WebKit, GeolocationTransitionToHighAccuracy) 258 258 { 259 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));259 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 260 260 261 261 GeolocationTransitionToHighAccuracyStateTracker stateTracker; … … 264 264 PlatformWebView lowAccuracyWebView(context.get()); 265 265 setupView(lowAccuracyWebView); 266 WKRetainPtr<WKURLRef> lowAccuracyURL (AdoptWK,Util::createURLForResource("geolocationWatchPosition", "html"));266 WKRetainPtr<WKURLRef> lowAccuracyURL = adoptWK(Util::createURLForResource("geolocationWatchPosition", "html")); 267 267 WKPageLoadURL(lowAccuracyWebView.page(), lowAccuracyURL.get()); 268 268 Util::run(&stateTracker.finishedFirstStep); … … 270 270 PlatformWebView highAccuracyWebView(lowAccuracyWebView.page()); 271 271 setupView(highAccuracyWebView); 272 WKRetainPtr<WKURLRef> highAccuracyURL (AdoptWK,Util::createURLForResource("geolocationWatchPositionWithHighAccuracy", "html"));272 WKRetainPtr<WKURLRef> highAccuracyURL = adoptWK(Util::createURLForResource("geolocationWatchPositionWithHighAccuracy", "html")); 273 273 WKPageLoadURL(highAccuracyWebView.page(), highAccuracyURL.get()); 274 274 Util::run(&stateTracker.enabledHighAccuracy); … … 330 330 TEST(WebKit, GeolocationTransitionToLowAccuracy) 331 331 { 332 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));332 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 333 333 334 334 GeolocationTransitionToLowAccuracyStateTracker stateTracker; … … 337 337 PlatformWebView highAccuracyWebView(context.get()); 338 338 setupView(highAccuracyWebView); 339 WKRetainPtr<WKURLRef> highAccuracyURL (AdoptWK,Util::createURLForResource("geolocationWatchPositionWithHighAccuracy", "html"));339 WKRetainPtr<WKURLRef> highAccuracyURL = adoptWK(Util::createURLForResource("geolocationWatchPositionWithHighAccuracy", "html")); 340 340 WKPageLoadURL(highAccuracyWebView.page(), highAccuracyURL.get()); 341 341 Util::run(&stateTracker.finishedFirstStep); … … 354 354 WKPageSetPageUIClient(lowAccuracyWebView.page(), &uiClient.base); 355 355 356 WKRetainPtr<WKURLRef> lowAccuracyURL (AdoptWK,Util::createURLForResource("geolocationWatchPosition", "html"));356 WKRetainPtr<WKURLRef> lowAccuracyURL = adoptWK(Util::createURLForResource("geolocationWatchPosition", "html")); 357 357 WKPageLoadURL(lowAccuracyWebView.page(), lowAccuracyURL.get()); 358 358 Util::run(&secondStepContext.didRun); … … 372 372 TEST(WebKit, GeolocationWatchMultiprocess) 373 373 { 374 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));374 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 375 375 376 376 GeolocationStateTracker stateTracker; … … 388 388 PlatformWebView view1(context.get()); 389 389 WKPageSetPageUIClient(view1.page(), &uiClient.base); 390 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("geolocationWatchPosition", "html"));390 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("geolocationWatchPosition", "html")); 391 391 WKPageLoadURL(view1.page(), url.get()); 392 392 Util::run(&testContext.didRun); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/GetInjectedBundleInitializationUserDataCallback.cpp
r221505 r244390 49 49 TEST(WebKit, GetInjectedBundleInitializationUserDataCallback) 50 50 { 51 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextWithInjectedBundle());51 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle()); 52 52 53 53 WKContextInjectedBundleClientV1 injectedBundleClient; … … 62 62 PlatformWebView webView(context.get()); 63 63 64 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));64 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 65 65 WKPageLoadURL(webView.page(), url.get()); 66 66 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle.cpp
r235117 r244390 74 74 TEST(WebKit, HitTestResultNodeHandle) 75 75 { 76 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("HitTestResultNodeHandleTest"));76 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("HitTestResultNodeHandleTest")); 77 77 78 78 setInjectedBundleClient(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle_Bundle.cpp
r179409 r244390 46 46 static void getContextMenuFromDefaultMenu(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKArrayRef defaultMenu, WKArrayRef* newMenu, WKTypeRef* userData, const void* clientInfo) 47 47 { 48 WKRetainPtr<WKBundleNodeHandleRef> nodeHandle (AdoptWK,WKBundleHitTestResultCopyNodeHandle(hitTestResult));48 WKRetainPtr<WKBundleNodeHandleRef> nodeHandle = adoptWK(WKBundleHitTestResultCopyNodeHandle(hitTestResult)); 49 49 if (!nodeHandle) 50 50 return; -
trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleBasic.cpp
r235117 r244390 54 54 TEST(WebKit, InjectedBundleBasic) 55 55 { 56 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("InjectedBundleBasicTest"));56 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleBasicTest")); 57 57 58 58 WKContextInjectedBundleClientV0 injectedBundleClient; … … 74 74 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 75 75 76 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));76 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 77 77 WKPageLoadURL(webView.page(), url.get()); 78 78 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior.cpp
r228309 r244390 51 51 TEST(WebKit, InjectedBundleNoDisableOverrideBuiltinsBehaviorTest) 52 52 { 53 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleNoDisableOverrideBuiltinsBehaviorTestPageGroup")));53 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleNoDisableOverrideBuiltinsBehaviorTestPageGroup"))); 54 54 55 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("InjectedBundleNoDisableOverrideBuiltinsBehaviorTest", pageGroup.get()));55 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleNoDisableOverrideBuiltinsBehaviorTest", pageGroup.get())); 56 56 PlatformWebView webView(context.get(), pageGroup.get()); 57 57 … … 66 66 testNumber = 0; 67 67 done = false; 68 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("override-builtins-test", "html"));68 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("override-builtins-test", "html")); 69 69 WKPageLoadURL(webView.page(), url.get()); 70 70 … … 85 85 TEST(WebKit, InjectedBundleDisableOverrideBuiltinsBehaviorTest) 86 86 { 87 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleDisableOverrideBuiltinsBehaviorTestPageGroup")));87 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleDisableOverrideBuiltinsBehaviorTestPageGroup"))); 88 88 89 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("InjectedBundleDisableOverrideBuiltinsBehaviorTest", pageGroup.get()));89 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleDisableOverrideBuiltinsBehaviorTest", pageGroup.get())); 90 90 PlatformWebView webView(context.get(), pageGroup.get()); 91 91 … … 100 100 testNumber = 0; 101 101 done = false; 102 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("override-builtins-test", "html"));102 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("override-builtins-test", "html")); 103 103 WKPageLoadURL(webView.page(), url.get()); 104 104 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp
r228309 r244390 48 48 WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData); 49 49 50 WKRetainPtr<WKStringRef> source (AdoptWK,WKStringCreateWithUTF8CString(50 WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString( 51 51 "window.onload = function () {\n" 52 52 " const form = document.getElementById('test').parentNode;\n" … … 73 73 WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData); 74 74 75 WKRetainPtr<WKStringRef> source (AdoptWK,WKStringCreateWithUTF8CString(75 WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString( 76 76 "window.onload = function () {\n" 77 77 " const form = document.getElementById('test').parentNode;\n" -
trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest.cpp
r221505 r244390 58 58 TEST(WebKit, InjectedBundleFrameHitTest) 59 59 { 60 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("InjectedBundleFrameHitTestTest"));60 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleFrameHitTestTest")); 61 61 62 62 setInjectedBundleClient(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest_Bundle.cpp
r197563 r244390 75 75 { 76 76 WKBundleHitTestResultRef hitTestResult = WKBundleFrameCreateHitTestResult(frame, WKPointMake(50, 50)); 77 WKRetainPtr<WKStringRef> linkTitle (AdoptWK,WKBundleHitTestResultCopyLinkTitle(hitTestResult));77 WKRetainPtr<WKStringRef> linkTitle = adoptWK(WKBundleHitTestResultCopyLinkTitle(hitTestResult)); 78 78 WKBundlePostMessage(m_bundle, Util::toWK("InjectedBundleFrameHitTestDone").get(), linkTitle.get()); 79 79 } -
trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleInitializationUserDataCallbackWins.cpp
r221505 r244390 49 49 TEST(WebKit, InjectedBundleInitializationUserDataCallbackWins) 50 50 { 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())); 53 53 WKContextSetInitializationUserDataForInjectedBundle(context.get(), initializationDictionary.get()); 54 54 … … 64 64 PlatformWebView webView(context.get()); 65 65 66 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));66 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 67 67 WKPageLoadURL(webView.page(), url.get()); 68 68 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen.cpp
r221505 r244390 86 86 TEST(WebKit, InjectedBundleMakeAllShadowRootOpenTest) 87 87 { 88 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleMakeAllShadowRootOpenTestPageGroup")));88 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("InjectedBundleMakeAllShadowRootOpenTestPageGroup"))); 89 89 90 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("InjectedBundleMakeAllShadowRootOpenTest", pageGroup.get()));90 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleMakeAllShadowRootOpenTest", pageGroup.get())); 91 91 PlatformWebView webView(context.get(), pageGroup.get()); 92 92 … … 99 99 WKPageSetPageUIClient(webView.page(), &uiClient.base); 100 100 101 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("closed-shadow-tree-test", "html"));101 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("closed-shadow-tree-test", "html")); 102 102 WKPageLoadURL(webView.page(), url.get()); 103 103 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp
r211139 r244390 51 51 WKBundleScriptWorldMakeAllShadowRootsOpen(world); 52 52 53 WKRetainPtr<WKStringRef> source (AdoptWK,WKStringCreateWithUTF8CString(53 WKRetainPtr<WKStringRef> source = adoptWK(WKStringCreateWithUTF8CString( 54 54 "window.onload = function () {\n" 55 55 " const element = document.createElement('div');\n" -
trunk/Tools/TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp
r240450 r244390 54 54 TEST(WebKit, LayoutMilestonesWithAllContentInFrame) 55 55 { 56 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));56 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 57 57 PlatformWebView webView(context.get()); 58 58 … … 75 75 TEST(WebKit, FirstVisuallyNonEmptyLayoutAfterPageCacheRestore) 76 76 { 77 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));77 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 78 78 79 79 WKContextSetCacheModel(context.get(), kWKCacheModelPrimaryWebBrowser); // Enables the Page Cache. … … 120 120 TEST(WebKit, FirstVisuallyNonEmptyMilestoneWithLoadComplete) 121 121 { 122 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));122 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 123 123 PlatformWebView webView(context.get()); 124 124 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
r239631 r244390 48 48 static void loadAlternateHTMLString(WKURLRef baseURL, WKURLRef unreachableURL) 49 49 { 50 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));50 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 51 51 PlatformWebView webView(context.get()); 52 52 … … 58 58 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 59 59 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>")); 61 61 WKPageLoadAlternateHTMLString(webView.page(), alternateHTMLString.get(), baseURL, unreachableURL); 62 62 … … 68 68 { 69 69 // 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")); 71 71 loadAlternateHTMLString(fileURL.get(), fileURL.get()); 72 72 } … … 77 77 // when baseURL does not grant read access to the unreachableURL. We use a separate test 78 78 // to ensure the previous test does not pollute the result. 79 WKRetainPtr<WKURLRef> unreachableURL (AdoptWK,Util::URLForNonExistentResource());79 WKRetainPtr<WKURLRef> unreachableURL = adoptWK(Util::URLForNonExistentResource()); 80 80 loadAlternateHTMLString(nullptr, unreachableURL.get()); 81 81 } -
trunk/Tools/TestWebKitAPI/Tests/WebKit/LoadCanceledNoServerRedirectCallback.cpp
r235117 r244390 54 54 TEST(WebKit, LoadCanceledNoServerRedirectCallback) 55 55 { 56 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("LoadCanceledNoServerRedirectCallbackTest"));56 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("LoadCanceledNoServerRedirectCallbackTest")); 57 57 58 58 WKContextInjectedBundleClientV0 injectedBundleClient; … … 81 81 WKContextSetHistoryClient(context.get(), &historyClient.base); 82 82 83 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple-iframe", "html"));83 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple-iframe", "html")); 84 84 WKPageLoadURL(webView.page(), url.get()); 85 85 Util::run(&loadedAllFrames); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/LoadPageOnCrash.cpp
r239631 r244390 40 40 public: 41 41 WebKit2CrashLoader() 42 : context( AdoptWK, WKContextCreateWithConfiguration(nullptr))42 : context(adoptWK(WKContextCreateWithConfiguration(nullptr))) 43 43 , webView(context.get()) 44 44 , url(adoptWK(WKURLCreateWithUTF8CString("about:blank"))) -
trunk/Tools/TestWebKitAPI/Tests/WebKit/MenuTypesForMouseEvents.cpp
r239631 r244390 54 54 static void buildAndPerformTest(WKEventMouseButton button, WKEventModifiers modifiers, const char* expectedButton, const char* expectedMenuType) 55 55 { 56 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));56 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 57 57 PlatformWebView webView(context.get()); 58 58 setPageLoaderClient(webView.page()); 59 59 60 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("mouse-button-listener", "html"));60 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("mouse-button-listener", "html")); 61 61 WKPageLoadURL(webView.page(), url.get()); 62 62 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ModalAlertsSPI.cpp
r239631 r244390 134 134 WKPageSetPageUIClient(webView.page(), &uiClient.base); 135 135 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")); 137 137 WKPageLoadURL(webView.page(), url.get()); 138 138 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/MouseMoveAfterCrash.cpp
r235117 r244390 59 59 setPageLoaderClient(webView.page()); 60 60 61 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("mouse-move-listener", "html"));61 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("mouse-move-listener", "html")); 62 62 WKPageLoadURL(webView.page(), url.get()); 63 63 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayout.cpp
r235138 r244390 76 76 TEST(WebKit, DISABLED_NewFirstVisuallyNonEmptyLayout) 77 77 { 78 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutTest"));78 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutTest")); 79 79 80 80 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFails.cpp
r235138 r244390 72 72 TEST(WebKit, NewFirstVisuallyNonEmptyLayoutFails) 73 73 { 74 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFailsTest"));74 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFailsTest")); 75 75 76 76 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutForImages.cpp
r235138 r244390 76 76 TEST(WebKit, DISABLED_NewFirstVisuallyNonEmptyLayoutForImages) 77 77 { 78 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutForImagesTest"));78 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutForImagesTest")); 79 79 80 80 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp
r235123 r244390 78 78 { 79 79 didHitRelevantRepaintedObjectsAreaThresholdCounter = 0; 80 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFramesTest"));80 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFramesTest")); 81 81 82 82 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp
r239631 r244390 109 109 State state; 110 110 111 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));111 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 112 112 PlatformWebView webView(context.get()); 113 113 … … 128 128 EXPECT_NULL(WKPageCopyActiveURL(webView.page())); 129 129 130 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));130 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 131 131 WKPageLoadURL(webView.page(), url.get()); 132 132 … … 141 141 TEST(WebKit, PageReload) 142 142 { 143 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));143 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 144 144 PlatformWebView webView(context.get()); 145 145 … … 148 148 WKPageReload(webView.page()); 149 149 150 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));150 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 151 151 WKPageLoadURL(webView.page(), url.get()); 152 152 … … 161 161 TEST(WebKit, PageLoadTwiceAndReload) 162 162 { 163 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));163 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 164 164 PlatformWebView webView(context.get()); 165 165 … … 184 184 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 185 185 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")); 188 188 WKPageLoadURL(webView.page(), url1.get()); 189 189 WKPageLoadURL(webView.page(), url2.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp
r239631 r244390 57 57 TEST(WebKit, PageLoadDidChangeLocationWithinPage) 58 58 { 59 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));59 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 60 60 PlatformWebView webView(context.get()); 61 61 … … 71 71 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 72 72 73 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("file-with-anchor", "html"));73 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("file-with-anchor", "html")); 74 74 WKPageLoadURL(webView.page(), url.get()); 75 75 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PasteboardNotifications.mm
r221505 r244390 68 68 PlatformWebView webView(context.get()); 69 69 70 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());70 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 71 71 WKPreferencesSetJavaScriptCanAccessClipboard(preferences.get(), true); 72 72 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PendingAPIRequestURL.cpp
r239631 r244390 39 39 TEST(WebKit, PendingAPIRequestURL) 40 40 { 41 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));41 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 42 42 PlatformWebView webView(context.get()); 43 43 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PreventEmptyUserAgent.cpp
r239631 r244390 61 61 TEST(WebKit, PreventEmptyUserAgent) 62 62 { 63 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));63 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 64 64 PlatformWebView webView(context.get()); 65 65 66 66 WKPageSetCustomUserAgent(webView.page(), WKStringCreateWithUTF8CString("")); 67 WKRetainPtr<WKStringRef> javaScriptString (AdoptWK,WKStringCreateWithUTF8CString("navigator.userAgent"));67 WKRetainPtr<WKStringRef> javaScriptString = adoptWK(WKStringCreateWithUTF8CString("navigator.userAgent")); 68 68 WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), reinterpret_cast<void*>(0x1234578), didRunJavaScript); 69 69 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp
r239631 r244390 52 52 TEST(WebKit, PrivateBrowsingPushStateNoHistoryCallback) 53 53 { 54 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));54 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 55 55 56 56 WKContextHistoryClientV0 historyClient; … … 74 74 WKPageSetPageNavigationClient(webView.page(), &pageLoaderClient.base); 75 75 76 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());76 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 77 77 WKPreferencesSetPrivateBrowsingEnabled(preferences.get(), true); 78 78 WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true); … … 81 81 WKPageGroupSetPreferences(pageGroup, preferences.get()); 82 82 83 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("push-state", "html"));83 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("push-state", "html")); 84 84 WKPageLoadURL(webView.page(), url.get()); 85 85 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ProcessDidTerminate.cpp
r239631 r244390 79 79 TEST(WebKit, ProcessDidTerminateRequestedByClient) 80 80 { 81 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));81 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 82 82 PlatformWebView webView(context.get()); 83 83 … … 103 103 TEST(WebKit, ProcessDidTerminateWithReasonCrash) 104 104 { 105 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));105 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 106 106 PlatformWebView webView(context.get()); 107 107 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ProvisionalURLAfterWillSendRequestCallback.cpp
r236833 r244390 55 55 EXPECT_TRUE(WKURLIsEqual(committedURL.get(), static_cast<WKURLRef>(userData))); 56 56 57 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple2", "html"));57 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple2", "html")); 58 58 EXPECT_TRUE(WKURLIsEqual(committedURL.get(), url.get())); 59 59 … … 63 63 TEST(WebKit2, ProvisionalURLAfterWillSendRequestCallback) 64 64 { 65 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("ProvisionalURLAfterWillSendRequestCallbackTest"));65 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("ProvisionalURLAfterWillSendRequestCallbackTest")); 66 66 67 67 WKContextInjectedBundleClientV0 injectedBundleClient; … … 79 79 WKPageSetPageNavigationClient(webView.page(), &navigationClient.base); 80 80 81 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));81 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 82 82 WKPageLoadURL(webView.page(), url.get()); 83 83 Util::run(&committedLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ProvisionalURLAfterWillSendRequestCallback_Bundle.cpp
r207325 r244390 52 52 53 53 // Change the main frame URL. 54 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple2", "html"));54 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple2", "html")); 55 55 return WKURLRequestCreateWithWKURL(url.get()); 56 56 } -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp
r243870 r244390 69 69 TEST(WebKit, ReloadPageAfterCrash) 70 70 { 71 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));71 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 72 72 PlatformWebView webView(context.get()); 73 73 … … 112 112 TEST(WebKit, FocusedFrameAfterCrash) 113 113 { 114 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));114 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 115 115 PlatformWebView webView(context.get()); 116 116 … … 130 130 EXPECT_FALSE(!WKPageGetMainFrame(webView.page())); 131 131 132 WKRetainPtr<WKStringRef> javaScriptString (AdoptWK,WKStringCreateWithUTF8CString("frames[2].focus()"));132 WKRetainPtr<WKStringRef> javaScriptString = adoptWK(WKStringCreateWithUTF8CString("frames[2].focus()")); 133 133 WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), 0, nullJavaScriptCallback); 134 134 … … 143 143 TEST(WebKit, FrameSetLargestFrameAfterCrash) 144 144 { 145 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));145 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 146 146 PlatformWebView webView(context.get()); 147 147 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ResizeReversePaginatedWebView.cpp
r239631 r244390 62 62 TEST(WebKit, ResizeReversePaginatedWebView) 63 63 { 64 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));64 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 65 65 PlatformWebView webView(context.get()); 66 66 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ResizeWindowAfterCrash.cpp
r239631 r244390 76 76 TEST(WebKit, ResizeWindowAfterCrash) 77 77 { 78 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));78 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 79 79 TestStatesData states(context.get()); 80 80 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp
r239631 r244390 86 86 TEST(WebKit, RestoreSessionStateContainingScrollRestorationDefault) 87 87 { 88 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));88 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 89 89 90 90 PlatformWebView webView(context.get()); … … 104 104 TEST(WebKit, RestoreSessionStateContainingScrollRestorationDefaultWithAsyncPolicyDelegates) 105 105 { 106 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));106 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 107 107 108 108 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/RestoreSessionStateContainingFormData.cpp
r239631 r244390 73 73 TEST(WebKit, RestoreSessionStateContainingFormData) 74 74 { 75 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));75 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 76 76 77 77 // FIXME: Once <rdar://problem/8708435> is fixed, we can move the creation of this -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ScrollPinningBehaviors.cpp
r239631 r244390 72 72 TEST(WebKit, ScrollPinningBehaviors) 73 73 { 74 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));74 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 75 75 76 76 // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to 77 77 // update using WKPageForceRepaint would be better, but for some reason doesn't block until 78 78 // 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())); 80 80 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 81 81 WKPreferencesSetThreadedScrollingEnabled(preferences, false); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ShouldKeepCurrentBackForwardListItemInList.cpp
r239631 r244390 124 124 TEST(WebKit, ShouldKeepCurrentBackForwardListItemInList) 125 125 { 126 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));126 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 127 127 128 128 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/SpacebarScrolling.cpp
r235117 r244390 52 52 TEST(WebKit, SpacebarScrolling) 53 53 { 54 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextWithInjectedBundle());54 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle()); 55 55 56 56 // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to 57 57 // 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())); 59 59 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 60 60 WKPreferencesSetThreadedScrollingEnabled(preferences, false); … … 78 78 WKPageSetPageUIClient(webView.page(), &uiClient.base); 79 79 80 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("spacebar-scrolling", "html"));80 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("spacebar-scrolling", "html")); 81 81 WKPageLoadURL(webView.page(), url.get()); 82 82 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/StopLoadingDuringDidFailProvisionalLoad.cpp
r235117 r244390 63 63 TEST(WebKit, StopLoadingDuringDidFailProvisionalLoadTest) 64 64 { 65 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("StopLoadingDuringDidFailProvisionalLoadTest"));65 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("StopLoadingDuringDidFailProvisionalLoadTest")); 66 66 setInjectedBundleClient(context.get()); 67 67 … … 73 73 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 74 74 75 WKRetainPtr<WKURLRef> url (AdoptWK,Util::URLForNonExistentResource());75 WKRetainPtr<WKURLRef> url = adoptWK(Util::URLForNonExistentResource()); 76 76 WKPageLoadURL(webView.page(), url.get()); 77 77 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/TerminateTwice.cpp
r239631 r244390 42 42 TEST(WebKit, TerminateTwice) 43 43 { 44 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));44 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 45 45 PlatformWebView webView(context.get()); 46 46 … … 53 53 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 54 54 55 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));55 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 56 56 WKPageLoadURL(webView.page(), url.get()); 57 57 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/UserMedia.cpp
r240830 r244390 72 72 auto context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 73 73 74 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));74 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get())); 75 75 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 76 76 WKPreferencesSetMediaDevicesEnabled(preferences, true); … … 108 108 auto context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 109 109 110 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));110 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get())); 111 111 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 112 112 WKPreferencesSetMediaDevicesEnabled(preferences, true); … … 168 168 auto context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 169 169 170 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));170 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get())); 171 171 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 172 172 WKPreferencesSetMediaDevicesEnabled(preferences, true); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageCopySessionStateWithFiltering.cpp
r239631 r244390 106 106 TEST(WebKit, WKPageCopySessionStateWithFiltering) 107 107 { 108 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));108 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 109 109 110 110 createSessionStates(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageGetScaleFactorNotZero.cpp
r239631 r244390 66 66 TEST(WebKit, WKPageGetScaleFactorNotZero) 67 67 { 68 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));68 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 69 69 70 70 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp
r239631 r244390 118 118 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 119 119 120 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(Util::toWK("MSEIsPlayingAudioPageGroup").get()));120 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("MSEIsPlayingAudioPageGroup").get())); 121 121 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 122 122 WKPreferencesSetMediaSourceEnabled(preferences, true); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp
r238264 r244390 107 107 TEST(WebKit, WKPreferencesCopying) 108 108 { 109 WKRetainPtr<WKStringRef> identifier (AdoptWK,WKStringCreateWithUTF8CString("identifier"));109 WKRetainPtr<WKStringRef> identifier = adoptWK(WKStringCreateWithUTF8CString("identifier")); 110 110 111 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreateWithIdentifier(identifier.get()));111 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreateWithIdentifier(identifier.get())); 112 112 WKPreferencesSetDefaultFontSize(preferences.get(), 36); 113 113 114 WKRetainPtr<WKPreferencesRef> copy (AdoptWK,WKPreferencesCreateCopy(preferences.get()));114 WKRetainPtr<WKPreferencesRef> copy = adoptWK(WKPreferencesCreateCopy(preferences.get())); 115 115 116 116 WKPreferencesSetDefaultFontSize(preferences.get(), 24); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WKThumbnailView.mm
r242339 r244390 103 103 WKPageSetCustomBackingScaleFactor(webView.page(), 1); 104 104 105 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("lots-of-text", "html"));105 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("lots-of-text", "html")); 106 106 WKPageLoadURL(webView.page(), url.get()); 107 107 Util::run(&didFinishLoad); … … 149 149 WKPageSetCustomBackingScaleFactor(webView.page(), 1); 150 150 151 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("lots-of-text", "html"));151 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("lots-of-text", "html")); 152 152 WKPageLoadURL(webView.page(), url.get()); 153 153 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WillSendSubmitEvent.cpp
r224206 r244390 45 45 WKDictionaryRef values = static_cast<WKDictionaryRef>(body); 46 46 47 WKRetainPtr<WKStringRef> textFieldKey (AdoptWK,WKStringCreateWithUTF8CString("textField"));47 WKRetainPtr<WKStringRef> textFieldKey = adoptWK(WKStringCreateWithUTF8CString("textField")); 48 48 WKStringRef textFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, textFieldKey.get())); 49 49 EXPECT_WK_STREQ("text field", textFieldValueWK); 50 50 51 WKRetainPtr<WKStringRef> passwordFieldKey (AdoptWK,WKStringCreateWithUTF8CString("passwordField"));51 WKRetainPtr<WKStringRef> passwordFieldKey = adoptWK(WKStringCreateWithUTF8CString("passwordField")); 52 52 WKStringRef passwordFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, passwordFieldKey.get())); 53 53 EXPECT_WK_STREQ("password field", passwordFieldValueWK); 54 54 55 55 // <input type="hidden"> fields are not sent. 56 WKRetainPtr<WKStringRef> hiddenFieldKey (AdoptWK,WKStringCreateWithUTF8CString("hiddenField"));56 WKRetainPtr<WKStringRef> hiddenFieldKey = adoptWK(WKStringCreateWithUTF8CString("hiddenField")); 57 57 WKStringRef hiddenFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, hiddenFieldKey.get())); 58 58 EXPECT_NULL(hiddenFieldValueWK); 59 59 60 WKRetainPtr<WKStringRef> targetFrameKey (AdoptWK,WKStringCreateWithUTF8CString("targetFrameIsMainFrame"));60 WKRetainPtr<WKStringRef> targetFrameKey = adoptWK(WKStringCreateWithUTF8CString("targetFrameIsMainFrame")); 61 61 WKBooleanRef targetFrameIsMainFrame = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(values, targetFrameKey.get())); 62 62 EXPECT_FALSE(WKBooleanGetValue(targetFrameIsMainFrame)); 63 63 64 WKRetainPtr<WKStringRef> sourceFrameKey (AdoptWK,WKStringCreateWithUTF8CString("sourceFrameIsMainFrame"));64 WKRetainPtr<WKStringRef> sourceFrameKey = adoptWK(WKStringCreateWithUTF8CString("sourceFrameIsMainFrame")); 65 65 WKBooleanRef sourceFrameIsMainFrame = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(values, sourceFrameKey.get())); 66 66 EXPECT_TRUE(WKBooleanGetValue(sourceFrameIsMainFrame)); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/AttributedSubstringForProposedRangeWithImage.mm
r235117 r244390 58 58 TEST(WebKit, AttributedSubstringForProposedRangeWithImage) 59 59 { 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())); 62 62 PlatformWebView webView(context.get(), pageGroup.get()); 63 63 … … 71 71 WKContextSetInvalidMessageFunction(invalidMessageFunction); 72 72 73 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("chinese-character-with-image", "html"));73 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("chinese-character-with-image", "html")); 74 74 WKPageLoadURL(webView.page(), url.get()); 75 75 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/ContextMenuDownload.mm
r235117 r244390 81 81 TEST(WebKit, ContextMenuDownloadHTMLDownloadAttribute) 82 82 { 83 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextWithInjectedBundle());83 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle()); 84 84 85 85 WKContextDownloadClientV0 client; … … 89 89 WKContextSetDownloadClient(context.get(), &client.base); 90 90 91 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(Util::toWK("MyGroup").get()));91 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("MyGroup").get())); 92 92 PlatformWebView webView(context.get(), pageGroup.get()); 93 93 … … 104 104 WKPageSetPageContextMenuClient(webView.page(), &contextMenuClient.base); 105 105 106 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("link-with-download-attribute", "html"));106 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("link-with-download-attribute", "html")); 107 107 108 108 expectedOriginatingPage = webView.page(); … … 128 128 TEST(WebKit, ContextMenuDownloadHTMLDownloadAttributeWithSlashes) 129 129 { 130 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextWithInjectedBundle());130 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle()); 131 131 132 132 WKContextDownloadClientV0 client; … … 136 136 WKContextSetDownloadClient(context.get(), &client.base); 137 137 138 WKRetainPtr<WKPageGroupRef> pageGroup (AdoptWK,WKPageGroupCreateWithIdentifier(Util::toWK("MyGroup").get()));138 WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("MyGroup").get())); 139 139 PlatformWebView webView(context.get(), pageGroup.get()); 140 140 … … 151 151 WKPageSetPageContextMenuClient(webView.page(), &contextMenuClient.base); 152 152 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")); 154 154 155 155 expectedOriginatingPage = webView.page(); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter.mm
r242339 r244390 77 77 TEST(WebKit, CustomBundleParameter) 78 78 { 79 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("CustomBundleParameterTest"));79 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("CustomBundleParameterTest")); 80 80 81 81 WKContextInjectedBundleClientV0 injectedBundleClient; … … 97 97 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 98 98 99 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));99 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 100 100 WKPageLoadURL(webView.page(), url.get()); 101 101 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/EditorCommands.mm
r235117 r244390 43 43 TEST(WebKit, ScrollByLineCommands) 44 44 { 45 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextWithInjectedBundle());45 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle()); 46 46 47 47 // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to 48 48 // 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())); 50 50 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 51 51 WKPreferencesSetThreadedScrollingEnabled(preferences, false); … … 61 61 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 62 62 63 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple-tall", "html"));63 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple-tall", "html")); 64 64 WKPageLoadURL(webView.page(), url.get()); 65 65 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm
r239904 r244390 58 58 TEST(WebKit, ForceLightAppearanceInBundle) 59 59 { 60 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("ForceLightAppearanceInBundleTest"));60 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("ForceLightAppearanceInBundleTest")); 61 61 62 62 PlatformWebView webView(context.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/GetPIDAfterAbortedProcessLaunch.cpp
r239631 r244390 43 43 TEST(WebKit, GetPIDAfterAbortedProcessLaunch) 44 44 { 45 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));45 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 46 46 47 47 PlatformWebView webView(context.get()); … … 55 55 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 56 56 57 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));57 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 58 58 WKPageLoadURL(webView.page(), url.get()); 59 59 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/InjectedBundleAppleEvent.cpp
r235117 r244390 68 68 TEST(WebKit, InjectedBundleAppleEvent) 69 69 { 70 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextForInjectedBundleTest("InjectedBundleAppleEventTest"));70 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("InjectedBundleAppleEventTest")); 71 71 72 72 WKContextInjectedBundleClientV0 injectedBundleClient; … … 88 88 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 89 89 90 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple", "html"));90 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple", "html")); 91 91 WKPageLoadURL(webView.page(), url.get()); 92 92 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm
r239631 r244390 72 72 TEST(WebKit, RestoreStateAfterTermination) 73 73 { 74 WKRetainPtr<WKContextRef> context (AdoptWK,WKContextCreateWithConfiguration(nullptr));74 WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 75 75 PlatformWebView webView(context.get()); 76 76 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm
r242339 r244390 119 119 { 120 120 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())); 122 122 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 123 123 WKPreferencesSetFullScreenEnabled(preferences, true); … … 136 136 137 137 receivedLoadedMessage = false; 138 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("FullscreenDelegate", "html"));138 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("FullscreenDelegate", "html")); 139 139 WKPageLoadURL(webView.page(), url.get()); 140 140 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm
r242339 r244390 202 202 { 203 203 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())); 205 205 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 206 206 WKPreferencesSetFullScreenEnabled(preferences, true); … … 227 227 228 228 receivedLoadedMessage = false; 229 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("PictureInPictureDelegate", "html"));229 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("PictureInPictureDelegate", "html")); 230 230 WKPageLoadURL(webView.page(), url.get()); 231 231 TestWebKitAPI::Util::run(&receivedLoadedMessage); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm
r242339 r244390 43 43 { 44 44 configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 45 WKRetainPtr<WKContextRef> context (AdoptWK,TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));45 WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest")); 46 46 configuration.get().processPool = (WKProcessPool *)context.get(); 47 47 configuration.get().preferences._lowPowerVideoAudioBufferSizeEnabled = YES; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSuspendMediaBuffering.mm
r242339 r244390 37 37 { 38 38 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 39 WKRetainPtr<WKContextRef> context (AdoptWK,TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));39 WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest")); 40 40 configuration.get().processPool = (WKProcessPool *)context.get(); 41 41 configuration.get()._mediaDataLoadsAutomatically = YES; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm
r243094 r244390 192 192 // Test page requires window.internals. 193 193 #if WK_HAVE_C_SPI 194 WKRetainPtr<WKContextRef> context (AdoptWK,TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));194 WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest")); 195 195 configuration.get().processPool = (WKProcessPool *)context.get(); 196 196 #endif -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm
r244097 r244390 965 965 void setConfigurationInjectedBundlePath(WKWebViewConfiguration* configuration) 966 966 { 967 WKRetainPtr<WKContextRef> context (AdoptWK,TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));967 WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest")); 968 968 configuration.processPool = (WKProcessPool *)context.get(); 969 969 auto pool = configuration.processPool; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm
r243753 r244390 716 716 [webView setNavigationDelegate:delegate.get()]; 717 717 718 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());718 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 719 719 WKPreferencesSetNeedsSiteSpecificQuirks(preferences.get(), true); 720 720 WKPageGroupSetPreferences(WKPageGetPageGroup([webView _pageForTesting]), preferences.get()); … … 749 749 [webView setNavigationDelegate:delegate.get()]; 750 750 751 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());751 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 752 752 WKPreferencesSetNeedsSiteSpecificQuirks(preferences.get(), true); 753 753 WKPageGroupSetPreferences(WKPageGetPageGroup([webView _pageForTesting]), preferences.get()); … … 807 807 [webView setNavigationDelegate:delegate.get()]; 808 808 809 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());809 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 810 810 WKPreferencesSetNeedsSiteSpecificQuirks(preferences.get(), true); 811 811 WKPageGroupSetPreferences(WKPageGetPageGroup([webView _pageForTesting]), preferences.get()); … … 870 870 [webView setNavigationDelegate:delegate.get()]; 871 871 872 WKRetainPtr<WKPreferencesRef> preferences (AdoptWK,WKPreferencesCreate());872 WKRetainPtr<WKPreferencesRef> preferences = adoptWK(WKPreferencesCreate()); 873 873 WKPreferencesSetNeedsSiteSpecificQuirks(preferences.get(), true); 874 874 WKPageGroupSetPreferences(WKPageGetPageGroup([webView _pageForTesting]), preferences.get()); -
trunk/Tools/TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm
r235117 r244390 44 44 TEST(WebKit, FirstResponderScrollingPosition) 45 45 { 46 WKRetainPtr<WKContextRef> context (AdoptWK,Util::createContextWithInjectedBundle());46 WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextWithInjectedBundle()); 47 47 48 48 // Turn off threaded scrolling; synchronously waiting for the main thread scroll position to 49 49 // 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())); 51 51 WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get()); 52 52 WKPreferencesSetThreadedScrollingEnabled(preferences, false); … … 68 68 [window.get() makeFirstResponder:webView.platformView()]; 69 69 70 WKRetainPtr<WKURLRef> url (AdoptWK,Util::createURLForResource("simple-tall", "html"));70 WKRetainPtr<WKURLRef> url = adoptWK(Util::createURLForResource("simple-tall", "html")); 71 71 WKPageLoadURL(webView.page(), url.get()); 72 72 Util::run(&didFinishLoad); -
trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm
r238348 r244390 121 121 WKPageSetPageUIClient(wkView.pageRef, &uiClient.base); 122 122 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())); 125 125 WKPreferencesSetFullScreenEnabled(customPreferences.get(), true); 126 126 WKPageGroupSetPreferences(WKPageGetPageGroup(wkView.pageRef), customPreferences.get()); -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
r239719 r244390 63 63 { 64 64 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())); 66 66 return JSValueMakeString(context, toJS(wkTitle).get()); 67 67 } … … 194 194 WKMutableDictionaryRef EventSenderMessageBody = WKMutableDictionaryCreate(); 195 195 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")); 198 198 WKDictionarySetItem(EventSenderMessageBody, subMessageKey.get(), subMessageName.get()); 199 199 … … 217 217 WKEventModifiers modifiers = parseModifierArray(context, modifierArray); 218 218 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)); 221 221 222 222 WKBundlePagePostSynchronousMessageForTesting(page, EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); … … 230 230 WKEventModifiers modifiers = parseModifierArray(context, modifierArray); 231 231 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)); 234 234 235 235 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); … … 238 238 void EventSendingController::mouseMoveTo(int x, int y) 239 239 { 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)); 249 249 WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 250 250 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)); 253 253 WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 254 254 … … 260 260 void EventSendingController::mouseForceClick() 261 261 { 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")); 267 267 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 268 268 … … 272 272 void EventSendingController::startAndCancelMouseForceClick() 273 273 { 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")); 279 279 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 280 280 … … 284 284 void EventSendingController::mouseForceDown() 285 285 { 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")); 291 291 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 292 292 … … 296 296 void EventSendingController::mouseForceUp() 297 297 { 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")); 303 303 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 304 304 … … 308 308 void EventSendingController::mouseForceChanged(double force) 309 309 { 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)); 319 319 WKDictionarySetItem(EventSenderMessageBody.get(), forceKey.get(), forceRef.get()); 320 320 … … 324 324 void EventSendingController::leapForward(int milliseconds) 325 325 { 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)); 335 335 WKDictionarySetItem(EventSenderMessageBody.get(), timeKey.get(), timeRef.get()); 336 336 … … 343 343 int button = 0; 344 344 345 WKRetainPtr<WKStringRef> EventSenderMessageName (AdoptWK,WKStringCreateWithUTF8CString("EventSender"));345 WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender")); 346 346 347 347 // Asynchronous mouse down. 348 WKRetainPtr<WKMutableDictionaryRef> mouseDownMessageBody (AdoptWK,createMouseMessageBody(MouseDown, button, modifiers));348 WKRetainPtr<WKMutableDictionaryRef> mouseDownMessageBody = adoptWK(createMouseMessageBody(MouseDown, button, modifiers)); 349 349 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), mouseDownMessageBody.get()); 350 350 351 351 // Asynchronous mouse up. 352 WKRetainPtr<WKMutableDictionaryRef> mouseUpMessageBody (AdoptWK,createMouseMessageBody(MouseUp, button, modifiers));352 WKRetainPtr<WKMutableDictionaryRef> mouseUpMessageBody = adoptWK(createMouseMessageBody(MouseUp, button, modifiers)); 353 353 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), mouseUpMessageBody.get()); 354 354 } … … 356 356 static WKRetainPtr<WKMutableDictionaryRef> createKeyDownMessageBody(JSStringRef key, WKEventModifiers modifiers, int location) 357 357 { 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")); 365 365 WKDictionarySetItem(EventSenderMessageBody.get(), keyKey.get(), toWK(key).get()); 366 366 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)); 369 369 WKDictionarySetItem(EventSenderMessageBody.get(), modifiersKey.get(), modifiersRef.get()); 370 370 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)); 373 373 WKDictionarySetItem(EventSenderMessageBody.get(), locationKey.get(), locationRef.get()); 374 374 … … 383 383 WKEventModifiers modifiers = parseModifierArray(context, modifierArray); 384 384 385 WKRetainPtr<WKStringRef> EventSenderMessageName (AdoptWK,WKStringCreateWithUTF8CString("EventSender"));385 WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender")); 386 386 WKRetainPtr<WKMutableDictionaryRef> keyDownMessageBody = createKeyDownMessageBody(key, modifiers, location); 387 387 … … 391 391 void EventSendingController::scheduleAsynchronousKeyDown(JSStringRef key) 392 392 { 393 WKRetainPtr<WKStringRef> EventSenderMessageName (AdoptWK,WKStringCreateWithUTF8CString("EventSender"));393 WKRetainPtr<WKStringRef> EventSenderMessageName = adoptWK(WKStringCreateWithUTF8CString("EventSender")); 394 394 WKRetainPtr<WKMutableDictionaryRef> keyDownMessageBody = createKeyDownMessageBody(key, 0 /* modifiers */, 0 /* location */); 395 395 … … 399 399 void EventSendingController::mouseScrollBy(int x, int y) 400 400 { 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)); 410 410 WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 411 411 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)); 414 414 WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 415 415 … … 454 454 void EventSendingController::mouseScrollByWithWheelAndMomentumPhases(int x, int y, JSStringRef phaseStr, JSStringRef momentumStr) 455 455 { 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()); 458 458 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")); 461 461 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 462 462 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)); 465 465 WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 466 466 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)); 469 469 WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 470 470 … … 472 472 uint64_t momentum = cgEventMomentumPhaseFromString(momentumStr); 473 473 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)); 476 476 WKDictionarySetItem(EventSenderMessageBody.get(), phaseKey.get(), phaseRef.get()); 477 477 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)); 480 480 WKDictionarySetItem(EventSenderMessageBody.get(), momentumKey.get(), momentumRef.get()); 481 481 … … 486 486 void EventSendingController::continuousMouseScrollBy(int x, int y, bool paged) 487 487 { 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)); 497 497 WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 498 498 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)); 501 501 WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 502 502 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)); 505 505 WKDictionarySetItem(EventSenderMessageBody.get(), pagedKey.get(), pagedRef.get()); 506 506 … … 638 638 void EventSendingController::addTouchPoint(int x, int y) 639 639 { 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)); 649 649 WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 650 650 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)); 653 653 WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 654 654 … … 658 658 void EventSendingController::updateTouchPoint(int index, int x, int y) 659 659 { 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)); 669 669 WKDictionarySetItem(EventSenderMessageBody.get(), indexKey.get(), indexRef.get()); 670 670 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)); 673 673 WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 674 674 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)); 677 677 WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 678 678 … … 682 682 void EventSendingController::setTouchModifier(const JSStringRef &modifier, bool enable) 683 683 { 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")); 689 689 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 690 690 … … 699 699 mod = kWKEventModifiersMetaKey; 700 700 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)); 703 703 WKDictionarySetItem(EventSenderMessageBody.get(), modifierKey.get(), modifierRef.get()); 704 704 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)); 707 707 WKDictionarySetItem(EventSenderMessageBody.get(), enableKey.get(), enableRef.get()); 708 708 … … 713 713 void EventSendingController::setTouchPointRadius(int radiusX, int radiusY) 714 714 { 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)); 724 724 WKDictionarySetItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 725 725 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)); 728 728 WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 729 729 … … 733 733 void EventSendingController::touchStart() 734 734 { 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")); 740 740 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 741 741 … … 745 745 void EventSendingController::touchMove() 746 746 { 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")); 752 752 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 753 753 … … 757 757 void EventSendingController::touchEnd() 758 758 { 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")); 764 764 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 765 765 … … 769 769 void EventSendingController::touchCancel() 770 770 { 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")); 776 776 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 777 777 … … 781 781 void EventSendingController::clearTouchPoints() 782 782 { 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")); 788 788 WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 789 789 … … 793 793 void EventSendingController::releaseTouchPoint(int index) 794 794 { 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)); 804 804 WKDictionarySetItem(EventSenderMessageBody.get(), indexKey.get(), indexRef.get()); 805 805 … … 809 809 void EventSendingController::cancelTouchPoint(int index) 810 810 { 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)); 820 820 WKDictionarySetItem(EventSenderMessageBody.get(), indexKey.get(), indexRef.get()); 821 821 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r244370 r244390 119 119 return; 120 120 121 WKRetainPtr<WKStringRef> messsageName (AdoptWK,WKStringCreateWithUTF8CString("Initialization"));121 WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("Initialization")); 122 122 WKTypeRef result = nullptr; 123 123 WKBundlePostSynchronousMessage(m_bundle, messsageName.get(), nullptr, &result); 124 124 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")); 128 128 WKTypeRef resumeTestingValue = WKDictionaryGetItemForKey(initializationDictionary.get(), resumeTestingKey.get()); 129 129 ASSERT(WKGetTypeID(resumeTestingValue) == WKBooleanGetTypeID()); … … 176 176 void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody) 177 177 { 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")); 180 180 WKBundlePostMessage(m_bundle, errorMessageName.get(), errorMessageBody.get()); 181 181 } … … 206 206 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 207 207 208 WKRetainPtr<WKStringRef> dumpPixelsKey (AdoptWK,WKStringCreateWithUTF8CString("DumpPixels"));208 WKRetainPtr<WKStringRef> dumpPixelsKey = adoptWK(WKStringCreateWithUTF8CString("DumpPixels")); 209 209 m_dumpPixels = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dumpPixelsKey.get()))); 210 210 211 WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey (AdoptWK,WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer"));211 WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey = adoptWK(WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer")); 212 212 m_useWaitToDumpWatchdogTimer = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, useWaitToDumpWatchdogTimerKey.get()))); 213 213 214 WKRetainPtr<WKStringRef> timeoutKey (AdoptWK,WKStringCreateWithUTF8CString("Timeout"));214 WKRetainPtr<WKStringRef> timeoutKey = adoptWK(WKStringCreateWithUTF8CString("Timeout")); 215 215 m_timeout = Seconds::fromMilliseconds(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, timeoutKey.get())))); 216 216 217 WKRetainPtr<WKStringRef> dumpJSConsoleLogInStdErrKey (AdoptWK,WKStringCreateWithUTF8CString("DumpJSConsoleLogInStdErr"));217 WKRetainPtr<WKStringRef> dumpJSConsoleLogInStdErrKey = adoptWK(WKStringCreateWithUTF8CString("DumpJSConsoleLogInStdErr")); 218 218 m_dumpJSConsoleLogInStdErr = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dumpJSConsoleLogInStdErrKey.get()))); 219 219 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")); 222 222 WKBundlePagePostMessage(page, ackMessageName.get(), ackMessageBody.get()); 223 223 … … 230 230 ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); 231 231 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 232 WKRetainPtr<WKStringRef> jscOptionsKey (AdoptWK,WKStringCreateWithUTF8CString("JSCOptions"));232 WKRetainPtr<WKStringRef> jscOptionsKey = adoptWK(WKStringCreateWithUTF8CString("JSCOptions")); 233 233 WKRetainPtr<WKStringRef> jscOptionsString = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, jscOptionsKey.get())); 234 234 if (jscOptionsString) { … … 237 237 } 238 238 239 WKRetainPtr<WKStringRef> shouldGCKey (AdoptWK,WKStringCreateWithUTF8CString("ShouldGC"));239 WKRetainPtr<WKStringRef> shouldGCKey = adoptWK(WKStringCreateWithUTF8CString("ShouldGC")); 240 240 bool shouldGC = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, shouldGCKey.get()))); 241 241 if (shouldGC) 242 242 WKBundleGarbageCollectJavaScriptObjects(m_bundle); 243 243 244 WKRetainPtr<WKStringRef> allowedHostsKey (AdoptWK,WKStringCreateWithUTF8CString("AllowedHosts"));244 WKRetainPtr<WKStringRef> allowedHostsKey = adoptWK(WKStringCreateWithUTF8CString("AllowedHosts")); 245 245 WKTypeRef allowedHostsValue = WKDictionaryGetItemForKey(messageBodyDictionary, allowedHostsKey.get()); 246 246 if (allowedHostsValue && WKGetTypeID(allowedHostsValue) == WKArrayGetTypeID()) { … … 399 399 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 400 400 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")); 403 403 404 404 unsigned callbackID = (unsigned)WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, callbackIDKey.get()))); … … 430 430 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 431 431 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")); 435 435 436 436 unsigned totalPrevalentResources = (unsigned)WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, totalPrevalentResourcesKey.get()))); … … 452 452 } 453 453 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")); 456 456 WKBundlePagePostMessage(page, errorMessageName.get(), errorMessageBody.get()); 457 457 } … … 459 459 bool InjectedBundle::booleanForKey(WKDictionaryRef dictionary, const char* key) 460 460 { 461 WKRetainPtr<WKStringRef> wkKey (AdoptWK,WKStringCreateWithUTF8CString(key));461 WKRetainPtr<WKStringRef> wkKey = adoptWK(WKStringCreateWithUTF8CString(key)); 462 462 WKTypeRef value = WKDictionaryGetItemForKey(dictionary, wkKey.get()); 463 463 if (WKGetTypeID(value) != WKBooleanGetTypeID()) { … … 550 550 #endif 551 551 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()); 554 554 555 555 WKRetainPtr<WKStringRef> pixelResultIsPendingKey = adoptWK(WKStringCreateWithUTF8CString("PixelResultIsPending")); 556 WKRetainPtr<WKBooleanRef> pixelResultIsPending (AdoptWK,WKBooleanCreate(m_pixelResultIsPending));556 WKRetainPtr<WKBooleanRef> pixelResultIsPending = adoptWK(WKBooleanCreate(m_pixelResultIsPending)); 557 557 WKDictionarySetItem(doneMessageBody.get(), pixelResultIsPendingKey.get(), pixelResultIsPending.get()); 558 558 … … 599 599 if (output.isEmpty()) 600 600 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())); 603 603 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 604 604 } … … 610 610 if (output.isEmpty()) 611 611 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())); 614 614 // We use WKBundlePagePostMessageIgnoringFullySynchronousMode() instead of WKBundlePagePostMessage() to make sure that all text output 615 615 // is done via asynchronous IPC, even if the connection is in fully synchronous mode due to a WKBundlePagePostSynchronousMessageForTesting() … … 620 620 void InjectedBundle::postNewBeforeUnloadReturnValue(bool value) 621 621 { 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)); 624 624 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 625 625 } … … 627 627 void InjectedBundle::postAddChromeInputField() 628 628 { 629 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("AddChromeInputField"));629 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("AddChromeInputField")); 630 630 WKBundlePagePostMessage(page()->page(), messageName.get(), 0); 631 631 } … … 633 633 void InjectedBundle::postRemoveChromeInputField() 634 634 { 635 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("RemoveChromeInputField"));635 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("RemoveChromeInputField")); 636 636 WKBundlePagePostMessage(page()->page(), messageName.get(), 0); 637 637 } … … 639 639 void InjectedBundle::postFocusWebView() 640 640 { 641 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("FocusWebView"));641 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("FocusWebView")); 642 642 WKBundlePagePostMessage(page()->page(), messageName.get(), 0); 643 643 } … … 645 645 void InjectedBundle::postSetBackingScaleFactor(double backingScaleFactor) 646 646 { 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)); 649 649 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 650 650 } … … 652 652 void InjectedBundle::postSetWindowIsKey(bool isKey) 653 653 { 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)); 656 656 WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), messageBody.get(), 0); 657 657 } … … 659 659 void InjectedBundle::postSetViewSize(double width, double height) 660 660 { 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)); 669 669 WKDictionarySetItem(messageBody.get(), widthKey.get(), widthWK.get()); 670 670 671 WKRetainPtr<WKDoubleRef> heightWK (AdoptWK,WKDoubleCreate(height));671 WKRetainPtr<WKDoubleRef> heightWK = adoptWK(WKDoubleCreate(height)); 672 672 WKDictionarySetItem(messageBody.get(), heightKey.get(), heightWK.get()); 673 673 … … 677 677 void InjectedBundle::postSimulateWebNotificationClick(uint64_t notificationID) 678 678 { 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)); 681 681 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 682 682 } … … 684 684 void InjectedBundle::postSetAddsVisitedLinks(bool addsVisitedLinks) 685 685 { 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)); 688 688 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 689 689 } … … 691 691 void InjectedBundle::setGeolocationPermission(bool enabled) 692 692 { 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)); 695 695 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 696 696 } … … 698 698 void 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) 699 699 { 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)); 706 706 WKDictionarySetItem(messageBody.get(), latitudeKeyWK.get(), latitudeWK.get()); 707 707 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)); 710 710 WKDictionarySetItem(messageBody.get(), longitudeKeyWK.get(), longitudeWK.get()); 711 711 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)); 714 714 WKDictionarySetItem(messageBody.get(), accuracyKeyWK.get(), accuracyWK.get()); 715 715 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)); 718 718 WKDictionarySetItem(messageBody.get(), providesAltitudeKeyWK.get(), providesAltitudeWK.get()); 719 719 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)); 722 722 WKDictionarySetItem(messageBody.get(), altitudeKeyWK.get(), altitudeWK.get()); 723 723 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)); 726 726 WKDictionarySetItem(messageBody.get(), providesAltitudeAccuracyKeyWK.get(), providesAltitudeAccuracyWK.get()); 727 727 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)); 730 730 WKDictionarySetItem(messageBody.get(), altitudeAccuracyKeyWK.get(), altitudeAccuracyWK.get()); 731 731 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)); 734 734 WKDictionarySetItem(messageBody.get(), providesHeadingKeyWK.get(), providesHeadingWK.get()); 735 735 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)); 738 738 WKDictionarySetItem(messageBody.get(), headingKeyWK.get(), headingWK.get()); 739 739 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)); 742 742 WKDictionarySetItem(messageBody.get(), providesSpeedKeyWK.get(), providesSpeedWK.get()); 743 743 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)); 746 746 WKDictionarySetItem(messageBody.get(), speedKeyWK.get(), speedWK.get()); 747 747 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)); 750 750 WKDictionarySetItem(messageBody.get(), providesFloorLevelKeyWK.get(), providesFloorLevelWK.get()); 751 751 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)); 754 754 WKDictionarySetItem(messageBody.get(), floorLevelKeyWK.get(), floorLevelWK.get()); 755 755 … … 759 759 void InjectedBundle::setMockGeolocationPositionUnavailableError(WKStringRef errorMessage) 760 760 { 761 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("SetMockGeolocationPositionUnavailableError"));761 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetMockGeolocationPositionUnavailableError")); 762 762 WKBundlePagePostMessage(page()->page(), messageName.get(), errorMessage); 763 763 } … … 765 765 bool InjectedBundle::isGeolocationProviderActive() const 766 766 { 767 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("IsGeolocationClientActive"));767 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsGeolocationClientActive")); 768 768 WKTypeRef resultToPass = 0; 769 769 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)); 771 771 772 772 return WKBooleanGetValue(isActive.get()); … … 775 775 unsigned InjectedBundle::imageCountInGeneralPasteboard() const 776 776 { 777 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("ImageCountInGeneralPasteboard"));777 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ImageCountInGeneralPasteboard")); 778 778 WKTypeRef resultToPass = 0; 779 779 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)); 781 781 782 782 return static_cast<unsigned>(WKUInt64GetValue(imageCount.get())); … … 799 799 { 800 800 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)); 805 805 WKDictionarySetItem(messageBody.get(), permissionKeyWK.get(), permissionWK.get()); 806 806 807 WKRetainPtr<WKStringRef> originKeyWK (AdoptWK,WKStringCreateWithUTF8CString("origin"));807 WKRetainPtr<WKStringRef> originKeyWK = adoptWK(WKStringCreateWithUTF8CString("origin")); 808 808 WKDictionarySetItem(messageBody.get(), originKeyWK.get(), origin); 809 809 810 WKRetainPtr<WKStringRef> parentOriginKeyWK (AdoptWK,WKStringCreateWithUTF8CString("parentOrigin"));810 WKRetainPtr<WKStringRef> parentOriginKeyWK = adoptWK(WKStringCreateWithUTF8CString("parentOrigin")); 811 811 WKDictionarySetItem(messageBody.get(), parentOriginKeyWK.get(), parentOrigin); 812 812 … … 816 816 unsigned InjectedBundle::userMediaPermissionRequestCountForOrigin(WKStringRef origin, WKStringRef parentOrigin) const 817 817 { 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")); 822 822 WKDictionarySetItem(messageBody.get(), originKeyWK.get(), origin); 823 823 824 WKRetainPtr<WKStringRef> parentOriginKeyWK (AdoptWK,WKStringCreateWithUTF8CString("parentOrigin"));824 WKRetainPtr<WKStringRef> parentOriginKeyWK = adoptWK(WKStringCreateWithUTF8CString("parentOrigin")); 825 825 WKDictionarySetItem(messageBody.get(), parentOriginKeyWK.get(), parentOrigin); 826 826 827 827 WKTypeRef resultToPass = 0; 828 828 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)); 830 830 831 831 return static_cast<unsigned>(WKUInt64GetValue(count.get())); … … 834 834 void InjectedBundle::resetUserMediaPermissionRequestCountForOrigin(WKStringRef origin, WKStringRef parentOrigin) 835 835 { 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")); 840 840 WKDictionarySetItem(messageBody.get(), originKeyWK.get(), origin); 841 841 842 WKRetainPtr<WKStringRef> parentOriginKeyWK (AdoptWK,WKStringCreateWithUTF8CString("parentOrigin"));842 WKRetainPtr<WKStringRef> parentOriginKeyWK = adoptWK(WKStringCreateWithUTF8CString("parentOrigin")); 843 843 WKDictionarySetItem(messageBody.get(), parentOriginKeyWK.get(), parentOrigin); 844 844 … … 848 848 void InjectedBundle::setCustomPolicyDelegate(bool enabled, bool permissive) 849 849 { 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)); 856 856 WKDictionarySetItem(messageBody.get(), enabledKeyWK.get(), enabledWK.get()); 857 857 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)); 860 860 WKDictionarySetItem(messageBody.get(), permissiveKeyWK.get(), permissiveWK.get()); 861 861 … … 865 865 void InjectedBundle::setHidden(bool hidden) 866 866 { 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)); 872 872 WKDictionarySetItem(messageBody.get(), isInitialKeyWK.get(), isInitialWK.get()); 873 873 … … 877 877 void InjectedBundle::setCacheModel(int model) 878 878 { 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)); 881 881 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 882 882 } … … 887 887 return false; 888 888 889 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("IsWorkQueueEmpty"));889 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsWorkQueueEmpty")); 890 890 WKTypeRef resultToPass = 0; 891 891 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)); 893 893 894 894 // The IPC failed. This happens when swapping processes on navigation because the WebPageProxy unregisters itself … … 902 902 void InjectedBundle::processWorkQueue() 903 903 { 904 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("ProcessWorkQueue"));904 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ProcessWorkQueue")); 905 905 WKBundlePagePostMessage(page()->page(), messageName.get(), 0); 906 906 } … … 910 910 m_useWorkQueue = true; 911 911 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)); 914 914 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 915 915 } … … 919 919 m_useWorkQueue = true; 920 920 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)); 923 923 WKBundlePagePostMessage(page()->page(), messageName.get(), messageBody.get()); 924 924 } … … 928 928 m_useWorkQueue = true; 929 929 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")); 935 935 WKDictionarySetItem(loadData.get(), urlKey.get(), url); 936 936 937 WKRetainPtr<WKStringRef> targetKey (AdoptWK,WKStringCreateWithUTF8CString("target"));937 WKRetainPtr<WKStringRef> targetKey = adoptWK(WKStringCreateWithUTF8CString("target")); 938 938 WKDictionarySetItem(loadData.get(), targetKey.get(), target); 939 939 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)); 942 942 WKDictionarySetItem(loadData.get(), shouldOpenExternalURLsKey.get(), shouldOpenExternalURLsValue.get()); 943 943 … … 949 949 m_useWorkQueue = true; 950 950 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")); 956 956 WKDictionarySetItem(loadData.get(), contentKey.get(), content); 957 957 958 958 if (baseURL) { 959 WKRetainPtr<WKStringRef> baseURLKey (AdoptWK,WKStringCreateWithUTF8CString("baseURL"));959 WKRetainPtr<WKStringRef> baseURLKey = adoptWK(WKStringCreateWithUTF8CString("baseURL")); 960 960 WKDictionarySetItem(loadData.get(), baseURLKey.get(), baseURL); 961 961 } 962 962 963 963 if (unreachableURL) { 964 WKRetainPtr<WKStringRef> unreachableURLKey (AdoptWK,WKStringCreateWithUTF8CString("unreachableURL"));964 WKRetainPtr<WKStringRef> unreachableURLKey = adoptWK(WKStringCreateWithUTF8CString("unreachableURL")); 965 965 WKDictionarySetItem(loadData.get(), unreachableURLKey.get(), unreachableURL); 966 966 } … … 973 973 m_useWorkQueue = true; 974 974 975 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("QueueReload"));975 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueReload")); 976 976 WKBundlePagePostMessage(page()->page(), messageName.get(), 0); 977 977 } … … 981 981 m_useWorkQueue = true; 982 982 983 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("QueueLoadingScript"));983 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueLoadingScript")); 984 984 WKBundlePagePostMessage(page()->page(), messageName.get(), script); 985 985 } … … 989 989 m_useWorkQueue = true; 990 990 991 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("QueueNonLoadingScript"));991 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("QueueNonLoadingScript")); 992 992 WKBundlePagePostMessage(page()->page(), messageName.get(), script); 993 993 } -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r241749 r244390 200 200 static WTF::String frameToStr(WKBundleFrameRef frame) 201 201 { 202 WKRetainPtr<WKStringRef> name (AdoptWK,WKBundleFrameCopyName(frame));202 WKRetainPtr<WKStringRef> name = adoptWK(WKBundleFrameCopyName(frame)); 203 203 StringBuilder stringBuilder; 204 204 if (WKBundleFrameIsMainFrame(frame)) { … … 268 268 InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page) 269 269 : m_page(page) 270 , m_world( AdoptWK, WKBundleScriptWorldCreateWorld())270 , m_world(adoptWK(WKBundleScriptWorldCreateWorld())) 271 271 { 272 272 WKBundlePageLoaderClientV9 loaderClient = { … … 452 452 static void dumpFrameDescriptionSuitableForTestResult(WKBundleFrameRef frame, StringBuilder& stringBuilder) 453 453 { 454 WKRetainPtr<WKStringRef> name (AdoptWK,WKBundleFrameCopyName(frame));454 WKRetainPtr<WKStringRef> name = adoptWK(WKBundleFrameCopyName(frame)); 455 455 if (WKBundleFrameIsMainFrame(frame)) { 456 456 if (WKStringIsEmpty(name.get())) { … … 781 781 782 782 if (shouldIncludeFrameName) { 783 WKRetainPtr<WKStringRef> name (AdoptWK,WKBundleFrameCopyName(frame));783 WKRetainPtr<WKStringRef> name = adoptWK(WKBundleFrameCopyName(frame)); 784 784 stringBuilder.appendLiteral("frame '"); 785 785 stringBuilder.append(toWTFString(name)); … … 795 795 static void dumpDescendantFrameScrollPositions(WKBundleFrameRef frame, StringBuilder& stringBuilder) 796 796 { 797 WKRetainPtr<WKArrayRef> childFrames (AdoptWK,WKBundleFrameCopyChildFrames(frame));797 WKRetainPtr<WKArrayRef> childFrames = adoptWK(WKBundleFrameCopyChildFrames(frame)); 798 798 size_t size = WKArrayGetSize(childFrames.get()); 799 799 for (size_t i = 0; i < size; ++i) { … … 843 843 return; 844 844 845 WKRetainPtr<WKStringRef> text (AdoptWK,WKBundleFrameCopyInnerText(frame));845 WKRetainPtr<WKStringRef> text = adoptWK(WKBundleFrameCopyInnerText(frame)); 846 846 stringBuilder.append(toWTFString(text)); 847 847 stringBuilder.append('\n'); … … 850 850 static void dumpDescendantFramesText(WKBundleFrameRef frame, StringBuilder& stringBuilder) 851 851 { 852 WKRetainPtr<WKArrayRef> childFrames (AdoptWK,WKBundleFrameCopyChildFrames(frame));852 WKRetainPtr<WKArrayRef> childFrames = adoptWK(WKBundleFrameCopyChildFrames(frame)); 853 853 size_t size = WKArrayGetSize(childFrames.get()); 854 854 for (size_t i = 0; i < size; ++i) { 855 855 WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(WKArrayGetItemAtIndex(childFrames.get(), i)); 856 WKRetainPtr<WKStringRef> subframeName (AdoptWK,WKBundleFrameCopyName(subframe));856 WKRetainPtr<WKStringRef> subframeName = adoptWK(WKBundleFrameCopyName(subframe)); 857 857 858 858 // DumpRenderTree ignores empty frames, so do the same thing here. -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r244370 r244390 129 129 bool TestRunner::shouldDumpPixels() const 130 130 { 131 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("GetDumpPixels"));131 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetDumpPixels")); 132 132 WKTypeRef returnData = nullptr; 133 133 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, &returnData); … … 138 138 void TestRunner::setDumpPixels(bool dumpPixels) 139 139 { 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)); 142 142 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 143 143 } … … 152 152 WhatToDump TestRunner::whatToDump() const 153 153 { 154 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("GetWhatToDump"));154 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetWhatToDump")); 155 155 WKTypeRef returnData = nullptr; 156 156 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, &returnData); … … 161 161 void TestRunner::setWhatToDump(WhatToDump whatToDump) 162 162 { 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))); 165 165 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 166 166 } … … 199 199 void TestRunner::setWaitUntilDone(bool value) 200 200 { 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)); 203 203 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), messageBody.get(), nullptr); 204 204 } … … 206 206 bool TestRunner::shouldWaitUntilDone() const 207 207 { 208 WKRetainPtr<WKStringRef> messsageName (AdoptWK,WKStringCreateWithUTF8CString("GetWaitUntilDone"));208 WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("GetWaitUntilDone")); 209 209 WKTypeRef returnData = nullptr; 210 210 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), nullptr, &returnData); … … 256 256 void TestRunner::setShouldDumpFrameLoadCallbacks(bool value) 257 257 { 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)); 260 260 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), messageBody.get(), nullptr); 261 261 } … … 263 263 bool TestRunner::shouldDumpFrameLoadCallbacks() 264 264 { 265 WKRetainPtr<WKStringRef> messsageName (AdoptWK,WKStringCreateWithUTF8CString("GetDumpFrameLoadCallbacks"));265 WKRetainPtr<WKStringRef> messsageName = adoptWK(WKStringCreateWithUTF8CString("GetDumpFrameLoadCallbacks")); 266 266 WKTypeRef returnData = nullptr; 267 267 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), nullptr, &returnData); … … 381 381 WKBundleClearAllDatabases(InjectedBundle::singleton().bundle()); 382 382 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)); 385 385 386 386 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 419 419 void TestRunner::setIDBPerOriginQuota(uint64_t quota) 420 420 { 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)); 423 423 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 424 424 } … … 443 443 WKBundlePageRef page = InjectedBundle::singleton().page()->page(); 444 444 445 WKRetainPtr<WKArrayRef> origins (AdoptWK,WKBundlePageCopyOriginsWithApplicationCache(page));445 WKRetainPtr<WKArrayRef> origins = adoptWK(WKBundlePageCopyOriginsWithApplicationCache(page)); 446 446 447 447 WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(page); … … 458 458 void TestRunner::setCanOpenWindows() 459 459 { 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)); 462 462 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), messageBody.get(), nullptr); 463 463 } … … 465 465 void TestRunner::setXSSAuditorEnabled(bool enabled) 466 466 { 467 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitXSSAuditorEnabled"));467 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitXSSAuditorEnabled")); 468 468 auto& injectedBundle = InjectedBundle::singleton(); 469 469 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 472 472 void TestRunner::setMediaDevicesEnabled(bool enabled) 473 473 { 474 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitMediaDevicesEnabled"));474 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitMediaDevicesEnabled")); 475 475 auto& injectedBundle = InjectedBundle::singleton(); 476 476 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 479 479 void TestRunner::setWebRTCMDNSICECandidatesEnabled(bool enabled) 480 480 { 481 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitWebRTCMDNSICECandidatesEnabled"));481 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebRTCMDNSICECandidatesEnabled")); 482 482 auto& injectedBundle = InjectedBundle::singleton(); 483 483 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 486 486 void TestRunner::setWebRTCUnifiedPlanEnabled(bool enabled) 487 487 { 488 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitWebRTCUnifiedPlanEnabled"));488 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebRTCUnifiedPlanEnabled")); 489 489 auto& injectedBundle = InjectedBundle::singleton(); 490 490 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 493 493 void TestRunner::setCustomUserAgent(JSStringRef userAgent) 494 494 { 495 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("SetCustomUserAgent"));495 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetCustomUserAgent")); 496 496 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), toWK(userAgent).get(), nullptr); 497 497 } … … 499 499 void TestRunner::setWebAPIStatisticsEnabled(bool enabled) 500 500 { 501 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitWebAPIStatisticsEnabled"));501 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebAPIStatisticsEnabled")); 502 502 auto& injectedBundle = InjectedBundle::singleton(); 503 503 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 506 506 void TestRunner::setModernMediaControlsEnabled(bool enabled) 507 507 { 508 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitModernMediaControlsEnabled"));508 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitModernMediaControlsEnabled")); 509 509 auto& injectedBundle = InjectedBundle::singleton(); 510 510 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 513 513 void TestRunner::setWebGL2Enabled(bool enabled) 514 514 { 515 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitWebGL2Enabled"));515 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebGL2Enabled")); 516 516 auto& injectedBundle = InjectedBundle::singleton(); 517 517 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 520 520 void TestRunner::setWritableStreamAPIEnabled(bool enabled) 521 521 { 522 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitWritableStreamAPIEnabled"));522 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWritableStreamAPIEnabled")); 523 523 auto& injectedBundle = InjectedBundle::singleton(); 524 524 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 527 527 void TestRunner::setReadableByteStreamAPIEnabled(bool enabled) 528 528 { 529 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitReadableByteStreamAPIEnabled"));529 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitReadableByteStreamAPIEnabled")); 530 530 auto& injectedBundle = InjectedBundle::singleton(); 531 531 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 534 534 void TestRunner::setEncryptedMediaAPIEnabled(bool enabled) 535 535 { 536 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitEncryptedMediaAPIEnabled"));536 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitEncryptedMediaAPIEnabled")); 537 537 auto& injectedBundle = InjectedBundle::singleton(); 538 538 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 544 544 injectedBundle.setAllowsAnySSLCertificate(enabled); 545 545 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)); 548 548 WKBundlePagePostSynchronousMessageForTesting(injectedBundle.page()->page(), messageName.get(), messageBody.get(), nullptr); 549 549 } … … 569 569 void TestRunner::setPluginsEnabled(bool enabled) 570 570 { 571 WKRetainPtr<WKStringRef> key (AdoptWK,WKStringCreateWithUTF8CString("WebKitPluginsEnabled"));571 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitPluginsEnabled")); 572 572 auto& injectedBundle = InjectedBundle::singleton(); 573 573 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); … … 630 630 return; 631 631 632 WKRetainPtr<WKBundleNodeHandleRef> nodeHandle (AdoptWK,WKBundleNodeHandleCreate(context, const_cast<JSObjectRef>(element)));632 WKRetainPtr<WKBundleNodeHandleRef> nodeHandle = adoptWK(WKBundleNodeHandleCreate(context, const_cast<JSObjectRef>(element))); 633 633 WKBundleNodeHandleSetHTMLInputElementValueForUser(nodeHandle.get(), toWK(value).get()); 634 634 } … … 638 638 auto& injectedBundle = InjectedBundle::singleton(); 639 639 // 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)); 641 641 injectedBundle.setAudioResult(audioData.get()); 642 642 setWhatToDump(WhatToDump::Audio); … … 737 737 bool TestRunner::didReceiveServerRedirectForProvisionalNavigation() const 738 738 { 739 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("DidReceiveServerRedirectForProvisionalNavigation"));739 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("DidReceiveServerRedirectForProvisionalNavigation")); 740 740 WKTypeRef returnData = nullptr; 741 741 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData); … … 746 746 void TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation() 747 747 { 748 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("ClearDidReceiveServerRedirectForProvisionalNavigation"));748 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ClearDidReceiveServerRedirectForProvisionalNavigation")); 749 749 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr); 750 750 } … … 910 910 void TestRunner::setAlwaysAcceptCookies(bool accept) 911 911 { 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)); 915 915 916 916 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 919 919 void TestRunner::setOnlyAcceptFirstPartyCookies(bool accept) 920 920 { 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)); 924 924 925 925 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 1086 1086 bool TestRunner::isDoingMediaCapture() const 1087 1087 { 1088 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("IsDoingMediaCapture"));1088 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("IsDoingMediaCapture")); 1089 1089 WKTypeRef returnData = nullptr; 1090 1090 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData); … … 1133 1133 { 1134 1134 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())); 1138 1138 1139 1139 injectedBundle.queueLoad(urlStringWK.get(), toWK(target).get(), shouldOpenExternalURLs); … … 1168 1168 void TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value) 1169 1169 { 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)); 1172 1172 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1173 1173 } … … 1175 1175 void TestRunner::setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) 1176 1176 { 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)); 1179 1179 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1180 1180 } … … 1182 1182 void TestRunner::setShouldLogCanAuthenticateAgainstProtectionSpace(bool value) 1183 1183 { 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)); 1186 1186 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1187 1187 } … … 1189 1189 void TestRunner::setShouldLogDownloadCallbacks(bool value) 1190 1190 { 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)); 1193 1193 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1194 1194 } … … 1196 1196 void TestRunner::setAuthenticationUsername(JSStringRef username) 1197 1197 { 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)); 1200 1200 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1201 1201 } … … 1203 1203 void TestRunner::setAuthenticationPassword(JSStringRef password) 1204 1204 { 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)); 1207 1207 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1208 1208 } … … 1210 1210 bool TestRunner::secureEventInputIsEnabled() const 1211 1211 { 1212 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("SecureEventInputIsEnabled"));1212 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SecureEventInputIsEnabled")); 1213 1213 WKTypeRef returnData = nullptr; 1214 1214 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData); … … 1219 1219 void TestRunner::setBlockAllPlugins(bool shouldBlock) 1220 1220 { 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)); 1223 1223 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1224 1224 } … … 1226 1226 void TestRunner::setPluginSupportedMode(JSStringRef mode) 1227 1227 { 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)); 1230 1230 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1231 1231 } … … 1255 1255 { 1256 1256 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)); 1259 1259 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1260 1260 } … … 1263 1263 { 1264 1264 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)); 1267 1267 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1268 1268 } … … 1270 1270 void TestRunner::setNavigationGesturesEnabled(bool value) 1271 1271 { 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)); 1274 1274 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1275 1275 } … … 1277 1277 void TestRunner::setIgnoresViewportScaleLimits(bool value) 1278 1278 { 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)); 1281 1281 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1282 1282 } … … 1284 1284 void TestRunner::setShouldDownloadUndisplayableMIMETypes(bool value) 1285 1285 { 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)); 1288 1288 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1289 1289 } … … 1291 1291 void TestRunner::setShouldAllowDeviceOrientationAndMotionAccess(bool value) 1292 1292 { 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)); 1295 1295 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); 1296 1296 } … … 1298 1298 void TestRunner::terminateNetworkProcess() 1299 1299 { 1300 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("TerminateNetworkProcess"));1300 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("TerminateNetworkProcess")); 1301 1301 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr); 1302 1302 } … … 1304 1304 void TestRunner::terminateServiceWorkerProcess() 1305 1305 { 1306 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("TerminateServiceWorkerProcess"));1306 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("TerminateServiceWorkerProcess")); 1307 1307 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr); 1308 1308 } … … 1319 1319 cacheTestRunnerCallback(callbackID, callback); 1320 1320 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")); 1329 1329 WKRetainPtr<WKUInt64Ref> callbackIDValue = adoptWK(WKUInt64Create(callbackID)); 1330 1330 … … 1346 1346 void TestRunner::setAllowedMenuActions(JSValueRef actions) 1347 1347 { 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()); 1350 1350 1351 1351 auto page = InjectedBundle::singleton().page()->page(); … … 1365 1365 1366 1366 auto actionName = adopt(JSValueToStringCopy(context, value, 0)); 1367 WKRetainPtr<WKStringRef> action (AdoptWK,WKStringCreateWithJSString(actionName.get()));1367 WKRetainPtr<WKStringRef> action = adoptWK(WKStringCreateWithJSString(actionName.get())); 1368 1368 WKArrayAppendItem(messageBody.get(), action.get()); 1369 1369 } … … 1376 1376 cacheTestRunnerCallback(CustomMenuActionCallbackID, callback); 1377 1377 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)); 1383 1383 WKDictionarySetItem(messageBody.get(), nameKey.get(), nameValue.get()); 1384 1384 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)); 1387 1387 WKDictionarySetItem(messageBody.get(), dismissesAutomaticallyKey.get(), dismissesAutomaticallyValue.get()); 1388 1388 … … 1434 1434 cacheTestRunnerCallback(SetStatisticsDebugModeCallbackID, completionHandler); 1435 1435 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)); 1438 1438 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1439 1439 … … 1449 1449 cacheTestRunnerCallback(SetStatisticsPrevalentResourceForDebugModeCallbackID, completionHandler); 1450 1450 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)); 1453 1453 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1454 1454 } … … 1466 1466 Vector<WKRetainPtr<WKTypeRef>> values; 1467 1467 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))); 1473 1473 1474 1474 Vector<WKStringRef> rawKeys(keys.size()); … … 1480 1480 } 1481 1481 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())); 1484 1484 1485 1485 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 1498 1498 Vector<WKRetainPtr<WKTypeRef>> values; 1499 1499 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))); 1505 1505 1506 1506 Vector<WKStringRef> rawKeys; … … 1514 1514 } 1515 1515 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())); 1518 1518 1519 1519 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 1532 1532 Vector<WKRetainPtr<WKTypeRef>> values; 1533 1533 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))); 1539 1539 1540 1540 Vector<WKStringRef> rawKeys; … … 1548 1548 } 1549 1549 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())); 1552 1552 1553 1553 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 1561 1561 void TestRunner::dumpResourceLoadStatistics() 1562 1562 { 1563 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("dumpResourceLoadStatistics"));1563 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("dumpResourceLoadStatistics")); 1564 1564 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr); 1565 1565 } … … 1567 1567 bool TestRunner::isStatisticsPrevalentResource(JSStringRef hostName) 1568 1568 { 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)); 1571 1571 WKTypeRef returnData = nullptr; 1572 1572 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 1577 1577 bool TestRunner::isStatisticsVeryPrevalentResource(JSStringRef hostName) 1578 1578 { 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)); 1581 1581 WKTypeRef returnData = nullptr; 1582 1582 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 1590 1590 Vector<WKRetainPtr<WKTypeRef>> values; 1591 1591 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))); 1597 1597 1598 1598 Vector<WKStringRef> rawKeys(keys.size()); … … 1604 1604 } 1605 1605 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())); 1608 1608 WKTypeRef returnData = nullptr; 1609 1609 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 1617 1617 Vector<WKRetainPtr<WKTypeRef>> values; 1618 1618 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))); 1624 1624 1625 1625 Vector<WKStringRef> rawKeys(keys.size()); … … 1631 1631 } 1632 1632 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())); 1635 1635 WKTypeRef returnData = nullptr; 1636 1636 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 1644 1644 Vector<WKRetainPtr<WKTypeRef>> values; 1645 1645 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))); 1651 1651 1652 1652 Vector<WKStringRef> rawKeys(keys.size()); … … 1658 1658 } 1659 1659 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())); 1662 1662 WKTypeRef returnData = nullptr; 1663 1663 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 1673 1673 Vector<WKRetainPtr<WKTypeRef>> values; 1674 1674 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))); 1680 1680 1681 1681 Vector<WKStringRef> rawKeys; … … 1689 1689 } 1690 1690 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())); 1693 1693 1694 1694 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 1702 1702 bool TestRunner::isStatisticsHasHadUserInteraction(JSStringRef hostName) 1703 1703 { 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)); 1706 1706 WKTypeRef returnData = nullptr; 1707 1707 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 1715 1715 Vector<WKRetainPtr<WKTypeRef>> values; 1716 1716 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))); 1722 1722 1723 1723 Vector<WKStringRef> rawKeys; … … 1731 1731 } 1732 1732 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())); 1735 1735 1736 1736 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 1739 1739 bool TestRunner::isStatisticsGrandfathered(JSStringRef hostName) 1740 1740 { 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)); 1743 1743 WKTypeRef returnData = nullptr; 1744 1744 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 1752 1752 Vector<WKRetainPtr<WKTypeRef>> values; 1753 1753 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))); 1759 1759 1760 1760 Vector<WKStringRef> rawKeys(keys.size()); … … 1766 1766 } 1767 1767 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())); 1770 1770 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1771 1771 } … … 1776 1776 Vector<WKRetainPtr<WKTypeRef>> values; 1777 1777 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))); 1783 1783 1784 1784 Vector<WKStringRef> rawKeys(keys.size()); … … 1790 1790 } 1791 1791 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())); 1794 1794 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1795 1795 } … … 1800 1800 Vector<WKRetainPtr<WKTypeRef>> values; 1801 1801 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))); 1807 1807 1808 1808 Vector<WKStringRef> rawKeys(keys.size()); … … 1814 1814 } 1815 1815 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())); 1818 1818 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1819 1819 } … … 1825 1825 Vector<WKRetainPtr<WKTypeRef>> values; 1826 1826 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))); 1832 1832 1833 1833 Vector<WKStringRef> rawKeys(keys.size()); … … 1839 1839 } 1840 1840 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())); 1843 1843 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1844 1844 } … … 1849 1849 Vector<WKRetainPtr<WKTypeRef>> values; 1850 1850 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))); 1856 1856 1857 1857 Vector<WKStringRef> rawKeys(keys.size()); … … 1863 1863 } 1864 1864 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())); 1867 1867 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1868 1868 } … … 1873 1873 Vector<WKRetainPtr<WKTypeRef>> values; 1874 1874 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))); 1880 1880 1881 1881 Vector<WKStringRef> rawKeys(keys.size()); … … 1887 1887 } 1888 1888 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())); 1891 1891 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1892 1892 } … … 1897 1897 Vector<WKRetainPtr<WKTypeRef>> values; 1898 1898 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))); 1904 1904 1905 1905 Vector<WKStringRef> rawKeys(keys.size()); … … 1911 1911 } 1912 1912 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())); 1915 1915 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1916 1916 } … … 1918 1918 void TestRunner::setStatisticsTimeToLiveUserInteraction(double seconds) 1919 1919 { 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)); 1922 1922 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1923 1923 } … … 1940 1940 1941 1941 // 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)); 1944 1944 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 1945 1945 } … … 1981 1981 void TestRunner::statisticsProcessStatisticsAndDataRecords() 1982 1982 { 1983 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("StatisticsProcessStatisticsAndDataRecords"));1983 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsProcessStatisticsAndDataRecords")); 1984 1984 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 1985 1985 } … … 1989 1989 cacheTestRunnerCallback(StatisticsDidSetBlockCookiesForHostCallbackID, completionHandler); 1990 1990 1991 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("StatisticsUpdateCookieBlocking"));1991 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsUpdateCookieBlocking")); 1992 1992 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 1993 1993 } … … 2000 2000 void TestRunner::statisticsSubmitTelemetry() 2001 2001 { 2002 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("StatisticsSubmitTelemetry"));2002 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsSubmitTelemetry")); 2003 2003 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2004 2004 } … … 2006 2006 void TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool value) 2007 2007 { 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)); 2010 2010 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2011 2011 } … … 2013 2013 void TestRunner::setStatisticsIsRunningTest(bool value) 2014 2014 { 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)); 2017 2017 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2018 2018 } … … 2020 2020 void TestRunner::setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(bool value) 2021 2021 { 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)); 2024 2024 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2025 2025 } … … 2027 2027 void TestRunner::setStatisticsNotifyPagesWhenTelemetryWasCaptured(bool value) 2028 2028 { 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)); 2031 2031 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2032 2032 } … … 2034 2034 void TestRunner::setStatisticsMinimumTimeBetweenDataRecordsRemoval(double seconds) 2035 2035 { 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)); 2038 2038 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2039 2039 } … … 2041 2041 void TestRunner::setStatisticsGrandfatheringTime(double seconds) 2042 2042 { 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)); 2045 2045 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2046 2046 } … … 2048 2048 void TestRunner::setStatisticsMaxStatisticsEntries(unsigned entries) 2049 2049 { 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)); 2052 2052 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2053 2053 } … … 2055 2055 void TestRunner::setStatisticsPruneEntriesDownTo(unsigned entries) 2056 2056 { 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)); 2059 2059 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2060 2060 } … … 2064 2064 cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback); 2065 2065 2066 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStore"));2066 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStore")); 2067 2067 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2068 2068 } … … 2072 2072 cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback); 2073 2073 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)); 2076 2076 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2077 2077 } … … 2081 2081 cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback); 2082 2082 2083 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("StatisticsClearThroughWebsiteDataRemoval"));2083 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsClearThroughWebsiteDataRemoval")); 2084 2084 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2085 2085 } … … 2090 2090 Vector<WKRetainPtr<WKTypeRef>> values; 2091 2091 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))); 2097 2097 2098 2098 Vector<WKStringRef> rawKeys; … … 2106 2106 } 2107 2107 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())); 2110 2110 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2111 2111 } … … 2123 2123 void TestRunner::setStatisticsCacheMaxAgeCap(double seconds) 2124 2124 { 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)); 2127 2127 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2128 2128 } … … 2137 2137 cacheTestRunnerCallback(StatisticsDidResetToConsistentStateCallbackID, completionHandler); 2138 2138 2139 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("StatisticsResetToConsistentState"));2139 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsResetToConsistentState")); 2140 2140 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2141 2141 } … … 2178 2178 void TestRunner::setStorageAccessAPIEnabled(bool enabled) 2179 2179 { 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)); 2183 2183 2184 2184 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2189 2189 cacheTestRunnerCallback(AllStorageAccessEntriesCallbackID, callback); 2190 2190 2191 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("GetAllStorageAccessEntries"));2191 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetAllStorageAccessEntries")); 2192 2192 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2193 2193 } … … 2222 2222 Vector<WKRetainPtr<WKTypeRef>> values; 2223 2223 2224 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("PersistentID") });2224 keys.append(adoptWK(WKStringCreateWithUTF8CString("PersistentID"))); 2225 2225 values.append(toWK(persistentId)); 2226 2226 2227 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("Label") });2227 keys.append(adoptWK(WKStringCreateWithUTF8CString("Label"))); 2228 2228 values.append(toWK(label)); 2229 2229 2230 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("Type") });2231 values.append( { AdoptWK, WKStringCreateWithUTF8CString(type) });2230 keys.append(adoptWK(WKStringCreateWithUTF8CString("Type"))); 2231 values.append(adoptWK(WKStringCreateWithUTF8CString(type))); 2232 2232 2233 2233 Vector<WKStringRef> rawKeys; … … 2241 2241 } 2242 2242 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())); 2245 2245 2246 2246 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2264 2264 void TestRunner::clearMockMediaDevices() 2265 2265 { 2266 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("ClearMockMediaDevices"));2266 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ClearMockMediaDevices")); 2267 2267 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2268 2268 } … … 2270 2270 void TestRunner::removeMockMediaDevice(JSStringRef persistentId) 2271 2271 { 2272 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("RemoveMockMediaDevice"));2272 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("RemoveMockMediaDevice")); 2273 2273 WKRetainPtr<WKTypeRef> messageBody(toWK(persistentId)); 2274 2274 … … 2278 2278 void TestRunner::resetMockMediaDevices() 2279 2279 { 2280 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("ResetMockMediaDevices"));2280 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ResetMockMediaDevices")); 2281 2281 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2282 2282 } … … 2285 2285 void TestRunner::connectMockGamepad(unsigned index) 2286 2286 { 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)); 2289 2289 2290 2290 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2293 2293 void TestRunner::disconnectMockGamepad(unsigned index) 2294 2294 { 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)); 2297 2297 2298 2298 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2304 2304 Vector<WKRetainPtr<WKTypeRef>> values; 2305 2305 2306 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("GamepadID") });2306 keys.append(adoptWK(WKStringCreateWithUTF8CString("GamepadID"))); 2307 2307 values.append(toWK(gamepadID)); 2308 2308 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))); 2317 2317 2318 2318 Vector<WKStringRef> rawKeys; … … 2326 2326 } 2327 2327 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())); 2330 2330 2331 2331 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2337 2337 Vector<WKRetainPtr<WKTypeRef>> values; 2338 2338 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))); 2347 2347 2348 2348 Vector<WKStringRef> rawKeys; … … 2356 2356 } 2357 2357 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())); 2360 2360 2361 2361 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2367 2367 Vector<WKRetainPtr<WKTypeRef>> values; 2368 2368 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))); 2377 2377 2378 2378 Vector<WKStringRef> rawKeys; … … 2386 2386 } 2387 2387 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())); 2390 2390 2391 2391 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2450 2450 cacheTestRunnerCallback(DidRemoveAllSessionCredentialsCallbackID, callback); 2451 2451 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)); 2454 2454 2455 2455 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2463 2463 void TestRunner::clearDOMCache(JSStringRef origin) 2464 2464 { 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)); 2467 2467 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2468 2468 } … … 2470 2470 void TestRunner::clearDOMCaches() 2471 2471 { 2472 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("ClearDOMCaches"));2472 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ClearDOMCaches")); 2473 2473 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2474 2474 } … … 2476 2476 bool TestRunner::hasDOMCache(JSStringRef origin) 2477 2477 { 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)); 2480 2480 WKTypeRef returnData = nullptr; 2481 2481 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 2486 2486 uint64_t TestRunner::domCacheSize(JSStringRef origin) 2487 2487 { 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)); 2490 2490 WKTypeRef returnData = nullptr; 2491 2491 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); … … 2495 2495 void TestRunner::setAllowStorageQuotaIncrease(bool willIncrease) 2496 2496 { 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)); 2499 2499 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2500 2500 } … … 2504 2504 cacheTestRunnerCallback(GetApplicationManifestCallbackID, callback); 2505 2505 2506 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("GetApplicationManifest"));2506 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetApplicationManifest")); 2507 2507 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2508 2508 } … … 2525 2525 void TestRunner::injectUserScript(JSStringRef script) 2526 2526 { 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)); 2529 2529 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), nullptr); 2530 2530 } … … 2532 2532 void TestRunner::sendDisplayConfigurationChangedMessageForTesting() 2533 2533 { 2534 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("SendDisplayConfigurationChangedMessageForTesting"));2534 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SendDisplayConfigurationChangedMessageForTesting")); 2535 2535 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2536 2536 } … … 2555 2555 return; 2556 2556 bool silentFailure = JSValueToBoolean(context, silentFailureValue); 2557 configurationKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("SilentFailure") });2557 configurationKeys.append(adoptWK(WKStringCreateWithUTF8CString("SilentFailure"))); 2558 2558 configurationValues.append(adoptWK(WKBooleanCreate(silentFailure)).get()); 2559 2559 } … … 2580 2580 Vector<WKRetainPtr<WKStringRef>> localKeys; 2581 2581 Vector<WKRetainPtr<WKTypeRef>> localValues; 2582 localKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("AcceptAuthentication") });2582 localKeys.append(adoptWK(WKStringCreateWithUTF8CString("AcceptAuthentication"))); 2583 2583 localValues.append(adoptWK(WKBooleanCreate(acceptAuthentication)).get()); 2584 localKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("AcceptAttestation") });2584 localKeys.append(adoptWK(WKStringCreateWithUTF8CString("AcceptAttestation"))); 2585 2585 localValues.append(adoptWK(WKBooleanCreate(acceptAttestation)).get()); 2586 2586 … … 2601 2601 return; 2602 2602 2603 localKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("PrivateKeyBase64") });2603 localKeys.append(adoptWK(WKStringCreateWithUTF8CString("PrivateKeyBase64"))); 2604 2604 localValues.append(toWK(adopt(JSValueToStringCopy(context, privateKeyBase64Value, 0)).get())); 2605 localKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("UserCertificateBase64") });2605 localKeys.append(adoptWK(WKStringCreateWithUTF8CString("UserCertificateBase64"))); 2606 2606 localValues.append(toWK(adopt(JSValueToStringCopy(context, userCertificateBase64Value, 0)).get())); 2607 localKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("IntermediateCACertificateBase64") });2607 localKeys.append(adoptWK(WKStringCreateWithUTF8CString("IntermediateCACertificateBase64"))); 2608 2608 localValues.append(toWK(adopt(JSValueToStringCopy(context, intermediateCACertificateBase64Value, 0)).get())); 2609 2609 } … … 2618 2618 } 2619 2619 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()))); 2622 2622 } 2623 2623 … … 2646 2646 Vector<WKRetainPtr<WKStringRef>> hidKeys; 2647 2647 Vector<WKRetainPtr<WKTypeRef>> hidValues; 2648 hidKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("Stage") });2648 hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("Stage"))); 2649 2649 hidValues.append(toWK(adopt(JSValueToStringCopy(context, stageValue, 0)).get())); 2650 hidKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("SubStage") });2650 hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("SubStage"))); 2651 2651 hidValues.append(toWK(adopt(JSValueToStringCopy(context, subStageValue, 0)).get())); 2652 hidKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("Error") });2652 hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("Error"))); 2653 2653 hidValues.append(toWK(adopt(JSValueToStringCopy(context, errorValue, 0)).get())); 2654 2654 … … 2674 2674 } 2675 2675 2676 hidKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("PayloadBase64") });2676 hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("PayloadBase64"))); 2677 2677 hidValues.append(payloadBase64s); 2678 2678 } … … 2684 2684 return; 2685 2685 bool isU2f = JSValueToBoolean(context, isU2fValue); 2686 hidKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("IsU2f") });2686 hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("IsU2f"))); 2687 2687 hidValues.append(adoptWK(WKBooleanCreate(isU2f)).get()); 2688 2688 } … … 2694 2694 return; 2695 2695 bool keepAlive = JSValueToBoolean(context, keepAliveValue); 2696 hidKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("KeepAlive") });2696 hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("KeepAlive"))); 2697 2697 hidValues.append(adoptWK(WKBooleanCreate(keepAlive)).get()); 2698 2698 } … … 2704 2704 return; 2705 2705 bool fastDataArrival = JSValueToBoolean(context, fastDataArrivalValue); 2706 hidKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("FastDataArrival") });2706 hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("FastDataArrival"))); 2707 2707 hidValues.append(adoptWK(WKBooleanCreate(fastDataArrival)).get()); 2708 2708 } … … 2714 2714 return; 2715 2715 bool continueAfterErrorData = JSValueToBoolean(context, continueAfterErrorDataValue); 2716 hidKeys.append( { AdoptWK, WKStringCreateWithUTF8CString("ContinueAfterErrorData") });2716 hidKeys.append(adoptWK(WKStringCreateWithUTF8CString("ContinueAfterErrorData"))); 2717 2717 hidValues.append(adoptWK(WKBooleanCreate(continueAfterErrorData)).get()); 2718 2718 } … … 2727 2727 } 2728 2728 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()))); 2731 2731 } 2732 2732 … … 2740 2740 } 2741 2741 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())); 2744 2744 2745 2745 WKBundlePostSynchronousMessage(injectedBundle.bundle(), messageName.get(), messageBody.get(), nullptr); … … 2751 2751 Vector<WKRetainPtr<WKTypeRef>> values; 2752 2752 2753 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("PrivateKey") });2753 keys.append(adoptWK(WKStringCreateWithUTF8CString("PrivateKey"))); 2754 2754 values.append(toWK(privateKeyBase64)); 2755 2755 2756 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("AttrLabel") });2756 keys.append(adoptWK(WKStringCreateWithUTF8CString("AttrLabel"))); 2757 2757 values.append(toWK(attrLabel)); 2758 2758 2759 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("ApplicationTag") });2759 keys.append(adoptWK(WKStringCreateWithUTF8CString("ApplicationTag"))); 2760 2760 values.append(toWK(applicationTagBase64)); 2761 2761 … … 2770 2770 } 2771 2771 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())); 2774 2774 2775 2775 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2778 2778 void TestRunner::cleanUpKeychain(JSStringRef attrLabel) 2779 2779 { 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)); 2782 2782 2783 2783 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); … … 2789 2789 Vector<WKRetainPtr<WKTypeRef>> values; 2790 2790 2791 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("AttrLabel") });2791 keys.append(adoptWK(WKStringCreateWithUTF8CString("AttrLabel"))); 2792 2792 values.append(toWK(attrLabel)); 2793 2793 2794 keys.append( { AdoptWK, WKStringCreateWithUTF8CString("ApplicationTag") });2794 keys.append(adoptWK(WKStringCreateWithUTF8CString("ApplicationTag"))); 2795 2795 values.append(toWK(applicationTagBase64)); 2796 2796 … … 2805 2805 } 2806 2806 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())); 2809 2809 2810 2810 WKTypeRef returnData = nullptr; … … 2816 2816 void TestRunner::setCanHandleHTTPSServerTrustEvaluation(bool canHandle) 2817 2817 { 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)); 2820 2820 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2821 2821 } … … 2823 2823 bool TestRunner::canDoServerTrustEvaluationInNetworkProcess() 2824 2824 { 2825 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("CanDoServerTrustEvaluationInNetworkProcess"));2825 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CanDoServerTrustEvaluationInNetworkProcess")); 2826 2826 WKTypeRef returnData = nullptr; 2827 2827 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData); … … 2832 2832 unsigned long TestRunner::serverTrustEvaluationCallbackCallsCount() 2833 2833 { 2834 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("ServerTrustEvaluationCallbackCallsCount"));2834 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ServerTrustEvaluationCallbackCallsCount")); 2835 2835 WKTypeRef returnData = nullptr; 2836 2836 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData); … … 2841 2841 void TestRunner::setShouldDismissJavaScriptAlertsAsynchronously(bool shouldDismissAsynchronously) 2842 2842 { 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)); 2845 2845 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2846 2846 } … … 2860 2860 void TestRunner::setAdClickAttributionOverrideTimerForTesting(bool value) 2861 2861 { 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)); 2864 2864 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), nullptr); 2865 2865 } … … 2867 2867 void TestRunner::setAdClickAttributionConversionURLForTesting(JSStringRef urlString) 2868 2868 { 2869 WKRetainPtr<WKStringRef> messageName (AdoptWK,WKStringCreateWithUTF8CString("SetAdClickAttributionConversionURLForTesting"));2869 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetAdClickAttributionConversionURLForTesting")); 2870 2870 auto wtfURLString = toWTFString(WKStringCreateWithJSString(urlString)); 2871 WKRetainPtr<WKURLRef> messageBody (AdoptWK,WKURLCreateWithUTF8CString(wtfURLString.utf8().data()));2871 WKRetainPtr<WKURLRef> messageBody = adoptWK(WKURLCreateWithUTF8CString(wtfURLString.utf8().data())); 2872 2872 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), nullptr); 2873 2873 } -
trunk/Tools/WebKitTestRunner/TestController.cpp
r244382 r244390 463 463 #endif 464 464 465 WKRetainPtr<WKStringRef> pageGroupIdentifier (AdoptWK,WKStringCreateWithUTF8CString("WebKitTestRunnerPageGroup"));465 WKRetainPtr<WKStringRef> pageGroupIdentifier = adoptWK(WKStringCreateWithUTF8CString("WebKitTestRunnerPageGroup")); 466 466 m_pageGroup.adopt(WKPageGroupCreateWithIdentifier(pageGroupIdentifier.get())); 467 467 … … 1240 1240 static std::string parseStringTestHeaderValueAsRelativePath(const std::string& value, const std::string& pathOrURL) 1241 1241 { 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())); 1244 1244 return toSTD(adoptWK(WKURLCopyPath(relativeURL.get()))); 1245 1245 } … … 1250 1250 if (filename.empty()) { 1251 1251 // 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())); 1253 1253 filename = testPath(wkURL.get()); 1254 1254 } … … 1616 1616 TestOptions options = testOptionsForTest(command); 1617 1617 1618 WKRetainPtr<WKURLRef> wkURL (AdoptWK,createTestURL(command.pathOrURL.c_str()));1618 WKRetainPtr<WKURLRef> wkURL = adoptWK(createTestURL(command.pathOrURL.c_str())); 1619 1619 m_currentInvocation = std::make_unique<TestInvocation>(wkURL.get(), options); 1620 1620 … … 1760 1760 WKDictionaryRef liveDocumentItem = static_cast<WKDictionaryRef>(item); 1761 1761 1762 WKRetainPtr<WKStringRef> idKey (AdoptWK,WKStringCreateWithUTF8CString("id"));1762 WKRetainPtr<WKStringRef> idKey = adoptWK(WKStringCreateWithUTF8CString("id")); 1763 1763 WKUInt64Ref documentID = static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(liveDocumentItem, idKey.get())); 1764 1764 1765 WKRetainPtr<WKStringRef> urlKey (AdoptWK,WKStringCreateWithUTF8CString("url"));1765 WKRetainPtr<WKStringRef> urlKey = adoptWK(WKStringCreateWithUTF8CString("url")); 1766 1766 WKStringRef documentURL = static_cast<WKStringRef>(WKDictionaryGetItemForKey(liveDocumentItem, urlKey.get())); 1767 1767 … … 1802 1802 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 1803 1803 1804 WKRetainPtr<WKStringRef> subMessageKey (AdoptWK,WKStringCreateWithUTF8CString("SubMessage"));1804 WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage")); 1805 1805 WKStringRef subMessageName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subMessageKey.get())); 1806 1806 … … 1874 1874 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 1875 1875 1876 WKRetainPtr<WKStringRef> subMessageKey (AdoptWK,WKStringCreateWithUTF8CString("SubMessage"));1876 WKRetainPtr<WKStringRef> subMessageKey = adoptWK(WKStringCreateWithUTF8CString("SubMessage")); 1877 1877 WKStringRef subMessageName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subMessageKey.get())); 1878 1878 … … 2257 2257 return; 2258 2258 2259 WKRetainPtr<WKURLRef> wkURL (AdoptWK,WKFrameCopyURL(WKPageGetMainFrame(page)));2259 WKRetainPtr<WKURLRef> wkURL = adoptWK(WKFrameCopyURL(WKPageGetMainFrame(page))); 2260 2260 if (!WKURLIsEqual(wkURL.get(), blankURL())) 2261 2261 return; … … 2301 2301 return; 2302 2302 } 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)); 2306 2306 WKAuthenticationDecisionListenerUseCredential(decisionListener, credential.get()); 2307 2307 } -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r244370 r244390 440 440 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 441 441 442 WKRetainPtr<WKStringRef> latitudeKeyWK (AdoptWK,WKStringCreateWithUTF8CString("latitude"));442 WKRetainPtr<WKStringRef> latitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("latitude")); 443 443 WKDoubleRef latitudeWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, latitudeKeyWK.get())); 444 444 double latitude = WKDoubleGetValue(latitudeWK); 445 445 446 WKRetainPtr<WKStringRef> longitudeKeyWK (AdoptWK,WKStringCreateWithUTF8CString("longitude"));446 WKRetainPtr<WKStringRef> longitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("longitude")); 447 447 WKDoubleRef longitudeWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, longitudeKeyWK.get())); 448 448 double longitude = WKDoubleGetValue(longitudeWK); 449 449 450 WKRetainPtr<WKStringRef> accuracyKeyWK (AdoptWK,WKStringCreateWithUTF8CString("accuracy"));450 WKRetainPtr<WKStringRef> accuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("accuracy")); 451 451 WKDoubleRef accuracyWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, accuracyKeyWK.get())); 452 452 double accuracy = WKDoubleGetValue(accuracyWK); 453 453 454 WKRetainPtr<WKStringRef> providesAltitudeKeyWK (AdoptWK,WKStringCreateWithUTF8CString("providesAltitude"));454 WKRetainPtr<WKStringRef> providesAltitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesAltitude")); 455 455 WKBooleanRef providesAltitudeWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesAltitudeKeyWK.get())); 456 456 bool providesAltitude = WKBooleanGetValue(providesAltitudeWK); 457 457 458 WKRetainPtr<WKStringRef> altitudeKeyWK (AdoptWK,WKStringCreateWithUTF8CString("altitude"));458 WKRetainPtr<WKStringRef> altitudeKeyWK = adoptWK(WKStringCreateWithUTF8CString("altitude")); 459 459 WKDoubleRef altitudeWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, altitudeKeyWK.get())); 460 460 double altitude = WKDoubleGetValue(altitudeWK); 461 461 462 WKRetainPtr<WKStringRef> providesAltitudeAccuracyKeyWK (AdoptWK,WKStringCreateWithUTF8CString("providesAltitudeAccuracy"));462 WKRetainPtr<WKStringRef> providesAltitudeAccuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesAltitudeAccuracy")); 463 463 WKBooleanRef providesAltitudeAccuracyWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesAltitudeAccuracyKeyWK.get())); 464 464 bool providesAltitudeAccuracy = WKBooleanGetValue(providesAltitudeAccuracyWK); 465 465 466 WKRetainPtr<WKStringRef> altitudeAccuracyKeyWK (AdoptWK,WKStringCreateWithUTF8CString("altitudeAccuracy"));466 WKRetainPtr<WKStringRef> altitudeAccuracyKeyWK = adoptWK(WKStringCreateWithUTF8CString("altitudeAccuracy")); 467 467 WKDoubleRef altitudeAccuracyWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, altitudeAccuracyKeyWK.get())); 468 468 double altitudeAccuracy = WKDoubleGetValue(altitudeAccuracyWK); 469 469 470 WKRetainPtr<WKStringRef> providesHeadingKeyWK (AdoptWK,WKStringCreateWithUTF8CString("providesHeading"));470 WKRetainPtr<WKStringRef> providesHeadingKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesHeading")); 471 471 WKBooleanRef providesHeadingWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesHeadingKeyWK.get())); 472 472 bool providesHeading = WKBooleanGetValue(providesHeadingWK); 473 473 474 WKRetainPtr<WKStringRef> headingKeyWK (AdoptWK,WKStringCreateWithUTF8CString("heading"));474 WKRetainPtr<WKStringRef> headingKeyWK = adoptWK(WKStringCreateWithUTF8CString("heading")); 475 475 WKDoubleRef headingWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, headingKeyWK.get())); 476 476 double heading = WKDoubleGetValue(headingWK); 477 477 478 WKRetainPtr<WKStringRef> providesSpeedKeyWK (AdoptWK,WKStringCreateWithUTF8CString("providesSpeed"));478 WKRetainPtr<WKStringRef> providesSpeedKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesSpeed")); 479 479 WKBooleanRef providesSpeedWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesSpeedKeyWK.get())); 480 480 bool providesSpeed = WKBooleanGetValue(providesSpeedWK); 481 481 482 WKRetainPtr<WKStringRef> speedKeyWK (AdoptWK,WKStringCreateWithUTF8CString("speed"));482 WKRetainPtr<WKStringRef> speedKeyWK = adoptWK(WKStringCreateWithUTF8CString("speed")); 483 483 WKDoubleRef speedWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, speedKeyWK.get())); 484 484 double speed = WKDoubleGetValue(speedWK); 485 485 486 WKRetainPtr<WKStringRef> providesFloorLevelKeyWK (AdoptWK,WKStringCreateWithUTF8CString("providesFloorLevel"));486 WKRetainPtr<WKStringRef> providesFloorLevelKeyWK = adoptWK(WKStringCreateWithUTF8CString("providesFloorLevel")); 487 487 WKBooleanRef providesFloorLevelWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesFloorLevelKeyWK.get())); 488 488 bool providesFloorLevel = WKBooleanGetValue(providesFloorLevelWK); 489 489 490 WKRetainPtr<WKStringRef> floorLevelKeyWK (AdoptWK,WKStringCreateWithUTF8CString("floorLevel"));490 WKRetainPtr<WKStringRef> floorLevelKeyWK = adoptWK(WKStringCreateWithUTF8CString("floorLevel")); 491 491 WKDoubleRef floorLevelWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, floorLevelKeyWK.get())); 492 492 double floorLevel = WKDoubleGetValue(floorLevelWK); … … 519 519 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 520 520 521 WKRetainPtr<WKStringRef> permissionKeyWK (AdoptWK,WKStringCreateWithUTF8CString("permission"));521 WKRetainPtr<WKStringRef> permissionKeyWK = adoptWK(WKStringCreateWithUTF8CString("permission")); 522 522 WKBooleanRef permissionWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, permissionKeyWK.get())); 523 523 bool permission = WKBooleanGetValue(permissionWK); 524 524 525 WKRetainPtr<WKStringRef> originKey (AdoptWK,WKStringCreateWithUTF8CString("origin"));525 WKRetainPtr<WKStringRef> originKey = adoptWK(WKStringCreateWithUTF8CString("origin")); 526 526 WKStringRef originWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, originKey.get())); 527 527 528 WKRetainPtr<WKStringRef> parentOriginKey (AdoptWK,WKStringCreateWithUTF8CString("parentOrigin"));528 WKRetainPtr<WKStringRef> parentOriginKey = adoptWK(WKStringCreateWithUTF8CString("parentOrigin")); 529 529 WKStringRef parentOriginWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, parentOriginKey.get())); 530 530 … … 537 537 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 538 538 539 WKRetainPtr<WKStringRef> originKey (AdoptWK,WKStringCreateWithUTF8CString("origin"));539 WKRetainPtr<WKStringRef> originKey = adoptWK(WKStringCreateWithUTF8CString("origin")); 540 540 WKStringRef originWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, originKey.get())); 541 541 542 WKRetainPtr<WKStringRef> parentOriginKey (AdoptWK,WKStringCreateWithUTF8CString("parentOrigin"));542 WKRetainPtr<WKStringRef> parentOriginKey = adoptWK(WKStringCreateWithUTF8CString("parentOrigin")); 543 543 WKStringRef parentOriginWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, parentOriginKey.get())); 544 544 … … 558 558 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 559 559 560 WKRetainPtr<WKStringRef> enabledKeyWK (AdoptWK,WKStringCreateWithUTF8CString("enabled"));560 WKRetainPtr<WKStringRef> enabledKeyWK = adoptWK(WKStringCreateWithUTF8CString("enabled")); 561 561 WKBooleanRef enabledWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, enabledKeyWK.get())); 562 562 bool enabled = WKBooleanGetValue(enabledWK); 563 563 564 WKRetainPtr<WKStringRef> permissiveKeyWK (AdoptWK,WKStringCreateWithUTF8CString("permissive"));564 WKRetainPtr<WKStringRef> permissiveKeyWK = adoptWK(WKStringCreateWithUTF8CString("permissive")); 565 565 WKBooleanRef permissiveWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, permissiveKeyWK.get())); 566 566 bool permissive = WKBooleanGetValue(permissiveWK); … … 574 574 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 575 575 576 WKRetainPtr<WKStringRef> isInitialKeyWK (AdoptWK,WKStringCreateWithUTF8CString("hidden"));576 WKRetainPtr<WKStringRef> isInitialKeyWK = adoptWK(WKStringCreateWithUTF8CString("hidden")); 577 577 WKBooleanRef hiddenWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, isInitialKeyWK.get())); 578 578 bool hidden = WKBooleanGetValue(hiddenWK); … … 608 608 WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody); 609 609 610 WKRetainPtr<WKStringRef> urlKey (AdoptWK,WKStringCreateWithUTF8CString("url"));610 WKRetainPtr<WKStringRef> urlKey = adoptWK(WKStringCreateWithUTF8CString("url")); 611 611 WKStringRef urlWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, urlKey.get())); 612 612 613 WKRetainPtr<WKStringRef> targetKey (AdoptWK,WKStringCreateWithUTF8CString("target"));613 WKRetainPtr<WKStringRef> targetKey = adoptWK(WKStringCreateWithUTF8CString("target")); 614 614 WKStringRef targetWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, targetKey.get())); 615 615 616 WKRetainPtr<WKStringRef> shouldOpenExternalURLsKey (AdoptWK,WKStringCreateWithUTF8CString("shouldOpenExternalURLs"));616 WKRetainPtr<WKStringRef> shouldOpenExternalURLsKey = adoptWK(WKStringCreateWithUTF8CString("shouldOpenExternalURLs")); 617 617 WKBooleanRef shouldOpenExternalURLsValueWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(loadDataDictionary, shouldOpenExternalURLsKey.get())); 618 618 … … 625 625 WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody); 626 626 627 WKRetainPtr<WKStringRef> contentKey (AdoptWK,WKStringCreateWithUTF8CString("content"));627 WKRetainPtr<WKStringRef> contentKey = adoptWK(WKStringCreateWithUTF8CString("content")); 628 628 WKStringRef contentWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, contentKey.get())); 629 629 630 WKRetainPtr<WKStringRef> baseURLKey (AdoptWK,WKStringCreateWithUTF8CString("baseURL"));630 WKRetainPtr<WKStringRef> baseURLKey = adoptWK(WKStringCreateWithUTF8CString("baseURL")); 631 631 WKStringRef baseURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, baseURLKey.get())); 632 632 633 WKRetainPtr<WKStringRef> unreachableURLKey (AdoptWK,WKStringCreateWithUTF8CString("unreachableURL"));633 WKRetainPtr<WKStringRef> unreachableURLKey = adoptWK(WKStringCreateWithUTF8CString("unreachableURL")); 634 634 WKStringRef unreachableURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, unreachableURLKey.get())); 635 635 … … 757 757 if (WKStringIsEqualToUTF8CString(messageName, "RunUIProcessScript")) { 758 758 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")); 761 761 762 762 UIScriptInvocationData* invocationData = new UIScriptInvocationData(); … … 771 771 if (WKStringIsEqualToUTF8CString(messageName, "InstallCustomMenuAction")) { 772 772 auto messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 773 WKRetainPtr<WKStringRef> nameKey (AdoptWK,WKStringCreateWithUTF8CString("name"));773 WKRetainPtr<WKStringRef> nameKey = adoptWK(WKStringCreateWithUTF8CString("name")); 774 774 WKRetainPtr<WKStringRef> name = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, nameKey.get())); 775 WKRetainPtr<WKStringRef> dismissesAutomaticallyKey (AdoptWK,WKStringCreateWithUTF8CString("dismissesAutomatically"));775 WKRetainPtr<WKStringRef> dismissesAutomaticallyKey = adoptWK(WKStringCreateWithUTF8CString("dismissesAutomatically")); 776 776 auto dismissesAutomatically = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dismissesAutomaticallyKey.get())); 777 777 TestController::singleton().installCustomMenuAction(toWTFString(name.get()), WKBooleanGetValue(dismissesAutomatically)); … … 814 814 } 815 815 if (WKStringIsEqualToUTF8CString(messageName, "GetDumpPixels")) 816 return WKRetainPtr<WKTypeRef>(AdoptWK,WKBooleanCreate(m_dumpPixels));816 return adoptWK(WKBooleanCreate(m_dumpPixels)); 817 817 818 818 if (WKStringIsEqualToUTF8CString(messageName, "SetWhatToDump")) { … … 822 822 } 823 823 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))); 825 825 826 826 if (WKStringIsEqualToUTF8CString(messageName, "SetWaitUntilDone")) { … … 830 830 } 831 831 if (WKStringIsEqualToUTF8CString(messageName, "GetWaitUntilDone")) 832 return WKRetainPtr<WKTypeRef>(AdoptWK,WKBooleanCreate(m_waitUntilDone));832 return adoptWK(WKBooleanCreate(m_waitUntilDone)); 833 833 834 834 if (WKStringIsEqualToUTF8CString(messageName, "SetDumpFrameLoadCallbacks")) { … … 838 838 } 839 839 if (WKStringIsEqualToUTF8CString(messageName, "GetDumpFrameLoadCallbacks")) 840 return WKRetainPtr<WKTypeRef>(AdoptWK,WKBooleanCreate(m_dumpFrameLoadCallbacks));840 return adoptWK(WKBooleanCreate(m_dumpFrameLoadCallbacks)); 841 841 842 842 if (WKStringIsEqualToUTF8CString(messageName, "SetCanOpenWindows")) { … … 857 857 858 858 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")); 861 861 862 862 WKDoubleRef widthWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, widthKey.get())); … … 869 869 if (WKStringIsEqualToUTF8CString(messageName, "IsGeolocationClientActive")) { 870 870 bool isActive = TestController::singleton().isGeolocationProviderActive(); 871 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(isActive));871 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isActive)); 872 872 return result; 873 873 } … … 875 875 if (WKStringIsEqualToUTF8CString(messageName, "IsWorkQueueEmpty")) { 876 876 bool isEmpty = TestController::singleton().workQueueManager().isWorkQueueEmpty(); 877 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(isEmpty));877 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isEmpty)); 878 878 return result; 879 879 } 880 880 881 881 if (WKStringIsEqualToUTF8CString(messageName, "DidReceiveServerRedirectForProvisionalNavigation")) { 882 WKRetainPtr<WKBooleanRef> result (AdoptWK,WKBooleanCreate(TestController::singleton().didReceiveServerRedirectForProvisionalNavigation()));882 WKRetainPtr<WKBooleanRef> result = adoptWK(WKBooleanCreate(TestController::singleton().didReceiveServerRedirectForProvisionalNavigation())); 883 883 return result; 884 884 } … … 891 891 if (WKStringIsEqualToUTF8CString(messageName, "SecureEventInputIsEnabled")) { 892 892 #if PLATFORM(MAC) && !PLATFORM(IOS_FAMILY) 893 WKRetainPtr<WKBooleanRef> result (AdoptWK,WKBooleanCreate(IsSecureEventInputEnabled()));893 WKRetainPtr<WKBooleanRef> result = adoptWK(WKBooleanCreate(IsSecureEventInputEnabled())); 894 894 #else 895 WKRetainPtr<WKBooleanRef> result (AdoptWK,WKBooleanCreate(false));895 WKRetainPtr<WKBooleanRef> result = adoptWK(WKBooleanCreate(false)); 896 896 #endif 897 897 return result; … … 938 938 if (WKStringIsEqualToUTF8CString(messageName, "ImageCountInGeneralPasteboard")) { 939 939 unsigned count = TestController::singleton().imageCountInGeneralPasteboard(); 940 WKRetainPtr<WKUInt64Ref> result (AdoptWK,WKUInt64Create(count));940 WKRetainPtr<WKUInt64Ref> result = adoptWK(WKUInt64Create(count)); 941 941 return result; 942 942 } … … 951 951 952 952 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")); 956 956 957 957 auto persistentID = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, persistentIDKey.get())); … … 1003 1003 1004 1004 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")); 1009 1009 1010 1010 WKUInt64Ref gamepadIndex = static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, gamepadIndexKey.get())); … … 1021 1021 1022 1022 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")); 1026 1026 1027 1027 WKUInt64Ref gamepadIndex = static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, gamepadIndexKey.get())); … … 1038 1038 1039 1039 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")); 1043 1043 1044 1044 WKUInt64Ref gamepadIndex = static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, gamepadIndexKey.get())); … … 1056 1056 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 1057 1057 1058 WKRetainPtr<WKStringRef> originKey (AdoptWK,WKStringCreateWithUTF8CString("origin"));1058 WKRetainPtr<WKStringRef> originKey = adoptWK(WKStringCreateWithUTF8CString("origin")); 1059 1059 WKStringRef originWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, originKey.get())); 1060 1060 1061 WKRetainPtr<WKStringRef> parentOriginKey (AdoptWK,WKStringCreateWithUTF8CString("parentOrigin"));1061 WKRetainPtr<WKStringRef> parentOriginKey = adoptWK(WKStringCreateWithUTF8CString("parentOrigin")); 1062 1062 WKStringRef parentOriginWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, parentOriginKey.get())); 1063 1063 1064 1064 unsigned count = TestController::singleton().userMediaPermissionRequestCountForOrigin(originWK, parentOriginWK); 1065 WKRetainPtr<WKUInt64Ref> result (AdoptWK,WKUInt64Create(count));1065 WKRetainPtr<WKUInt64Ref> result = adoptWK(WKUInt64Create(count)); 1066 1066 return result; 1067 1067 } 1068 1068 if (WKStringIsEqualToUTF8CString(messageName, "IsDoingMediaCapture")) { 1069 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(TestController::singleton().isDoingMediaCapture()));1069 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(TestController::singleton().isDoingMediaCapture())); 1070 1070 return result; 1071 1071 } … … 1089 1089 1090 1090 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")); 1093 1093 1094 1094 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1104 1104 1105 1105 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")); 1108 1108 1109 1109 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1118 1118 1119 1119 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")); 1122 1122 1123 1123 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1138 1138 WKStringRef hostName = static_cast<WKStringRef>(messageBody); 1139 1139 bool isPrevalent = TestController::singleton().isStatisticsPrevalentResource(hostName); 1140 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(isPrevalent));1140 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isPrevalent)); 1141 1141 return result; 1142 1142 } … … 1147 1147 WKStringRef hostName = static_cast<WKStringRef>(messageBody); 1148 1148 bool isPrevalent = TestController::singleton().isStatisticsVeryPrevalentResource(hostName); 1149 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(isPrevalent));1149 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isPrevalent)); 1150 1150 return result; 1151 1151 } … … 1155 1155 1156 1156 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")); 1159 1159 1160 1160 WKStringRef subresourceHost = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subresourceHostKey.get())); … … 1162 1162 1163 1163 bool isRegisteredAsSubresourceUnder = TestController::singleton().isStatisticsRegisteredAsSubresourceUnder(subresourceHost, topFrameHost); 1164 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(isRegisteredAsSubresourceUnder));1164 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isRegisteredAsSubresourceUnder)); 1165 1165 return result; 1166 1166 } … … 1170 1170 1171 1171 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")); 1174 1174 1175 1175 WKStringRef subFrameHost = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subFrameHostKey.get())); … … 1177 1177 1178 1178 bool isRegisteredAsSubFrameUnder = TestController::singleton().isStatisticsRegisteredAsSubFrameUnder(subFrameHost, topFrameHost); 1179 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(isRegisteredAsSubFrameUnder));1179 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isRegisteredAsSubFrameUnder)); 1180 1180 return result; 1181 1181 } … … 1185 1185 1186 1186 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")); 1189 1189 1190 1190 WKStringRef hostRedirectedFrom = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostRedirectedFromKey.get())); … … 1192 1192 1193 1193 bool isRegisteredAsRedirectingTo = TestController::singleton().isStatisticsRegisteredAsRedirectingTo(hostRedirectedFrom, hostRedirectedTo); 1194 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(isRegisteredAsRedirectingTo));1194 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isRegisteredAsRedirectingTo)); 1195 1195 return result; 1196 1196 } … … 1200 1200 1201 1201 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")); 1204 1204 1205 1205 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1215 1215 WKStringRef hostName = static_cast<WKStringRef>(messageBody); 1216 1216 bool hasHadUserInteraction = TestController::singleton().isStatisticsHasHadUserInteraction(hostName); 1217 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(hasHadUserInteraction));1217 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(hasHadUserInteraction)); 1218 1218 return result; 1219 1219 } … … 1223 1223 1224 1224 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")); 1227 1227 1228 1228 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1238 1238 WKStringRef hostName = static_cast<WKStringRef>(messageBody); 1239 1239 bool isGrandfathered = TestController::singleton().isStatisticsGrandfathered(hostName); 1240 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(isGrandfathered));1240 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isGrandfathered)); 1241 1241 return result; 1242 1242 } … … 1246 1246 1247 1247 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")); 1250 1250 1251 1251 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1260 1260 1261 1261 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")); 1264 1264 1265 1265 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1274 1274 1275 1275 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")); 1278 1278 1279 1279 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1288 1288 1289 1289 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")); 1292 1292 1293 1293 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1302 1302 1303 1303 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")); 1306 1306 1307 1307 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1316 1316 1317 1317 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")); 1320 1320 1321 1321 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1439 1439 1440 1440 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")); 1443 1443 1444 1444 WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get())); … … 1495 1495 1496 1496 bool hasDOMCache = TestController::singleton().hasDOMCache(origin); 1497 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(hasDOMCache));1497 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(hasDOMCache)); 1498 1498 return result; 1499 1499 } … … 1504 1504 1505 1505 auto domCacheSize = TestController::singleton().domCacheSize(origin); 1506 WKRetainPtr<WKTypeRef> result (AdoptWK,WKUInt64Create(domCacheSize));1506 WKRetainPtr<WKTypeRef> result = adoptWK(WKUInt64Create(domCacheSize)); 1507 1507 return result; 1508 1508 } … … 1570 1570 WKDictionaryRef testKeyDictionary = static_cast<WKDictionaryRef>(messageBody); 1571 1571 1572 WKRetainPtr<WKStringRef> privateKeyKey (AdoptWK,WKStringCreateWithUTF8CString("PrivateKey"));1572 WKRetainPtr<WKStringRef> privateKeyKey = adoptWK(WKStringCreateWithUTF8CString("PrivateKey")); 1573 1573 WKStringRef privateKeyWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testKeyDictionary, privateKeyKey.get())); 1574 1574 1575 WKRetainPtr<WKStringRef> attrLabelKey (AdoptWK,WKStringCreateWithUTF8CString("AttrLabel"));1575 WKRetainPtr<WKStringRef> attrLabelKey = adoptWK(WKStringCreateWithUTF8CString("AttrLabel")); 1576 1576 WKStringRef attrLabelWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testKeyDictionary, attrLabelKey.get())); 1577 1577 1578 WKRetainPtr<WKStringRef> applicationTagKey (AdoptWK,WKStringCreateWithUTF8CString("ApplicationTag"));1578 WKRetainPtr<WKStringRef> applicationTagKey = adoptWK(WKStringCreateWithUTF8CString("ApplicationTag")); 1579 1579 WKStringRef applicationTagWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testKeyDictionary, applicationTagKey.get())); 1580 1580 … … 1593 1593 WKDictionaryRef testDictionary = static_cast<WKDictionaryRef>(messageBody); 1594 1594 1595 WKRetainPtr<WKStringRef> attrLabelKey (AdoptWK,WKStringCreateWithUTF8CString("AttrLabel"));1595 WKRetainPtr<WKStringRef> attrLabelKey = adoptWK(WKStringCreateWithUTF8CString("AttrLabel")); 1596 1596 WKStringRef attrLabelWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testDictionary, attrLabelKey.get())); 1597 1597 1598 WKRetainPtr<WKStringRef> applicationTagKey (AdoptWK,WKStringCreateWithUTF8CString("ApplicationTag"));1598 WKRetainPtr<WKStringRef> applicationTagKey = adoptWK(WKStringCreateWithUTF8CString("ApplicationTag")); 1599 1599 WKStringRef applicationTagWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(testDictionary, applicationTagKey.get())); 1600 1600 1601 1601 bool keyExistsInKeychain = TestController::singleton().keyExistsInKeychain(toWTFString(attrLabelWK), toWTFString(applicationTagWK)); 1602 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(keyExistsInKeychain));1602 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(keyExistsInKeychain)); 1603 1603 return result; 1604 1604 } … … 1612 1612 1613 1613 if (WKStringIsEqualToUTF8CString(messageName, "CanDoServerTrustEvaluationInNetworkProcess")) { 1614 WKRetainPtr<WKTypeRef> result (AdoptWK,WKBooleanCreate(TestController::singleton().canDoServerTrustEvaluationInNetworkProcess()));1614 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(TestController::singleton().canDoServerTrustEvaluationInNetworkProcess())); 1615 1615 return result; 1616 1616 } 1617 1617 1618 1618 if (WKStringIsEqualToUTF8CString(messageName, "ServerTrustEvaluationCallbackCallsCount")) { 1619 WKRetainPtr<WKTypeRef> result (AdoptWK,WKUInt64Create(TestController::singleton().serverTrustEvaluationCallbackCallsCount()));1619 WKRetainPtr<WKTypeRef> result = adoptWK(WKUInt64Create(TestController::singleton().serverTrustEvaluationCallbackCallsCount())); 1620 1620 return result; 1621 1621 } … … 1680 1680 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallUISideScriptCallback")); 1681 1681 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")); 1685 1685 WKRetainPtr<WKUInt64Ref> callbackIDValue = adoptWK(WKUInt64Create(scriptCallbackID)); 1686 1686 … … 1784 1784 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidReceiveAllStorageAccessEntries")); 1785 1785 1786 WKRetainPtr<WKMutableArrayRef> messageBody (AdoptWK,WKMutableArrayCreate());1786 WKRetainPtr<WKMutableArrayRef> messageBody = adoptWK(WKMutableArrayCreate()); 1787 1787 for (auto& domain : domains) 1788 1788 WKArrayAppendItem(messageBody.get(), adoptWK(WKStringCreateWithUTF8CString(domain.utf8().data())).get()); -
trunk/Tools/WebKitTestRunner/WebNotificationProvider.cpp
r239871 r244390 127 127 removeGlobalIDFromIDMap(m_localToGlobalNotificationIDMap, id); 128 128 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()); 131 131 WKArrayAppendItem(array.get(), wkID.get()); 132 132 WKNotificationManagerProviderDidCloseNotifications(notificationManager, array.get()); -
trunk/Tools/WebKitTestRunner/WorkQueueManager.cpp
r185072 r244390 76 76 public: 77 77 explicit ScriptItem(const String& script) 78 : m_script( AdoptWK, WKStringCreateWithUTF8CString(script.utf8().data()))78 : m_script(adoptWK(WKStringCreateWithUTF8CString(script.utf8().data()))) 79 79 { 80 80 } … … 132 132 public: 133 133 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()))) 135 135 , m_target(target) 136 136 , m_shouldOpenExternalURLs(shouldOpenExternalURLs) … … 162 162 public: 163 163 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()))) 167 167 { 168 168 } -
trunk/Tools/WebKitTestRunner/win/TestControllerWin.cpp
r238098 r244390 127 127 static WKRetainPtr<WKStringRef> toWK(const char* string) 128 128 { 129 return WKRetainPtr<WKStringRef>(AdoptWK,WKStringCreateWithUTF8CString(string));129 return adoptWK(WKStringCreateWithUTF8CString(string)); 130 130 } 131 131
Note:
See TracChangeset
for help on using the changeset viewer.