Switch uses of WTF::bind in MockMediaPlayerMediaSource to C++11 lambdas
Created attachment 220630 [details] Patch
Comment on attachment 220630 [details] Patch lgtm
Comment on attachment 220630 [details] Patch r=me
Comment on attachment 220630 [details] Patch Actually, you should protect against this being freed before the lambda is called by passing in a RefPtr into the lambda.
(In reply to comment #4) > (From update of attachment 220630 [details]) > Actually, you should protect against this being freed before the lambda is called by passing in a RefPtr into the lambda. MockMediaPlayerMediaSource is not ref-counted and is not derived from a ref-counted class (MediaPlayerPrivateInterface). It's obvious it probably should be.
(In reply to comment #5) > (In reply to comment #4) > > (From update of attachment 220630 [details] [details]) > > Actually, you should protect against this being freed before the lambda is called by passing in a RefPtr into the lambda. > > MockMediaPlayerMediaSource is not ref-counted and is not derived from a ref-counted class (MediaPlayerPrivateInterface). > > It's obvious it probably should be. In this situation, you can use a WeakPtrFactory and WeakPtrs without making the class RefCounted. Though you're right this class should probably be RefCounted.
WTF::bind() uses have been removed, making the patch stale.