Bug 189228 - [Cocoa] Turn on ARC for WebKitTestRunner
Summary: [Cocoa] Turn on ARC for WebKitTestRunner
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar
Depends on: 189464
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-02 00:20 PDT by Darin Adler
Modified: 2020-04-17 02:32 PDT (History)
5 users (show)

See Also:


Attachments
Patch (32.58 KB, patch)
2018-09-02 00:32 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
Patch (42.20 KB, patch)
2018-09-02 12:22 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
Patch (42.14 KB, patch)
2018-09-03 10:05 PDT, Darin Adler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2018-09-02 00:20:05 PDT
[Cocoa] Turn on ARC for WebKitTestRunner
Comment 1 Darin Adler 2018-09-02 00:32:55 PDT Comment hidden (obsolete)
Comment 2 Darin Adler 2018-09-02 12:22:08 PDT
Created attachment 348746 [details]
Patch
Comment 3 Darin Adler 2018-09-03 10:05:51 PDT
Created attachment 348777 [details]
Patch
Comment 4 Sam Weinig 2018-09-03 13:30:22 PDT
Comment on attachment 348777 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=348777&action=review

> Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityTextMarkerIOS.mm:32
> +    return [(__bridge id)platformTextMarker() isEqual:(__bridge id)other->platformTextMarker()];

Is there any way to make platformTextMarker() return (or rather make PlatformTextMarker) an id rather than CFTypeRef? I know in WebCore we use the trick of doing something like:

#ifndef __OBJC__
typedef struct objc_object *id;
#endif

in the C++ class. Though I am not sure what the implications for ARC are of that.

> Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:1066
> +    return AccessibilityTextMarkerRange::create((__bridge PlatformTextMarkerRange)textMarkerRange);

Same question as above, but for PlatformTextMarkerRange.

> Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:1825
> -    id mutableString = [[[NSMutableString alloc] init] autorelease];
> +    id mutableString = [[NSMutableString alloc] init];

Seems like this could be NSMutableString * rather than id (as long as you are changing this line).

> Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:138
> +    return JSStringCreateWithCFString((__bridge CFStringRef)webView.accessibilitySpeakSelectionContent);

There is a category in WebKitTestRunner that adds a  -[NSString createJSStringRef] (and a +[NSString stringWithJSStringRef:]). It is currently in AccessibilityCommonMac.h, but seems more generally useful (could probably add ones for WKStringRef as well if we were going wild).
Comment 5 Darin Adler 2018-09-08 14:29:56 PDT
Committed r235832: <https://trac.webkit.org/changeset/235832>
Comment 6 Radar WebKit Bug Importer 2018-09-08 14:30:25 PDT
<rdar://problem/44264628>
Comment 7 Alexey Proskuryakov 2018-09-09 10:47:36 PDT
This patch broke WebKit2 tests, because it apparently makes system resources leak. Rolling back.

EWS detected this before landing.


worker/10: OSError('[Errno 35] Resource temporarily unavailable') raised:
    File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/common/message_pool.py", line 257, in run
      worker.handle(message.name, message.src, *message.args)
    File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py", line 283, in handle
...
Comment 8 WebKit Commit Bot 2018-09-09 10:52:02 PDT
Re-opened since this is blocked by bug 189464
Comment 9 Darin Adler 2018-09-11 19:14:58 PDT
This did not break WebKit2 tests on my computer.
Comment 10 Darin Adler 2018-09-11 19:16:27 PDT
(In reply to Alexey Proskuryakov from comment #7)
> This patch broke WebKit2 tests, because it apparently makes system resources
> leak. Rolling back.
> 
> EWS detected this before landing.
> 
> 
> worker/10: OSError('[Errno 35] Resource temporarily unavailable') raised:
>     File
> "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/common/message_pool.py",
> line 257, in run
>       worker.handle(message.name, message.src, *message.args)
>     File
> "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/
> layout_test_runner.py", line 283, in handle
> ...

I’m accustomed to seeing this on EWS when there is a server problem, which is why I didn’t realize it was a problem with the patch.

I guess I can abandon this for now because I’m not sure what to do next since I don’t see any problem locally.
Comment 11 Alexey Proskuryakov 2018-09-26 09:21:44 PDT
Watching open files and processes with lsof and ps would likely be the most straightforward way to see what's going on locally.

It's also possible that this is something specific to Sierra and the version of clang used there. This doesn't feel like a very likely cause to me though.
Comment 12 Darin Adler 2018-09-26 09:23:18 PDT
Thanks. I will try your suggestion next time I have an opportunity to work on this.