Title: [232452] trunk
Revision
232452
Author
[email protected]
Date
2018-06-03 12:46:17 -0700 (Sun, 03 Jun 2018)

Log Message

[Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
https://bugs.webkit.org/show_bug.cgi?id=186227

Reviewed by Dan Bernstein.

Source/_javascript_Core:

* API/JSContext.mm:
(-[JSContext name]): Use CFBridgingRelease instead of autorelease.
* API/JSValue.mm:
(valueToObjectWithoutCopy): Use CFBridgingRelease instead of autorelease.
(containerValueToObject): Use adoptCF instead of autorelease. This is not only more
ARC-compatible, but more efficient.
(valueToString): Use CFBridgingRelease instead of autorelease.

Source/WebCore:

* bridge/objc/objc_instance.mm:
(ObjcInstance::~ObjcInstance): Use @autoreleasepool instead of NSAutoreleasePool.
* platform/ios/wak/WAKView.mm:
(-[WAKView _appendDescriptionToString:atLevel:]): Ditto.

Source/WebKitLegacy/mac:

* Misc/WebKitErrors.m:
(+[NSError _registerWebKitErrors]): Use @autoreleasepool instead of NSAutoreleasePool.
* Plugins/WebPluginDatabase.mm:
(-[WebPluginDatabase refresh]): Ditto.
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::setStatusbarText): Ditto.

Tools:

* DumpRenderTree/mac/AccessibilityCommonMac.mm:
(+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
(-[NSString createJSStringRef]): Add __bridge to a bridging typecast.

* DumpRenderTree/mac/AccessibilityControllerMac.mm: Add a missing include.

* DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Add __bridge to a bridging typecast.
* DumpRenderTree/mac/AccessibilityTextMarkerMac.mm:
(AccessibilityTextMarker::isEqual): Ditto.
(AccessibilityTextMarkerRange::isEqual): Ditto.

* DumpRenderTree/mac/DumpRenderTree.mm:
(-[DumpRenderTree _waitForWebThread]): Use @autoreleasepool instead of NSAutoreleasePool.
(DumpRenderTreeMain): Ditto.
(WebThreadLockAfterDelegateCallbacksHaveCompleted): Ditto.
(runTest): Ditto.

* DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
(copyFile): Use a std::pair to return both a URL and an error rather than using an
out argument for the NSError.
(-[DumpRenderTreeFilePromiseReceiver receivePromisedFilesAtDestination:options:operationQueue:reader:]):
Updated for the above change.

* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
(-[DumpRenderTreeWindow _addToOpenWindows]): Add __bridge to a bridging typecast.
(-[DumpRenderTreeWindow close]): Ditto.
* DumpRenderTree/mac/LayoutTestHelper.m:
(setDisplayColorProfile): Ditto.

* DumpRenderTree/mac/PolicyDelegate.mm: Add a missing include.

* DumpRenderTree/mac/ResourceLoadDelegate.mm:
(-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
Add __bridge to a bridging typecast.
* DumpRenderTree/mac/TestRunnerMac.mm:
(-[APITestDelegateIPhone initWithTestRunner:utf8Data:baseURL:]): Ditto.
(TestRunner::apiTestNewWindowDataLoadBaseURL): Use @autoreleasepool instead of NSAutoreleasePool.

* DumpRenderTree/mac/TextInputControllerMac.m: Fix a comment.

* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::replaceTextAtRange): Add __bridge to a bridging typecast.
(WTR::UIScriptController::contentsOfUserInterfaceItem const): Ditto.
(WTR::UIScriptController::overridePreference): Ditto.
* DumpRenderTree/mac/WorkQueueItemMac.mm:
(LoadItem::invoke const): Ditto.
(LoadHTMLStringItem::invoke const): Ditto.
(ScriptItem::invoke const): Ditto.

* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
(-[NSString createJSStringRef]): Add __bridge to a bridging typecast.

* WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm:
(+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
(-[NSString createJSStringRef]): Add __bridge to a bridging typecast.

* WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
(WTR::AccessibilityController::accessibleElementById): Add __bridge to a bridging typecast.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Ditto.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm:
(WTR::AccessibilityTextMarker::isEqual): Ditto.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm:
(WTR::AccessibilityTextMarkerRange::isEqual): Ditto.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::setSelectedVisibleTextRange): Ditto.
(WTR::AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::textMarkerRangeLength): Ditto.
(WTR::AccessibilityUIElement::previousTextMarker): Ditto.
(WTR::AccessibilityUIElement::nextTextMarker): Ditto.
(WTR::AccessibilityUIElement::stringForTextMarkerRange): Ditto.
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Ditto.
(WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange): Ditto.
(WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange): Ditto.
(WTR::AccessibilityUIElement::accessibilityElementForTextMarker): Ditto.
(WTR::createJSStringRef): Ditto.
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute): Ditto.
(WTR::AccessibilityUIElement::indexForTextMarker): Ditto.
(WTR::AccessibilityUIElement::isTextMarkerValid): Ditto.
(WTR::AccessibilityUIElement::leftWordTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::previousWordStartTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::nextWordEndTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): Ditto.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration): Ditto.
(WTR::TestController::platformContext): Ditto.
(WTR::TestController::platformPreferences): Ditto.
(WTR::TestController::platformAdjustContext): Ditto.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView): Ditto.
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::initializeInjectedBundlePath): Ditto.
(WTR::TestController::initializeTestPluginDirectory): Ditto.
(WTR::TestController::platformConfigureViewForTest): Ditto.

* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::nsString): Use CFBridgingRelease instead of autorelease.
(WTR::UIScriptController::platformPlayBackEventStream): Add __bridge to a bridging
typecast.

* WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm: Add a missing include.

* WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm:
(-[LocalPasteboard setPropertyList:forType:]): Add _bridge to a bridging typecast.
(-[LocalPasteboard setString:forType:]): Ditto.

* WebKitTestRunner/mac/main.mm:
(main): Use @autoreleasepool instead of NSAutoreleasePool.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSContext.mm (232451 => 232452)


--- trunk/Source/_javascript_Core/API/JSContext.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/_javascript_Core/API/JSContext.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -197,7 +197,7 @@
     if (!name)
         return nil;
 
-    return (NSString *)adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name)).autorelease();
+    return CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, name));
 }
 
 - (void)setName:(NSString *)name

Modified: trunk/Source/_javascript_Core/API/JSValue.mm (232451 => 232452)


--- trunk/Source/_javascript_Core/API/JSValue.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/_javascript_Core/API/JSValue.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -686,9 +686,8 @@
         } else if (JSValueIsString(context, value)) {
             // Would be nice to unique strings, too.
             JSStringRef jsstring = JSValueToStringCopy(context, value, 0);
-            NSString * stringNS = (NSString *)JSStringCopyCFString(kCFAllocatorDefault, jsstring);
+            primitive = CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsstring));
             JSStringRelease(jsstring);
-            primitive = [stringNS autorelease];
         } else if (JSValueIsNull(context, value))
             primitive = [NSNull null];
         else {
@@ -749,7 +748,7 @@
             for (size_t i = 0; i < length; ++i) {
                 JSStringRef propertyName = JSPropertyNameArrayGetNameAtIndex(propertyNameArray, i);
                 if (id objc = convertor.convert(JSObjectGetProperty(context, js, propertyName, 0)))
-                    dictionary[[(NSString *)JSStringCopyCFString(kCFAllocatorDefault, propertyName) autorelease]] = objc;
+                    dictionary[(__bridge NSString *)adoptCF(JSStringCopyCFString(kCFAllocatorDefault, propertyName)).get()] = objc;
             }
 
             JSPropertyNameArrayRelease(propertyNameArray);
@@ -797,9 +796,9 @@
         return nil;
     }
 
-    RetainPtr<CFStringRef> stringCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, jsstring));
+    NSString *string = CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsstring));
     JSStringRelease(jsstring);
-    return (NSString *)stringCF.autorelease();
+    return string;
 }
 
 id valueToDate(JSGlobalContextRef context, JSValueRef value, JSValueRef* exception)

Modified: trunk/Source/_javascript_Core/ChangeLog (232451 => 232452)


