⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 273194 in webkit


Ignore:
Timestamp:
Feb 19, 2021, 10:37:00 PM (6 years ago)
Author:
Chris Dumez
Message:

Review remaining usage of autorelease to make sure it is necessary
https://bugs.webkit.org/show_bug.cgi?id=222177

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

  • API/JSContext.mm:

(+[JSContext contextWithJSGlobalContextRef:]):

  • API/JSVirtualMachine.mm:

(+[JSVirtualMachine virtualMachineWithContextGroupRef:]):

  • API/JSWrapperMap.mm:

(-[JSWrapperMap objcWrapperForJSValueRef:inContext:]):

Source/WebCore:

  • platform/ios/WebVideoFullscreenControllerAVKit.mm:

(-[WebVideoFullscreenController didFinishFullscreen:]):

Source/WebKit:

  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

  • Platform/cocoa/WKPaymentAuthorizationDelegate.mm:

(-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]):
(-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):

  • UIProcess/API/Cocoa/NSAttributedString.mm:

(+[_WKAttributedStringWebViewCache configuration]):
(+[NSAttributedString _loadFromHTMLWithOptions:contentLoader:completionHandler:]):

  • UIProcess/API/Cocoa/WKBrowsingContextController.mm:

(setUpPagePolicyClient):

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):

  • UIProcess/API/ios/WKWebViewTestingIOS.mm:

(-[WKWebView _requestTextInputContextsInRect:completionHandler:]):

  • WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:

(WebKit::convertToNPNNString):

  • WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:

(-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):

Source/WebKitLegacy/mac:

  • Misc/WebNSObjectExtras.mm:

(-[WebMainThreadInvoker forwardInvocation:]):

  • Plugins/WebNetscapePluginView.mm:

(-[WebNetscapePluginView sendEvent:isDrawRect:]):

  • WebView/WebVideoFullscreenController.mm:

(-[WebVideoFullscreenController init]):

Tools:

  • TestRunnerShared/mac/NSPasteboardAdditions.mm:

(+[NSPasteboard _modernPasteboardType:]):

  • TestWebKitAPI/Tests/JavaScriptCore/JSRunLoopTimer.mm:

(TestWebKitAPI::triggerGC):

  • TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm:

(TestWebKitAPI::WebCoreNSURLSessionTest::SetUp):

  • TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm:

(TestWebKitAPI::TEST):

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

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm:

(-[ContentRuleListNotificationDelegate webView:startURLSchemeTask:]):

  • TestWebKitAPI/Tests/WebKitCocoa/DeviceManagementRestrictions.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/Download.mm:

(TestWebKitAPI::webViewWithDownloadMonitorSpeedMultiplier):

  • TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm:

(runDragStartDataTestCase):

  • TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:

(-[InAppBrowserSchemeHandler webView:startURLSchemeTask:]):

  • TestWebKitAPI/Tests/WebKitCocoa/IndexedDBStructuredCloneBackwardCompatibility.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/IndexedDBTempFileSize.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/JITEnabled.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/LocalStorageDatabaseTracker.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/ReparentWebViewTimeout.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:

(TEST):
(-[ResourceLoadStatisticsSchemeHandler webView:startURLSchemeTask:]):

  • TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:

(TEST):

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

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:

(TEST):
(-[UITestDelegate webView:startURLSchemeTask:]):

  • TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:

