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

Changeset 240076 in webkit


Ignore:
Timestamp:
Jan 16, 2019, 3:28:11 PM (8 years ago)
Author:
Alan Coon
Message:

Cherry-pick r239889. rdar://problem/47260233

REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
​https://bugs.webkit.org/show_bug.cgi?id=193342
<rdar://problem/47119836>

Reviewed by Eric Carlson.

Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.

  • platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
  • platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::initCallback): (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@239889 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-607-branch/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/Source/WebCore/ChangeLog

    r240075 r240076  
     12019-01-15  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r239889. rdar://problem/47260233
     4
     5    REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
     6    https://bugs.webkit.org/show_bug.cgi?id=193342
     7    <rdar://problem/47119836>
     8   
     9    Reviewed by Eric Carlson.
     10   
     11    Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.
     12   
     13    * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
     14    * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
     15    (WebCore::AudioSourceProviderAVFObjC::initCallback):
     16    (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
     17   
     18   
     19    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     20
     21    2019-01-11  Jer Noble  <jer.noble@apple.com>
     22
     23            REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
     24            https://bugs.webkit.org/show_bug.cgi?id=193342
     25            <rdar://problem/47119836>
     26
     27            Reviewed by Eric Carlson.
     28
     29            Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.
     30
     31            * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
     32            * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
     33            (WebCore::AudioSourceProviderAVFObjC::initCallback):
     34            (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
     35
    1362019-01-15  Alan Coon  <alancoon@apple.com>
    237
  • branches/safari-607-branch/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h

    r217878 r240076  
    9999    AudioSourceProviderClient* m_client { nullptr };
    100100
    101     struct TapStorage;
    102     TapStorage* m_tapStorage { nullptr };
     101    class TapStorage;
     102    RefPtr<TapStorage> m_tapStorage;
    103103};
    104104   
  • branches/safari-607-branch/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm

    r239458 r240076  
    7070static const double kRingBufferDuration = 1;
    7171
    72 struct AudioSourceProviderAVFObjC::TapStorage {
     72class AudioSourceProviderAVFObjC::TapStorage : public ThreadSafeRefCounted<AudioSourceProviderAVFObjC::TapStorage> {
     73public:
    7374    TapStorage(AudioSourceProviderAVFObjC* _this) : _this(_this) { }
    7475    AudioSourceProviderAVFObjC* _this;
    … …  
    239240    AudioSourceProviderAVFObjC* _this = static_cast<AudioSourceProviderAVFObjC*>(clientInfo);
    240241    _this->m_tap = adoptCF(tap);
    241     _this->m_tapStorage = new TapStorage(_this);
     242    _this->m_tapStorage = adoptRef(new TapStorage(_this));
    242243    _this->init(clientInfo, tapStorageOut);
    243     *tapStorageOut = _this->m_tapStorage;
     244    *tapStorageOut = _this->m_tapStorage.get();
     245
     246    // ref balanced by deref in finalizeCallback:
     247    _this->m_tapStorage->ref();
    244248}
    245249
    … …  
    254258            tapStorage->_this->finalize();
    255259    }
    256     delete tapStorage;
     260    tapStorage->deref();
    257261}
    258262
Note: See TracChangeset for help on using the changeset viewer.