--- trunk/Source/_javascript_Core/ChangeLog	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-06-03 19:46:17 UTC (rev 232452)
@@ -1,3 +1,18 @@
+2018-06-02  Darin Adler  <[email protected]>
+
+        [Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
+        https://bugs.webkit.org/show_bug.cgi?id=186227
+
+        Reviewed by Dan Bernstein.
+
+        * API/JSContext.mm:
+        (-[JSContext name]): Use CFBridgingRelease instead of autorelease.
+        * API/JSValue.mm:
+        (valueToObjectWithoutCopy): Use CFBridgingRelease instead of autorelease.
+        (containerValueToObject): Use adoptCF instead of autorelease. This is not only more
+        ARC-compatible, but more efficient.
+        (valueToString): Use CFBridgingRelease instead of autorelease.
+
 2018-06-02  Caio Lima  <[email protected]>
 
         [ESNext][BigInt] Implement support for addition operations

Modified: trunk/Source/WebCore/ChangeLog (232451 => 232452)


--- trunk/Source/WebCore/ChangeLog	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/WebCore/ChangeLog	2018-06-03 19:46:17 UTC (rev 232452)
@@ -1,3 +1,15 @@
+2018-06-02  Darin Adler  <[email protected]>
+
+        [Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
+        https://bugs.webkit.org/show_bug.cgi?id=186227
+
+        Reviewed by Dan Bernstein.
+
+        * bridge/objc/objc_instance.mm:
+        (ObjcInstance::~ObjcInstance): Use @autoreleasepool instead of NSAutoreleasePool.
+        * platform/ios/wak/WAKView.mm:
+        (-[WAKView _appendDescriptionToString:atLevel:]): Ditto.
+
 2018-06-03  Zan Dobersek  <[email protected]>
 
         [WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value

Modified: trunk/Source/WebCore/bridge/objc/objc_instance.mm (232451 => 232452)


--- trunk/Source/WebCore/bridge/objc/objc_instance.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/WebCore/bridge/objc/objc_instance.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -121,16 +121,14 @@
 ObjcInstance::~ObjcInstance() 
 {
     // Both -finalizeForWebScript and -dealloc/-finalize of _instance may require autorelease pools.
-    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+    @autoreleasepool {
+        ASSERT(_instance);
+        wrapperCache().remove(_instance.get());
 
-    ASSERT(_instance);
-    wrapperCache().remove(_instance.get());
-
-    if ([_instance.get() respondsToSelector:@selector(finalizeForWebScript)])
-        [_instance.get() performSelector:@selector(finalizeForWebScript)];
-    _instance = 0;
-
-    [pool drain];
+        if ([_instance.get() respondsToSelector:@selector(finalizeForWebScript)])
+            [_instance.get() performSelector:@selector(finalizeForWebScript)];
+        _instance = 0;
+    }
 }
 
 void ObjcInstance::virtualBegin()

Modified: trunk/Source/WebCore/platform/ios/wak/WAKView.mm (232451 => 232452)


--- trunk/Source/WebCore/platform/ios/wak/WAKView.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/WebCore/platform/ios/wak/WAKView.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -776,20 +776,18 @@
 
 - (void)_appendDescriptionToString:(NSMutableString *)info atLevel:(int)level
 {
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    @autoreleasepool {
+        if ([info length])
+            [info appendString:@"\n"];
 
-    if ([info length] != 0)
-        [info appendString:@"\n"];
+        for (int i = 1; i <= level; i++)
+            [info appendString:@"   | "];
 
-    for (int i = 1; i <= level; i++)
-        [info appendString:@"   | "];
+        [info appendString:[self description]];
 
-    [info appendString:[self description]];
-
-    for (WAKView *subview in [self subviews])
-        [subview _appendDescriptionToString:info atLevel:level + 1];
-
-    [pool release];
+        for (WAKView *subview in [self subviews])
+            [subview _appendDescriptionToString:info atLevel:level + 1];
+    }
 }
 
 @end

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (232451 => 232452)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-06-03 19:46:17 UTC (rev 232452)
@@ -1,3 +1,17 @@
+2018-06-02  Darin Adler  <[email protected]>
+
+        [Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
+        https://bugs.webkit.org/show_bug.cgi?id=186227
+
+        Reviewed by Dan Bernstein.
+
+        * Misc/WebKitErrors.m:
+        (+[NSError _registerWebKitErrors]): Use @autoreleasepool instead of NSAutoreleasePool.
+        * Plugins/WebPluginDatabase.mm:
+        (-[WebPluginDatabase refresh]): Ditto.
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::setStatusbarText): Ditto.
+
 2018-06-01  Chris Dumez  <[email protected]>
 
         REGRESSION (r231456): Colloquy is broken

Modified: trunk/Source/WebKitLegacy/mac/Misc/WebKitErrors.m (232451 => 232452)


--- trunk/Source/WebKitLegacy/mac/Misc/WebKitErrors.m	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/WebKitLegacy/mac/Misc/WebKitErrors.m	2018-06-03 19:46:17 UTC (rev 232452)
@@ -66,30 +66,28 @@
 {
     static dispatch_once_t flag;
     dispatch_once(&flag, ^{
-        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+        @autoreleasepool {
+            NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
+                // Policy errors
+                WebKitErrorDescriptionCannotShowMIMEType,                   [NSNumber numberWithInt: WebKitErrorCannotShowMIMEType],
+                WebKitErrorDescriptionCannotShowURL,                        [NSNumber numberWithInt: WebKitErrorCannotShowURL],
+                WebKitErrorDescriptionFrameLoadInterruptedByPolicyChange,   [NSNumber numberWithInt: WebKitErrorFrameLoadInterruptedByPolicyChange],
+                WebKitErrorDescriptionCannotUseRestrictedPort,              [NSNumber numberWithInt: WebKitErrorCannotUseRestrictedPort],
+                WebKitErrorDescriptionFrameLoadBlockedByContentFilter,      [NSNumber numberWithInt: WebKitErrorFrameLoadBlockedByContentFilter],
 
-        NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
-            // Policy errors
-            WebKitErrorDescriptionCannotShowMIMEType,                   [NSNumber numberWithInt: WebKitErrorCannotShowMIMEType],
-            WebKitErrorDescriptionCannotShowURL,                        [NSNumber numberWithInt: WebKitErrorCannotShowURL],
-            WebKitErrorDescriptionFrameLoadInterruptedByPolicyChange,   [NSNumber numberWithInt: WebKitErrorFrameLoadInterruptedByPolicyChange],
-            WebKitErrorDescriptionCannotUseRestrictedPort,              [NSNumber numberWithInt: WebKitErrorCannotUseRestrictedPort],
-            WebKitErrorDescriptionFrameLoadBlockedByContentFilter,      [NSNumber numberWithInt: WebKitErrorFrameLoadBlockedByContentFilter],
+                // Plug-in and java errors
+                WebKitErrorDescriptionCannotFindPlugin,                     [NSNumber numberWithInt: WebKitErrorCannotFindPlugIn],
+                WebKitErrorDescriptionCannotLoadPlugin,                     [NSNumber numberWithInt: WebKitErrorCannotLoadPlugIn],
+                WebKitErrorDescriptionJavaUnavailable,                      [NSNumber numberWithInt: WebKitErrorJavaUnavailable],
+                WebKitErrorDescriptionPlugInCancelledConnection,            [NSNumber numberWithInt: WebKitErrorPlugInCancelledConnection],
+                WebKitErrorDescriptionPlugInWillHandleLoad,                 [NSNumber numberWithInt: WebKitErrorPlugInWillHandleLoad],
 
-            // Plug-in and java errors
-            WebKitErrorDescriptionCannotFindPlugin,                     [NSNumber numberWithInt: WebKitErrorCannotFindPlugIn],
-            WebKitErrorDescriptionCannotLoadPlugin,                     [NSNumber numberWithInt: WebKitErrorCannotLoadPlugIn],
-            WebKitErrorDescriptionJavaUnavailable,                      [NSNumber numberWithInt: WebKitErrorJavaUnavailable],
-            WebKitErrorDescriptionPlugInCancelledConnection,            [NSNumber numberWithInt: WebKitErrorPlugInCancelledConnection],
-            WebKitErrorDescriptionPlugInWillHandleLoad,                 [NSNumber numberWithInt: WebKitErrorPlugInWillHandleLoad],
+                // Geolocation errors
+                WebKitErrorDescriptionGeolocationLocationUnknown,           [NSNumber numberWithInt: WebKitErrorGeolocationLocationUnknown],
+                nil];
 
-            // Geolocation errors
-            WebKitErrorDescriptionGeolocationLocationUnknown,           [NSNumber numberWithInt: WebKitErrorGeolocationLocationUnknown],
-            nil];
-
-        [NSError _webkit_addErrorsWithCodesAndDescriptions:dict inDomain:WebKitErrorDomain];
-
-        [pool drain];
+            [NSError _webkit_addErrorsWithCodesAndDescriptions:dict inDomain:WebKitErrorDomain];
+        }
     });
 }
 

Modified: trunk/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm (232451 => 232452)


--- trunk/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -248,79 +248,80 @@
 {
     // This method does a bit of autoreleasing, so create an autorelease pool to ensure that calling
     // -refresh multiple times does not bloat the default pool.
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    
-    // Create map from plug-in path to WebBasePluginPackage
-    if (!plugins)
-        plugins = [[NSMutableDictionary alloc] initWithCapacity:12];
+    @autoreleasepool {
+        // Create map from plug-in path to WebBasePluginPackage
+        if (!plugins)
+            plugins = [[NSMutableDictionary alloc] initWithCapacity:12];
 
-    // Find all plug-ins on disk
-    NSMutableSet *newPlugins = [self _scanForNewPlugins];
+        // Find all plug-ins on disk
+        NSMutableSet *newPlugins = [self _scanForNewPlugins];
 
-    // Find plug-ins to remove from database (i.e., plug-ins that no longer exist on disk)
-    NSMutableSet *pluginsToRemove = [NSMutableSet set];
-    NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
-    WebBasePluginPackage *plugin;
-    while ((plugin = [pluginEnumerator nextObject]) != nil) {
-        // Any plug-ins that were removed from disk since the last refresh should be removed from
-        // the database.
-        if (![newPlugins containsObject:plugin])
-            [pluginsToRemove addObject:plugin];
-            
-        // Remove every member of 'plugins' from 'newPlugins'.  After this loop exits, 'newPlugins'
-        // will be the set of new plug-ins that should be added to the database.
-        [newPlugins removeObject:plugin];
-    }
+        // Find plug-ins to remove from database (i.e., plug-ins that no longer exist on disk)
+        NSMutableSet *pluginsToRemove = [NSMutableSet set];
+        NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
+        WebBasePluginPackage *plugin;
+        while ((plugin = [pluginEnumerator nextObject]) != nil) {
+            // Any plug-ins that were removed from disk since the last refresh should be removed from
+            // the database.
+            if (![newPlugins containsObject:plugin])
+                [pluginsToRemove addObject:plugin];
 
+            // Remove every member of 'plugins' from 'newPlugins'. After this loop exits, 'newPlugins'
+            // will be the set of new plug-ins that should be added to the database.
+            [newPlugins removeObject:plugin];
+        }
+
 #if !LOG_DISABLED
-    if ([newPlugins count] > 0)
-        LOG(Plugins, "New plugins:\n%@", newPlugins);
-    if ([pluginsToRemove count] > 0)
-        LOG(Plugins, "Removed plugins:\n%@", pluginsToRemove);
+        if ([newPlugins count] > 0)
+            LOG(Plugins, "New plugins:\n%@", newPlugins);
+        if ([pluginsToRemove count] > 0)
+            LOG(Plugins, "Removed plugins:\n%@", pluginsToRemove);
 #endif
 
-    // Remove plugins from database
-    pluginEnumerator = [pluginsToRemove objectEnumerator];
-    while ((plugin = [pluginEnumerator nextObject]) != nil) 
-        [self _removePlugin:plugin];
-    
-    // Add new plugins to database
-    pluginEnumerator = [newPlugins objectEnumerator];
-    while ((plugin = [pluginEnumerator nextObject]) != nil)
-        [self _addPlugin:plugin];
+        // Remove plugins from database
+        pluginEnumerator = [pluginsToRemove objectEnumerator];
+        while ((plugin = [pluginEnumerator nextObject]) != nil)
+            [self _removePlugin:plugin];
 
-    // Build a list of MIME types.
-    NSMutableSet *MIMETypes = [[NSMutableSet alloc] init];
-    pluginEnumerator = [plugins objectEnumerator];
-    while ((plugin = [pluginEnumerator nextObject])) {
-        const PluginInfo& pluginInfo = [plugin pluginInfo];
-        for (size_t i = 0; i < pluginInfo.mimes.size(); ++i)
-            [MIMETypes addObject:pluginInfo.mimes[i].type];
-    }
-    
-    // Register plug-in views and representations.
-    NSEnumerator *MIMEEnumerator = [MIMETypes objectEnumerator];
-    NSString *MIMEType;
-    while ((MIMEType = [MIMEEnumerator nextObject]) != nil) {
-        [registeredMIMETypes addObject:MIMEType];
+        // Add new plugins to database
+        pluginEnumerator = [newPlugins objectEnumerator];
+        while ((plugin = [pluginEnumerator nextObject]) != nil)
+            [self _addPlugin:plugin];
 
-        if ([WebView canShowMIMETypeAsHTML:MIMEType])
-            // Don't allow plug-ins to override our core HTML types.
-            continue;
-        plugin = [self pluginForMIMEType:MIMEType];
-        if ([plugin isJavaPlugIn])
-            // Don't register the Java plug-in for a document view since Java files should be downloaded when not embedded.
-            continue;
-        if ([plugin isQuickTimePlugIn] && [[WebFrameView _viewTypesAllowImageTypeOmission:NO] objectForKey:MIMEType])
-            // Don't allow the QT plug-in to override any types because it claims many that we can handle ourselves.
-            continue;
-        
-        if (self == sharedDatabase)
-            [WebView _registerPluginMIMEType:MIMEType];
+        // Build a list of MIME types.
+        NSMutableSet *MIMETypes = [[NSMutableSet alloc] init];
+        pluginEnumerator = [plugins objectEnumerator];
+        while ((plugin = [pluginEnumerator nextObject])) {
+            const PluginInfo& pluginInfo = [plugin pluginInfo];
+            for (size_t i = 0; i < pluginInfo.mimes.size(); ++i)
+                [MIMETypes addObject:pluginInfo.mimes[i].type];
+        }
+
+        // Register plug-in views and representations.
+        NSEnumerator *MIMEEnumerator = [MIMETypes objectEnumerator];
+        NSString *MIMEType;
+        while ((MIMEType = [MIMEEnumerator nextObject]) != nil) {
+            [registeredMIMETypes addObject:MIMEType];
+
+            if ([WebView canShowMIMETypeAsHTML:MIMEType]) {
+                // Don't allow plug-ins to override our core HTML types.
+                continue;
+            }
+            plugin = [self pluginForMIMEType:MIMEType];
+            if ([plugin isJavaPlugIn]) {
+                // Don't register the Java plug-in for a document view since Java files should be downloaded when not embedded.
+                continue;
+            }
+            if ([plugin isQuickTimePlugIn] && [[WebFrameView _viewTypesAllowImageTypeOmission:NO] objectForKey:MIMEType]) {
+                // Don't allow the QT plug-in to override any types because it claims many that we can handle ourselves.
+                continue;
+            }
+
+            if (self == sharedDatabase)
+                [WebView _registerPluginMIMEType:MIMEType];
+        }
+        [MIMETypes release];
     }
-    [MIMETypes release];
-    
-    [pool drain];
 }
 
 - (BOOL)isMIMETypeRegistered:(NSString *)MIMEType

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm (232451 => 232452)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -558,9 +558,9 @@
 {
     // We want the temporaries allocated here to be released even before returning to the 
     // event loop; see <http://bugs.webkit.org/show_bug.cgi?id=9880>.
-    NSAutoreleasePool* localPool = [[NSAutoreleasePool alloc] init];
-    CallUIDelegate(m_webView, @selector(webView:setStatusText:), (NSString *)status);
-    [localPool drain];
+    @autoreleasepool {
+        CallUIDelegate(m_webView, @selector(webView:setStatusText:), (NSString *)status);
+    }
 }
 
 bool WebChromeClient::supportsImmediateInvalidation()

Modified: trunk/Tools/ChangeLog (232451 => 232452)


--- trunk/Tools/ChangeLog	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/ChangeLog	2018-06-03 19:46:17 UTC (rev 232452)
@@ -1,3 +1,129 @@
+2018-06-02  Darin Adler  <[email protected]>
+
+        [Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
+        https://bugs.webkit.org/show_bug.cgi?id=186227
+
+        Reviewed by Dan Bernstein.
+
+        * DumpRenderTree/mac/AccessibilityCommonMac.mm:
+        (+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
+        (-[NSString createJSStringRef]): Add __bridge to a bridging typecast.
+
+        * DumpRenderTree/mac/AccessibilityControllerMac.mm: Add a missing include.
+
+        * DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
+        (-[NSString createJSStringRef]): Add __bridge to a bridging typecast.
+        * DumpRenderTree/mac/AccessibilityTextMarkerMac.mm:
+        (AccessibilityTextMarker::isEqual): Ditto.
+        (AccessibilityTextMarkerRange::isEqual): Ditto.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (-[DumpRenderTree _waitForWebThread]): Use @autoreleasepool instead of NSAutoreleasePool.
+        (DumpRenderTreeMain): Ditto.
+        (WebThreadLockAfterDelegateCallbacksHaveCompleted): Ditto.
+        (runTest): Ditto.
+
+        * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
+        (copyFile): Use a std::pair to return both a URL and an error rather than using an
+        out argument for the NSError.
+        (-[DumpRenderTreeFilePromiseReceiver receivePromisedFilesAtDestination:options:operationQueue:reader:]):
+        Updated for the above change.
+
+        * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+        (-[DumpRenderTreeWindow _addToOpenWindows]): Add __bridge to a bridging typecast.
+        (-[DumpRenderTreeWindow close]): Ditto.
+        * DumpRenderTree/mac/LayoutTestHelper.m:
+        (setDisplayColorProfile): Ditto.
+
+        * DumpRenderTree/mac/PolicyDelegate.mm: Add a missing include.
+
+        * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+        (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
+        Add __bridge to a bridging typecast.
+        * DumpRenderTree/mac/TestRunnerMac.mm:
+        (-[APITestDelegateIPhone initWithTestRunner:utf8Data:baseURL:]): Ditto.
+        (TestRunner::apiTestNewWindowDataLoadBaseURL): Use @autoreleasepool instead of NSAutoreleasePool.
+
+        * DumpRenderTree/mac/TextInputControllerMac.m: Fix a comment.
+
+        * DumpRenderTree/mac/UIScriptControllerMac.mm:
+        (WTR::UIScriptController::replaceTextAtRange): Add __bridge to a bridging typecast.
+        (WTR::UIScriptController::contentsOfUserInterfaceItem const): Ditto.
+        (WTR::UIScriptController::overridePreference): Ditto.
+        * DumpRenderTree/mac/WorkQueueItemMac.mm:
+        (LoadItem::invoke const): Ditto.
+        (LoadHTMLStringItem::invoke const): Ditto.
+        (ScriptItem::invoke const): Ditto.
+
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+        (+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
+        (-[NSString createJSStringRef]): Add __bridge to a bridging typecast.
+
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm:
+        (+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
+        (-[NSString createJSStringRef]): Add __bridge to a bridging typecast.
+
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
+        (WTR::AccessibilityController::accessibleElementById): Add __bridge to a bridging typecast.
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
+        (-[NSString createJSStringRef]): Ditto.
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm:
+        (WTR::AccessibilityTextMarker::isEqual): Ditto.
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm:
+        (WTR::AccessibilityTextMarkerRange::isEqual): Ditto.
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::AccessibilityUIElement::setSelectedVisibleTextRange): Ditto.
+        (WTR::AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::textMarkerRangeLength): Ditto.
+        (WTR::AccessibilityUIElement::previousTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::nextTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::stringForTextMarkerRange): Ditto.
+        (WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Ditto.
+        (WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange): Ditto.
+        (WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange): Ditto.
+        (WTR::AccessibilityUIElement::accessibilityElementForTextMarker): Ditto.
+        (WTR::createJSStringRef): Ditto.
+        (WTR::AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
+        (WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
+        (WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute): Ditto.
+        (WTR::AccessibilityUIElement::indexForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::isTextMarkerValid): Ditto.
+        (WTR::AccessibilityUIElement::leftWordTextMarkerRangeForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::previousWordStartTextMarkerForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::nextWordEndTextMarkerForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): Ditto.
+        (WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): Ditto.
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::initializeWebViewConfiguration): Ditto.
+        (WTR::TestController::platformContext): Ditto.
+        (WTR::TestController::platformPreferences): Ditto.
+        (WTR::TestController::platformAdjustContext): Ditto.
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::PlatformWebView): Ditto.
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::initializeInjectedBundlePath): Ditto.
+        (WTR::TestController::initializeTestPluginDirectory): Ditto.
+        (WTR::TestController::platformConfigureViewForTest): Ditto.
+
+        * WebKitTestRunner/mac/UIScriptControllerMac.mm:
+        (WTR::nsString): Use CFBridgingRelease instead of autorelease.
+        (WTR::UIScriptController::platformPlayBackEventStream): Add __bridge to a bridging
+        typecast.
+
+        * WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm: Add a missing include.
+
+        * WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm:
+        (-[LocalPasteboard setPropertyList:forType:]): Add _bridge to a bridging typecast.
+        (-[LocalPasteboard setString:forType:]): Ditto.
+
+        * WebKitTestRunner/mac/main.mm:
+        (main): Use @autoreleasepool instead of NSAutoreleasePool.
+
 2018-06-02  Keith Miller  <[email protected]>
 
         run-jsc should pass the option to use dollar vm by default

Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -42,13 +42,12 @@
     if (!jsStringRef)
         return nil;
 
-    CFStringRef cfString = JSStringCopyCFString(kCFAllocatorDefault, jsStringRef);
-    return [(NSString *)cfString autorelease];
+    return CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsStringRef));
 }
 
 - (JSStringRef)createJSStringRef
 {
-    return JSStringCreateWithCFString((CFStringRef)self);
+    return JSStringCreateWithCFString((__bridge CFStringRef)self);
 }
 
 NSDictionary *searchPredicateParameterizedAttributeForSearchCriteria(JSContextRef context, AccessibilityUIElement *startElement, bool isDirectionNext, unsigned resultsLimit, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly)

Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -34,8 +34,8 @@
 #import <Foundation/Foundation.h>
 #import <_javascript_Core/JSStringRef.h>
 #import <_javascript_Core/JSStringRefCF.h>
-#import <WebKit/WebFrame.h>
 #import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebFrameView.h>
 #import <WebKit/WebHTMLView.h>
 
 AccessibilityController::AccessibilityController()

Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -52,7 +52,7 @@
 
 - (JSStringRef)createJSStringRef
 {
-    return JSStringCreateWithCFString((CFStringRef)self);
+    return JSStringCreateWithCFString((__bridge CFStringRef)self);
 }
 
 @end

Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -48,7 +48,7 @@
 
 bool AccessibilityTextMarker::isEqual(AccessibilityTextMarker* other)
 {
-    return [(id)platformTextMarker() isEqual:(id)other->platformTextMarker()];
+    return [(__bridge id)platformTextMarker() isEqual:(__bridge id)other->platformTextMarker()];
 }
 
 PlatformTextMarker AccessibilityTextMarker::platformTextMarker() const 
@@ -74,7 +74,7 @@
 
 bool AccessibilityTextMarkerRange::isEqual(AccessibilityTextMarkerRange* other)
 {
-    return [(id)platformTextMarkerRange() isEqual:(id)other->platformTextMarkerRange()];
+    return [(__bridge id)platformTextMarkerRange() isEqual:(__bridge id)other->platformTextMarkerRange()];
 }
 
 PlatformTextMarkerRange AccessibilityTextMarkerRange::platformTextMarkerRange() const

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -1337,9 +1337,9 @@
         [self _webThreadInvoked];
     });
     while (!_hasFlushedWebThreadRunQueue) {
-        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
-        [pool release];
+        @autoreleasepool {
+            [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+        }
     }
 }
 
@@ -1367,23 +1367,25 @@
 #if PLATFORM(IOS)
     _UIApplicationLoadWebKit();
 #endif
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
-    setDefaultsToConsistentValuesForTesting(); // Must be called before NSApplication initialization.
+    @autoreleasepool {
+        setDefaultsToConsistentValuesForTesting(); // Must be called before NSApplication initialization.
 
 #if !PLATFORM(IOS)
-    [DumpRenderTreeApplication sharedApplication]; // Force AppKit to init itself
+        [DumpRenderTreeApplication sharedApplication]; // Force AppKit to init itself
 
-    dumpRenderTree(argc, argv);
+        dumpRenderTree(argc, argv);
 #else
-    _argc = argc;
-    _argv = argv;
-    UIApplicationMain(argc, (char**)argv, @"DumpRenderTree", @"DumpRenderTree");
+        _argc = argc;
+        _argv = argv;
+        UIApplicationMain(argc, (char**)argv, @"DumpRenderTree", @"DumpRenderTree");
 #endif
-    [WebCoreStatistics garbageCollectJavaScriptObjects];
-    [WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts
-    JSC::finalizeStatsAtEndOfTesting();
-    [pool release];
+
+        [WebCoreStatistics garbageCollectJavaScriptObjects];
+        [WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts
+        JSC::finalizeStatsAtEndOfTesting();
+    }
+
     returningFromMain = true;
     return 0;
 }
@@ -1867,9 +1869,9 @@
     });
 
     while (dispatch_semaphore_wait(delegateSemaphore, DISPATCH_TIME_NOW)) {
-        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
-        [pool release];
+        @autoreleasepool {
+            [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+        }
     }
 
     WebThreadLock();
@@ -1994,14 +1996,14 @@
     if (ignoreWebCoreNodeLeaks)
         [WebCoreStatistics startIgnoringWebCoreNodeLeaks];
 
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    [mainFrame loadRequest:[NSURLRequest requestWithURL:url]];
-    [pool release];
+    @autoreleasepool {
+        [mainFrame loadRequest:[NSURLRequest requestWithURL:url]];
+    }
 
     while (!done) {
-        pool = [[NSAutoreleasePool alloc] init];
-        CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, false);
-        [pool release];
+        @autoreleasepool {
+            CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, false);
+        }
     }
 
 #if PLATFORM(IOS)
