Title: [280573] trunk
Revision
280573
Author
[email protected]
Date
2021-08-02 17:49:37 -0700 (Mon, 02 Aug 2021)

Log Message

[WebAudio] Add webm/vorbis container support
https://bugs.webkit.org/show_bug.cgi?id=228139
rdar://80883073

Reviewed by Jer Noble.

Source/WebKit:

Access to the com.apple.audio.AudioComponentRegistrar is denied by the sandbox which
prevents registering the Vorbis Audio Component. So we instantiate the decoder right before
setting up the sandbox.
This is a workaround for rdar://81137953.
Test: webaudio/decode-audio-data-webm-vorbis.html

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeSandbox):

LayoutTests:

* platform/mac/TestExpectations:
* webaudio/decode-audio-data-webm-vorbis-expected.txt: Added.
* webaudio/decode-audio-data-webm-vorbis.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (280572 => 280573)


--- trunk/LayoutTests/ChangeLog	2021-08-03 00:24:30 UTC (rev 280572)
+++ trunk/LayoutTests/ChangeLog	2021-08-03 00:49:37 UTC (rev 280573)
@@ -1,3 +1,15 @@
+2021-08-02  Jean-Yves Avenard  <[email protected]>
+
+        [WebAudio] Add webm/vorbis container support
+        https://bugs.webkit.org/show_bug.cgi?id=228139
+        rdar://80883073
+
+        Reviewed by Jer Noble.
+
+        * platform/mac/TestExpectations:
+        * webaudio/decode-audio-data-webm-vorbis-expected.txt: Added.
+        * webaudio/decode-audio-data-webm-vorbis.html: Added.
+
 2021-08-02  Eric Hutchison  <[email protected]>
 
         [ iOS iPad ] editing/inserting/insert-paragraph-separator-with-html-elements-crash.html is a flaky failure.

Modified: trunk/LayoutTests/platform/mac/TestExpectations (280572 => 280573)


--- trunk/LayoutTests/platform/mac/TestExpectations	2021-08-03 00:24:30 UTC (rev 280572)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-08-03 00:49:37 UTC (rev 280573)
@@ -1716,6 +1716,7 @@
 [ Catalina Mojave BigSur ] media/media-source/media-webm-opus-partial.html [ Skip ]
 [ Catalina Mojave BigSur ] media/media-source/media-webm-opus-partial-abort.html [ Skip ]
 [ Catalina Mojave BigSur ] webaudio/decode-audio-data-webm-opus.html [ Skip ]
+[ Catalina Mojave BigSur ] webaudio/decode-audio-data-webm-vorbis.html [ Skip ]
 
 webkit.org/b/214422 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/suspend-after-construct.html [ Pass Failure ]
 

Added: trunk/LayoutTests/webaudio/decode-audio-data-webm-vorbis-expected.txt (0 => 280573)


--- trunk/LayoutTests/webaudio/decode-audio-data-webm-vorbis-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webaudio/decode-audio-data-webm-vorbis-expected.txt	2021-08-03 00:49:37 UTC (rev 280573)
@@ -0,0 +1,10 @@
+Test that decoding an vorbis webm file succeeds
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Successfully decoded content
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/webaudio/decode-audio-data-webm-vorbis.html (0 => 280573)


--- trunk/LayoutTests/webaudio/decode-audio-data-webm-vorbis.html	                        (rev 0)
+++ trunk/LayoutTests/webaudio/decode-audio-data-webm-vorbis.html	2021-08-03 00:49:37 UTC (rev 280573)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script type="text/_javascript_" src=""
+</head>
+<body>
+<script>
+description("Test that decoding an vorbis webm file succeeds");
+
+window.jsTestIsAsync = true;
+
+var context = new window.AudioContext();
+var request = new XMLHttpRequest();
+request.open("GET", 'resources/media/vorbis.webm', true);
+request.responseType = "arraybuffer";
+
+request._onload_ = function() {
+    context.decodeAudioData(request.response, (buffer) => {
+        testPassed("Successfully decoded content");
+        finishJSTest();
+      }, () => {
+        testFailed("Failed to decode file");
+        finishJSTest();
+      });
+}
+request.send();
+
+</script>
+</body>
+</html>

Modified: trunk/Source/WebKit/ChangeLog (280572 => 280573)


--- trunk/Source/WebKit/ChangeLog	2021-08-03 00:24:30 UTC (rev 280572)
+++ trunk/Source/WebKit/ChangeLog	2021-08-03 00:49:37 UTC (rev 280573)
@@ -1,5 +1,22 @@
 2021-08-02  Jean-Yves Avenard  <[email protected]>
 
+        [WebAudio] Add webm/vorbis container support
+        https://bugs.webkit.org/show_bug.cgi?id=228139
+        rdar://80883073
+
+        Reviewed by Jer Noble.
+
+        Access to the com.apple.audio.AudioComponentRegistrar is denied by the sandbox which
+        prevents registering the Vorbis Audio Component. So we instantiate the decoder right before
+        setting up the sandbox.
+        This is a workaround for rdar://81137953.
+        Test: webaudio/decode-audio-data-webm-vorbis.html
+
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::initializeSandbox):
+
+2021-08-02  Jean-Yves Avenard  <[email protected]>
+
         Crash in -[WKFullScreenWindowController windowDidExitFullScreen:]
         https://bugs.webkit.org/show_bug.cgi?id=228694
         rdar://79569881

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (280572 => 280573)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2021-08-03 00:24:30 UTC (rev 280572)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2021-08-03 00:49:37 UTC (rev 280573)
@@ -81,6 +81,7 @@
 #import <WebCore/SystemSoundManager.h>
 #import <WebCore/UTIUtilities.h>
 #import <WebCore/VersionChecks.h>
+#import <WebCore/WebMAudioUtilitiesCocoa.h>
 #import <algorithm>
 #import <dispatch/dispatch.h>
 #import <mach/mach.h>
@@ -744,6 +745,9 @@
     // Need to override the default, because service has a different bundle ID.
     auto webKitBundle = [NSBundle bundleWithIdentifier:@"com.apple.WebKit"];
 
+    // We need to initialize the Vorbis decoder before the sandbox gets setup; this is a one off action.
+    WebCore::registerVorbisDecoderIfNeeded();
+
     sandboxParameters.setOverrideSandboxProfilePath(makeString(String([webKitBundle resourcePath]), "/com.apple.WebProcess.sb"));
 
     bool enableMessageFilter = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to