Changeset 273194 in webkit
- Timestamp:
- Feb 19, 2021, 10:37:00 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 52 edited
-
Source/JavaScriptCore/API/JSContext.mm (modified) (1 diff)
-
Source/JavaScriptCore/API/JSVirtualMachine.mm (modified) (1 diff)
-
Source/JavaScriptCore/API/JSWrapperMap.mm (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (modified) (2 diffs)
-
Source/WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.mm (modified) (2 diffs)
-
Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm (modified) (2 diffs)
-
Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm (modified) (2 diffs)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm (modified) (1 diff)
-
Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (modified) (2 diffs)
-
Source/WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/mac/Misc/WebNSObjectExtras.mm (modified) (1 diff)
-
Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebView/WebVideoFullscreenController.mm (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/JavaScriptCore/JSRunLoopTimer.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm (modified) (2 diffs)
-
Tools/TestWebKitAPI/Tests/WebKit/mac/ContextMenuImgWithVideo.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/DeviceManagementRestrictions.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm (modified) (2 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm (modified) (5 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBStructuredCloneBackwardCompatibility.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBTempFileSize.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/JITEnabled.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStorageDatabaseTracker.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm (modified) (3 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ReparentWebViewTimeout.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm (modified) (2 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm (modified) (13 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm (modified) (5 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm (modified) (2 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm (modified) (2 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm (modified) (2 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm (modified) (3 diffs)
-
Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSContext.mm
r273128 r273194 407 407 { 408 408 JSVirtualMachine *virtualMachine = [JSVirtualMachine virtualMachineWithContextGroupRef:toRef(&toJS(globalContext)->vm())]; 409 JSContext *context = [virtualMachine contextForGlobalContextRef:globalContext];409 auto context = retainPtr([virtualMachine contextForGlobalContextRef:globalContext]); 410 410 if (!context) 411 context = adoptNS([[JSContext alloc] initWithGlobalContextRef:globalContext]) .autorelease();412 return context ;411 context = adoptNS([[JSContext alloc] initWithGlobalContextRef:globalContext]); 412 return context.autorelease(); 413 413 } 414 414 -
trunk/Source/JavaScriptCore/API/JSVirtualMachine.mm
r273138 r273194 235 235 + (JSVirtualMachine *)virtualMachineWithContextGroupRef:(JSContextGroupRef)group 236 236 { 237 JSVirtualMachine *virtualMachine = [JSVMWrapperCache wrapperForJSContextGroupRef:group];237 auto virtualMachine = retainPtr([JSVMWrapperCache wrapperForJSContextGroupRef:group]); 238 238 if (!virtualMachine) 239 virtualMachine = adoptNS([[JSVirtualMachine alloc] initWithContextGroupRef:group]) .autorelease();240 return virtualMachine ;239 virtualMachine = adoptNS([[JSVirtualMachine alloc] initWithContextGroupRef:group]); 240 return virtualMachine.autorelease(); 241 241 } 242 242 -
trunk/Source/JavaScriptCore/API/JSWrapperMap.mm
r273128 r273194 665 665 { 666 666 ASSERT(toJSGlobalObject([context JSGlobalContextRef])->wrapperMap() == self); 667 JSValue *wrapper = (__bridge JSValue *)NSMapGet(m_cachedObjCWrappers.get(), value);667 auto wrapper = retainPtr((__bridge JSValue *)NSMapGet(m_cachedObjCWrappers.get(), value)); 668 668 if (!wrapper) { 669 wrapper = adoptNS([[JSValue alloc] initWithValue:value inContext:context]) .autorelease();670 NSMapInsert(m_cachedObjCWrappers.get(), value, (__bridge void*)wrapper );671 } 672 return wrapper ;669 wrapper = adoptNS([[JSValue alloc] initWithValue:value inContext:context]); 670 NSMapInsert(m_cachedObjCWrappers.get(), value, (__bridge void*)wrapper.get()); 671 } 672 return wrapper.autorelease(); 673 673 } 674 674 -
trunk/Source/JavaScriptCore/ChangeLog
r273187 r273194 1 2021-02-19 Chris Dumez <cdumez@apple.com> 2 3 Review remaining usage of autorelease to make sure it is necessary 4 https://bugs.webkit.org/show_bug.cgi?id=222177 5 6 Reviewed by Geoffrey Garen. 7 8 * API/JSContext.mm: 9 (+[JSContext contextWithJSGlobalContextRef:]): 10 * API/JSVirtualMachine.mm: 11 (+[JSVirtualMachine virtualMachineWithContextGroupRef:]): 12 * API/JSWrapperMap.mm: 13 (-[JSWrapperMap objcWrapperForJSValueRef:inContext:]): 14 1 15 2021-02-19 Yusuke Suzuki <ysuzuki@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r273193 r273194 1 2021-02-19 Chris Dumez <cdumez@apple.com> 2 3 Review remaining usage of autorelease to make sure it is necessary 4 https://bugs.webkit.org/show_bug.cgi?id=222177 5 6 Reviewed by Geoffrey Garen. 7 8 * platform/ios/WebVideoFullscreenControllerAVKit.mm: 9 (-[WebVideoFullscreenController didFinishFullscreen:]): 10 1 11 2021-02-19 Rob Buis <rbuis@igalia.com> 2 12 -
trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
r272936 r273194 1063 1063 ASSERT(WebThreadIsCurrent()); 1064 1064 ASSERT_UNUSED(context, context == _context); 1065 retainPtr(self).autorelease(); // retain self before breaking a retain cycle.1065 auto strongSelf = retainPtr(self); // retain self before breaking a retain cycle. 1066 1066 _context->setController(nil); 1067 1067 _context = nullptr; -
trunk/Source/WebKit/ChangeLog
r273192 r273194 1 2021-02-19 Chris Dumez <cdumez@apple.com> 2 3 Review remaining usage of autorelease to make sure it is necessary 4 https://bugs.webkit.org/show_bug.cgi?id=222177 5 6 Reviewed by Geoffrey Garen. 7 8 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 9 (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 10 * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: 11 (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): 12 (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]): 13 (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): 14 * UIProcess/API/Cocoa/NSAttributedString.mm: 15 (+[_WKAttributedStringWebViewCache configuration]): 16 (+[NSAttributedString _loadFromHTMLWithOptions:contentLoader:completionHandler:]): 17 * UIProcess/API/Cocoa/WKBrowsingContextController.mm: 18 (setUpPagePolicyClient): 19 * UIProcess/API/Cocoa/WKWebView.mm: 20 (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]): 21 * UIProcess/API/ios/WKWebViewTestingIOS.mm: 22 (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): 23 * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: 24 (WebKit::convertToNPNNString): 25 * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: 26 (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): 27 1 28 2021-02-19 Devin Rousso <drousso@apple.com> 2 29 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r272936 r273194 1233 1233 // FIXME: Remove this respondsToSelector check once rdar://problem/50109631 is in a build and bots are updated. 1234 1234 if ([configuration respondsToSelector:@selector(_hstsStorage)]) 1235 configuration._hstsStorage = adoptNS([alloc_NSHSTSStorageInstance() initPersistentStoreWithURL:[NSURL fileURLWithPath:parameters.hstsStorageDirectory isDirectory:YES]]). autorelease();1235 configuration._hstsStorage = adoptNS([alloc_NSHSTSStorageInstance() initPersistentStoreWithURL:[NSURL fileURLWithPath:parameters.hstsStorageDirectory isDirectory:YES]]).get(); 1236 1236 } 1237 1237 #endif … … 1268 1268 if (!parameters.alternativeServiceDirectory.isEmpty()) { 1269 1269 SandboxExtension::consumePermanently(parameters.alternativeServiceDirectoryExtensionHandle); 1270 configuration._alternativeServicesStorage = adoptNS([[_NSHTTPAlternativeServicesStorage alloc] initPersistentStoreWithURL:[[NSURL fileURLWithPath:parameters.alternativeServiceDirectory isDirectory:YES] URLByAppendingPathComponent:@"AlternativeService.sqlite"]]). autorelease();1270 configuration._alternativeServicesStorage = adoptNS([[_NSHTTPAlternativeServicesStorage alloc] initPersistentStoreWithURL:[[NSURL fileURLWithPath:parameters.alternativeServiceDirectory isDirectory:YES] URLByAppendingPathComponent:@"AlternativeService.sqlite"]]).get(); 1271 1271 } 1272 1272 if (parameters.http3Enabled) -
trunk/Source/WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.mm
r273192 r273194 70 70 - (void)completePaymentMethodSelection:(PKPaymentRequestPaymentMethodUpdate *)paymentMethodUpdate 71 71 { 72 PKPaymentRequestPaymentMethodUpdate *update = paymentMethodUpdate ?: adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]).autorelease();73 _summaryItems = adoptNS([ update.paymentSummaryItemscopy]);74 std::exchange(_didSelectPaymentMethodCompletion, nil)(update );72 auto update = !paymentMethodUpdate ? adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]) : nil; 73 _summaryItems = adoptNS([[update paymentSummaryItems] copy]); 74 std::exchange(_didSelectPaymentMethodCompletion, nil)(update.get()); 75 75 } 76 76 … … 82 82 - (void)completeShippingContactSelection:(PKPaymentRequestShippingContactUpdate *)shippingContactUpdate 83 83 { 84 PKPaymentRequestShippingContactUpdate *update = shippingContactUpdate ?: adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[] paymentSummaryItems:_summaryItems.get() shippingMethods:_shippingMethods.get()]).autorelease();85 _summaryItems = adoptNS([ update.paymentSummaryItemscopy]);86 _shippingMethods = adoptNS([ update.shippingMethodscopy]);87 std::exchange(_didSelectShippingContactCompletion, nil)(update );84 auto update = !shippingContactUpdate ? adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[] paymentSummaryItems:_summaryItems.get() shippingMethods:_shippingMethods.get()]) : nil; 85 _summaryItems = adoptNS([[update paymentSummaryItems] copy]); 86 _shippingMethods = adoptNS([[update shippingMethods] copy]); 87 std::exchange(_didSelectShippingContactCompletion, nil)(update.get()); 88 88 } 89 89 90 90 - (void)completeShippingMethodSelection:(PKPaymentRequestShippingMethodUpdate *)shippingMethodUpdate 91 91 { 92 PKPaymentRequestShippingMethodUpdate *update = shippingMethodUpdate ?: adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]).autorelease();93 _summaryItems = adoptNS([ update.paymentSummaryItemscopy]);94 std::exchange(_didSelectShippingMethodCompletion, nil)(update );92 auto update = !shippingMethodUpdate ? adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]) : nil; 93 _summaryItems = adoptNS([[update paymentSummaryItems] copy]); 94 std::exchange(_didSelectShippingMethodCompletion, nil)(update.get()); 95 95 } 96 96 -
trunk/Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm
r273128 r273194 134 134 if (!configuration) { 135 135 configuration = [[WKWebViewConfiguration alloc] init]; 136 configuration.processPool = adoptNS([[WKProcessPool alloc] init]). autorelease();136 configuration.processPool = adoptNS([[WKProcessPool alloc] init]).get(); 137 137 configuration.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore]; 138 138 configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll; … … 270 270 271 271 // Make the string be an instance of the receiver class. 272 if (attributedString && self != attributedString.class) 273 attributedString = adoptNS([[self alloc] initWithAttributedString:attributedString]).autorelease(); 272 RetainPtr<NSAttributedString> newAttributedString; 273 if (attributedString && self != attributedString.class) { 274 newAttributedString = adoptNS([[self alloc] initWithAttributedString:attributedString]); 275 attributedString = newAttributedString.get(); 276 } 274 277 275 278 // Make the document attributes immutable. 276 if ([attributes isKindOfClass:NSMutableDictionary.class]) 277 attributes = adoptNS([[NSDictionary alloc] initWithDictionary:attributes]).autorelease(); 279 RetainPtr<NSDictionary<NSAttributedStringDocumentAttributeKey, id>> newAttributes; 280 if ([attributes isKindOfClass:NSMutableDictionary.class]) { 281 newAttributes = adoptNS([[NSDictionary alloc] initWithDictionary:attributes]); 282 attributes = newAttributes.get(); 283 } 278 284 279 285 completionHandler(attributedString, attributes, error); -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm
r272936 r273194 495 495 496 496 if ([policyDelegate respondsToSelector:@selector(browsingContextController:decidePolicyForNavigationAction:decisionHandler:)]) { 497 NSDictionary *actionDictionary =@{497 auto actionDictionary = retainPtr(@{ 498 498 WKActionIsMainFrameKey: @(WKFrameIsMainFrame(frame)), 499 499 WKActionNavigationTypeKey: @(navigationType), … … 502 502 WKActionOriginalURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(originalRequest)).get(), 503 503 WKActionURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(request)).get() 504 } ;504 }); 505 505 506 506 if (originatingFrame) { 507 actionDictionary = adoptNS([actionDictionary mutableCopy]) .autorelease();508 [(NSMutableDictionary *)actionDictionary setObject:[NSURL _web_URLWithWTFString:WebKit::toImpl(originatingFrame)->url().string()] forKey:WKActionOriginatingFrameURLKey];507 actionDictionary = adoptNS([actionDictionary mutableCopy]); 508 [(NSMutableDictionary *)actionDictionary.get() setObject:[NSURL _web_URLWithWTFString:WebKit::toImpl(originatingFrame)->url().string()] forKey:WKActionOriginatingFrameURLKey]; 509 509 } 510 510 511 [policyDelegate browsingContextController:browsingContext decidePolicyForNavigationAction:actionDictionary decisionHandler:makePolicyDecisionBlock(listener)];511 [policyDelegate browsingContextController:browsingContext decidePolicyForNavigationAction:actionDictionary.get() decisionHandler:makePolicyDecisionBlock(listener)]; 512 512 } else 513 513 WKFramePolicyListenerUse(listener); -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r273186 r273194 2256 2256 } 2257 2257 2258 [self createPDFWithConfiguration:pdfConfiguration. autorelease() completionHandler:completionHandler];2258 [self createPDFWithConfiguration:pdfConfiguration.get() completionHandler:completionHandler]; 2259 2259 } 2260 2260 -
trunk/Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm
r273049 r273194 59 59 [adjustedContexts addObject:adoptNS([[_WKTextInputContext alloc] _initWithTextInputContext:adjustedContext]).get()]; 60 60 } 61 completionHandler(adjustedContexts. autorelease());61 completionHandler(adjustedContexts.get()); 62 62 }]; 63 63 } -
trunk/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
r267916 r273194 482 482 static NPNSString *convertToNPNNString(const String& string) 483 483 { 484 CFTypeRef releasedString = string.createCFString().autorelease(); 485 return static_cast<NPNSString*>(const_cast<void*>(releasedString)); 484 return static_cast<NPNSString*>(static_cast<NSString*>(string)); 486 485 } 487 486 -
trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm
r272789 r273194 96 96 #endif 97 97 98 idnames = ax::retrieveValueFromMainThread<RetainPtr<id>>([PROTECTED_SELF] () -> RetainPtr<id> {98 auto names = ax::retrieveValueFromMainThread<RetainPtr<id>>([PROTECTED_SELF] () -> RetainPtr<id> { 99 99 auto page = protectedSelf->m_page; 100 100 if (!page) … … 106 106 107 107 return createNSArray(corePage->pageOverlayController().copyAccessibilityAttributesNames(true)); 108 }) .autorelease();109 110 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) 111 self.cachedParameterizedAttributeNames = names ;112 #endif 113 114 return names ;108 }); 109 110 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) 111 self.cachedParameterizedAttributeNames = names.get(); 112 #endif 113 114 return names.autorelease(); 115 115 } 116 116 -
trunk/Source/WebKitLegacy/mac/ChangeLog
r273159 r273194 1 2021-02-19 Chris Dumez <cdumez@apple.com> 2 3 Review remaining usage of autorelease to make sure it is necessary 4 https://bugs.webkit.org/show_bug.cgi?id=222177 5 6 Reviewed by Geoffrey Garen. 7 8 * Misc/WebNSObjectExtras.mm: 9 (-[WebMainThreadInvoker forwardInvocation:]): 10 * Plugins/WebNetscapePluginView.mm: 11 (-[WebNetscapePluginView sendEvent:isDrawRect:]): 12 * WebView/WebVideoFullscreenController.mm: 13 (-[WebVideoFullscreenController init]): 14 1 15 2021-02-19 Devin Rousso <drousso@apple.com> 2 16 -
trunk/Source/WebKitLegacy/mac/Misc/WebNSObjectExtras.mm
r273062 r273194 63 63 [invocation performSelectorOnMainThread:@selector(_webkit_invokeAndHandleException:) withObject:self waitUntilDone:YES]; 64 64 if (exception) { 65 id exceptionToThrow = std::exchange(exception, nil).autorelease();66 @throw exceptionToThrow ;65 auto exceptionToThrow = std::exchange(exception, nil); 66 @throw exceptionToThrow.get(); 67 67 } else if (returnTypeIsObject(invocation)) { 68 68 // _webkit_invokeAndHandleException retained the return value on the main thread. -
trunk/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm
r273062 r273194 356 356 357 357 // Temporarily retain self in case the plug-in view is released while sending an event. 358 retainPtr(self).autorelease();358 auto strongSelf = retainPtr(self); 359 359 360 360 BOOL acceptedEvent; -
trunk/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenController.mm
r273062 r273194 152 152 _contentOverlay = adoptNS([[NSView alloc] initWithFrame:NSZeroRect]); 153 153 _contentOverlay.get().layerContentsRedrawPolicy = NSViewLayerContentsRedrawNever; 154 _contentOverlay.get().layer = adoptNS([[WebVideoFullscreenOverlayLayer alloc] init]). autorelease();154 _contentOverlay.get().layer = adoptNS([[WebVideoFullscreenOverlayLayer alloc] init]).get(); 155 155 [_contentOverlay setWantsLayer:YES]; 156 156 [_contentOverlay setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; -
trunk/Tools/ChangeLog
r273184 r273194 1 2021-02-19 Chris Dumez <cdumez@apple.com> 2 3 Review remaining usage of autorelease to make sure it is necessary 4 https://bugs.webkit.org/show_bug.cgi?id=222177 5 6 Reviewed by Geoffrey Garen. 7 8 * TestRunnerShared/mac/NSPasteboardAdditions.mm: 9 (+[NSPasteboard _modernPasteboardType:]): 10 * TestWebKitAPI/Tests/JavaScriptCore/JSRunLoopTimer.mm: 11 (TestWebKitAPI::triggerGC): 12 * TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm: 13 (TestWebKitAPI::WebCoreNSURLSessionTest::SetUp): 14 * TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm: 15 (TestWebKitAPI::TEST): 16 * TestWebKitAPI/Tests/WebKit/mac/ContextMenuImgWithVideo.mm: 17 (TestWebKitAPI::TEST): 18 * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: 19 (TestWebKitAPI::TEST): 20 * TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm: 21 (-[ContentRuleListNotificationDelegate webView:startURLSchemeTask:]): 22 * TestWebKitAPI/Tests/WebKitCocoa/DeviceManagementRestrictions.mm: 23 (TEST): 24 * TestWebKitAPI/Tests/WebKitCocoa/Download.mm: 25 (TestWebKitAPI::webViewWithDownloadMonitorSpeedMultiplier): 26 * TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm: 27 (runDragStartDataTestCase): 28 * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm: 29 (-[InAppBrowserSchemeHandler webView:startURLSchemeTask:]): 30 * TestWebKitAPI/Tests/WebKitCocoa/IndexedDBStructuredCloneBackwardCompatibility.mm: 31 (TEST): 32 * TestWebKitAPI/Tests/WebKitCocoa/IndexedDBTempFileSize.mm: 33 (TEST): 34 * TestWebKitAPI/Tests/WebKitCocoa/JITEnabled.mm: 35 (TEST): 36 * TestWebKitAPI/Tests/WebKitCocoa/LocalStorageDatabaseTracker.mm: 37 (TEST): 38 * TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm: 39 (TEST): 40 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 41 * TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm: 42 (TestWebKitAPI::TEST): 43 * TestWebKitAPI/Tests/WebKitCocoa/ReparentWebViewTimeout.mm: 44 (TEST): 45 * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm: 46 (TEST): 47 (-[ResourceLoadStatisticsSchemeHandler webView:startURLSchemeTask:]): 48 * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm: 49 (TEST): 50 * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: 51 * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm: 52 (TestWebKitAPI::TEST): 53 * TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm: 54 (TestWebKitAPI::TEST): 55 * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm: 56 (TEST): 57 (-[UITestDelegate webView:startURLSchemeTask:]): 58 * TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm: 59 (webViewForScriptMessageHandlerMultipleHandlerRemovalTest): 60 (TEST): 61 * TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm: 62 (TestWebKitAPI::TEST): 63 * TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm: 64 (TEST): 65 * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm: 66 (-[SyncErrorScheme webView:startURLSchemeTask:]): 67 * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm: 68 * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm: 69 (TestWebKitAPI::TEST): 70 * TestWebKitAPI/Tests/mac/FontManagerTests.mm: 71 (TestWebKitAPI::TEST): 72 1 73 2021-02-19 Wenson Hsieh <wenson_hsieh@apple.com> 2 74 -
trunk/Tools/TestWebKitAPI/Tests/JavaScriptCore/JSRunLoopTimer.mm
r273062 r273194 66 66 @autoreleasepool { 67 67 for (size_t i = 0; i < 1000; ++i) 68 [JSValue valueWithObject:adoptNS([TestObject new]). autorelease() inContext:context];68 [JSValue valueWithObject:adoptNS([TestObject new]).get() inContext:context]; 69 69 JSGarbageCollect([context JSGlobalContextRef]); 70 70 } -
trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm
r273062 r273194 119 119 #endif 120 120 view = adoptNS([[WebView alloc] initWithFrame:NSZeroRect]); 121 [view setFrameLoadDelegate:adoptNS([[TestNSURLSessionLoaderDelegate alloc] init]). autorelease()];121 [view setFrameLoadDelegate:adoptNS([[TestNSURLSessionLoaderDelegate alloc] init]).get()]; 122 122 123 123 didLoadMainResource = false; -
trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm
r273130 r273194 116 116 117 117 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 118 [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]). autorelease()];118 [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get()]; 119 119 auto processPoolConfig = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 120 120 auto preferences = [configuration preferences]; … … 146 146 147 147 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 148 [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]). autorelease()];148 [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get()]; 149 149 auto processPoolConfig = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 150 150 auto preferences = [configuration preferences]; -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/ContextMenuImgWithVideo.mm
r273062 r273194 56 56 { 57 57 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]); 58 webView.get().UIDelegate = adoptNS([[ContextMenuImgWithVideoDelegate alloc] init]).autorelease(); 58 auto uiDelegate = adoptNS([[ContextMenuImgWithVideoDelegate alloc] init]); 59 webView.get().UIDelegate = uiDelegate.get(); 59 60 [webView synchronouslyLoadTestPageNamed:@"ContextMenuImgWithVideo"]; 60 61 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm
r273181 r273194 557 557 auto dataStoreConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]); 558 558 [dataStoreConfiguration setFastServerTrustEvaluationEnabled:YES]; 559 [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]). autorelease()];559 [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).get()]; 560 560 auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]); 561 561 auto delegate = adoptNS([ServerTrustDelegate new]); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm
r273062 r273194 87 87 - (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask 88 88 { 89 [urlSchemeTask didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:urlSchemeTask.request.URL MIMEType:@"text/html" expectedContentLength:0 textEncodingName:nil]). autorelease()];89 [urlSchemeTask didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:urlSchemeTask.request.URL MIMEType:@"text/html" expectedContentLength:0 textEncodingName:nil]).get()]; 90 90 [urlSchemeTask didFinish]; 91 91 } -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DeviceManagementRestrictions.mm
r273062 r273194 43 43 44 44 RetainPtr<WKWebViewConfiguration> webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 45 [webViewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]). autorelease()];45 [webViewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).get()]; 46 46 47 47 RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:webViewConfiguration.get() addToWindow:YES]); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm
r273062 r273194 359 359 { 360 360 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]); 361 [webView setNavigationDelegate:[[DownloadRequestOriginalURLNavigationDelegate alloc] init]]; 361 auto navigationDelegate = adoptNS([[DownloadRequestOriginalURLNavigationDelegate alloc] init]); 362 [webView setNavigationDelegate:navigationDelegate.get()]; 362 363 [[[webView configuration] processPool] _setDownloadDelegate:[[DownloadRequestOriginalURLDelegate alloc] initWithExpectedOriginalURL:sourceURL]]; 363 364 … … 898 899 [dataStoreConfiguration setTestSpeedMultiplier:multiplier]; 899 900 auto webViewConfiguration = adoptNS([WKWebViewConfiguration new]); 900 [webViewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]). autorelease()];901 [webViewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).get()]; 901 902 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 902 903 [webView setNavigationDelegate:navigationDelegate.get()]; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm
r262507 r273194 194 194 NSString *url { nil }; 195 195 NSString *html { nil }; 196 NSDictionary<NSString *, NSString *> *customData { nil };196 RetainPtr<NSDictionary<NSString *, NSString *>> customData; 197 197 }; 198 198 … … 216 216 [allData removeObjectForKey:@"Files"]; 217 217 if ([allData count]) 218 result.customData = allData.autorelease();218 result.customData = WTFMove(allData); 219 219 return result; 220 220 } … … 243 243 EXPECT_NULL(result.url); 244 244 EXPECT_TRUE([result.html containsString:@"Regular text + custom data"]); 245 EXPECT_WK_STREQ("Hello world", result.customData [@"text/foo"]);245 EXPECT_WK_STREQ("Hello world", result.customData.get()[@"text/foo"]); 246 246 EXPECT_FALSE(result.containsFile); 247 247 … … 257 257 EXPECT_NULL(result.url); 258 258 EXPECT_NULL(result.html); 259 EXPECT_WK_STREQ("Hello world", result.customData [@"text/foo"]);259 EXPECT_WK_STREQ("Hello world", result.customData.get()[@"text/foo"]); 260 260 EXPECT_FALSE(result.containsFile); 261 261 } … … 306 306 EXPECT_WK_STREQ("https://www.apple.com/", result.url); 307 307 EXPECT_NULL(result.html); 308 EXPECT_WK_STREQ("bar", result.customData [@"text/foo"]);308 EXPECT_WK_STREQ("bar", result.customData.get()[@"text/foo"]); 309 309 EXPECT_FALSE(result.containsFile); 310 310 } -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm
r273102 r273194 121 121 response = @"<body id = 'body'></body><iframe id='iframe'></iframe></body>"; 122 122 123 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:response.length textEncodingName:nil]). autorelease()];123 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:response.length textEncodingName:nil]).get()]; 124 124 [task didReceiveData:[response dataUsingEncoding:NSUTF8StringEncoding]]; 125 125 [task didFinish]; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBStructuredCloneBackwardCompatibility.mm
r273062 r273194 97 97 RetainPtr<_WKWebsiteDataStoreConfiguration> websiteDataStoreConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]); 98 98 websiteDataStoreConfiguration.get()._indexedDBDatabaseDirectory = idbPath; 99 configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]). autorelease();99 configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get(); 100 100 101 101 idbPath = [idbPath URLByAppendingPathComponent:@"file__0"]; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBTempFileSize.mm
r273062 r273194 72 72 websiteDataStoreConfiguration.get()._indexedDBDatabaseDirectory = idbPath.get(); 73 73 74 configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]). autorelease();74 configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get(); 75 75 auto types = adoptNS([[NSSet alloc] initWithObjects:WKWebsiteDataTypeIndexedDBDatabases, nil]); 76 76 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/JITEnabled.mm
r273062 r273194 50 50 [processPoolConfiguration setJITEnabled:NO]; 51 51 auto configuration = adoptNS([WKWebViewConfiguration new]); 52 [configuration setProcessPool:adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]). autorelease()];52 [configuration setProcessPool:adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]).get()]; 53 53 auto webViewNoJIT = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 54 54 checkJITEnabled(WTFMove(webViewNoJIT), NO); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStorageDatabaseTracker.mm
r273062 r273194 57 57 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 58 58 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 59 webView.get().UIDelegate = adoptNS([[LocalStorageUIDelegate alloc] init]).autorelease(); 59 auto uiDelegate = adoptNS([[LocalStorageUIDelegate alloc] init]); 60 webView.get().UIDelegate = uiDelegate.get(); 60 61 [webView loadHTMLString:@"<script>localStorage.setItem('testKey', 'testValue');alert(localStorage.getItem('testKey'));</script>" baseURL:[NSURL URLWithString:@"http://localhost"]]; 61 62 TestWebKitAPI::Util::run(&readyToContinue); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm
r273062 r273194 37 37 TEST(WebKit, NetworkProcessEntitlements) 38 38 { 39 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:adoptNS([[WKWebViewConfiguration alloc] init]). autorelease()]);39 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:adoptNS([[WKWebViewConfiguration alloc] init]).get()]); 40 40 [webView synchronouslyLoadTestPageNamed:@"simple"]; 41 41 WKWebsiteDataStore *store = [webView configuration].websiteDataStore; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r273130 r273194 5456 5456 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 5457 5457 [webViewConfiguration setProcessPool:processPool.get()]; 5458 webViewConfiguration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]). autorelease();5458 webViewConfiguration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get(); 5459 5459 5460 5460 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm
r273062 r273194 85 85 [storeConfiguration setAllowsServerPreconnect:NO]; 86 86 auto viewConfiguration = adoptNS([WKWebViewConfiguration new]); 87 [viewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration.get()]). autorelease()];87 [viewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration.get()]).get()]; 88 88 auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:viewConfiguration.get()]); 89 89 auto delegate = adoptNS([ProxyDelegate new]); … … 132 132 133 133 auto viewConfiguration = adoptNS([WKWebViewConfiguration new]); 134 [viewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration.get()]). autorelease()];134 [viewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration.get()]).get()]; 135 135 auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:viewConfiguration.get()]); 136 136 auto delegate = adoptNS([ProxyDelegate new]); … … 175 175 176 176 auto viewConfiguration = adoptNS([WKWebViewConfiguration new]); 177 [viewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration.get()]). autorelease()];177 [viewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration.get()]).get()]; 178 178 auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:viewConfiguration.get()]); 179 179 [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://example.com/"]]]; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ReparentWebViewTimeout.mm
r273062 r273194 39 39 40 40 RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 41 [configuration setProcessPool:adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]). autorelease()];41 [configuration setProcessPool:adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]).get()]; 42 42 43 43 RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:configuration.get() addToWindow:YES]); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm
r273062 r273194 327 327 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 328 328 auto websiteDataStoreConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]); 329 configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]). autorelease();329 configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get(); 330 330 331 331 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); … … 584 584 { 585 585 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 586 auto dataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]). autorelease()]);586 auto dataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]).get()]); 587 587 [configuration setWebsiteDataStore:dataStore.get()]; 588 588 [dataStore _setResourceLoadStatisticsEnabled:YES]; … … 1280 1280 auto *sharedProcessPool = [WKProcessPool _sharedProcessPool]; 1281 1281 auto *dataStore1 = [WKWebsiteDataStore defaultDataStore]; 1282 auto dataStore2 = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]). autorelease()]);1282 auto dataStore2 = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]).get()]); 1283 1283 1284 1284 [dataStore1 _setResourceLoadStatisticsEnabled:YES]; … … 1326 1326 response = @"<body></body>"; 1327 1327 1328 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:response.length textEncodingName:nil]). autorelease()];1328 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:response.length textEncodingName:nil]).get()]; 1329 1329 [task didReceiveData:[response dataUsingEncoding:NSUTF8StringEncoding]]; 1330 1330 [task didFinish]; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm
r273062 r273194 309 309 auto showWarning = ^{ 310 310 completionHandlerCalled = false; 311 [webView _showSafeBrowsingWarningWithURL:nil title:@"test title" warning:@"test warning" details:adoptNS([[NSAttributedString alloc] initWithString:@"test details"]). autorelease() completionHandler:^(BOOL shouldContinue) {311 [webView _showSafeBrowsingWarningWithURL:nil title:@"test title" warning:@"test warning" details:adoptNS([[NSAttributedString alloc] initWithString:@"test details"]).get() completionHandler:^(BOOL shouldContinue) { 312 312 shouldContinueValue = shouldContinue; 313 313 completionHandlerCalled = true; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm
r273062 r273194 1408 1408 websiteDataStoreConfiguration.get()._indexedDBDatabaseDirectory = idbPath; 1409 1409 1410 configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]). autorelease();1410 configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get(); 1411 1411 1412 1412 RetainPtr<SWMessageHandlerWithExpectedMessage> messageHandler = adoptNS([[SWMessageHandlerWithExpectedMessage alloc] init]); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm
r273062 r273194 414 414 auto dataStoreConfiguration = adoptNS([_WKWebsiteDataStoreConfiguration new]); 415 415 [dataStoreConfiguration setFastServerTrustEvaluationEnabled:YES]; 416 [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]). autorelease()];416 [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).get()]; 417 417 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 418 418 [webView setNavigationDelegate:delegate.get()]; … … 474 474 [dataStoreConfiguration setFastServerTrustEvaluationEnabled:YES]; 475 475 auto webViewConfiguration = adoptNS([WKWebViewConfiguration new]); 476 [webViewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]). autorelease()];476 [webViewConfiguration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).get()]; 477 477 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 478 478 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm
r273062 r273194 405 405 RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]); 406 406 [configuration setExclusionRules:@[ 407 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"code"]). autorelease(),407 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"code"]).get(), 408 408 ]]; 409 409 … … 441 441 RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]); 442 442 [configuration setExclusionRules:@[ 443 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forAttribute:@"data-exclude" value:@"yes"]). autorelease(),444 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)NO forAttribute:@"data-exclude" value:@"no"]). autorelease(),443 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forAttribute:@"data-exclude" value:@"yes"]).get(), 444 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)NO forAttribute:@"data-exclude" value:@"no"]).get(), 445 445 ]]; 446 446 … … 469 469 auto configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]); 470 470 [configuration setExclusionRules:@[ 471 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:YES forClass:@"exclude"]). autorelease(),471 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:YES forClass:@"exclude"]).get(), 472 472 ]]; 473 473 … … 496 496 auto configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]); 497 497 [configuration setExclusionRules:@[ 498 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:YES forAttribute:@"data-exclude" value:@"yes"]). autorelease(),499 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:NO forAttribute:@"data-exclude" value:@"no"]). autorelease(),500 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:YES forClass:@"exclude"]). autorelease(),498 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:YES forAttribute:@"data-exclude" value:@"yes"]).get(), 499 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:NO forAttribute:@"data-exclude" value:@"no"]).get(), 500 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:YES forClass:@"exclude"]).get(), 501 501 ]]; 502 502 … … 1920 1920 1921 1921 auto replacementItems = retainPtr(@[ 1922 createItem(items[0].identifier, { { items[0].tokens[0].identifier, @"Replacement" }, { items[0].tokens[0].identifier, @"title" } }). autorelease(),1923 createItem(items[1].identifier, { { items[1].tokens[0].identifier, @"Replacement" }, { items[1].tokens[0].identifier, @"option" } }). autorelease(),1924 createItem(items[2].identifier, { { items[2].tokens[0].identifier, @"Failed replacement" }, { @"12345", @"option" } }). autorelease(),1925 createItem(items[3].identifier, { { items[3].tokens[0].identifier, @"Replacement" }, { items[3].tokens[0].identifier, @"label" } }). autorelease(),1926 createItem(items[4].identifier, { { items[4].tokens[0].identifier, @"Replacement" }, { items[4].tokens[0].identifier, @"image" } }). autorelease(),1922 createItem(items[0].identifier, { { items[0].tokens[0].identifier, @"Replacement" }, { items[0].tokens[0].identifier, @"title" } }).get(), 1923 createItem(items[1].identifier, { { items[1].tokens[0].identifier, @"Replacement" }, { items[1].tokens[0].identifier, @"option" } }).get(), 1924 createItem(items[2].identifier, { { items[2].tokens[0].identifier, @"Failed replacement" }, { @"12345", @"option" } }).get(), 1925 createItem(items[3].identifier, { { items[3].tokens[0].identifier, @"Replacement" }, { items[3].tokens[0].identifier, @"label" } }).get(), 1926 createItem(items[4].identifier, { { items[4].tokens[0].identifier, @"Replacement" }, { items[4].tokens[0].identifier, @"image" } }).get(), 1927 1927 ]); 1928 1928 … … 2340 2340 done = false; 2341 2341 [webView _completeTextManipulationForItems:@[ 2342 createItem(items[0].identifier, {{ items[0].tokens[0].identifier, @"Hello World" }}). autorelease(),2342 createItem(items[0].identifier, {{ items[0].tokens[0].identifier, @"Hello World" }}).get(), 2343 2343 ] completion:^(NSArray<NSError *> *errors) { 2344 2344 EXPECT_EQ(errors, nil); … … 2407 2407 RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]); 2408 2408 [configuration setExclusionRules:@[ 2409 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]). autorelease(),2409 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).get(), 2410 2410 ]]; 2411 2411 … … 2452 2452 RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]); 2453 2453 [configuration setExclusionRules:@[ 2454 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]). autorelease(),2454 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).get(), 2455 2455 ]]; 2456 2456 … … 2497 2497 RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]); 2498 2498 [configuration setExclusionRules:@[ 2499 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]). autorelease(),2499 adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).get(), 2500 2500 ]]; 2501 2501 … … 2595 2595 done = false; 2596 2596 [webView _completeTextManipulationForItems:@[ 2597 createItem(items[0].identifier, {{ items[0].tokens[0].identifier, @"hello" }}). autorelease(),2598 createItem(items[1].identifier, {{ items[1].tokens[0].identifier, @"world" }}). autorelease()2597 createItem(items[0].identifier, {{ items[0].tokens[0].identifier, @"hello" }}).get(), 2598 createItem(items[1].identifier, {{ items[1].tokens[0].identifier, @"world" }}).get() 2599 2599 ] completion:^(NSArray<NSError *> *errors) { 2600 2600 EXPECT_EQ(errors, nil); … … 2632 2632 2633 2633 auto replacementItems = retainPtr(@[ 2634 createItem(items[0].identifier, { { items[0].tokens[0].identifier, @"ONE" }, { items[0].tokens[1].identifier, items[0].tokens[1].content }, { items[0].tokens[2].identifier, @"TWO" }, { items[0].tokens[3].identifier, items[0].tokens[3].content } }). autorelease(),2634 createItem(items[0].identifier, { { items[0].tokens[0].identifier, @"ONE" }, { items[0].tokens[1].identifier, items[0].tokens[1].content }, { items[0].tokens[2].identifier, @"TWO" }, { items[0].tokens[3].identifier, items[0].tokens[3].content } }).get(), 2635 2635 ]); 2636 2636 … … 2713 2713 2714 2714 auto replacementItems = retainPtr(@[ 2715 createItem(items[0].identifier, { { items[0].tokens[0].identifier, @"Hello" }, { items[0].tokens[1].identifier, @"World" } }). autorelease(),2716 createItem(items[1].identifier, { { items[1].tokens[0].identifier, @"From WebKit" } }). autorelease(),2715 createItem(items[0].identifier, { { items[0].tokens[0].identifier, @"Hello" }, { items[0].tokens[1].identifier, @"World" } }).get(), 2716 createItem(items[1].identifier, { { items[1].tokens[0].identifier, @"From WebKit" } }).get(), 2717 2717 ]); 2718 2718 … … 2752 2752 2753 2753 auto replacementItems = retainPtr(@[ 2754 createItem(items[0].identifier, { { items[0].tokens[0].identifier, @"Hello" }, { items[0].tokens[1].identifier, @"World" }, { items[0].tokens[2].identifier, @"From WebKit" } }). autorelease()2754 createItem(items[0].identifier, { { items[0].tokens[0].identifier, @"Hello" }, { items[0].tokens[1].identifier, @"World" }, { items[0].tokens[2].identifier, @"From WebKit" } }).get() 2755 2755 ]); 2756 2756 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm
r273075 r273194 67 67 TEST(WebKit, WKWebViewIsPlayingAudio) 68 68 { 69 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:adoptNS([[WKWebViewConfiguration alloc] init]). autorelease()]);69 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:adoptNS([[WKWebViewConfiguration alloc] init]).get()]); 70 70 auto observer = adoptNS([[AudioObserver alloc] init]); 71 71 [webView addObserver:observer.get() forKeyPath:@"_isPlayingAudio" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil]; … … 225 225 { 226 226 NSString *data = @"<script>window.open('other.html');</script>"; 227 [urlSchemeTask didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:urlSchemeTask.request.URL MIMEType:@"text/html" expectedContentLength:data.length textEncodingName:nil]). autorelease()];227 [urlSchemeTask didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:urlSchemeTask.request.URL MIMEType:@"text/html" expectedContentLength:data.length textEncodingName:nil]).get()]; 228 228 [urlSchemeTask didReceiveData:[data dataUsingEncoding:NSUTF8StringEncoding]]; 229 229 [urlSchemeTask didFinish]; … … 514 514 NSString *html = @"<script>Notification.requestPermission(function(p){alert('permission '+p)})</script>"; 515 515 auto webView = adoptNS([[WKWebView alloc] init]); 516 [webView setUIDelegate:adoptNS([[NotificationDelegate alloc] initWithAllowNotifications:YES]).autorelease()]; 516 auto uiDelegate = adoptNS([[NotificationDelegate alloc] initWithAllowNotifications:YES]); 517 [webView setUIDelegate:uiDelegate.get()]; 517 518 [webView loadHTMLString:html baseURL:[NSURL URLWithString:@"https://example.org"]]; 518 519 TestWebKitAPI::Util::run(&done); 519 520 done = false; 520 [webView setUIDelegate:adoptNS([[NotificationDelegate alloc] initWithAllowNotifications:NO]).autorelease()]; 521 uiDelegate = adoptNS([[NotificationDelegate alloc] initWithAllowNotifications:NO]); 522 [webView setUIDelegate:uiDelegate.get()]; 521 523 [webView loadHTMLString:html baseURL:[NSURL URLWithString:@"https://example.com"]]; 522 524 TestWebKitAPI::Util::run(&done); … … 577 579 TEST(WebKit, ToolbarVisible) 578 580 { 579 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:adoptNS([[WKWebViewConfiguration alloc] init]). autorelease()]);581 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:adoptNS([[WKWebViewConfiguration alloc] init]).get()]); 580 582 auto delegate = adoptNS([[ToolbarDelegate alloc] init]); 581 583 [webView setUIDelegate:delegate.get()]; … … 605 607 WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"FrameHandleSerialization"]; 606 608 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:configuration]); 607 [webView setUIDelegate:adoptNS([[MouseMoveOverElementDelegate alloc] init]).autorelease()]; 609 auto uiDelegate = adoptNS([[MouseMoveOverElementDelegate alloc] init]); 610 [webView setUIDelegate:uiDelegate.get()]; 608 611 [webView synchronouslyLoadHTMLString:@"<a href='http://example.com/path' title='link title'>link label</a>"]; 609 612 [webView mouseMoveToPoint:NSMakePoint(20, 600 - 20) withFlags:NSEventModifierFlagShift]; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm
r273062 r273194 239 239 RetainPtr<ScriptMessageHandler> handler = adoptNS([[ScriptMessageHandler alloc] init]); 240 240 RetainPtr<WKWebViewConfiguration> configurationCopy = adoptNS([configuration copy]); 241 [configurationCopy setUserContentController:adoptNS([[WKUserContentController alloc] init]). autorelease()];241 [configurationCopy setUserContentController:adoptNS([[WKUserContentController alloc] init]).get()]; 242 242 [[configurationCopy userContentController] addScriptMessageHandler:handler.get() name:@"handlerToRemove"]; 243 243 [[configurationCopy userContentController] addScriptMessageHandler:handler.get() name:@"handlerToPost"]; … … 257 257 RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 258 258 RetainPtr<_WKProcessPoolConfiguration> processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 259 [configuration setProcessPool:adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]). autorelease()];259 [configuration setProcessPool:adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]).get()]; 260 260 261 261 RetainPtr<WKWebView> webView = webViewForScriptMessageHandlerMultipleHandlerRemovalTest(configuration.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm
r273062 r273194 2083 2083 TEST(WKAttachmentTestsIOS, InsertPastedContactAsAttachment) 2084 2084 { 2085 UIPasteboard.generalPasteboard.itemProviders = @[ contactItemForTesting(). autorelease() ];2085 UIPasteboard.generalPasteboard.itemProviders = @[ contactItemForTesting().get() ]; 2086 2086 auto webView = webViewForTestingAttachments(); 2087 2087 ObserveAttachmentUpdatesForScope observer(webView.get()); … … 2100 2100 { 2101 2101 UIApplicationInitialize(); 2102 UIPasteboard.generalPasteboard.itemProviders = @[ mapItemForTesting(). autorelease() ];2102 UIPasteboard.generalPasteboard.itemProviders = @[ mapItemForTesting().get() ]; 2103 2103 auto webView = webViewForTestingAttachments(); 2104 2104 ObserveAttachmentUpdatesForScope observer(webView.get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm
r273075 r273194 162 162 TEST(PDFHUD, MainResourcePDF) 163 163 { 164 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:adoptNS([WKWebViewConfiguration new]). autorelease()]);164 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:adoptNS([WKWebViewConfiguration new]).get()]); 165 165 [webView loadData:pdfData() MIMEType:@"application/pdf" characterEncodingName:@"" baseURL:[NSURL URLWithString:@"https://www.apple.com/testPath"]]; 166 166 EXPECT_EQ([webView _pdfHUDs].count, 0u); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm
r273062 r273194 580 580 } else { 581 581 EXPECT_STREQ(task.request.URL.absoluteString.UTF8String, "syncerror:///subresource"); 582 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] init]). autorelease()];582 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] init]).get()]; 583 583 [task didFailWithError:[NSError errorWithDomain:@"TestErrorDomain" code:123 userInfo:nil]]; 584 584 } … … 801 801 @"Content-Length": @"2", 802 802 @"Content-Type":@"text/html" 803 }]). autorelease()];803 }]).get()]; 804 804 } else 805 805 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:0 textEncodingName:nil]).get()]; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm
r273062 r273194 512 512 if ([task.request.URL.absoluteString isEqualToString:@"framestest://test/index.html"]) { 513 513 NSData *data = [[NSString stringWithFormat:@"%s", framesMainResource] dataUsingEncoding:NSUTF8StringEncoding]; 514 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:data.length textEncodingName:nil]). autorelease()];514 [task didReceiveResponse:adoptNS([[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:data.length textEncodingName:nil]).get()]; 515 515 [task didReceiveData:data]; 516 516 [task didFinish]; -
trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm
r273154 r273194 1114 1114 1115 1115 auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]); 1116 [simulator setExternalItemProviders:@[ createMapItemForTesting(). autorelease() ]];1116 [simulator setExternalItemProviders:@[ createMapItemForTesting().get() ]]; 1117 1117 [simulator runFrom:CGPointMake(0, 0) to:CGPointMake(100, 100)]; 1118 1118 EXPECT_WK_STREQ("Apple Park", [webView stringByEvaluatingJavaScript:@"document.querySelector('div[contenteditable]').textContent"]); … … 1132 1132 1133 1133 auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]); 1134 [simulator setExternalItemProviders:@[ createContactItemForTesting(). autorelease() ]];1134 [simulator setExternalItemProviders:@[ createContactItemForTesting().get() ]]; 1135 1135 [simulator runFrom:CGPointMake(0, 0) to:CGPointMake(100, 100)]; 1136 1136 EXPECT_WK_STREQ("", [webView stringByEvaluatingJavaScript:@"document.querySelector('div[contenteditable]').textContent"]); … … 1146 1146 1147 1147 auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]); 1148 [simulator setExternalItemProviders:@[ createMapItemForTesting(). autorelease(), createContactItemForTesting().autorelease() ]];1148 [simulator setExternalItemProviders:@[ createMapItemForTesting().get(), createContactItemForTesting().get() ]]; 1149 1149 [simulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 300)]; 1150 1150 -
trunk/Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm
r272765 r273194 100 100 RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 101 101 102 CrossPartitionFileSchemeAccessNavigationDelegate *delegate = [[CrossPartitionFileSchemeAccessNavigationDelegate alloc] init];103 [webView setNavigationDelegate:delegate ];102 auto delegate = adoptNS([[CrossPartitionFileSchemeAccessNavigationDelegate alloc] init]); 103 [webView setNavigationDelegate:delegate.get()]; 104 104 105 105 NSURLRequest *request = [NSURLRequest requestWithURL:url]; -
trunk/Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm
r252598 r273194 124 124 [webView selectWord:nil]; 125 125 [webView waitForNextPresentationUpdate]; 126 [fontManager addFontTrait:menuItemCellForFontAction(NSBoldFontMask). autorelease()];126 [fontManager addFontTrait:menuItemCellForFontAction(NSBoldFontMask).get()]; 127 127 EXPECT_WK_STREQ("bold", [webView stylePropertyAtSelectionStart:@"font-weight"]); 128 128 EXPECT_WK_STREQ("bold", [webView stylePropertyAtSelectionEnd:@"font-weight"]); 129 129 EXPECT_WK_STREQ("Times-Bold", [fontManager selectedFont].fontName); 130 130 131 [fontManager addFontTrait:menuItemCellForFontAction(NSUnboldFontMask). autorelease()];131 [fontManager addFontTrait:menuItemCellForFontAction(NSUnboldFontMask).get()]; 132 132 EXPECT_WK_STREQ("normal", [webView stylePropertyAtSelectionStart:@"font-weight"]); 133 133 EXPECT_WK_STREQ("normal", [webView stylePropertyAtSelectionEnd:@"font-weight"]); 134 134 EXPECT_WK_STREQ("Times-Roman", [fontManager selectedFont].fontName); 135 135 136 [fontManager addFontTrait:menuItemCellForFontAction(NSItalicFontMask). autorelease()];136 [fontManager addFontTrait:menuItemCellForFontAction(NSItalicFontMask).get()]; 137 137 EXPECT_WK_STREQ("italic", [webView stylePropertyAtSelectionStart:@"font-style"]); 138 138 EXPECT_WK_STREQ("italic", [webView stylePropertyAtSelectionEnd:@"font-style"]); 139 139 EXPECT_WK_STREQ("Times-Italic", [fontManager selectedFont].fontName); 140 140 141 [fontManager addFontTrait:menuItemCellForFontAction(NSUnitalicFontMask). autorelease()];141 [fontManager addFontTrait:menuItemCellForFontAction(NSUnitalicFontMask).get()]; 142 142 EXPECT_WK_STREQ("normal", [webView stylePropertyAtSelectionStart:@"font-style"]); 143 143 EXPECT_WK_STREQ("normal", [webView stylePropertyAtSelectionEnd:@"font-style"]);
Note:
See TracChangeset
for help on using the changeset viewer.