Title: [268939] trunk
Revision
268939
Author
[email protected]
Date
2020-10-23 13:19:53 -0700 (Fri, 23 Oct 2020)

Log Message

[Media in GPU Process] in-band metadata cues sometimes crash
https://bugs.webkit.org/show_bug.cgi?id=218106
<rdar://problem/70226170>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, enabled existing test in the GPU process.

* platform/SerializedPlatformDataCueValue.h:
(WebCore::SerializedPlatformDataCueValue::SerializedPlatformDataCueValue):
(WebCore::SerializedPlatformDataCueValue::nativeValue const):
Make m_nativeValue a RetainPtr<> so the ownership and lifetime of the object is
explicit and managed correctly.

* platform/mac/SerializedPlatformDataCueMac.mm:
(WebCore::SerializedPlatformDataCueMac::encodableValue const): Update for change
to native value.
(WebCore::jsValueWithAVMetadataItemInContext):  Ditto.
(WebCore::NSDictionaryWithAVMetadataItem): Return a RetainPtr<NSDictionary> instead
of an auto-released dictionary.

Source/WebKit:

* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData):
SerializedPlatformDataCueValue::nativeValue() is a RetainPtr<>.

LayoutTests:

* gpu-process/TestExpectations: Mark test as passing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268938 => 268939)


--- trunk/LayoutTests/ChangeLog	2020-10-23 20:13:34 UTC (rev 268938)
+++ trunk/LayoutTests/ChangeLog	2020-10-23 20:19:53 UTC (rev 268939)
@@ -1,3 +1,13 @@
+2020-10-23  Eric Carlson  <[email protected]>
+
+        [Media in GPU Process] in-band metadata cues sometimes crash
+        https://bugs.webkit.org/show_bug.cgi?id=218106
+        <rdar://problem/70226170>
+
+        Reviewed by Jer Noble.
+
+        * gpu-process/TestExpectations: Mark test as passing.
+
 2020-10-23  Simon Fraser  <[email protected]>
 
         [ macOS wk2 ] fast/scrolling/latching/latched-scroll-remove-iframe.html is a flaky failure

Modified: trunk/LayoutTests/gpu-process/TestExpectations (268938 => 268939)


--- trunk/LayoutTests/gpu-process/TestExpectations	2020-10-23 20:13:34 UTC (rev 268938)
+++ trunk/LayoutTests/gpu-process/TestExpectations	2020-10-23 20:19:53 UTC (rev 268939)
@@ -270,7 +270,7 @@
 http/tests/contentextensions/video-element-resource-type.html [ Skip ]
 http/tests/media [ Skip ]
 http/tests/media/hls/hls-webvtt-tracks.html [ Pass ]
-http/tests/media/track-in-band-hls-metadata-crash.html [ Crash Pass ]
+http/tests/media/track-in-band-hls-metadata-crash.html [ Pass ]
 http/tests/media/track/track-webvtt-slow-loading.html [ Crash Pass ]
 http/tests/media/track/track-webvtt-slow-loading-2.html [ Pass ]
 http/tests/media/video-load-twice.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (268938 => 268939)


--- trunk/Source/WebCore/ChangeLog	2020-10-23 20:13:34 UTC (rev 268938)
+++ trunk/Source/WebCore/ChangeLog	2020-10-23 20:19:53 UTC (rev 268939)
@@ -1,3 +1,26 @@
+2020-10-23  Eric Carlson  <[email protected]>
+
+        [Media in GPU Process] in-band metadata cues sometimes crash
+        https://bugs.webkit.org/show_bug.cgi?id=218106
+        <rdar://problem/70226170>
+
+        Reviewed by Jer Noble.
+
+        No new tests, enabled existing test in the GPU process.
+
+        * platform/SerializedPlatformDataCueValue.h:
+        (WebCore::SerializedPlatformDataCueValue::SerializedPlatformDataCueValue):
+        (WebCore::SerializedPlatformDataCueValue::nativeValue const):
+        Make m_nativeValue a RetainPtr<> so the ownership and lifetime of the object is
+        explicit and managed correctly.
+
+        * platform/mac/SerializedPlatformDataCueMac.mm:
+        (WebCore::SerializedPlatformDataCueMac::encodableValue const): Update for change
+        to native value.
+        (WebCore::jsValueWithAVMetadataItemInContext):  Ditto.
+        (WebCore::NSDictionaryWithAVMetadataItem): Return a RetainPtr<NSDictionary> instead
+        of an auto-released dictionary.
+
 2020-10-23  Aditya Keerthi  <[email protected]>
 
         webkit.org/status/ is missing input type=date (and related) features

Modified: trunk/Source/WebCore/platform/SerializedPlatformDataCueValue.h (268938 => 268939)


--- trunk/Source/WebCore/platform/SerializedPlatformDataCueValue.h	2020-10-23 20:13:34 UTC (rev 268938)
+++ trunk/Source/WebCore/platform/SerializedPlatformDataCueValue.h	2020-10-23 20:19:53 UTC (rev 268939)
@@ -33,8 +33,10 @@
 
 #if PLATFORM(COCOA)
 using PlatformNativeValue = id;
