Skip to content
Permalink
Browse files
[Media in GPU Process] Move AudioSessionRoutingArbitratorProxy to the…
… GPU process

https://bugs.webkit.org/show_bug.cgi?id=217535
<rdar://problem/70152548>

Reviewed by Eric Carlson.

Source/WebCore:

Add a new shared object, SharedRoutingArbitrator, to be used both in the UIProcess (when media
in the GPU process is not enabled) and the GPUProcess (when it is).

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/AudioSession.h:
* platform/audio/mac/SharedRoutingArbitrator.h: Added.
* platform/audio/mac/SharedRoutingArbitrator.mm: Added.
(WebCore::SharedRoutingArbitrator::Token::create):
(WebCore::SharedRoutingArbitrator::sharedInstance):
(WebCore::SharedRoutingArbitrator::isInRoutingArbitrationForToken):
(WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken):
(WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken):

Source/WebKit:

Add a new, local-only object which can aggregate changes to the audio routing.
The UIProcess version of this object spans a process boundary, but this new
object can operate locally without an XPC communication channel. As part of this
change, the "SharedArbitrator" in AudioSessionRoutingArbitratorProxyCocoa has been
moved into WebCore to be used both there and in this new object.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess):
(WebKit::GPUConnectionToWebProcess::didClose):
* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/mac/LocalAudioSessionRoutingArbitrator.cpp: Added.
(WebKit::LocalAudioSessionRoutingArbitrator::create):
(WebKit::LocalAudioSessionRoutingArbitrator::LocalAudioSessionRoutingArbitrator):
(WebKit::LocalAudioSessionRoutingArbitrator::~LocalAudioSessionRoutingArbitrator):
(WebKit::LocalAudioSessionRoutingArbitrator::processDidTerminate):
(WebKit::LocalAudioSessionRoutingArbitrator::beginRoutingArbitrationWithCategory):
(WebKit::LocalAudioSessionRoutingArbitrator::leaveRoutingAbritration):
* GPUProcess/mac/LocalAudioSessionRoutingArbitrator.h:
* SourcesCocoa.txt:
* UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
* UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
(WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy):
(WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
(WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):
(WebKit::AudioSessionRoutingArbitratorProxy::endRoutingArbitration):
(): Deleted.
(WebKit::SharedArbitrator::sharedInstance): Deleted.
(WebKit::SharedArbitrator::isInRoutingArbitrationForArbitrator): Deleted.
(WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator): Deleted.
(WebKit::SharedArbitrator::endRoutingArbitrationForArbitrator): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/media/RemoteAudioSession.cpp:
(WebKit::RemoteAudioSession::setCategory):


Canonical link: https://commits.webkit.org/237316@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jernoble committed May 4, 2021
1 parent 15a3ee7 commit 44ff4f98cb8a0e297bc0c8af8ac972f564b2f8f6
Showing 18 changed files with 540 additions and 137 deletions.
@@ -1,3 +1,25 @@
2021-05-04 Jer Noble <jer.noble@apple.com>

[Media in GPU Process] Move AudioSessionRoutingArbitratorProxy to the GPU process
https://bugs.webkit.org/show_bug.cgi?id=217535
<rdar://problem/70152548>

Reviewed by Eric Carlson.

Add a new shared object, SharedRoutingArbitrator, to be used both in the UIProcess (when media
in the GPU process is not enabled) and the GPUProcess (when it is).

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/AudioSession.h:
* platform/audio/mac/SharedRoutingArbitrator.h: Added.
* platform/audio/mac/SharedRoutingArbitrator.mm: Added.
(WebCore::SharedRoutingArbitrator::Token::create):
(WebCore::SharedRoutingArbitrator::sharedInstance):
(WebCore::SharedRoutingArbitrator::isInRoutingArbitrationForToken):
(WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken):
(WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken):

2021-05-04 Chris Dumez <cdumez@apple.com>

Blob contentType with charset renders html as plain text
@@ -227,6 +227,7 @@ platform/audio/mac/AudioFileReaderMac.cpp
platform/audio/mac/AudioHardwareListenerMac.cpp
platform/audio/mac/AudioSessionMac.mm
platform/audio/mac/FFTFrameMac.cpp
platform/audio/mac/SharedRoutingArbitrator.mm
platform/cf/KeyedDecoderCF.cpp
platform/cf/KeyedEncoderCF.cpp
platform/cf/MainThreadSharedTimerCF.cpp
@@ -4301,6 +4301,7 @@
CD336F6417FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h in Headers */ = {isa = PBXBuildFile; fileRef = CD336F6317FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h */; };
CD336F6717FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD336F6517FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp */; };
CD336F6817FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD336F6617FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h */; };
CD36C16B260A65CC00C8C529 /* SharedRoutingArbitrator.h in Headers */ = {isa = PBXBuildFile; fileRef = CD36C168260A63D300C8C529 /* SharedRoutingArbitrator.h */; settings = {ATTRIBUTES = (Private, ); }; };
CD3A495F17A9D01B00274E42 /* MediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495617A9D01B00274E42 /* MediaSource.h */; };
CD3A496217A9D01B00274E42 /* SourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495917A9D01B00274E42 /* SourceBuffer.h */; };
CD3A496517A9D01B00274E42 /* SourceBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495C17A9D01B00274E42 /* SourceBufferList.h */; };
@@ -14827,6 +14828,8 @@
CD336F6317FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackPrivateAVF.h; sourceTree = "<group>"; };
CD336F6517FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoTrackPrivateAVFObjC.cpp; sourceTree = "<group>"; };
CD336F6617FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackPrivateAVFObjC.h; sourceTree = "<group>"; };
CD36C168260A63D300C8C529 /* SharedRoutingArbitrator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedRoutingArbitrator.h; sourceTree = "<group>"; };
CD36C169260A63D400C8C529 /* SharedRoutingArbitrator.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SharedRoutingArbitrator.mm; sourceTree = "<group>"; };
CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DiagnosticLoggingKeys.cpp; sourceTree = "<group>"; };
CD37B37515C1A7E1006DC898 /* DiagnosticLoggingKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagnosticLoggingKeys.h; sourceTree = "<group>"; };
CD3A495517A9D01B00274E42 /* MediaSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSource.cpp; sourceTree = "<group>"; };
@@ -31225,6 +31228,8 @@
FD3160B612B0272A00C1A359 /* AudioOutputUnitAdaptorMac.cpp */,
CD54DE4917469C6D005E5B36 /* AudioSessionMac.mm */,
FD3160BA12B0272A00C1A359 /* FFTFrameMac.cpp */,
CD36C168260A63D300C8C529 /* SharedRoutingArbitrator.h */,
CD36C169260A63D400C8C529 /* SharedRoutingArbitrator.mm */,
);
path = mac;
sourceTree = "<group>";
@@ -35017,6 +35022,7 @@
1D9F0FC12122029B005D8FD4 /* ShareData.h in Headers */,
1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */,
510A91DC24CF46FE00BFD89C /* SharedGamepadValue.h in Headers */,
CD36C16B260A65CC00C8C529 /* SharedRoutingArbitrator.h in Headers */,
834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */,
93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */,
DF19E2AC24772BC1007BDACB /* ShouldRelaxThirdPartyCookieBlocking.h in Headers */,
@@ -145,7 +145,9 @@ class WEBCORE_EXPORT AudioSessionRoutingArbitrationClient {
enum class RoutingArbitrationError : uint8_t { None, Failed, Cancelled };
enum class DefaultRouteChanged : bool { No, Yes };

virtual void beginRoutingArbitrationWithCategory(AudioSession::CategoryType, CompletionHandler<void(RoutingArbitrationError, DefaultRouteChanged)>&&) = 0;
using ArbitrationCallback = CompletionHandler<void(RoutingArbitrationError, DefaultRouteChanged)>;

virtual void beginRoutingArbitrationWithCategory(AudioSession::CategoryType, ArbitrationCallback&&) = 0;
virtual void leaveRoutingAbritration() = 0;

using WeakValueType = AudioSessionRoutingArbitrationClient;
@@ -0,0 +1,66 @@
/*
* Copyright (C) 2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#if ENABLE(ROUTING_ARBITRATION) && HAVE(AVAUDIO_ROUTING_ARBITER)

#include "AudioSession.h"
#include <wtf/Optional.h>
#include <wtf/UniqueRef.h>

namespace WebCore {

class WEBCORE_EXPORT SharedRoutingArbitrator {
public:
static SharedRoutingArbitrator& sharedInstance();

using RoutingArbitrationError = AudioSessionRoutingArbitrationClient::RoutingArbitrationError;
using DefaultRouteChanged = AudioSessionRoutingArbitrationClient::DefaultRouteChanged;
using ArbitrationCallback = AudioSessionRoutingArbitrationClient::ArbitrationCallback;

class WEBCORE_EXPORT Token : public CanMakeWeakPtr<Token> {
WTF_MAKE_FAST_ALLOCATED;
public:
static UniqueRef<Token> create();
private:
friend UniqueRef<Token> WTF::makeUniqueRefWithoutFastMallocCheck<Token>();
Token() = default;
};

bool isInRoutingArbitrationForToken(const Token&);
void beginRoutingArbitrationForToken(const Token&, AudioSession::CategoryType, ArbitrationCallback&&);
void endRoutingArbitrationForToken(const Token&);

private:
Optional<AudioSession::CategoryType> m_currentCategory { AudioSession::None };
WeakHashSet<Token> m_tokens;
Vector<ArbitrationCallback> m_enqueuedCallbacks;
bool m_setupArbitrationOngoing { false };
};

}

#endif
@@ -0,0 +1,138 @@
/*
* Copyright (C) 2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#import "config.h"
#import "SharedRoutingArbitrator.h"

#if ENABLE(ROUTING_ARBITRATION) && HAVE(AVAUDIO_ROUTING_ARBITER)

#import <wtf/NeverDestroyed.h>

#import <pal/cocoa/AVFoundationSoftLink.h>

namespace WebCore {

UniqueRef<SharedRoutingArbitrator::Token> SharedRoutingArbitrator::Token::create()
{
return makeUniqueRef<Token>();
}

SharedRoutingArbitrator& SharedRoutingArbitrator::sharedInstance()
{
static NeverDestroyed<SharedRoutingArbitrator> instance;
return instance;
}

bool SharedRoutingArbitrator::isInRoutingArbitrationForToken(const Token& token)
{
return m_tokens.contains(token);
}

void SharedRoutingArbitrator::beginRoutingArbitrationForToken(const Token& token, AudioSession::CategoryType requestedCategory, ArbitrationCallback&& callback)
{
ASSERT(!isInRoutingArbitrationForToken(token));

if (m_setupArbitrationOngoing) {
m_enqueuedCallbacks.append([this, weakToken = makeWeakPtr(token), callback = WTFMove(callback)] (RoutingArbitrationError error, DefaultRouteChanged routeChanged) mutable {
if (error == RoutingArbitrationError::None && weakToken)
m_tokens.add(*weakToken);

callback(error, routeChanged);
});

return;
}

if (m_currentCategory) {
if (*m_currentCategory >= requestedCategory) {
m_tokens.add(token);
callback(RoutingArbitrationError::None, DefaultRouteChanged::No);
return;
}

[[PAL::getAVAudioRoutingArbiterClass() sharedRoutingArbiter] leaveArbitration];
}

m_currentCategory = requestedCategory;

AVAudioRoutingArbitrationCategory arbitrationCategory = AVAudioRoutingArbitrationCategoryPlayback;
switch (requestedCategory) {
case AudioSession::MediaPlayback:
arbitrationCategory = AVAudioRoutingArbitrationCategoryPlayback;
break;
case AudioSession::RecordAudio:
arbitrationCategory = AVAudioRoutingArbitrationCategoryPlayAndRecord;
break;
case AudioSession::PlayAndRecord:
arbitrationCategory = AVAudioRoutingArbitrationCategoryPlayAndRecordVoice;
break;
default:
ASSERT_NOT_REACHED();
}

m_setupArbitrationOngoing = true;
m_enqueuedCallbacks.append([this, weakToken = makeWeakPtr(token), callback = WTFMove(callback)] (RoutingArbitrationError error, DefaultRouteChanged routeChanged) mutable {
if (error == RoutingArbitrationError::None && weakToken)
m_tokens.add(*weakToken);

callback(error, routeChanged);
});

[[PAL::getAVAudioRoutingArbiterClass() sharedRoutingArbiter] beginArbitrationWithCategory:arbitrationCategory completionHandler:[this](BOOL defaultDeviceChanged, NSError * _Nullable error) {
callOnMainRunLoop([this, defaultDeviceChanged, error = retainPtr(error)] {
if (error)
RELEASE_LOG_ERROR(Media, "SharedRoutingArbitrator::beginRoutingArbitrationForToken: %s failed with error %s:%s", convertEnumerationToString(*m_currentCategory).ascii().data(), [[error domain] UTF8String], [[error localizedDescription] UTF8String]);

// FIXME: Do we need to reset sample rate and buffer size for the new default device?
if (defaultDeviceChanged)
LOG(Media, "AudioSession::setCategory() - defaultDeviceChanged!");

Vector<ArbitrationCallback> callbacks = WTFMove(m_enqueuedCallbacks);
for (auto& callback : callbacks)
callback(error ? RoutingArbitrationError::Failed : RoutingArbitrationError::None, defaultDeviceChanged ? DefaultRouteChanged::Yes : DefaultRouteChanged::No);

m_setupArbitrationOngoing = false;
});
}];
}

void SharedRoutingArbitrator::endRoutingArbitrationForToken(const Token& token)
{
ASSERT(isInRoutingArbitrationForToken(token));
m_tokens.remove(token);

if (!m_tokens.computesEmpty())
return;

for (auto& callback : m_enqueuedCallbacks)
callback(RoutingArbitrationError::Cancelled, DefaultRouteChanged::No);

m_enqueuedCallbacks.clear();
m_currentCategory.reset();
[[PAL::getAVAudioRoutingArbiterClass() sharedRoutingArbiter] leaveArbitration];
}

}
#endif
@@ -1,3 +1,45 @@
2021-05-04 Jer Noble <jer.noble@apple.com>

[Media in GPU Process] Move AudioSessionRoutingArbitratorProxy to the GPU process
https://bugs.webkit.org/show_bug.cgi?id=217535
<rdar://problem/70152548>

Reviewed by Eric Carlson.

Add a new, local-only object which can aggregate changes to the audio routing.
The UIProcess version of this object spans a process boundary, but this new
object can operate locally without an XPC communication channel. As part of this
change, the "SharedArbitrator" in AudioSessionRoutingArbitratorProxyCocoa has been
moved into WebCore to be used both there and in this new object.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess):
(WebKit::GPUConnectionToWebProcess::didClose):
* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/mac/LocalAudioSessionRoutingArbitrator.cpp: Added.
(WebKit::LocalAudioSessionRoutingArbitrator::create):
(WebKit::LocalAudioSessionRoutingArbitrator::LocalAudioSessionRoutingArbitrator):
(WebKit::LocalAudioSessionRoutingArbitrator::~LocalAudioSessionRoutingArbitrator):
(WebKit::LocalAudioSessionRoutingArbitrator::processDidTerminate):
(WebKit::LocalAudioSessionRoutingArbitrator::beginRoutingArbitrationWithCategory):
(WebKit::LocalAudioSessionRoutingArbitrator::leaveRoutingAbritration):
* GPUProcess/mac/LocalAudioSessionRoutingArbitrator.h:
* SourcesCocoa.txt:
* UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
* UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
(WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy):
(WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
(WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):
(WebKit::AudioSessionRoutingArbitratorProxy::endRoutingArbitration):
(): Deleted.
(WebKit::SharedArbitrator::sharedInstance): Deleted.
(WebKit::SharedArbitrator::isInRoutingArbitrationForArbitrator): Deleted.
(WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator): Deleted.
(WebKit::SharedArbitrator::endRoutingArbitrationForArbitrator): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/media/RemoteAudioSession.cpp:
(WebKit::RemoteAudioSession::setCategory):

2021-05-04 Kate Cheney <katherine_cheney@apple.com>

Remove internal NetworkSessionCocoa additions
@@ -133,6 +133,10 @@
#include <WebCore/VP9UtilitiesCocoa.h>
#endif

#if ENABLE(ROUTING_ARBITRATION) && HAVE(AVAUDIO_ROUTING_ARBITER)
#include "LocalAudioSessionRoutingArbitrator.h"
#endif

namespace WebKit {
using namespace WebCore;

@@ -198,6 +202,9 @@ GPUConnectionToWebProcess::GPUConnectionToWebProcess(GPUProcess& gpuProcess, Web
, m_audioTrackRendererManager(RemoteAudioMediaStreamTrackRendererManager::create(*this))
, m_sampleBufferDisplayLayerManager(RemoteSampleBufferDisplayLayerManager::create(*this))
#endif
#if ENABLE(ROUTING_ARBITRATION) && HAVE(AVAUDIO_ROUTING_ARBITER)
, m_routingArbitrator(LocalAudioSessionRoutingArbitrator::create())
#endif
{
RELEASE_ASSERT(RunLoop::isMain());

@@ -228,6 +235,10 @@ GPUConnectionToWebProcess::~GPUConnectionToWebProcess()

void GPUConnectionToWebProcess::didClose(IPC::Connection& connection)
{
#if ENABLE(ROUTING_ARBITRATION) && HAVE(AVAUDIO_ROUTING_ARBITER)
m_routingArbitrator->processDidTerminate();
#endif

#if USE(AUDIO_SESSION)
if (m_audioSessionProxy) {
gpuProcess().audioSessionManager().removeProxy(*m_audioSessionProxy);
@@ -57,6 +57,7 @@ namespace WebKit {
class GPUProcess;
class LayerHostingContext;
class LibWebRTCCodecsProxy;
class LocalAudioSessionRoutingArbitrator;
class RemoteAudioDestinationManager;
class RemoteAudioHardwareListenerProxy;
class RemoteAudioMediaStreamTrackRendererManager;
@@ -282,6 +283,10 @@ class GPUConnectionToWebProcess

RefPtr<RemoteRemoteCommandListenerProxy> m_remoteRemoteCommandListener;
bool m_isActiveNowPlayingProcess { false };

#if ENABLE(ROUTING_ARBITRATION) && HAVE(AVAUDIO_ROUTING_ARBITER)
UniqueRef<LocalAudioSessionRoutingArbitrator> m_routingArbitrator;
#endif
};

} // namespace WebKit

0 comments on commit 44ff4f9

Please sign in to comment.