⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280698 in webkit


Ignore:
Timestamp:
Aug 5, 2021, 10:05:58 AM (5 years ago)
Author:
eric.carlson@apple.com
Message:

[GPUP] RemoteAudioSessionProxyManager should use the shared audio session
https://bugs.webkit.org/show_bug.cgi?id=228795
<rdar://problem/81530450>

Reviewed by Jer Noble.

RemoteAudioSessionProxyManager creates and uses a private AudioSession, which means
that any code that moves from the WebProcess to the GPUProcess and uses
AudioSession::sharedSession will be using a separate platform audio session wrapper
object. RemoteAudioSessionProxyManager doesn't need a private AudioSession, so
change it to use AudioSession::sharedSession.

  • GPUProcess/media/RemoteAudioSessionProxyManager.cpp:

(WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager): Don't
create a new AudioSession.
(WebKit::RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager): Use
AudioSession::sharedSession().
(WebKit::RemoteAudioSessionProxyManager::updateCategory): Ditto.
(WebKit::RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess): Ditto.
(WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess): Ditto.

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r280690 r280698  
     12021-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
    1242021-08-05  Wenson Hsieh  <wenson_hsieh@apple.com>
    225
  • trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp

    r280664 r280698  
    4545
    4646RemoteAudioSessionProxyManager::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);
    5150}
    5251
    5352RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager()
    5453{
    55     m_session->removeInterruptionObserver(*this);
    56     m_session->removeConfigurationChangeObserver(*this);
     54    AudioSession::sharedSession().removeInterruptionObserver(*this);
     55    AudioSession::sharedSession().removeConfigurationChangeObserver(*this);
    5756}
    5857
     
    106105        ASSERT_NOT_REACHED();
    107106
    108     m_session->setCategory(category, policy);
     107    AudioSession::sharedSession().setCategory(category, policy);
    109108}
    110109
     
    116115    }
    117116
    118     m_session->setPreferredBufferSize(preferredBufferSize);
     117    AudioSession::sharedSession().setPreferredBufferSize(preferredBufferSize);
    119118}
    120119
     
    139138        // proxy. Deactivate the session, and return whether that deactivation
    140139        // was sucessful;
    141         return m_session->tryToSetActive(false);
     140        return AudioSession::sharedSession().tryToSetActive(false);
    142141    }
    143142
     
    145144        // This proxy and only this proxy wants to become active. Activate
    146145        // the session, and return whether that activation was successful.
    147         return m_session->tryToSetActive(active);
     146        return AudioSession::sharedSession().tryToSetActive(active);
    148147    }
    149148
  • trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.h

    r280664 r280698  
    5353    bool tryToSetActiveForProcess(RemoteAudioSessionProxy&, bool);
    5454
    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(); }
    5757
    5858private:
     
    6565    void configurationDidChange(const WebCore::AudioSession&);
    6666
    67     UniqueRef<WebCore::AudioSession> m_session;
    6867    WeakHashSet<RemoteAudioSessionProxy> m_proxies;
    6968};
Note: See TracChangeset for help on using the changeset viewer.