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

Changeset 278286 in webkit


Ignore:
Timestamp:
May 31, 2021, 5:04:51 PM (5 years ago)
Author:
Chris Dumez
Message:

Stop using WTF_IGNORES_THREAD_SAFETY_ANALYSIS in MediaRecorderPrivateWriter code
https://bugs.webkit.org/show_bug.cgi?id=226446

Reviewed by Darin Adler.

Fold MediaRecorderPrivateWriter::clear() into the destructor since this is the
only place it is called. This allows us to stop using WTF_IGNORES_THREAD_SAFETY_ANALYSIS
since thread safety checks do not apply to destructors.

  • platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
  • platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:

(WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter):
(): Deleted.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r278285 r278286  
     12021-05-31  Chris Dumez  <cdumez@apple.com>
     2
     3        Stop using WTF_IGNORES_THREAD_SAFETY_ANALYSIS in MediaRecorderPrivateWriter code
     4        https://bugs.webkit.org/show_bug.cgi?id=226446
     5
     6        Reviewed by Darin Adler.
     7
     8        Fold MediaRecorderPrivateWriter::clear() into the destructor since this is the
     9        only place it is called. This allows us to stop using WTF_IGNORES_THREAD_SAFETY_ANALYSIS
     10        since thread safety checks do not apply to destructors.
     11
     12        * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
     13        * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
     14        (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter):
     15        (): Deleted.
     16
    1172021-05-31  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h

    r278253 r278286  
    8484private:
    8585    MediaRecorderPrivateWriter(bool hasAudio, bool hasVideo);
    86     void clear();
    8786
    8887    bool initialize(const MediaRecorderPrivateOptions&);
  • trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm

    r278158 r278286  
    128128MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter()
    129129{
    130     clear();
     130    m_pendingAudioSampleQueue.clear();
     131    m_pendingVideoSampleQueue.clear();
     132    if (m_writer) {
     133        [m_writer cancelWriting];
     134        m_writer.clear();
     135    }
     136
     137    // At this pointer, we should no longer be writing any data, so it should be safe to close and nullify m_data without locking.
     138    if (m_writerDelegate)
     139        [m_writerDelegate close];
     140    m_data = nullptr;
     141
     142    if (auto completionHandler = WTFMove(m_fetchDataCompletionHandler))
     143        completionHandler(nullptr, 0);
    131144}
    132145
     
    367380}
    368381
    369 // FIXME: This modifies m_data without grabbing m_dataLock.
    370 void MediaRecorderPrivateWriter::clear() WTF_IGNORES_THREAD_SAFETY_ANALYSIS
    371 {
    372     m_pendingAudioSampleQueue.clear();
    373     m_pendingVideoSampleQueue.clear();
    374     if (m_writer) {
    375         [m_writer cancelWriting];
    376         m_writer.clear();
    377     }
    378 
    379     // At this pointer, we should no longer be writing any data, so it should be safe to close and nullify m_data without locking.
    380     if (m_writerDelegate)
    381         [m_writerDelegate close];
    382     m_data = nullptr;
    383 
    384     if (auto completionHandler = WTFMove(m_fetchDataCompletionHandler))
    385         completionHandler(nullptr, 0);
    386 }
    387 
    388 
    389382static inline RetainPtr<CMSampleBufferRef> copySampleBufferWithCurrentTimeStamp(CMSampleBufferRef originalBuffer, CMTime startTime)
    390383{
Note: See TracChangeset for help on using the changeset viewer.