+using PlatformNativeValueSmartPtr = RetainPtr<PlatformNativeValue>;
 #else
 using PlatformNativeValue = void*;
+using PlatformNativeValueSmartPtr = PlatformNativeValue;
 #endif
 
 namespace WebCore {
@@ -57,12 +59,12 @@
 
     PlatformType platformType() const { return m_type; }
 
-    PlatformNativeValue nativeValue() const { return m_nativeValue; }
+    PlatformNativeValueSmartPtr nativeValue() const { return m_nativeValue; }
 
     bool encodingRequiresPlatformData() const { return m_type == PlatformType::ObjC; }
 
 protected:
-    PlatformNativeValue m_nativeValue { nullptr };
+    PlatformNativeValueSmartPtr m_nativeValue { nullptr };
     PlatformType m_type { PlatformType::None };
 };
 

Modified: trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm (268938 => 268939)


--- trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm	2020-10-23 20:13:34 UTC (rev 268938)
+++ trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm	2020-10-23 20:19:53 UTC (rev 268939)
@@ -48,7 +48,7 @@
 static JSValue *jsValueWithDictionaryInContext(NSDictionary *, JSContext *);
 static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *, JSContext *);
 static JSValue *jsValueWithValueInContext(id, JSContext *);
-static NSDictionary *NSDictionaryWithAVMetadataItem(AVMetadataItem *);
+static RetainPtr<NSDictionary> NSDictionaryWithAVMetadataItem(AVMetadataItem *);
 #endif
 
 Ref<SerializedPlatformDataCue> SerializedPlatformDataCue::create(SerializedPlatformDataCueValue&& value)
@@ -118,7 +118,7 @@
 SerializedPlatformDataCueValue SerializedPlatformDataCueMac::encodableValue() const
 {
     if ([m_nativeValue.get() isKindOfClass:PAL::getAVMetadataItemClass()])
-        return { SerializedPlatformDataCueValue::PlatformType::ObjC, NSDictionaryWithAVMetadataItem(m_nativeValue.get()) };
+        return { SerializedPlatformDataCueValue::PlatformType::ObjC, NSDictionaryWithAVMetadataItem(m_nativeValue.get()).get() };
 
     return { SerializedPlatformDataCueValue::PlatformType::ObjC, m_nativeValue.get() };
 }
@@ -206,14 +206,14 @@
 
 static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *item, JSContext *context)
 {
-    return jsValueWithDictionaryInContext(NSDictionaryWithAVMetadataItem(item), context);
+    return jsValueWithDictionaryInContext(NSDictionaryWithAVMetadataItem(item).get(), context);
 }
 
-static NSDictionary *NSDictionaryWithAVMetadataItem(AVMetadataItem *item)
+static RetainPtr<NSDictionary> NSDictionaryWithAVMetadataItem(AVMetadataItem *item)
 {
-    NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+    auto dictionary = adoptNS([[NSMutableDictionary alloc] init]);
+    NSDictionary *extras = [item extraAttributes];
 
-    NSDictionary *extras = [item extraAttributes];
     for (id key in [extras keyEnumerator]) {
         if (![key isKindOfClass:[NSString class]])
             continue;
@@ -247,7 +247,7 @@
     if (item.value)
         [dictionary setObject:item.value forKey:@"data"];
 
-    return dictionary;
+    return WTFMove(dictionary);
 }
 #endif
 

Modified: trunk/Source/WebKit/ChangeLog (268938 => 268939)


--- trunk/Source/WebKit/ChangeLog	2020-10-23 20:13:34 UTC (rev 268938)
+++ trunk/Source/WebKit/ChangeLog	2020-10-23 20:19:53 UTC (rev 268939)
@@ -1,3 +1,15 @@
+2020-10-23  Eric Carlson  <[email protected]>
+
+        [Media in GPU Process] in-band metadata cues sometimes crash
+        https://bugs.webkit.org/show_bug.cgi?id=218106
+        <rdar://problem/70226170>
+
+        Reviewed by Jer Noble.
+
+        * Shared/mac/WebCoreArgumentCodersMac.mm:
+        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData):
+        SerializedPlatformDataCueValue::nativeValue() is a RetainPtr<>.
+
 2020-10-23  Miguel Gomez  <[email protected]>
 
         [GTK][WPE] Implement antialiased rounded rectangle clipping in TextureMapper

Modified: trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm (268938 => 268939)


--- trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm	2020-10-23 20:13:34 UTC (rev 268938)
+++ trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm	2020-10-23 20:19:53 UTC (rev 268939)
@@ -684,7 +684,7 @@
 {
     ASSERT(value.platformType() == WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC);
     if (value.platformType() == WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC)
-        encodeObject(encoder, value.nativeValue());
+        encodeObject(encoder, value.nativeValue().get());
 }
 
 Optional<WebCore::SerializedPlatformDataCueValue>  ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decodePlatformData(Decoder& decoder, WebCore::SerializedPlatformDataCueValue::PlatformType platformType)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to