Bug 150669

Summary: MediaPlayer::getSupportedTypes only returns types from the last engine registered
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jer.noble, ryanhaddad
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch.
none
Updated patch none

Description Eric Carlson 2015-10-29 06:40:02 PDT
MediaPlayer::getSupportedTypes is used by MIMETypeRegistry::initializeSupportedMediaMIMETypes to build a static list of all media MIME types supported by a port. MediaPlayer::getSupportedTypes takes a HashSet<String>&, which it passes to ever registered media engine's getSupportedTypes factory method, which of course means that each call overwrites the values added by the previous engine. 

This works as long as every registered media engine supports the same set of MIME types, or the last engine registered is a superset of them all. r191721 added a MediaStream engine to the Mac port. This engine happens to get registered last, so MediaPlayer::getSupportedTypes returns an empty hash set.
Comment 1 Eric Carlson 2015-10-29 06:46:08 PDT
Created attachment 264313 [details]
Proposed patch.
Comment 2 WebKit Commit Bot 2015-10-29 06:47:10 PDT
Attachment 264313 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Eric Carlson 2015-10-29 07:46:01 PDT
Created attachment 264316 [details]
Updated patch
Comment 4 WebKit Commit Bot 2015-10-29 10:59:26 PDT
Comment on attachment 264316 [details]
Updated patch

Clearing flags on attachment: 264316

Committed r191734: <http://trac.webkit.org/changeset/191734>
Comment 5 WebKit Commit Bot 2015-10-29 10:59:29 PDT
All reviewed patches have been landed.  Closing bug.