(webViewForScriptMessageHandlerMultipleHandlerRemovalTest):
(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:

(-[SyncErrorScheme webView:startURLSchemeTask:]):

  • TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm:
  • TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/mac/FontManagerTests.mm:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContext.mm

    r273128 r273194  
    407407{
    408408    JSVirtualMachine *virtualMachine = [JSVirtualMachine virtualMachineWithContextGroupRef:toRef(&toJS(globalContext)->vm())];
    409     JSContext *context = [virtualMachine contextForGlobalContextRef:globalContext];
     409    auto context = retainPtr([virtualMachine contextForGlobalContextRef:globalContext]);
    410410    if (!context)
    411         context = adoptNS([[JSContext alloc] initWithGlobalContextRef:globalContext]).autorelease();
    412     return context;
     411        context = adoptNS([[JSContext alloc] initWithGlobalContextRef:globalContext]);
     412    return context.autorelease();
    413413}
    414414
  • trunk/Source/JavaScriptCore/API/JSVirtualMachine.mm

    r273138 r273194  
    235235+ (JSVirtualMachine *)virtualMachineWithContextGroupRef:(JSContextGroupRef)group
    236236{
    237     JSVirtualMachine *virtualMachine = [JSVMWrapperCache wrapperForJSContextGroupRef:group];
     237    auto virtualMachine = retainPtr([JSVMWrapperCache wrapperForJSContextGroupRef:group]);
    238238    if (!virtualMachine)
    239         virtualMachine = adoptNS([[JSVirtualMachine alloc] initWithContextGroupRef:group]).autorelease();
    240     return virtualMachine;
     239        virtualMachine = adoptNS([[JSVirtualMachine alloc] initWithContextGroupRef:group]);
     240    return virtualMachine.autorelease();
    241241}
    242242
  • trunk/Source/JavaScriptCore/API/JSWrapperMap.mm

    r273128 r273194  
    665665{
    666666    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));
    668668    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();
    673673}
    674674
  • trunk/Source/JavaScriptCore/ChangeLog

    r273187 r273194  
     12021-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
    1152021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r273193 r273194  
     12021-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
    1112021-02-19  Rob Buis  <rbuis@igalia.com>
    212
  • trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm

    r272936 r273194  
    10631063    ASSERT(WebThreadIsCurrent());
    10641064    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.
    10661066    _context->setController(nil);
    10671067    _context = nullptr;
  • trunk/Source/WebKit/ChangeLog

    r273192 r273194  
     12021-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
    1282021-02-19  Devin Rousso  <drousso@apple.com>
    229
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r272936 r273194  
    12331233        // FIXME: Remove this respondsToSelector check once rdar://problem/50109631 is in a build and bots are updated.
    12341234        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();
    12361236    }
    12371237#endif
     
    12681268    if (!parameters.alternativeServiceDirectory.isEmpty()) {
    12691269        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();
    12711271    }
    12721272    if (parameters.http3Enabled)
  • trunk/Source/WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.mm

    r273192 r273194  
    7070- (void)completePaymentMethodSelection:(PKPaymentRequestPaymentMethodUpdate *)paymentMethodUpdate
    7171{
    72     PKPaymentRequestPaymentMethodUpdate *update = paymentMethodUpdate ?: adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]).autorelease();
    73     _summaryItems = adoptNS([update.paymentSummaryItems copy]);
    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());
    7575}
    7676
     
    8282- (void)completeShippingContactSelection:(PKPaymentRequestShippingContactUpdate *)shippingContactUpdate
    8383{
    84     PKPaymentRequestShippingContactUpdate *update = shippingContactUpdate ?: adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[] paymentSummaryItems:_summaryItems.get() shippingMethods:_shippingMethods.get()]).autorelease();
    85     _summaryItems = adoptNS([update.paymentSummaryItems copy]);
    86     _shippingMethods = adoptNS([update.shippingMethods copy]);
    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());
    8888}
    8989
    9090- (void)completeShippingMethodSelection:(PKPaymentRequestShippingMethodUpdate *)shippingMethodUpdate
    9191{
    92     PKPaymentRequestShippingMethodUpdate *update = shippingMethodUpdate ?: adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]).autorelease();
    93     _summaryItems = adoptNS([update.paymentSummaryItems copy]);
    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());
    9595}
    9696
  • trunk/Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm

    r273128 r273194  
    134134    if (!configuration) {
    135135        configuration = [[WKWebViewConfiguration alloc] init];
    136         configuration.processPool = adoptNS([[WKProcessPool alloc] init]).autorelease();
     136        configuration.processPool = adoptNS([[WKProcessPool alloc] init]).get();
    137137        configuration.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore];
    138138        configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll;
     
    270270
    271271            // 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            }
    274277
    275278            // 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            }
    278284
    279285            completionHandler(attributedString, attributes, error);
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm

    r272936 r273194  
    495495
    496496        if ([policyDelegate respondsToSelector:@selector(browsingContextController:decidePolicyForNavigationAction:decisionHandler:)]) {
    497             NSDictionary *actionDictionary = @{
     497            auto actionDictionary = retainPtr(@{
    498498                WKActionIsMainFrameKey: @(WKFrameIsMainFrame(frame)),
    499499                WKActionNavigationTypeKey: @(navigationType),
     
    502502                WKActionOriginalURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(originalRequest)).get(),
    503503                WKActionURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(request)).get()
    504             };
     504            });
    505505
    506506            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];
    509509            }
    510510           
    511             [policyDelegate browsingContextController:browsingContext decidePolicyForNavigationAction:actionDictionary decisionHandler:makePolicyDecisionBlock(listener)];
     511            [policyDelegate browsingContextController:browsingContext decidePolicyForNavigationAction:actionDictionary.get() decisionHandler:makePolicyDecisionBlock(listener)];
    512512        } else
    513513            WKFramePolicyListenerUse(listener);
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r273186 r273194  
    22562256    }
    22572257
    2258     [self createPDFWithConfiguration:pdfConfiguration.autorelease() completionHandler:completionHandler];
     2258    [self createPDFWithConfiguration:pdfConfiguration.get() completionHandler:completionHandler];
    22592259}
    22602260
  • trunk/Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm

    r273049 r273194  
    5959            [adjustedContexts addObject:adoptNS([[_WKTextInputContext alloc] _initWithTextInputContext:adjustedContext]).get()];
    6060        }
    61         completionHandler(adjustedContexts.autorelease());
     61        completionHandler(adjustedContexts.get());
    6262    }];
    6363}
  • trunk/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm

    r267916 r273194  
    482482static NPNSString *convertToNPNNString(const String& string)
    483483{
    484     CFTypeRef releasedString = string.createCFString().autorelease();
    485     return static_cast<NPNSString*>(const_cast<void*>(releasedString));
     484    return static_cast<NPNSString*>(static_cast<NSString*>(string));
    486485}
    487486
  • trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm

    r272789 r273194  
    9696#endif
    9797
    98     id names = ax::retrieveValueFromMainThread<RetainPtr<id>>([PROTECTED_SELF] () -> RetainPtr<id> {
     98    auto names = ax::retrieveValueFromMainThread<RetainPtr<id>>([PROTECTED_SELF] () -> RetainPtr<id> {
    9999        auto page = protectedSelf->m_page;
    100100        if (!page)
     
    106106
    107107        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();
    115115}
    116116
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r273159 r273194  
     12021-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
    1152021-02-19  Devin Rousso  <drousso@apple.com>
    216
  • trunk/Source/WebKitLegacy/mac/Misc/WebNSObjectExtras.mm

    r273062 r273194  
    6363    [invocation performSelectorOnMainThread:@selector(_webkit_invokeAndHandleException:) withObject:self waitUntilDone:YES];
    6464    if (exception) {
    65         id exceptionToThrow = std::exchange(exception, nil).autorelease();
    66         @throw exceptionToThrow;
     65        auto exceptionToThrow = std::exchange(exception, nil);
     66        @throw exceptionToThrow.get();
    6767    } else if (returnTypeIsObject(invocation)) {
    6868        // _webkit_invokeAndHandleException retained the return value on the main thread.
  • trunk/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm

    r273062 r273194  
    356356
    357357    // Temporarily retain self in case the plug-in view is released while sending an event.
    358     retainPtr(self).autorelease();
     358    auto strongSelf = retainPtr(self);
    359359
    360360    BOOL acceptedEvent;
  • trunk/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenController.mm

    r273062 r273194  
    152152    _contentOverlay = adoptNS([[NSView alloc] initWithFrame:NSZeroRect]);
    153153    _contentOverlay.get().layerContentsRedrawPolicy = NSViewLayerContentsRedrawNever;
    154     _contentOverlay.get().layer = adoptNS([[WebVideoFullscreenOverlayLayer alloc] init]).autorelease();
     154    _contentOverlay.get().layer = adoptNS([[WebVideoFullscreenOverlayLayer alloc] init]).get();
    155155    [_contentOverlay setWantsLayer:YES];
    156156    [_contentOverlay setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
  • trunk/Tools/ChangeLog

    r273184 r273194  
     12021-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
    1732021-02-19  Wenson Hsieh  <wenson_hsieh@apple.com>
    274
  • trunk/Tools/TestWebKitAPI/Tests/JavaScriptCore/JSRunLoopTimer.mm

    r273062 r273194  
    6666    @autoreleasepool {
    6767        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];
    6969        JSGarbageCollect([context JSGlobalContextRef]);
    7070    }
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm

    r273062 r273194  
    119119#endif
    120120        view = adoptNS([[WebView alloc] initWithFrame:NSZeroRect]);
    121         [view setFrameLoadDelegate:adoptNS([[TestNSURLSessionLoaderDelegate alloc] init]).autorelease()];
     121        [view setFrameLoadDelegate:adoptNS([[TestNSURLSessionLoaderDelegate alloc] init]).get()];
    122122
    123123        didLoadMainResource = false;
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm

    r273130 r273194  
    116116
    117117    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()];
    119119    auto processPoolConfig = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
    120120    auto preferences = [configuration preferences];
     
    146146   
    147147    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()];
    149149    auto processPoolConfig = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
    150150    auto preferences = [configuration preferences];
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/ContextMenuImgWithVideo.mm

    r273062 r273194  
    5656{
    5757    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();
    5960    [webView synchronouslyLoadTestPageNamed:@"ContextMenuImgWithVideo"];
    6061
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm

    r273181 r273194  
    557557    auto dataStoreConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]);
    558558    [dataStoreConfiguration setFastServerTrustEvaluationEnabled:YES];
    559     [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).autorelease()];
     559    [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).get()];
    560560    auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
    561561    auto delegate = adoptNS([ServerTrustDelegate new]);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm

    r273062 r273194  
    8787- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
    8888{
    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()];
    9090    [urlSchemeTask didFinish];
    9191}
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DeviceManagementRestrictions.mm

    r273062 r273194  
    4343
    4444    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()];
    4646
    4747    RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:webViewConfiguration.get() addToWindow:YES]);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm

    r273062 r273194  
    359359{
    360360    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()];
    362363    [[[webView configuration] processPool] _setDownloadDelegate:[[DownloadRequestOriginalURLDelegate alloc] initWithExpectedOriginalURL:sourceURL]];
    363364
     
    898899    [dataStoreConfiguration setTestSpeedMultiplier:multiplier];
    899900    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()];
    901902    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
    902903    [webView setNavigationDelegate:navigationDelegate.get()];
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm

    r262507 r273194  
    194194    NSString *url { nil };
    195195    NSString *html { nil };
    196     NSDictionary<NSString *, NSString *> *customData { nil };
     196    RetainPtr<NSDictionary<NSString *, NSString *>> customData;
    197197};
    198198
     
    216216    [allData removeObjectForKey:@"Files"];
    217217    if ([allData count])
    218         result.customData = allData.autorelease();
     218        result.customData = WTFMove(allData);
    219219    return result;
    220220}
     
    243243    EXPECT_NULL(result.url);
    244244    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"]);
    246246    EXPECT_FALSE(result.containsFile);
    247247
     
    257257    EXPECT_NULL(result.url);
    258258    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"]);
    260260    EXPECT_FALSE(result.containsFile);
    261261}
     
    306306    EXPECT_WK_STREQ("https://www.apple.com/", result.url);
    307307    EXPECT_NULL(result.html);
    308     EXPECT_WK_STREQ("bar", result.customData[@"text/foo"]);
     308    EXPECT_WK_STREQ("bar", result.customData.get()[@"text/foo"]);
    309309    EXPECT_FALSE(result.containsFile);
    310310}
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm

    r273102 r273194  
    121121        response = @"<body id = 'body'></body><iframe id='iframe'></iframe></body>";
    122122
    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()];
    124124    [task didReceiveData:[response dataUsingEncoding:NSUTF8StringEncoding]];
    125125    [task didFinish];
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBStructuredCloneBackwardCompatibility.mm

    r273062 r273194  
    9797    RetainPtr<_WKWebsiteDataStoreConfiguration> websiteDataStoreConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]);
    9898    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();
    100100
    101101    idbPath = [idbPath URLByAppendingPathComponent:@"file__0"];
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBTempFileSize.mm

    r273062 r273194  
    7272    websiteDataStoreConfiguration.get()._indexedDBDatabaseDirectory = idbPath.get();
    7373
    74     configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).autorelease();
     74    configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get();
    7575    auto types = adoptNS([[NSSet alloc] initWithObjects:WKWebsiteDataTypeIndexedDBDatabases, nil]);
    7676
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/JITEnabled.mm

    r273062 r273194  
    5050    [processPoolConfiguration setJITEnabled:NO];
    5151    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()];
    5353    auto webViewNoJIT = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
    5454    checkJITEnabled(WTFMove(webViewNoJIT), NO);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStorageDatabaseTracker.mm

    r273062 r273194  
    5757    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
    5858    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();
    6061    [webView loadHTMLString:@"<script>localStorage.setItem('testKey', 'testValue');alert(localStorage.getItem('testKey'));</script>" baseURL:[NSURL URLWithString:@"http://localhost"]];
    6162    TestWebKitAPI::Util::run(&readyToContinue);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm

    r273062 r273194  
    3737TEST(WebKit, NetworkProcessEntitlements)
    3838{
    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()]);
    4040    [webView synchronouslyLoadTestPageNamed:@"simple"];
    4141    WKWebsiteDataStore *store = [webView configuration].websiteDataStore;
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

    r273130 r273194  
    54565456    auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
    54575457    [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();
    54595459
    54605460    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm

    r273062 r273194  
    8585    [storeConfiguration setAllowsServerPreconnect:NO];
    8686    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()];
    8888    auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:viewConfiguration.get()]);
    8989    auto delegate = adoptNS([ProxyDelegate new]);
     
    132132
    133133    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()];
    135135    auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:viewConfiguration.get()]);
    136136    auto delegate = adoptNS([ProxyDelegate new]);
     
    175175
    176176    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()];
    178178    auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:viewConfiguration.get()]);
    179179    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://example.com/"]]];
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ReparentWebViewTimeout.mm

    r273062 r273194  
    3939
    4040    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()];
    4242
    4343    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  
    327327    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
    328328    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();
    330330
    331331    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
     
    584584{
    585585    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()]);
    587587    [configuration setWebsiteDataStore:dataStore.get()];
    588588    [dataStore _setResourceLoadStatisticsEnabled:YES];
     
    12801280    auto *sharedProcessPool = [WKProcessPool _sharedProcessPool];
    12811281    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()]);
    12831283
    12841284    [dataStore1 _setResourceLoadStatisticsEnabled:YES];
     
    13261326        response = @"<body></body>";
    13271327
    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()];
    13291329    [task didReceiveData:[response dataUsingEncoding:NSUTF8StringEncoding]];
    13301330    [task didFinish];
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm

    r273062 r273194  
    309309    auto showWarning = ^{
    310310        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) {
    312312            shouldContinueValue = shouldContinue;
    313313            completionHandlerCalled = true;
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm

    r273062 r273194  
    14081408    websiteDataStoreConfiguration.get()._indexedDBDatabaseDirectory = idbPath;
    14091409
    1410     configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).autorelease();
     1410    configuration.get().websiteDataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()]).get();
    14111411
    14121412    RetainPtr<SWMessageHandlerWithExpectedMessage> messageHandler = adoptNS([[SWMessageHandlerWithExpectedMessage alloc] init]);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm

    r273062 r273194  
    414414    auto dataStoreConfiguration = adoptNS([_WKWebsiteDataStoreConfiguration new]);
    415415    [dataStoreConfiguration setFastServerTrustEvaluationEnabled:YES];
    416     [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).autorelease()];
     416    [configuration setWebsiteDataStore:adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()]).get()];
    417417    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
    418418    [webView setNavigationDelegate:delegate.get()];
     
    474474    [dataStoreConfiguration setFastServerTrustEvaluationEnabled:YES];
    475475    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()];
    477477    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
    478478
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm

    r273062 r273194  
    405405    RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]);
    406406    [configuration setExclusionRules:@[
    407         adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"code"]).autorelease(),
     407        adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"code"]).get(),
    408408    ]];
    409409
     
    441441    RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]);
    442442    [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(),
    445445    ]];
    446446
     
    469469    auto configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]);
    470470    [configuration setExclusionRules:@[
    471         adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:YES forClass:@"exclude"]).autorelease(),
     471        adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:YES forClass:@"exclude"]).get(),
    472472    ]];
    473473
     
    496496    auto configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]);
    497497    [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(),
    501501    ]];
    502502
     
    19201920
    19211921    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(),
    19271927    ]);
    19281928
     
    23402340    done = false;
    23412341    [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(),
    23432343    ] completion:^(NSArray<NSError *> *errors) {
    23442344        EXPECT_EQ(errors, nil);
     
    24072407    RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]);
    24082408    [configuration setExclusionRules:@[
    2409         adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).autorelease(),
     2409        adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).get(),
    24102410    ]];
    24112411
     
    24522452    RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]);
    24532453    [configuration setExclusionRules:@[
    2454         adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).autorelease(),
     2454        adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).get(),
    24552455    ]];
    24562456
     
    24972497    RetainPtr<_WKTextManipulationConfiguration> configuration = adoptNS([[_WKTextManipulationConfiguration alloc] init]);
    24982498    [configuration setExclusionRules:@[
    2499         adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).autorelease(),
     2499        adoptNS([[_WKTextManipulationExclusionRule alloc] initExclusion:(BOOL)YES forElement:@"em"]).get(),
    25002500    ]];
    25012501
     
    25952595    done = false;
    25962596    [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()
    25992599    ] completion:^(NSArray<NSError *> *errors) {
    26002600        EXPECT_EQ(errors, nil);
     
    26322632
    26332633    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(),
    26352635    ]);
    26362636
     
    27132713
    27142714    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(),
    27172717    ]);
    27182718
     
    27522752
    27532753    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()
    27552755    ]);
    27562756
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm

    r273075 r273194  
    6767TEST(WebKit, WKWebViewIsPlayingAudio)
    6868{
    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()]);
    7070    auto observer = adoptNS([[AudioObserver alloc] init]);
    7171    [webView addObserver:observer.get() forKeyPath:@"_isPlayingAudio" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];
     
    225225{
    226226    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()];
    228228    [urlSchemeTask didReceiveData:[data dataUsingEncoding:NSUTF8StringEncoding]];
    229229    [urlSchemeTask didFinish];
     
    514514    NSString *html = @"<script>Notification.requestPermission(function(p){alert('permission '+p)})</script>";
    515515    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()];
    517518    [webView loadHTMLString:html baseURL:[NSURL URLWithString:@"https://example.org"]];
    518519    TestWebKitAPI::Util::run(&done);
    519520    done = false;
    520     [webView setUIDelegate:adoptNS([[NotificationDelegate alloc] initWithAllowNotifications:NO]).autorelease()];
     521    uiDelegate = adoptNS([[NotificationDelegate alloc] initWithAllowNotifications:NO]);
     522    [webView setUIDelegate:uiDelegate.get()];
    521523    [webView loadHTMLString:html baseURL:[NSURL URLWithString:@"https://example.com"]];
    522524    TestWebKitAPI::Util::run(&done);
     
    577579TEST(WebKit, ToolbarVisible)
    578580{
    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()]);
    580582    auto delegate = adoptNS([[ToolbarDelegate alloc] init]);
    581583    [webView setUIDelegate:delegate.get()];
     
    605607    WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"FrameHandleSerialization"];
    606608    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()];
    608611    [webView synchronouslyLoadHTMLString:@"<a href='http://example.com/path' title='link title'>link label</a>"];
    609612    [webView mouseMoveToPoint:NSMakePoint(20, 600 - 20) withFlags:NSEventModifierFlagShift];
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm

    r273062 r273194  
    239239    RetainPtr<ScriptMessageHandler> handler = adoptNS([[ScriptMessageHandler alloc] init]);
    240240    RetainPtr<WKWebViewConfiguration> configurationCopy = adoptNS([configuration copy]);
    241     [configurationCopy setUserContentController:adoptNS([[WKUserContentController alloc] init]).autorelease()];
     241    [configurationCopy setUserContentController:adoptNS([[WKUserContentController alloc] init]).get()];
    242242    [[configurationCopy userContentController] addScriptMessageHandler:handler.get() name:@"handlerToRemove"];
    243243    [[configurationCopy userContentController] addScriptMessageHandler:handler.get() name:@"handlerToPost"];
     
    257257    RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
    258258    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()];
    260260
    261261    RetainPtr<WKWebView> webView = webViewForScriptMessageHandlerMultipleHandlerRemovalTest(configuration.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm

    r273062 r273194  
    20832083TEST(WKAttachmentTestsIOS, InsertPastedContactAsAttachment)
    20842084{
    2085     UIPasteboard.generalPasteboard.itemProviders = @[ contactItemForTesting().autorelease() ];
     2085    UIPasteboard.generalPasteboard.itemProviders = @[ contactItemForTesting().get() ];
    20862086    auto webView = webViewForTestingAttachments();
    20872087    ObserveAttachmentUpdatesForScope observer(webView.get());
     
    21002100{
    21012101    UIApplicationInitialize();
    2102     UIPasteboard.generalPasteboard.itemProviders = @[ mapItemForTesting().autorelease() ];
     2102    UIPasteboard.generalPasteboard.itemProviders = @[ mapItemForTesting().get() ];
    21032103    auto webView = webViewForTestingAttachments();
    21042104    ObserveAttachmentUpdatesForScope observer(webView.get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm

    r273075 r273194  
    162162TEST(PDFHUD, MainResourcePDF)
    163163{
    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()]);
    165165    [webView loadData:pdfData() MIMEType:@"application/pdf" characterEncodingName:@"" baseURL:[NSURL URLWithString:@"https://www.apple.com/testPath"]];
    166166    EXPECT_EQ([webView _pdfHUDs].count, 0u);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm

    r273062 r273194  
    580580    } else {
    581581        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()];
    583583        [task didFailWithError:[NSError errorWithDomain:@"TestErrorDomain" code:123 userInfo:nil]];
    584584    }
     
    801801                    @"Content-Length": @"2",
    802802                    @"Content-Type":@"text/html"
    803                 }]).autorelease()];
     803                }]).get()];
    804804            } else
    805805                [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  
    512512        if ([task.request.URL.absoluteString isEqualToString:@"framestest://test/index.html"]) {
    513513            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()];
    515515            [task didReceiveData:data];
    516516            [task didFinish];
  • trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm

    r273154 r273194  
    11141114
    11151115    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
    1116     [simulator setExternalItemProviders:@[ createMapItemForTesting().autorelease() ]];
     1116    [simulator setExternalItemProviders:@[ createMapItemForTesting().get() ]];
    11171117    [simulator runFrom:CGPointMake(0, 0) to:CGPointMake(100, 100)];
    11181118    EXPECT_WK_STREQ("Apple Park", [webView stringByEvaluatingJavaScript:@"document.querySelector('div[contenteditable]').textContent"]);
     
    11321132
    11331133    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
    1134     [simulator setExternalItemProviders:@[ createContactItemForTesting().autorelease() ]];
     1134    [simulator setExternalItemProviders:@[ createContactItemForTesting().get() ]];
    11351135    [simulator runFrom:CGPointMake(0, 0) to:CGPointMake(100, 100)];
    11361136    EXPECT_WK_STREQ("", [webView stringByEvaluatingJavaScript:@"document.querySelector('div[contenteditable]').textContent"]);
     
    11461146
    11471147    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
    1148     [simulator setExternalItemProviders:@[ createMapItemForTesting().autorelease(), createContactItemForTesting().autorelease() ]];
     1148    [simulator setExternalItemProviders:@[ createMapItemForTesting().get(), createContactItemForTesting().get() ]];
    11491149    [simulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 300)];
    11501150
  • trunk/Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm

    r272765 r273194  
    100100    RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
    101101   
    102     CrossPartitionFileSchemeAccessNavigationDelegate *delegate = [[CrossPartitionFileSchemeAccessNavigationDelegate alloc] init];
    103     [webView setNavigationDelegate:delegate];
     102    auto delegate = adoptNS([[CrossPartitionFileSchemeAccessNavigationDelegate alloc] init]);
     103    [webView setNavigationDelegate:delegate.get()];
    104104   
    105105    NSURLRequest *request = [NSURLRequest requestWithURL:url];
  • trunk/Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm

    r252598 r273194  
    124124    [webView selectWord:nil];
    125125    [webView waitForNextPresentationUpdate];
    126     [fontManager addFontTrait:menuItemCellForFontAction(NSBoldFontMask).autorelease()];
     126    [fontManager addFontTrait:menuItemCellForFontAction(NSBoldFontMask).get()];
    127127    EXPECT_WK_STREQ("bold", [webView stylePropertyAtSelectionStart:@"font-weight"]);
    128128    EXPECT_WK_STREQ("bold", [webView stylePropertyAtSelectionEnd:@"font-weight"]);
    129129    EXPECT_WK_STREQ("Times-Bold", [fontManager selectedFont].fontName);
    130130
    131     [fontManager addFontTrait:menuItemCellForFontAction(NSUnboldFontMask).autorelease()];
     131    [fontManager addFontTrait:menuItemCellForFontAction(NSUnboldFontMask).get()];
    132132    EXPECT_WK_STREQ("normal", [webView stylePropertyAtSelectionStart:@"font-weight"]);
    133133    EXPECT_WK_STREQ("normal", [webView stylePropertyAtSelectionEnd:@"font-weight"]);
    134134    EXPECT_WK_STREQ("Times-Roman", [fontManager selectedFont].fontName);
    135135
    136     [fontManager addFontTrait:menuItemCellForFontAction(NSItalicFontMask).autorelease()];
     136    [fontManager addFontTrait:menuItemCellForFontAction(NSItalicFontMask).get()];
    137137    EXPECT_WK_STREQ("italic", [webView stylePropertyAtSelectionStart:@"font-style"]);
    138138    EXPECT_WK_STREQ("italic", [webView stylePropertyAtSelectionEnd:@"font-style"]);
    139139    EXPECT_WK_STREQ("Times-Italic", [fontManager selectedFont].fontName);
    140140
    141     [fontManager addFontTrait:menuItemCellForFontAction(NSUnitalicFontMask).autorelease()];
     141    [fontManager addFontTrait:menuItemCellForFontAction(NSUnitalicFontMask).get()];
    142142    EXPECT_WK_STREQ("normal", [webView stylePropertyAtSelectionStart:@"font-style"]);
    143143    EXPECT_WK_STREQ("normal", [webView stylePropertyAtSelectionEnd:@"font-style"]);
Note: See TracChangeset for help on using the changeset viewer.