RESOLVED FIXED 144232
Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
https://bugs.webkit.org/show_bug.cgi?id=144232
Summary Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
Zan Dobersek
Reported 2015-04-26 11:35:31 PDT
Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
Attachments
Patch (9.58 KB, patch)
2015-04-26 11:37 PDT, Zan Dobersek
no flags
Patch (10.61 KB, patch)
2015-04-27 23:50 PDT, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2015-04-26 11:37:30 PDT
Darin Adler
Comment 2 2015-04-26 11:55:37 PDT
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.
Zan Dobersek
Comment 3 2015-04-27 23:50:00 PDT
Created attachment 251827 [details] Patch Uses RetainPtr<id> for ::setAsset().
WebKit Commit Bot
Comment 4 2015-04-27 23:51:41 PDT
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.
Zan Dobersek
Comment 5 2015-04-29 06:14:13 PDT
Comment on attachment 251827 [details] Patch Clearing flags on attachment: 251827 Committed r183544: <http://trac.webkit.org/changeset/183544>
Zan Dobersek
Comment 6 2015-04-29 06:14:20 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.