| Summary: | Switch uses of WTF::bind in MockMediaPlayerMediaSource to C++11 lambdas | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Zan Dobersek <zan> | ||||
| Component: | New Bugs | Assignee: | Zan Dobersek <zan> | ||||
| Status: | RESOLVED WONTFIX | ||||||
| Severity: | Normal | CC: | andersca, commit-queue, eric.carlson, glenn, jer.noble | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Zan Dobersek
2014-01-08 07:32:40 PST
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. |