Just don't do it!
Created attachment 221195 [details] Proposed patch
Comment on attachment 221195 [details] Proposed patch 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).
Created attachment 221320 [details] Another patch.
Comment on attachment 221320 [details] Another patch. Nice.
(In reply to comment #4) > (From update of attachment 221320 [details]) > Nice. Thanks for the suggestion, my first and second versions were definitely over engineered :-)
Comment on attachment 221320 [details] Another patch. Clearing flags on attachment: 221320 Committed r162108: <http://trac.webkit.org/changeset/162108>
All reviewed patches have been landed. Closing bug.