Bug 165711 - [MediaStream] Protect MediaDevicesRequest during callback
Summary: [MediaStream] Protect MediaDevicesRequest during callback
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-12-09 18:44 PST by Eric Carlson
Modified: 2017-01-12 09:21 PST (History)
6 users (show)

See Also:


Attachments
Proposed patch. (2.33 MB, patch)
2016-12-09 18:52 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch for landing. (1.47 KB, patch)
2016-12-10 10:50 PST, Eric Carlson
sam: review+
Details | Formatted Diff | Diff
Patch for landing. (1.45 KB, patch)
2016-12-11 13:31 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2016-12-09 18:44:03 PST
Protect the MediaDevicesRequest object during a call to the completion handler in case the handler is called immediately.
Comment 1 Eric Carlson 2016-12-09 18:45:22 PST
<rdar://problem/28400468>
Comment 2 Eric Carlson 2016-12-09 18:52:11 PST
Created attachment 296764 [details]
Proposed patch.
Comment 3 Eric Carlson 2016-12-10 10:50:12 PST
Created attachment 296808 [details]
Patch for landing.
Comment 4 Sam Weinig 2016-12-10 12:22:53 PST
Comment on attachment 296808 [details]
Patch for landing.

View in context: https://bugs.webkit.org/attachment.cgi?id=296808&action=review

> Source/WebCore/Modules/mediastream/MediaDevicesEnumerationRequest.cpp:91
> +    RefPtr<MediaDevicesEnumerationRequest> protectedThis = this;

I prefer Ref<MediaDevicesEnumerationRequest> protectedThis(*this) where possible.
Comment 5 Eric Carlson 2016-12-11 13:31:14 PST
Created attachment 296873 [details]
Patch for landing.
Comment 6 WebKit Commit Bot 2016-12-11 14:08:37 PST
Comment on attachment 296873 [details]
Patch for landing.

Clearing flags on attachment: 296873

Committed r209685: <http://trac.webkit.org/changeset/209685>