Translated applications cannot use remote methods with BOOL arguments
Created attachment 456315 [details] Patch
<rdar://problem/90509457>
Going to have to mull how to test this
Comment on attachment 456315 [details] Patch There must be a better way, but I don’t know immediately what it is.
Committed r292209 (249112@main): <https://commits.webkit.org/249112@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 456315 [details].
Comment on attachment 456315 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456315&action=review I think someone should simplify this at some point. The string manipulation is unnecessarily roundabout. > Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm:57 > +bool methodSignaturesAreCompatible(const String& wire, const String& local) Not new to this patch: It seems strange to take const String& instead of const char* or NSString * for these arguments given how this function is used. Even if we really love WTF, we should use StringView here, not const String&. As far as I can tell, all the strings passed to this function are created by calling the UTF8String method of an NSString, and then using that to create a String. Doing that is less efficient than just assigning an NSString to a String, because it allocates memory for a UTF-8 string, and although this is not important in this case, I think, it incorrectly handles non-ASCII characters, encoding them as UTF-8 and then treating them as Latin-1. > Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm:68 > + char localType = local[i]; > + char wireType = wire[i]; This chops UChar down to char, which makes sense, I suppose, since what’s passed to this function a string that we know is all ASCII, but further calls into question why we are using WTF::String here at all. > Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm:974 > + String remoteMethodSignature = typeSignature.UTF8String; > + String localMethodSignature = [invocation methodSignature]._typeString.UTF8String; Here’s one of those peculiar uses of UTF8String. _WKRemoteObjectRegistry.mm has two others of those.