Review usage of adoptNS(): 1. Make sure we call adoptNS() as soon as we allocate the object instead of doing it later on, as this is less error-prone 2. Fix cases where we called adoptNS() but really should have retained instead of adopting
Created attachment 420042 [details] Patch
Comment on attachment 420042 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420042&action=review > Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:510 > [webAnimationDelegate setOwner:this]; If you use [m_delegate setOwner:this] instead, this can only be two lines.
Comment on attachment 420042 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420042&action=review >> Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:510 >> [webAnimationDelegate setOwner:this]; > > If you use [m_delegate setOwner:this] instead, this can only be two lines. The issue is that the type of m_delegate is NSObject, not WebAnimationDelegate. Maybe that still works in ObjC?
(In reply to Chris Dumez from comment #3) > Comment on attachment 420042 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=420042&action=review > > >> Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:510 > >> [webAnimationDelegate setOwner:this]; > > > > If you use [m_delegate setOwner:this] instead, this can only be two lines. > > The issue is that the type of m_delegate is NSObject, not > WebAnimationDelegate. Maybe that still works in ObjC? As I thought, this does not work: ./platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:510:21: error: 'NSObject' may not respond to 'setOwner:' [-Werror]
Committed r272760: <https://commits.webkit.org/r272760> All reviewed patches have been landed. Closing bug and clearing flags on attachment 420042 [details].
<rdar://problem/74256841>