Bug 154029 - checkValidity() sometimes asserts in WebUserMediaClient::pageDestroyed
Summary: checkValidity() sometimes asserts in WebUserMediaClient::pageDestroyed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-02-09 08:21 PST by Eric Carlson
Modified: 2016-02-09 09:14 PST (History)
1 user (show)

See Also:


Attachments
Proposed patch. (4.58 KB, patch)
2016-02-09 08:39 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Updated patch. (4.58 KB, patch)
2016-02-09 08:53 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-02-09 08:21:07 PST
webkitGetUserMedia-shadowing-then.html sometimes triggers an assertion while enumerating the request map.
Comment 1 Eric Carlson 2016-02-09 08:39:16 PST
Created attachment 270927 [details]
Proposed patch.
Comment 2 Eric Carlson 2016-02-09 08:39:41 PST
<rdar://problem/24065022>
Comment 3 Eric Carlson 2016-02-09 08:53:47 PST
Created attachment 270929 [details]
Updated patch.
Comment 4 Alex Christensen 2016-02-09 08:57:34 PST
Comment on attachment 270929 [details]
Updated patch.

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

r=me

> Source/WebKit/mac/WebCoreSupport/WebUserMediaClient.mm:118
> +    ASSERT(userMediaRequestsMap().isEmpty());

These assertions seem kind of silly after calling clear, and they could be right after the call to clear, unless you are actually asserting that the map is still empty after calling cancelUserMediaAccessRequest on each request that used to be in the map.
Comment 5 Eric Carlson 2016-02-09 09:11:49 PST
Comment on attachment 270929 [details]
Updated patch.

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

>> Source/WebKit/mac/WebCoreSupport/WebUserMediaClient.mm:118
>> +    ASSERT(userMediaRequestsMap().isEmpty());
> 
> These assertions seem kind of silly after calling clear, and they could be right after the call to clear, unless you are actually asserting that the map is still empty after calling cancelUserMediaAccessRequest on each request that used to be in the map.

That is the idea, assert that the map is still empty after cancelling the requests to ensure that no new ones were added. This isn't currently possible, but if a future change enabled JS to run it could be.
Comment 6 Eric Carlson 2016-02-09 09:14:17 PST
Committed r196310: https://trac.webkit.org/r196310