Title: [278286] trunk/Source/WebCore
Revision
278286
Author
[email protected]
Date
2021-05-31 17:04:51 -0700 (Mon, 31 May 2021)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278285 => 278286)


--- trunk/Source/WebCore/ChangeLog	2021-06-01 00:03:36 UTC (rev 278285)
+++ trunk/Source/WebCore/ChangeLog	2021-06-01 00:04:51 UTC (rev 278286)
@@ -1,5 +1,21 @@
 2021-05-31  Chris Dumez  <[email protected]>
 
+        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.
+
+2021-05-31  Chris Dumez  <[email protected]>
+
         Fix thread safety issues in OscillatorNode
         https://bugs.webkit.org/show_bug.cgi?id=226450
 

Modified: trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h (278285 => 278286)


--- trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h	2021-06-01 00:03:36 UTC (rev 278285)
+++ trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h	2021-06-01 00:04:51 UTC (rev 278286)
@@ -83,7 +83,6 @@
 
 private:
     MediaRecorderPrivateWriter(bool hasAudio, bool hasVideo);
-    void clear();
 
     bool initialize(const MediaRecorderPrivateOptions&);
 

Modified: trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm (278285 => 278286)


--- trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm	2021-06-01 00:03:36 UTC (rev 278285)
+++ trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm	2021-06-01 00:04:51 UTC (rev 278286)
@@ -127,7 +127,20 @@
 
 MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter()
 {
-    clear();
+    m_pendingAudioSampleQueue.clear();
+    m_pendingVideoSampleQueue.clear();
+    if (m_writer) {
+        [m_writer cancelWriting];
+        m_writer.clear();
+    }
+
+    // At this pointer, we should no longer be writing any data, so it should be safe to close and nullify m_data without locking.
+    if (m_writerDelegate)
+        [m_writerDelegate close];
+    m_data = nullptr;
+
+    if (auto completionHandler = WTFMove(m_fetchDataCompletionHandler))
+        completionHandler(nullptr, 0);
 }
 
 bool MediaRecorderPrivateWriter::initialize(const MediaRecorderPrivateOptions& options)
@@ -366,26 +379,6 @@
         [m_videoAssetWriterInput requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:block.get()];
 }
 
-// FIXME: This modifies m_data without grabbing m_dataLock.
-void MediaRecorderPrivateWriter::clear() WTF_IGNORES_THREAD_SAFETY_ANALYSIS
-{
-    m_pendingAudioSampleQueue.clear();
-    m_pendingVideoSampleQueue.clear();
-    if (m_writer) {
-        [m_writer cancelWriting];
-        m_writer.clear();
-    }
-
-    // At this pointer, we should no longer be writing any data, so it should be safe to close and nullify m_data without locking.
-    if (m_writerDelegate)
-        [m_writerDelegate close];
-    m_data = nullptr;
-
-    if (auto completionHandler = WTFMove(m_fetchDataCompletionHandler))
-        completionHandler(nullptr, 0);
-}
-
-
 static inline RetainPtr<CMSampleBufferRef> copySampleBufferWithCurrentTimeStamp(CMSampleBufferRef originalBuffer, CMTime startTime)
 {
     CMItemCount count = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to