| Summary: | Support releasing media sessions | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Matt Rajca <mrajca> | ||||
| Component: | Media | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | conrad_shultz, eric.carlson, jer.noble, mrajca, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 145411 | ||||||
| Attachments: |
|
||||||
|
Description
Matt Rajca
2015-06-18 17:09:16 PDT
Created attachment 255155 [details]
Patch
Comment on attachment 255155 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255155&action=review > Source/WebCore/Modules/mediasession/MediaSession.cpp:84 > + while (!m_activeParticipatingElements.isEmpty()) { > + HTMLMediaElement* element = m_activeParticipatingElements.takeAny(); > + element->pause(); > + } Could write this without the local variable: while (!m_activeParticipatingElements.isEmpty()) m_activeParticipatingElements.takeAny()->pause(); > Source/WebCore/Modules/mediasession/MediaSession.cpp:98 > + if (m_activeParticipatingElements.size() >= 1) I think !isEmpty() would be better. Sometimes it’s better not to take specification language too literally! One or more doesn’t have to turn into >= 1. Committed r185885: <http://trac.webkit.org/changeset/185885> (In reply to comment #2) > Comment on attachment 255155 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=255155&action=review > > > Source/WebCore/Modules/mediasession/MediaSession.cpp:84 > > + while (!m_activeParticipatingElements.isEmpty()) { > > + HTMLMediaElement* element = m_activeParticipatingElements.takeAny(); > > + element->pause(); > > + } > > Could write this without the local variable: > > while (!m_activeParticipatingElements.isEmpty()) > m_activeParticipatingElements.takeAny()->pause(); > > > Source/WebCore/Modules/mediasession/MediaSession.cpp:98 > > + if (m_activeParticipatingElements.size() >= 1) > > I think !isEmpty() would be better. Sometimes it’s better not to take > specification language too literally! One or more doesn’t have to turn into > >= 1. Thanks for the feedback. Fixed. |