Title: [283145] branches/safari-612-branch
Revision
283145
Author
[email protected]
Date
2021-09-27 15:49:28 -0700 (Mon, 27 Sep 2021)

Log Message

Cherry-pick r282924. rdar://problem/83584505

    Make SharedBuffer inherit from ThreadSafeRefCounted
    https://bugs.webkit.org/show_bug.cgi?id=230662
    rdar://83419269

    Source/WebCore:

    The SourceBufferPrivateAVFObjC uses dispatch_async that takes an objective-C class.
    This copies its argument rather than move it and we end up with the SharedBuffer
    captured in the lambda to have its ref count be > 1.
    The easiest workaround is to make SharedBuffer use thread-safe refcount.
    Of course, this doesn't make a SharedBuffer a thread-safe class, but it allows
    to safely move it between threads.

    Already covered by existing tests.

    Reviewed by Chris Dumez.

    * platform/SharedBuffer.h:

    LayoutTests:

    Revert bug 230644.

    Reviewed by Chris Dumez.

    * platform/mac-wk1/TestExpectations:

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

Modified Paths

Diff

Modified: branches/safari-612-branch/LayoutTests/ChangeLog (283144 => 283145)


--- branches/safari-612-branch/LayoutTests/ChangeLog	2021-09-27 22:49:25 UTC (rev 283144)
+++ branches/safari-612-branch/LayoutTests/ChangeLog	2021-09-27 22:49:28 UTC (rev 283145)
@@ -1,5 +1,51 @@
 2021-09-27  Alan Coon  <[email protected]>
 
+        Cherry-pick r282924. rdar://problem/83584505
+
+    Make SharedBuffer inherit from ThreadSafeRefCounted
+    https://bugs.webkit.org/show_bug.cgi?id=230662
+    rdar://83419269
+    
+    Source/WebCore:
+    
+    The SourceBufferPrivateAVFObjC uses dispatch_async that takes an objective-C class.
+    This copies its argument rather than move it and we end up with the SharedBuffer
+    captured in the lambda to have its ref count be > 1.
+    The easiest workaround is to make SharedBuffer use thread-safe refcount.
+    Of course, this doesn't make a SharedBuffer a thread-safe class, but it allows
+    to safely move it between threads.
+    
+    Already covered by existing tests.
+    
+    Reviewed by Chris Dumez.
+    
+    * platform/SharedBuffer.h:
+    
+    LayoutTests:
+    
+    Revert bug 230644.
+    
+    Reviewed by Chris Dumez.
+    
+    * platform/mac-wk1/TestExpectations:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-09-22  Jean-Yves Avenard  <[email protected]>
+
+            Make SharedBuffer inherit from ThreadSafeRefCounted
+            https://bugs.webkit.org/show_bug.cgi?id=230662
+            rdar://83419269
+
+            Revert bug 230644.
+
+            Reviewed by Chris Dumez.
+
+            * platform/mac-wk1/TestExpectations:
+
+2021-09-27  Alan Coon  <[email protected]>
+
         Cherry-pick r282895. rdar://problem/83584505
 
     REGRESSION (r282865?): ASSERTION FAILED: Unsafe to ref/deref from different threads m_isOwnedByMainThread == isMainThread().

Modified: branches/safari-612-branch/LayoutTests/platform/mac-wk1/TestExpectations (283144 => 283145)


--- branches/safari-612-branch/LayoutTests/platform/mac-wk1/TestExpectations	2021-09-27 22:49:25 UTC (rev 283144)
+++ branches/safari-612-branch/LayoutTests/platform/mac-wk1/TestExpectations	2021-09-27 22:49:28 UTC (rev 283145)
@@ -1292,13 +1292,6 @@
 [ BigSur+ ] imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-framerate.html [ Skip ]
 [ BigSur+ ] imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-framesize.html [ Skip ]
 
