WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
127003
MediaSessionManager shouldn't use std::map
https://bugs.webkit.org/show_bug.cgi?id=127003
Summary
MediaSessionManager shouldn't use std::map
Eric Carlson
Reported
2014-01-14 13:26:27 PST
Just don't do it!
Attachments
Proposed patch
(4.22 KB, patch)
2014-01-14 13:30 PST
,
Eric Carlson
sam
: review-
Details
Formatted Diff
Diff
Another patch.
(3.30 KB, patch)
2014-01-15 17:21 PST
,
Eric Carlson
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Eric Carlson
Comment 1
2014-01-14 13:30:01 PST
Created
attachment 221195
[details]
Proposed patch
Sam Weinig
Comment 2
2014-01-14 18:01:08 PST
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).
Eric Carlson
Comment 3
2014-01-15 17:21:00 PST
Created
attachment 221320
[details]
Another patch.
Sam Weinig
Comment 4
2014-01-15 18:51:57 PST
Comment on
attachment 221320
[details]
Another patch. Nice.
Eric Carlson
Comment 5
2014-01-15 19:09:51 PST
(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 :-)
WebKit Commit Bot
Comment 6
2014-01-15 19:36:19 PST
Comment on
attachment 221320
[details]
Another patch. Clearing flags on attachment: 221320 Committed
r162108
: <
http://trac.webkit.org/changeset/162108
>
WebKit Commit Bot
Comment 7
2014-01-15 19:36:22 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug