Changeset 265089 in webkit


Ignore:
Timestamp:
Jul 30, 2020 10:30:44 AM (4 years ago)
Author:
Peng Liu
Message:

ASSERTION FAILED: !isInRoutingArbitrationForArbitrator(proxy) in WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator
https://bugs.webkit.org/show_bug.cgi?id=214904

Reviewed by Jer Noble.

Only add an AudioSessionRoutingArbitratorProxy to the WeakHashSet (m_arbitrators)
if the routing arbitration is completed successfully.

  • UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:

(WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r265087 r265089  
     12020-07-30  Peng Liu  <peng.liu6@apple.com>
     2
     3        ASSERTION FAILED: !isInRoutingArbitrationForArbitrator(proxy) in WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator
     4        https://bugs.webkit.org/show_bug.cgi?id=214904
     5
     6        Reviewed by Jer Noble.
     7
     8        Only add an AudioSessionRoutingArbitratorProxy to the WeakHashSet (m_arbitrators)
     9        if the routing arbitration is completed successfully.
     10
     11        * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
     12        (WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator):
     13
    1142020-07-30  Per Arne Vollan  <pvollan@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm

    r263328 r265089  
    7575{
    7676    ASSERT(!isInRoutingArbitrationForArbitrator(proxy));
    77     m_arbitrators.add(proxy);
    7877
    7978    if (m_setupArbitrationOngoing) {
    80         m_enqueuedCallbacks.append(WTFMove(callback));
     79        m_enqueuedCallbacks.append([this, weakProxy = makeWeakPtr(proxy), callback = WTFMove(callback)] (RoutingArbitrationError error, DefaultRouteChanged routeChanged) mutable {
     80            if (error == RoutingArbitrationError::None && weakProxy)
     81                m_arbitrators.add(*weakProxy);
     82
     83            callback(error, routeChanged);
     84        });
     85
    8186        return;
    8287    }
     
    8691    if (m_currentCategory) {
    8792        if (*m_currentCategory >= requestedCategory) {
     93            m_arbitrators.add(proxy);
    8894            callback(RoutingArbitrationError::None, DefaultRouteChanged::No);
    8995            return;
     
    111117
    112118    m_setupArbitrationOngoing = true;
    113     m_enqueuedCallbacks.append(WTFMove(callback));
     119    m_enqueuedCallbacks.append([this, weakProxy = makeWeakPtr(proxy), callback = WTFMove(callback)] (RoutingArbitrationError error, DefaultRouteChanged routeChanged) mutable {
     120        if (error == RoutingArbitrationError::None && weakProxy)
     121            m_arbitrators.add(*weakProxy);
     122
     123        callback(error, routeChanged);
     124    });
    114125
    115126    [[PAL::getAVAudioRoutingArbiterClass() sharedRoutingArbiter] beginArbitrationWithCategory:arbitrationCategory completionHandler:[this](BOOL defaultDeviceChanged, NSError * _Nullable error) {
Note: See TracChangeset for help on using the changeset viewer.