@@ -2008,57 +2010,57 @@
     [(DumpRenderTree *)UIApp _waitForWebThread];
     WebThreadLockAfterDelegateCallbacksHaveCompleted();
 #endif
-    pool = [[NSAutoreleasePool alloc] init];
-    [EventSendingController clearSavedEvents];
-    [[mainFrame webView] setSelectedDOMRange:nil affinity:NSSelectionAffinityDownstream];
 
-    workQueue.clear();
+    @autoreleasepool {
+        [EventSendingController clearSavedEvents];
+        [[mainFrame webView] setSelectedDOMRange:nil affinity:NSSelectionAffinityDownstream];
 
-    // If the test page could have possibly opened the Web Inspector frontend,
-    // then try to close it in case it was accidentally left open.
-    if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
-        gTestRunner->closeWebInspector();
-        gTestRunner->setDeveloperExtrasEnabled(false);
-    }
+        workQueue.clear();
 
+        // If the test page could have possibly opened the Web Inspector frontend,
+        // then try to close it in case it was accidentally left open.
+        if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+            gTestRunner->closeWebInspector();
+            gTestRunner->setDeveloperExtrasEnabled(false);
+        }
+
 #if PLATFORM(MAC)
-    // Make sure the WebView is parented, since the test may have unparented it.
-    WebView *webView = [mainFrame webView];
-    if (![webView superview])
-        [[mainWindow contentView] addSubview:webView];
+        // Make sure the WebView is parented, since the test may have unparented it.
+        WebView *webView = [mainFrame webView];
+        if (![webView superview])
+            [[mainWindow contentView] addSubview:webView];
 #endif
 