-webkit.org/b/230644 [ Debug ] imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-negative.html [ Pass Crash ]
-webkit.org/b/230644 [ Debug ] imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit.html [ Pass Crash ]
-webkit.org/b/230644 [ Debug ] media/media-source/media-source-abort-resets-parser.html [ Pass Crash ]
-webkit.org/b/230644 [ Debug ] media/media-source/media-source-resize.html [ Pass Crash ]
-webkit.org/b/230644 [ Debug ] media/media-source/media-source-trackid-change.html [ Pass Crash ]
-webkit.org/b/230644 [ Debug ] media/media-source/only-bcp47-language-tags-accepted-as-valid.html [ Pass Crash ]
-
 [ BigSur ] imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-filter-order.html [ Pass ImageOnlyFailure ]
 
 [ BigSur ] imported/w3c/web-platform-tests/css/css-will-change/will-change-fixpos-cb-transform-1.html [ Pass ImageOnlyFailure ]

Modified: branches/safari-612-branch/Source/WebCore/ChangeLog (283144 => 283145)


--- branches/safari-612-branch/Source/WebCore/ChangeLog	2021-09-27 22:49:25 UTC (rev 283144)
+++ branches/safari-612-branch/Source/WebCore/ChangeLog	2021-09-27 22:49:28 UTC (rev 283145)
@@ -1,5 +1,58 @@
 2021-09-27  Alan Coon  <[email protected]>
 
+        Cherry-pick r282924. rdar://problem/83584505
+
+    Make SharedBuffer inherit from ThreadSafeRefCounted
+    https://bugs.webkit.org/show_bug.cgi?id=230662
+    rdar://83419269
+    
+    Source/WebCore:
+    
+    The SourceBufferPrivateAVFObjC uses dispatch_async that takes an objective-C class.
+    This copies its argument rather than move it and we end up with the SharedBuffer
+    captured in the lambda to have its ref count be > 1.
+    The easiest workaround is to make SharedBuffer use thread-safe refcount.
+    Of course, this doesn't make a SharedBuffer a thread-safe class, but it allows
+    to safely move it between threads.
+    
+    Already covered by existing tests.
+    
+    Reviewed by Chris Dumez.
+    
+    * platform/SharedBuffer.h:
+    
+    LayoutTests:
+    
+    Revert bug 230644.
+    
+    Reviewed by Chris Dumez.
+    
+    * platform/mac-wk1/TestExpectations:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-09-22  Jean-Yves Avenard  <[email protected]>
+
+            Make SharedBuffer inherit from ThreadSafeRefCounted
+            https://bugs.webkit.org/show_bug.cgi?id=230662
+            rdar://83419269
+
+            The SourceBufferPrivateAVFObjC uses dispatch_async that takes an objective-C class.
+            This copies its argument rather than move it and we end up with the SharedBuffer
+            captured in the lambda to have its ref count be > 1.
+            The easiest workaround is to make SharedBuffer use thread-safe refcount.
+            Of course, this doesn't make a SharedBuffer a thread-safe class, but it allows
+            to safely move it between threads.
+
+            Already covered by existing tests.
+
+            Reviewed by Chris Dumez.
+
+            * platform/SharedBuffer.h:
+
+2021-09-27  Alan Coon  <[email protected]>
+
         Revert r280963. rdar://problem/83587220
 
 2021-09-24  Russell Epstein  <[email protected]>

Modified: branches/safari-612-branch/Source/WebCore/platform/SharedBuffer.h (283144 => 283145)


--- branches/safari-612-branch/Source/WebCore/platform/SharedBuffer.h	2021-09-27 22:49:25 UTC (rev 283144)
+++ branches/safari-612-branch/Source/WebCore/platform/SharedBuffer.h	2021-09-27 22:49:28 UTC (rev 283145)
@@ -30,7 +30,6 @@
 #include <wtf/FileSystem.h>
 #include <wtf/Forward.h>
 #include <wtf/Function.h>
-#include <wtf/RefCounted.h>
 #include <wtf/Span.h>
 #include <wtf/ThreadSafeRefCounted.h>
 #include <wtf/Variant.h>
@@ -65,7 +64,7 @@
 
 class SharedBufferDataView;
 
-class WEBCORE_EXPORT SharedBuffer : public RefCounted<SharedBuffer> {
+class WEBCORE_EXPORT SharedBuffer : public ThreadSafeRefCounted<SharedBuffer> {
 public:
     static Ref<SharedBuffer> create() { return adoptRef(*new SharedBuffer); }
     static Ref<SharedBuffer> create(const uint8_t* data, size_t size) { return adoptRef(*new SharedBuffer(data, size)); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to