[webkit-reviews] review denied: [Bug 127003] MediaSessionManager shouldn't use std::map : [Attachment 221195] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 14 18:03:30 PST 2014


Sam Weinig <sam at webkit.org> has denied Eric Carlson <eric.carlson at apple.com>'s
request for review:
Bug 127003: MediaSessionManager shouldn't use std::map
https://bugs.webkit.org/show_bug.cgi?id=127003

Attachment 221195: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=221195&action=review

------- Additional Comments from Sam Weinig <sam at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=221195&action=review


> Source/WebCore/platform/audio/MediaSessionManager.h:71
> +    typedef HashMap<MediaSession::MediaType, SessionRestrictions,
WTF::IntHash<unsigned>, WTF::HashTraits<unsigned>> RestrictionsMap;

I think you can actually do much better than a HashMap.  How about something
like an array of SessionRestrictions of size == LagestValueOfMediaType + 1:

SessionRestrictions[WebAudio + 1];

But, if you use the HashMap, you need to use traits that allow for a 0 value
key (e.g. UnsignedWithZeroKeyHashTraits).


More information about the webkit-reviews mailing list