<rdar://problem/64551566>
Created attachment 403505 [details] For EWS
Comment on attachment 403505 [details] For EWS View in context: https://bugs.webkit.org/attachment.cgi?id=403505&action=review > Tools/WebKitTestRunner/mac/TestControllerMac.mm:134 > + static NeverDestroyed<InstanceMethodSwizzler> cancelTrackingSwizzler { NSMenu.class, @selector(cancelTracking), reinterpret_cast<IMP>(swizzledCancelTracking) }; > + static NeverDestroyed<ClassMethodSwizzler> menuPopUpSwizzler { NSMenu.class, @selector(popUpContextMenu:withEvent:forView:), reinterpret_cast<IMP>(swizzledPopUpContextMenu) }; > + static NeverDestroyed<InstanceMethodSwizzler> carbonMenuPopUpSwizzler { Do these really need NeverDestroyed? Maybe they would with ARC, but I don’t see why they need it without ARC. Keep in mind that NeverDestroyed does not make something stay alive for the duration of execution: being a global makes that happen. NeverDestroyed simply prevents the destructor from being called, which is useful for such objects if they have destructors.
Comment on attachment 403505 [details] For EWS View in context: https://bugs.webkit.org/attachment.cgi?id=403505&action=review >> Tools/WebKitTestRunner/mac/TestControllerMac.mm:134 >> + static NeverDestroyed<InstanceMethodSwizzler> carbonMenuPopUpSwizzler { > > Do these really need NeverDestroyed? Maybe they would with ARC, but I don’t see why they need it without ARC. Keep in mind that NeverDestroyed does not make something stay alive for the duration of execution: being a global makes that happen. NeverDestroyed simply prevents the destructor from being called, which is useful for such objects if they have destructors. That's a good point — the `NeverDestroyed<>` doesn't add anything here. I changed these into just `static InstanceMethodSwizzler …` and `static ClassMethodSwizzler …`.
Created attachment 403507 [details] Remove NeverDestroyed.
Committed r263929: <https://trac.webkit.org/changeset/263929> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403507 [details].