Changeset 250694 in webkit
- Timestamp:
- Oct 3, 2019 6:09:43 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r250693 r250694 1 2019-10-03 Jer Noble <jer.noble@apple.com> 2 3 [iOS] WebContent process can be interrupted during suspension; loses "Now Playing" status 4 https://bugs.webkit.org/show_bug.cgi?id=202537 5 <rdar://problem/55952707> 6 7 Reviewed by Eric Carlson. 8 9 Always deactivate the AVAudioSession when the last playing PlatformAudioSession ends playback and the application is in the background. 10 11 * platform/audio/PlatformMediaSessionManager.cpp: 12 (WebCore::PlatformMediaSessionManager::removeSession): 13 (WebCore::PlatformMediaSessionManager::processWillSuspend): 14 (WebCore::PlatformMediaSessionManager::maybeDeactivateAudioSession): 15 * platform/audio/PlatformMediaSessionManager.h: 16 (WebCore::PlatformMediaSessionManager::isApplicationInBackground const): 17 * platform/audio/ios/MediaSessionManagerIOS.h: 18 * platform/audio/ios/MediaSessionManagerIOS.mm: 19 (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): 20 1 21 2019-10-03 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp
r247182 r250694 167 167 m_audioHardwareListener = nullptr; 168 168 #if USE(AUDIO_SESSION) 169 if (m_becameActive && shouldDeactivateAudioSession()) { 170 AudioSession::sharedSession().tryToSetActive(false); 171 m_becameActive = false; 172 } 169 maybeDeactivateAudioSession(); 173 170 #endif 174 171 } … … 364 361 m_processIsSuspended = true; 365 362 363 ALWAYS_LOG(LOGIDENTIFIER); 364 366 365 forEachSession([&] (auto& session) { 367 366 session.client().processIsSuspendedChanged(); … … 369 368 370 369 #if USE(AUDIO_SESSION) 371 if (m_becameActive && shouldDeactivateAudioSession()) { 372 AudioSession::sharedSession().tryToSetActive(false); 373 ALWAYS_LOG(LOGIDENTIFIER, "tried to set inactive AudioSession"); 374 m_becameActive = false; 375 } 370 maybeDeactivateAudioSession(); 376 371 #endif 377 372 } … … 546 541 } 547 542 543 #if USE(AUDIO_SESSION) 544 void PlatformMediaSessionManager::maybeDeactivateAudioSession() 545 { 546 if (!m_becameActive || !shouldDeactivateAudioSession()) 547 return; 548 549 ALWAYS_LOG(LOGIDENTIFIER, "tried to set inactive AudioSession"); 550 AudioSession::sharedSession().tryToSetActive(false); 551 m_becameActive = false; 552 } 553 #endif 554 548 555 static bool& deactivateAudioSession() 549 556 { -
trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h
r247118 r250694 150 150 AudioHardwareListener* audioHardwareListener() { return m_audioHardwareListener.get(); } 151 151 152 bool isApplicationInBackground() const { return m_isApplicationInBackground; } 153 #if USE(AUDIO_SESSION) 154 void maybeDeactivateAudioSession(); 155 #endif 156 152 157 #if !RELEASE_LOG_DISABLED 153 158 const Logger& logger() const final { return m_logger; } -
trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h
r248978 r250694 63 63 void configureWireLessTargetMonitoring() override; 64 64 void providePresentingApplicationPIDIfNecessary() final; 65 void sessionWillEndPlayback(PlatformMediaSession&) final; 65 66 66 67 #if !RELEASE_LOG_DISABLED -
trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
r248978 r250694 191 191 } 192 192 193 void MediaSessionManageriOS::sessionWillEndPlayback(PlatformMediaSession& session) 194 { 195 MediaSessionManagerCocoa::sessionWillEndPlayback(session); 196 197 #if USE(AUDIO_SESSION) 198 if (isApplicationInBackground() && !anyOfSessions([] (auto& session) { return session.state() == PlatformMediaSession::Playing; })) 199 maybeDeactivateAudioSession(); 200 #endif 201 } 202 193 203 void MediaSessionManageriOS::externalOutputDeviceAvailableDidChange() 194 204 {
Note: See TracChangeset
for help on using the changeset viewer.