Changeset 280698 in webkit
- Timestamp:
- Aug 5, 2021, 10:05:58 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
GPUProcess/media/RemoteAudioSessionProxyManager.cpp (modified) (5 diffs)
-
GPUProcess/media/RemoteAudioSessionProxyManager.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r280690 r280698 1 2021-08-05 Eric Carlson <eric.carlson@apple.com> 2 3 [GPUP] RemoteAudioSessionProxyManager should use the shared audio session 4 https://bugs.webkit.org/show_bug.cgi?id=228795 5 <rdar://problem/81530450> 6 7 Reviewed by Jer Noble. 8 9 RemoteAudioSessionProxyManager creates and uses a private AudioSession, which means 10 that any code that moves from the WebProcess to the GPUProcess and uses 11 `AudioSession::sharedSession` will be using a separate platform audio session wrapper 12 object. RemoteAudioSessionProxyManager doesn't need a private AudioSession, so 13 change it to use `AudioSession::sharedSession`. 14 15 * GPUProcess/media/RemoteAudioSessionProxyManager.cpp: 16 (WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager): Don't 17 create a new AudioSession. 18 (WebKit::RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager): Use 19 AudioSession::sharedSession(). 20 (WebKit::RemoteAudioSessionProxyManager::updateCategory): Ditto. 21 (WebKit::RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess): Ditto. 22 (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess): Ditto. 23 1 24 2021-08-05 Wenson Hsieh <wenson_hsieh@apple.com> 2 25 -
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp
r280664 r280698 45 45 46 46 RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager() 47 : m_session(AudioSession::create()) 48 { 49 m_session->addInterruptionObserver(*this); 50 m_session->addConfigurationChangeObserver(*this); 47 { 48 AudioSession::sharedSession().addInterruptionObserver(*this); 49 AudioSession::sharedSession().addConfigurationChangeObserver(*this); 51 50 } 52 51 53 52 RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager() 54 53 { 55 m_session->removeInterruptionObserver(*this);56 m_session->removeConfigurationChangeObserver(*this);54 AudioSession::sharedSession().removeInterruptionObserver(*this); 55 AudioSession::sharedSession().removeConfigurationChangeObserver(*this); 57 56 } 58 57 … … 106 105 ASSERT_NOT_REACHED(); 107 106 108 m_session->setCategory(category, policy);107 AudioSession::sharedSession().setCategory(category, policy); 109 108 } 110 109 … … 116 115 } 117 116 118 m_session->setPreferredBufferSize(preferredBufferSize);117 AudioSession::sharedSession().setPreferredBufferSize(preferredBufferSize); 119 118 } 120 119 … … 139 138 // proxy. Deactivate the session, and return whether that deactivation 140 139 // was sucessful; 141 return m_session->tryToSetActive(false);140 return AudioSession::sharedSession().tryToSetActive(false); 142 141 } 143 142 … … 145 144 // This proxy and only this proxy wants to become active. Activate 146 145 // the session, and return whether that activation was successful. 147 return m_session->tryToSetActive(active);146 return AudioSession::sharedSession().tryToSetActive(active); 148 147 } 149 148 -
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.h
r280664 r280698 53 53 bool tryToSetActiveForProcess(RemoteAudioSessionProxy&, bool); 54 54 55 WebCore::AudioSession& session() { return m_session; }56 const WebCore::AudioSession& session() const { return m_session; }55 WebCore::AudioSession& session() { return WebCore::AudioSession::sharedSession(); } 56 const WebCore::AudioSession& session() const { return WebCore::AudioSession::sharedSession(); } 57 57 58 58 private: … … 65 65 void configurationDidChange(const WebCore::AudioSession&); 66 66 67 UniqueRef<WebCore::AudioSession> m_session;68 67 WeakHashSet<RemoteAudioSessionProxy> m_proxies; 69 68 };
Note:
See TracChangeset
for help on using the changeset viewer.