-    if (gTestRunner->closeRemainingWindowsWhenComplete()) {
-        NSArray* array = [DumpRenderTreeWindow openWindows];
+        if (gTestRunner->closeRemainingWindowsWhenComplete()) {
+            NSArray* array = [DumpRenderTreeWindow openWindows];
 
-        unsigned count = [array count];
-        for (unsigned i = 0; i < count; i++) {
-            NSWindow *window = [array objectAtIndex:i];
+            unsigned count = [array count];
+            for (unsigned i = 0; i < count; i++) {
+                NSWindow *window = [array objectAtIndex:i];
 
-            // Don't try to close the main window
-            if (window == [[mainFrame webView] window])
-                continue;
+                // Don't try to close the main window
+                if (window == [[mainFrame webView] window])
+                    continue;
 
 #if !PLATFORM(IOS)
-            WebView *webView = [[[window contentView] subviews] objectAtIndex:0];
+                WebView *webView = [[[window contentView] subviews] objectAtIndex:0];
 #else
-            ASSERT([[window contentView] isKindOfClass:[WebView class]]);
-            WebView *webView = (WebView *)[window contentView];
+                ASSERT([[window contentView] isKindOfClass:[WebView class]]);
+                WebView *webView = (WebView *)[window contentView];
 #endif
 
-            [webView close];
-            [window close];
+                [webView close];
+                [window close];
+            }
         }
-    }
 
-    resetWebViewToConsistentStateBeforeTesting(options);
+        resetWebViewToConsistentStateBeforeTesting(options);
 
-    // Loading an empty request synchronously replaces the document with a blank one, which is necessary
-    // to stop timers, WebSockets and other activity that could otherwise spill output into next test's results.
-    [mainFrame loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@""]]];
+        // Loading an empty request synchronously replaces the document with a blank one, which is necessary
+        // to stop timers, WebSockets and other activity that could otherwise spill output into next test's results.
+        [mainFrame loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@""]]];
+    }
 
