Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
Created attachment 251701 [details] Patch
Comment on attachment 251701 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251701&action=review OK. I did a version of this that uses lambdas, but I guess this is more elegant. r=me, only if you fix the problem with setAsset > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3189 > + std::function<void()> function; I think we decided to standardize on void () with the space. Anders did a patch recently about making this consistent. > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3221 > - function = WTF::bind(&MediaPlayerPrivateAVFoundationObjC::setAsset, m_callback, RetainPtr<NSArray>(newValue)); > + function = std::bind(&MediaPlayerPrivateAVFoundationObjC::setAsset, m_callback, newValue); This introduces a bug. Nothing will retain/release the value and it could be deallocated by the time it runs on the main thread. Need to cast to some kind of RetainPtr.
Created attachment 251827 [details] Patch Uses RetainPtr<id> for ::setAsset().
Attachment 251827 [details] did not pass style-queue: ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3198: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 251827 [details] Patch Clearing flags on attachment: 251827 Committed r183544: <http://trac.webkit.org/changeset/183544>
All reviewed patches have been landed. Closing bug.