Skip to content

Commit

Permalink
Merge r220454 - Remove unnecessary copies of PlatformMediaSessionMana…
Browse files Browse the repository at this point in the history
…ger::m_sessions

https://bugs.webkit.org/show_bug.cgi?id=175375

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-09
Reviewed by Sam Weinig.

Remove unnecessary copies of PlatformMediaSessionManager::m_sessions.

These should have been removed in r207688.

No new tests: no behavior change.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
(WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
(WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
(WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
  • Loading branch information
Ms2ger authored and carlosgcampos committed Aug 14, 2017
1 parent 50ab083 commit f1469bb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
19 changes: 19 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,22 @@
2017-08-09 Ms2ger <Ms2ger@igalia.com>

Remove unnecessary copies of PlatformMediaSessionManager::m_sessions
https://bugs.webkit.org/show_bug.cgi?id=175375

Reviewed by Sam Weinig.

Remove unnecessary copies of PlatformMediaSessionManager::m_sessions.

These should have been removed in r207688.

No new tests: no behavior change.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
(WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
(WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
(WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):

2017-08-09 Chris Dumez <cdumez@apple.com>

Reinstate active flag for iterators
Expand Down
Expand Up @@ -298,7 +298,6 @@ void PlatformMediaSessionManager::applicationWillBecomeInactive() const
{
LOG(Media, "PlatformMediaSessionManager::applicationWillBecomeInactive");

Vector<PlatformMediaSession*> sessions = m_sessions;
forEachSession([&] (PlatformMediaSession& session, size_t) {
if (m_restrictions[session.mediaType()] & InactiveProcessPlaybackRestricted)
session.beginInterruption(PlatformMediaSession::ProcessInactive);
Expand All @@ -309,7 +308,6 @@ void PlatformMediaSessionManager::applicationDidBecomeActive() const
{
LOG(Media, "PlatformMediaSessionManager::applicationDidBecomeActive");

Vector<PlatformMediaSession*> sessions = m_sessions;
forEachSession([&] (PlatformMediaSession& session, size_t) {
if (m_restrictions[session.mediaType()] & InactiveProcessPlaybackRestricted)
session.endInterruption(PlatformMediaSession::MayResumePlaying);
Expand All @@ -324,8 +322,7 @@ void PlatformMediaSessionManager::applicationDidEnterBackground(bool suspendedUn
return;

m_isApplicationInBackground = true;

Vector<PlatformMediaSession*> sessions = m_sessions;

forEachSession([&] (PlatformMediaSession& session, size_t) {
if (suspendedUnderLock && m_restrictions[session.mediaType()] & SuspendedUnderLockPlaybackRestricted)
session.beginInterruption(PlatformMediaSession::SuspendedUnderLock);
Expand All @@ -343,7 +340,6 @@ void PlatformMediaSessionManager::applicationWillEnterForeground(bool suspendedU

m_isApplicationInBackground = false;

Vector<PlatformMediaSession*> sessions = m_sessions;
forEachSession([&] (PlatformMediaSession& session, size_t) {
if ((suspendedUnderLock && m_restrictions[session.mediaType()] & SuspendedUnderLockPlaybackRestricted) || m_restrictions[session.mediaType()] & BackgroundProcessPlaybackRestricted)
session.endInterruption(PlatformMediaSession::MayResumePlaying);
Expand Down

0 comments on commit f1469bb

Please sign in to comment.