-    [pool release];
-
     // We should only have our main window left open when we're done
     ASSERT(CFArrayGetCount(openWindowsRef) == 1);
     ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]);

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -96,7 +96,7 @@
     [super dealloc];
 }
 
-static NSURL *copyFile(NSURL *sourceURL, NSURL *destinationDirectory, NSError *&error)
+static std::pair<NSURL *, NSError *> copyFile(NSURL *sourceURL, NSURL *destinationDirectory)
 {
     // Emulate how CFPasteboard finds unique destination file names by inserting " 2", " 3", and so
     // on between the file name's base and extension until a new file is successfully created in
@@ -105,16 +105,16 @@
     NSUInteger number = 2;
     NSString *fileName = sourceURL.lastPathComponent;
     NSURL *destinationURL = [NSURL fileURLWithPath:fileName relativeToURL:destinationDirectory];
+    NSError *error;
     while (![NSFileManager.defaultManager copyItemAtURL:sourceURL toURL:destinationURL error:&error]) {
         if (error.domain != NSCocoaErrorDomain || error.code != NSFileWriteFileExistsError)
-            return nil;
+            return { nil, error };
 
         NSString *newFileName = [NSString stringWithFormat:@"%@ %lu.%@", fileName.stringByDeletingPathExtension, (unsigned long)number++, fileName.pathExtension];
         destinationURL = [NSURL fileURLWithPath:newFileName relativeToURL:destinationDirectory];
-        error = nil;
     }
 
-    return destinationURL;
+    return { destinationURL, nil };
 }
 
 - (void)receivePromisedFilesAtDestination:(NSURL *)destinationDirectory options:(NSDictionary *)options operationQueue:(NSOperationQueue *)operationQueue reader:(void (^)(NSURL *fileURL, NSError * __nullable errorOrNil))reader
@@ -125,8 +125,9 @@
     NSArray<NSURL *> *sourceURLs = _draggingSource.promisedFileURLs;
     for (NSURL *sourceURL in sourceURLs) {
         [operationQueue addOperationWithBlock:^{
-            NSError *error = nil;
-            NSURL *destinationURL = copyFile(sourceURL, destinationDirectory, error);
+            NSError *error;
+            NSURL *destinationURL;
+            std::tie(destinationURL, error) = copyFile(sourceURL, destinationDirectory);
             if (destinationURL) {
                 dispatch_async(dispatch_get_main_queue(), ^{
                     [_destinationURLs addObject:destinationURL];

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -68,7 +68,7 @@
     if (!openWindowsRef)
         openWindowsRef = CFArrayCreateMutable(NULL, 0, &NonRetainingArrayCallbacks);
 
-    CFArrayAppendValue(openWindowsRef, self);
+    CFArrayAppendValue(openWindowsRef, (__bridge CFTypeRef)self);
 }
 
 #if !PLATFORM(IOS)
@@ -102,7 +102,7 @@
     [[NSNotificationCenter defaultCenter] removeObserver:self];
 
     CFRange arrayRange = CFRangeMake(0, CFArrayGetCount(openWindowsRef));
-    CFIndex i = CFArrayGetFirstIndexOfValue(openWindowsRef, arrayRange, self);
+    CFIndex i = CFArrayGetFirstIndexOfValue(openWindowsRef, arrayRange, (__bridge CFTypeRef)self);
     if (i != kCFNotFound)
         CFArrayRemoveValueAtIndex(openWindowsRef, i);
 

Modified: trunk/Tools/DumpRenderTree/mac/LayoutTestHelper.m (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/LayoutTestHelper.m	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/LayoutTestHelper.m	2018-06-03 19:46:17 UTC (rev 232452)
@@ -147,7 +147,7 @@
 static void setDisplayColorProfile(NSString *displayUUIDString, NSURL *colorProfileURL)
 {
     NSDictionary *profileInfo = @{
-        (NSString *)kColorSyncDeviceDefaultProfileID : colorProfileURL
+        (__bridge NSString *)kColorSyncDeviceDefaultProfileID : colorProfileURL
     };
 
     CFUUIDRef uuid = CFUUIDCreateFromString(kCFAllocatorDefault, (CFStringRef)displayUUIDString);

Modified: trunk/Tools/DumpRenderTree/mac/PolicyDelegate.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/PolicyDelegate.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/PolicyDelegate.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -32,6 +32,7 @@
 #import "DumpRenderTree.h"
 #import "TestRunner.h"
 #import <WebKit/DOMElement.h>
+#import <WebKit/WebDataSource.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebPolicyDelegate.h>
 #import <WebKit/WebView.h>

Modified: trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -172,7 +172,7 @@
         }
     }
 
-    if (disallowedURLs && CFSetContainsValue(disallowedURLs, url))
+    if (disallowedURLs && CFSetContainsValue(disallowedURLs, (__bridge CFURLRef)url))
         return nil;
 
     NSMutableURLRequest *newRequest = [request mutableCopy];

Modified: trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -927,8 +927,8 @@
         return nil;
 
     testRunner = runner;
-    data = "" *)adoptCF(JSStringCopyCFString(kCFAllocatorDefault, dataString)).get() dataUsingEncoding:NSUTF8StringEncoding] retain];
-    baseURL = [[NSURL URLWithString:(NSString *)adoptCF(JSStringCopyCFString(kCFAllocatorDefault, baseURLString)).get()] retain];
+    data = "" NSString *)adoptCF(JSStringCopyCFString(kCFAllocatorDefault, dataString)).get() dataUsingEncoding:NSUTF8StringEncoding] retain];
+    baseURL = [[NSURL URLWithString:(__bridge NSString *)adoptCF(JSStringCopyCFString(kCFAllocatorDefault, baseURLString)).get()] retain];
     return self;
 }
 
