As described in the Media Session spec, MediaPlayPause events need to be handled by each Media Session, and we need a MediaSessionManager to keep track of them.
<rdar://problem/21302849>
Created attachment 254580 [details] Patch
Comment on attachment 254580 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=254580&action=review > Source/WebCore/Modules/mediasession/MediaSessionManager.cpp:49 > + m_sessions.remove(m_sessions.find(&session)); Normally it’s not good to use remove/find. I’d suggest using a HashSet or ListHashSet for this collection instead of a vector.
Created attachment 254585 [details] Patch
(In reply to comment #3) > Comment on attachment 254580 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=254580&action=review > > > Source/WebCore/Modules/mediasession/MediaSessionManager.cpp:49 > > + m_sessions.remove(m_sessions.find(&session)); > > Normally it’s not good to use remove/find. I’d suggest using a HashSet or > ListHashSet for this collection instead of a vector. Settled on HashSet since we don't care about the ordering of MediaSessions. Thanks!
Comment on attachment 254585 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=254585&action=review > Source/WebCore/Modules/mediasession/MediaSessionManager.h:41 > + const HashSet<MediaSession*>& sessions() const { return m_sessions; } Is there any reason to not make this private?
(In reply to comment #6) > Comment on attachment 254585 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=254585&action=review > > > Source/WebCore/Modules/mediasession/MediaSessionManager.h:41 > > + const HashSet<MediaSession*>& sessions() const { return m_sessions; } > > Is there any reason to not make this private? I have other uncommitted code here locally that requires it to be public, but that is probably going to get refactored anyway. I'll remove the accessor for now.
Created attachment 254599 [details] Patch
Comment on attachment 254599 [details] Patch Clearing flags on attachment: 254599 Committed r185389: <http://trac.webkit.org/changeset/185389>
All reviewed patches have been landed. Closing bug.