@@ -1004,33 +1004,32 @@
     }
 #endif
 
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    @autoreleasepool {
+        RetainPtr<CFStringRef> utf8DataCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, utf8Data));
+        RetainPtr<CFStringRef> baseURLCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, baseURL));
 
-    RetainPtr<CFStringRef> utf8DataCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, utf8Data));
-    RetainPtr<CFStringRef> baseURLCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, baseURL));
-    
-    WebView *webView = [[WebView alloc] initWithFrame:NSZeroRect frameName:@"" groupName:@""];
+        WebView *webView = [[WebView alloc] initWithFrame:NSZeroRect frameName:@"" groupName:@""];
 
-    bool done = false;
-    APITestDelegate *delegate = [[APITestDelegate alloc] initWithCompletionCondition:&done];
-    [webView setFrameLoadDelegate:delegate];
+        bool done = false;
+        APITestDelegate *delegate = [[APITestDelegate alloc] initWithCompletionCondition:&done];
+        [webView setFrameLoadDelegate:delegate];
 
-    [[webView mainFrame] loadData:[(NSString *)utf8DataCF.get() dataUsingEncoding:NSUTF8StringEncoding] MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:[NSURL URLWithString:(NSString *)baseURLCF.get()]];
-    
-    while (!done) {
-        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
-        [pool release];
-    }
+        [[webView mainFrame] loadData:[(__bridge NSString *)utf8DataCF.get() dataUsingEncoding:NSUTF8StringEncoding] MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:[NSURL URLWithString:(__bridge NSString *)baseURLCF.get()]];
 
+        while (!done) {
+            @autoreleasepool {
+                [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+            }
+        }
+
 #if PLATFORM(IOS)
-    [(DumpRenderTree *)[UIApplication sharedApplication] _waitForWebThread];
+        [(DumpRenderTree *)[UIApplication sharedApplication] _waitForWebThread];
 #endif
 
-    [webView close];
-    [webView release];
-    [delegate release];
-    [pool release];
+        [webView close];
+        [webView release];
+        [delegate release];
+    }
 }
 
 void TestRunner::apiTestGoToCurrentBackForwardItem()

Modified: trunk/Tools/DumpRenderTree/mac/TextInputControllerMac.m (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/TextInputControllerMac.m	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/TextInputControllerMac.m	2018-06-03 19:46:17 UTC (rev 232452)
@@ -546,4 +546,4 @@
 
 @end
 
-#endif // !PLATFORM(IOS)
+#endif // PLATFORM(MAC)

Modified: trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -70,7 +70,7 @@
 {
     auto textToInsert = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, text));
     auto rangeAttribute = adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:NSStringFromRange(NSMakeRange(location == -1 ? NSNotFound : location, length)), NSTextInputReplacementRangeAttributeName, nil]);
-    auto textAndRange = adoptNS([[NSAttributedString alloc] initWithString:(NSString *)textToInsert.get() attributes:rangeAttribute.get()]);
+    auto textAndRange = adoptNS([[NSAttributedString alloc] initWithString:(__bridge NSString *)textToInsert.get() attributes:rangeAttribute.get()]);
 
     [mainFrame.webView insertText:textAndRange.get()];
 }
@@ -98,7 +98,7 @@
 #if JSC_OBJC_API_ENABLED
     WebView *webView = [mainFrame webView];
     RetainPtr<CFStringRef> interfaceItemCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, interfaceItem));
-    NSDictionary *contentDictionary = [webView _contentsOfUserInterfaceItem:(NSString *)interfaceItemCF.get()];
+    NSDictionary *contentDictionary = [webView _contentsOfUserInterfaceItem:(__bridge NSString *)interfaceItemCF.get()];
     return JSValueToObject(m_context->jsContext(), [JSValue valueWithObject:contentDictionary inContext:[JSContext contextWithJSGlobalContextRef:m_context->jsContext()]].JSValueRef, nullptr);
 #else
     UNUSED_PARAM(interfaceItem);
@@ -112,7 +112,7 @@
 
     RetainPtr<CFStringRef> value = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, valueRef));
     if (JSStringIsEqualToUTF8CString(preferenceRef, "WebKitMinimumFontSize"))
-        preferences.minimumFontSize = [(NSString *)value.get() doubleValue];
+        preferences.minimumFontSize = [(__bridge NSString *)value.get() doubleValue];
 }
 
 void UIScriptController::simulateRotation(DeviceOrientation*, JSValueRef)

Modified: trunk/Tools/DumpRenderTree/mac/WorkQueueItemMac.mm (232451 => 232452)


--- trunk/Tools/DumpRenderTree/mac/WorkQueueItemMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/DumpRenderTree/mac/WorkQueueItemMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -41,9 +41,9 @@
 bool LoadItem::invoke() const
 {
     RetainPtr<CFStringRef> urlCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, m_url.get()));
-    NSString *urlNS = (NSString *)urlCF.get();
+    NSString *urlNS = (__bridge NSString *)urlCF.get();
     RetainPtr<CFStringRef> targetCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, m_target.get()));
-    NSString *targetNS = (NSString *)targetCF.get();
+    NSString *targetNS = (__bridge NSString *)targetCF.get();
 
     WebFrame *targetFrame;
     if (targetNS && [targetNS length])
@@ -61,11 +61,11 @@
 
     if (m_unreachableURL) {
         RetainPtr<CFStringRef> unreachableURLCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, m_unreachableURL.get()));
-        [mainFrame loadAlternateHTMLString:(NSString *)contentCF.get() baseURL:[NSURL URLWithString:(NSString *)baseURLCF.get()] forUnreachableURL:[NSURL URLWithString:(NSString *)unreachableURLCF.get()]];
+        [mainFrame loadAlternateHTMLString:(__bridge NSString *)contentCF.get() baseURL:[NSURL URLWithString:(__bridge NSString *)baseURLCF.get()] forUnreachableURL:[NSURL URLWithString:(__bridge NSString *)unreachableURLCF.get()]];
         return true;
     }
 
-    [mainFrame loadHTMLString:(NSString *)contentCF.get() baseURL:[NSURL URLWithString:(NSString *)baseURLCF.get()]];
+    [mainFrame loadHTMLString:(__bridge NSString *)contentCF.get() baseURL:[NSURL URLWithString:(__bridge NSString *)baseURLCF.get()]];
     return true;
 }
 
@@ -78,7 +78,7 @@
 bool ScriptItem::invoke() const
 {
     RetainPtr<CFStringRef> scriptCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, m_script.get()));
-    NSString *scriptNS = (NSString *)scriptCF.get();
+    NSString *scriptNS = (__bridge NSString *)scriptCF.get();
     [[mainFrame webView] stringByEvaluatingJavaScriptFromString:scriptNS];
     return true;
 }

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -108,13 +108,12 @@
     if (!jsStringRef)
         return nil;
     
-    CFStringRef cfString = JSStringCopyCFString(kCFAllocatorDefault, jsStringRef);
-    return [(NSString *)cfString autorelease];
+    return CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsStringRef));
 }
 
 - (JSStringRef)createJSStringRef
 {
-    return JSStringCreateWithCFString((CFStringRef)self);
+    return JSStringCreateWithCFString((__bridge CFStringRef)self);
 }
 
 @end

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -42,13 +42,12 @@
     if (!jsStringRef)
         return nil;
 
-    CFStringRef cfString = JSStringCopyCFString(kCFAllocatorDefault, jsStringRef);
-    return [(NSString *)cfString autorelease];
+    return CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsStringRef));
 }
 
 - (JSStringRef)createJSStringRef
 {
-    return JSStringCreateWithCFString((CFStringRef)self);
+    return JSStringCreateWithCFString((__bridge CFStringRef)self);
 }
 
 namespace WTR {

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -96,7 +96,7 @@
 RefPtr<AccessibilityUIElement> AccessibilityController::accessibleElementById(JSStringRef idAttribute)
 {
     WKBundlePageRef page = InjectedBundle::singleton().page()->page();
-    id root = static_cast<PlatformUIElement>(WKAccessibilityRootObject(page));
+    id root = (__bridge id)WKAccessibilityRootObject(page);
 
     id result = findAccessibleObjectById(root, [NSString stringWithJSStringRef:idAttribute]);
     if (result)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -54,7 +54,7 @@
 
 - (JSStringRef)createJSStringRef
 {
-    return JSStringCreateWithCFString((CFStringRef)self);
+    return JSStringCreateWithCFString((__bridge CFStringRef)self);
 }
 
 @end

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -29,7 +29,7 @@
 
 bool AccessibilityTextMarker::isEqual(AccessibilityTextMarker* other)
 {
-    return [(id)platformTextMarker() isEqual:(id)other->platformTextMarker()];
+    return [(__bridge id)platformTextMarker() isEqual:(__bridge id)other->platformTextMarker()];
 }
 
 } // namespace WTR

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -29,7 +29,7 @@
     
 bool AccessibilityTextMarkerRange::isEqual(AccessibilityTextMarkerRange* other)
 {
-    return [(id)platformTextMarkerRange() isEqual:(id)other->platformTextMarkerRange()];
+    return [(__bridge id)platformTextMarkerRange() isEqual:(__bridge id)other->platformTextMarkerRange()];
 }
     
 } // namespace WTR

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -1402,7 +1402,7 @@
 bool AccessibilityUIElement::setSelectedVisibleTextRange(AccessibilityTextMarkerRange* markerRange)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    [m_element accessibilitySetValue:(id)markerRange->platformTextMarkerRange() forAttribute:NSAccessibilitySelectedTextMarkerRangeAttribute];
+    [m_element accessibilitySetValue:(__bridge id)markerRange->platformTextMarkerRange() forAttribute:NSAccessibilitySelectedTextMarkerRangeAttribute];
     END_AX_OBJC_EXCEPTIONS
 
     return true;
@@ -1670,7 +1670,7 @@
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::lineTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLineTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLineTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarkerRange::create(textMarkerRange);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1690,7 +1690,7 @@
 int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    NSNumber* lengthValue = [m_element accessibilityAttributeValue:@"AXLengthForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+    NSNumber* lengthValue = [m_element accessibilityAttributeValue:@"AXLengthForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()];
     return [lengthValue intValue];
     END_AX_OBJC_EXCEPTIONS
     
@@ -1700,7 +1700,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id previousMarker = [m_element accessibilityAttributeValue:@"AXPreviousTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id previousMarker = [m_element accessibilityAttributeValue:@"AXPreviousTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarker::create(previousMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1710,7 +1710,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id nextMarker = [m_element accessibilityAttributeValue:@"AXNextTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id nextMarker = [m_element accessibilityAttributeValue:@"AXNextTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarker::create(nextMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1720,7 +1720,7 @@
 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id textString = [m_element accessibilityAttributeValue:@"AXStringForTextMarkerRange" forParameter:(id)markerRange->platformTextMarkerRange()];
+    id textString = [m_element accessibilityAttributeValue:@"AXStringForTextMarkerRange" forParameter:(__bridge id)markerRange->platformTextMarkerRange()];
     return [textString createJSStringRef];
     END_AX_OBJC_EXCEPTIONS
     
@@ -1730,7 +1730,7 @@
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    NSArray* textMarkers = [NSArray arrayWithObjects:(id)startMarker->platformTextMarker(), (id)endMarker->platformTextMarker(), nil];
+    NSArray* textMarkers = [NSArray arrayWithObjects:(__bridge id)startMarker->platformTextMarker(), (__bridge id)endMarker->platformTextMarker(), nil];
     id textMarkerRange = [m_element accessibilityAttributeValue:@"AXTextMarkerRangeForUnorderedTextMarkers" forParameter:textMarkers];
     return AccessibilityTextMarkerRange::create(textMarkerRange);
     END_AX_OBJC_EXCEPTIONS
@@ -1767,7 +1767,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarkerForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+    id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarkerForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()];
     return AccessibilityTextMarker::create(textMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1777,7 +1777,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarkerForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+    id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarkerForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()];
     return AccessibilityTextMarker::create(textMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1817,7 +1817,7 @@
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id uiElement = [m_element accessibilityAttributeValue:@"AXUIElementForTextMarker" forParameter:(id)marker->platformTextMarker()];
+    id uiElement = [m_element accessibilityAttributeValue:@"AXUIElementForTextMarker" forParameter:(__bridge id)marker->platformTextMarker()];
     if (uiElement)
         return AccessibilityUIElement::create(uiElement);
     END_AX_OBJC_EXCEPTIONS
@@ -1835,9 +1835,9 @@
             misspelled = [[attrs objectForKey:NSAccessibilityMarkedMisspelledTextAttribute] boolValue];
         if (misspelled)
             [mutableString appendString:@"Misspelled, "];
-        id font = [attributes objectForKey:(id)kAXFontTextAttribute];
+        id font = [attributes objectForKey:(__bridge id)kAXFontTextAttribute];
         if (font)
-            [mutableString appendFormat:@"%@ - %@, ", (id)kAXFontTextAttribute, font];
+            [mutableString appendFormat:@"%@ - %@, ", (__bridge id)kAXFontTextAttribute, font];
     };
     [string enumerateAttributesInRange:NSMakeRange(0, [string length]) options:(NSAttributedStringEnumerationOptions)0 usingBlock:attributeEnumerationBlock];
     [mutableString appendString:[string string]];
@@ -1849,7 +1849,7 @@
     NSAttributedString* string = nil;
 
     BEGIN_AX_OBJC_EXCEPTIONS
-    string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(id)markerRange->platformTextMarkerRange()];
+    string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(__bridge id)markerRange->platformTextMarkerRange()];
     END_AX_OBJC_EXCEPTIONS
 
     if (![string isKindOfClass:[NSAttributedString class]])
@@ -1864,9 +1864,9 @@
 
     id parameter = nil;
     if (includeSpellCheck)
-        parameter = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:includeSpellCheck], @"AXSpellCheck", (id)markerRange->platformTextMarkerRange(), @"AXTextMarkerRange", nil];
+        parameter = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:includeSpellCheck], @"AXSpellCheck", (__bridge id)markerRange->platformTextMarkerRange(), @"AXTextMarkerRange", nil];
     else
-        parameter = (id)markerRange->platformTextMarkerRange();
+        parameter = (__bridge id)markerRange->platformTextMarkerRange();
 
     BEGIN_AX_OBJC_EXCEPTIONS
     string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRangeWithOptions" forParameter:parameter];
@@ -1881,7 +1881,7 @@
 bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef attribute, AccessibilityTextMarkerRange* range)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    NSAttributedString* string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+    NSAttributedString* string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()];
     if (![string isKindOfClass:[NSAttributedString class]])
         return false;
     
@@ -1896,7 +1896,7 @@
 int AccessibilityUIElement::indexForTextMarker(AccessibilityTextMarker* marker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    NSNumber* indexNumber = [m_element accessibilityAttributeValue:@"AXIndexForTextMarker" forParameter:(id)marker->platformTextMarker()];
+    NSNumber* indexNumber = [m_element accessibilityAttributeValue:@"AXIndexForTextMarker" forParameter:(__bridge id)marker->platformTextMarker()];
     return [indexNumber intValue];
     END_AX_OBJC_EXCEPTIONS
     
@@ -1906,7 +1906,7 @@
 bool AccessibilityUIElement::isTextMarkerValid(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    NSNumber* validNumber = [m_element accessibilityAttributeValue:@"AXTextMarkerIsValid" forParameter:(id)textMarker->platformTextMarker()];
+    NSNumber* validNumber = [m_element accessibilityAttributeValue:@"AXTextMarkerIsValid" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return [validNumber boolValue];
     END_AX_OBJC_EXCEPTIONS
     
@@ -1946,7 +1946,7 @@
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::leftWordTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLeftWordTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLeftWordTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarkerRange::create(textMarkerRange);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1956,7 +1956,7 @@
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXRightWordTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXRightWordTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarkerRange::create(textMarkerRange);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1966,7 +1966,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousWordStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id previousWordStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousWordStartTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id previousWordStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousWordStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarker::create(previousWordStartMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1976,7 +1976,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextWordEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id nextWordEndMarker = [m_element accessibilityAttributeValue:@"AXNextWordEndTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id nextWordEndMarker = [m_element accessibilityAttributeValue:@"AXNextWordEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarker::create(nextWordEndMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1986,7 +1986,7 @@
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXParagraphTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXParagraphTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarkerRange::create(textMarkerRange);
     END_AX_OBJC_EXCEPTIONS
     
@@ -1996,7 +1996,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id previousParagraphStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousParagraphStartTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id previousParagraphStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousParagraphStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarker::create(previousParagraphStartMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -2006,7 +2006,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id nextParagraphEndMarker = [m_element accessibilityAttributeValue:@"AXNextParagraphEndTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id nextParagraphEndMarker = [m_element accessibilityAttributeValue:@"AXNextParagraphEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarker::create(nextParagraphEndMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -2016,7 +2016,7 @@
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXSentenceTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXSentenceTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarkerRange::create(textMarkerRange);
     END_AX_OBJC_EXCEPTIONS
     
@@ -2026,7 +2026,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id previousParagraphStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousSentenceStartTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id previousParagraphStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousSentenceStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarker::create(previousParagraphStartMarker);
     END_AX_OBJC_EXCEPTIONS
     
@@ -2036,7 +2036,7 @@
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker)
 {
     BEGIN_AX_OBJC_EXCEPTIONS
-    id nextParagraphEndMarker = [m_element accessibilityAttributeValue:@"AXNextSentenceEndTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    id nextParagraphEndMarker = [m_element accessibilityAttributeValue:@"AXNextSentenceEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()];
     return AccessibilityTextMarker::create(nextParagraphEndMarker);
     END_AX_OBJC_EXCEPTIONS
     

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -61,8 +61,8 @@
     [globalWebViewConfiguration release];
     globalWebViewConfiguration = [[WKWebViewConfiguration alloc] init];
 
-    globalWebViewConfiguration.processPool = (WKProcessPool *)context;
-    globalWebViewConfiguration.websiteDataStore = (WKWebsiteDataStore *)WKContextGetWebsiteDataStore(context);
+    globalWebViewConfiguration.processPool = (__bridge WKProcessPool *)context;
+    globalWebViewConfiguration.websiteDataStore = (__bridge WKWebsiteDataStore *)WKContextGetWebsiteDataStore(context);
     globalWebViewConfiguration._allowUniversalAccessFromFileURLs = YES;
     globalWebViewConfiguration._applePayEnabled = YES;
 
@@ -71,7 +71,7 @@
     WKCookieManagerSetStorageAccessAPIEnabled(WKContextGetCookieManager(context), true);
 #endif
 
-    WKWebsiteDataStore* poolWebsiteDataStore = (WKWebsiteDataStore *)WKContextGetWebsiteDataStore((WKContextRef)globalWebViewConfiguration.processPool);
+    WKWebsiteDataStore* poolWebsiteDataStore = (__bridge WKWebsiteDataStore *)WKContextGetWebsiteDataStore((__bridge WKContextRef)globalWebViewConfiguration.processPool);
     [poolWebsiteDataStore _setCacheStoragePerOriginQuota: 400 * 1024];
     if (libraryPath) {
         String cacheStorageDirectory = String(libraryPath) + '/' + "CacheStorage";
@@ -113,7 +113,7 @@
 WKContextRef TestController::platformContext()
 {
 #if WK_API_ENABLED
-    return (WKContextRef)globalWebViewConfiguration.processPool;
+    return (__bridge WKContextRef)globalWebViewConfiguration.processPool;
 #else
     return nullptr;
 #endif
@@ -122,7 +122,7 @@
 WKPreferencesRef TestController::platformPreferences()
 {
 #if WK_API_ENABLED
-    return (WKPreferencesRef)globalWebViewConfiguration.preferences;
+    return (__bridge WKPreferencesRef)globalWebViewConfiguration.preferences;
 #else
     return nullptr;
 #endif
@@ -174,7 +174,7 @@
 {
 #if WK_API_ENABLED
     initializeWebViewConfiguration(libraryPathForTesting(), injectedBundlePath(), context, contextConfiguration);
-    return (WKContextRef)globalWebViewConfiguration.processPool;
+    return (__bridge WKContextRef)globalWebViewConfiguration.processPool;
 #else
     return nullptr;
 #endif

Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -138,7 +138,7 @@
         [[NSUserDefaults standardUserDefaults] setValue:@YES forKey:@"WebKit2UseRemoteLayerTreeDrawingArea"];
 
     RetainPtr<WKWebViewConfiguration> copiedConfiguration = adoptNS([configuration copy]);
-    WKPreferencesSetThreadedScrollingEnabled((WKPreferencesRef)[copiedConfiguration preferences], m_options.useThreadedScrolling);
+    WKPreferencesSetThreadedScrollingEnabled((__bridge WKPreferencesRef)[copiedConfiguration preferences], m_options.useThreadedScrolling);
 
     NSRect rect = NSMakeRect(0, 0, TestController::viewWidth, TestController::viewHeight);
     m_view = [[TestRunnerWKWebView alloc] initWithFrame:rect configuration:copiedConfiguration.get()];

Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -90,12 +90,12 @@
 void TestController::initializeInjectedBundlePath()
 {
     NSString *nsBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"WebKitTestRunnerInjectedBundle.bundle"];
-    m_injectedBundlePath.adopt(WKStringCreateWithCFString((CFStringRef)nsBundlePath));
+    m_injectedBundlePath.adopt(WKStringCreateWithCFString((__bridge CFStringRef)nsBundlePath));
 }
 
 void TestController::initializeTestPluginDirectory()
 {
-    m_testPluginDirectory.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
+    m_testPluginDirectory.adopt(WKStringCreateWithCFString((__bridge CFStringRef)[[NSBundle mainBundle] bundlePath]));
 }
 
 void TestController::platformResetPreferencesToConsistentValues()
@@ -125,7 +125,7 @@
         return;
 
     RetainPtr<CFURLRef> testURL = adoptCF(WKURLCopyCFURL(kCFAllocatorDefault, test.url()));
-    NSURL *filterURL = [(NSURL *)testURL.get() URLByAppendingPathExtension:@"json"];
+    NSURL *filterURL = [(__bridge NSURL *)testURL.get() URLByAppendingPathExtension:@"json"];
 
     NSStringEncoding encoding;
     NSString *contentExtensionString = [[NSString alloc] initWithContentsOfURL:filterURL usedEncoding:&encoding error:NULL];

Modified: trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -46,7 +46,7 @@
 
 NSString *nsString(JSStringRef string)
 {
-    return (NSString *)adoptCF(JSStringCopyCFString(kCFAllocatorDefault, string)).autorelease();
+    return CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, string));
 }
 
 void UIScriptController::doAsyncTask(JSValueRef callback)
@@ -236,7 +236,7 @@
 void UIScriptController::platformPlayBackEventStream(JSStringRef eventStream, JSValueRef callback)
 {
     RetainPtr<CFStringRef> stream = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, eventStream));
-    playBackEvents(m_context, (NSString *)stream.get(), callback);
+    playBackEvents(m_context, (__bridge NSString *)stream.get(), callback);
 }
 
 void UIScriptController::firstResponderSuppressionForWebView(bool shouldSuppress)

Modified: trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -29,6 +29,7 @@
 #import "EventSenderProxy.h"
 #import "PlatformWebView.h"
 #import "TestController.h"
+#import "TestRunnerWKWebView.h"
 
 using namespace WTR;
 

Modified: trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -189,8 +189,8 @@
 {
     CFDataRef data = ""
     if (propertyList)
-        data = "" propertyList);
-    BOOL result = [self setData:(NSData *)data forType:dataType];
+        data = "" (__bridge CFTypeRef)propertyList);
+    BOOL result = [self setData:(__bridge NSData *)data forType:dataType];
     if (data)
         CFRelease(data);
     return result;
@@ -205,7 +205,7 @@
         else
             data = "" (CFStringRef)string, kCFStringEncodingUTF8, 0);
     }
-    BOOL result = [self setData:(NSData *)data forType:dataType];
+    BOOL result = [self setData:(__bridge NSData *)data forType:dataType];
     if (data)
         CFRelease(data);
     return result;

Modified: trunk/Tools/WebKitTestRunner/mac/main.mm (232451 => 232452)


--- trunk/Tools/WebKitTestRunner/mac/main.mm	2018-06-03 18:28:07 UTC (rev 232451)
+++ trunk/Tools/WebKitTestRunner/mac/main.mm	2018-06-03 19:46:17 UTC (rev 232452)
@@ -57,15 +57,12 @@
 
 int main(int argc, const char* argv[])
 {
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    [NSApplication sharedApplication];
-    setDefaultsToConsistentValuesForTesting();
-    disableAppNapInUIProcess(); // For secondary processes, app nap is disabled using WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled().
-
-    {
+    @autoreleasepool {
+        [NSApplication sharedApplication];
+        setDefaultsToConsistentValuesForTesting();
+        disableAppNapInUIProcess(); // For secondary processes, app nap is disabled using WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled().
         WTR::TestController controller(argc, argv);
     }
-    [pool drain];
     return 0;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to