Title: [265349] trunk
Revision
265349
Author
cdu...@apple.com
Date
2020-08-06 15:11:04 -0700 (Thu, 06 Aug 2020)

Log Message

Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext
https://bugs.webkit.org/show_bug.cgi?id=215238

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that one more check is passing.

* web-platform-tests/webaudio/idlharness.https.window-expected.txt:

Source/WebCore:

Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext:
- https://webaudio.github.io/web-audio-api/#BaseAudioContext

This overload is kept on WebKitAudioContext for backward-compatibility when the page
is still using the prefixed API.

No new tests, rebaselined existing test.

* Modules/webaudio/BaseAudioContext.cpp:
* Modules/webaudio/BaseAudioContext.h:
* Modules/webaudio/BaseAudioContext.idl:
* Modules/webaudio/WebKitAudioContext.cpp:
(WebCore::WebKitAudioContext::createLegacyBuffer):
* Modules/webaudio/WebKitAudioContext.h:
* Modules/webaudio/WebKitAudioContext.idl:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (265348 => 265349)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-08-06 22:11:04 UTC (rev 265349)
@@ -1,5 +1,16 @@
 2020-08-06  Chris Dumez  <cdu...@apple.com>
 
+        Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext
+        https://bugs.webkit.org/show_bug.cgi?id=215238
+
+        Reviewed by Darin Adler.
+
+        Rebaseline WPT tests now that one more check is passing.
+
+        * web-platform-tests/webaudio/idlharness.https.window-expected.txt:
+
+2020-08-06  Chris Dumez  <cdu...@apple.com>
+
         MediaStreamAudioDestinationNode should have a constructor
         https://bugs.webkit.org/show_bug.cgi?id=215233
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt (265348 => 265349)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt	2020-08-06 22:11:04 UTC (rev 265349)
@@ -24,7 +24,7 @@
 PASS BaseAudioContext interface: attribute onstatechange 
 PASS BaseAudioContext interface: operation createAnalyser() 
 PASS BaseAudioContext interface: operation createBiquadFilter() 
-FAIL BaseAudioContext interface: operation createBuffer(unsigned long, unsigned long, float) assert_equals: property has wrong .length expected 3 but got 2
+PASS BaseAudioContext interface: operation createBuffer(unsigned long, unsigned long, float) 
 PASS BaseAudioContext interface: operation createBufferSource() 
 PASS BaseAudioContext interface: operation createChannelMerger(optional unsigned long) 
 PASS BaseAudioContext interface: operation createChannelSplitter(optional unsigned long) 

Modified: trunk/Source/WebCore/ChangeLog (265348 => 265349)


--- trunk/Source/WebCore/ChangeLog	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/Source/WebCore/ChangeLog	2020-08-06 22:11:04 UTC (rev 265349)
@@ -1,5 +1,28 @@
 2020-08-06  Chris Dumez  <cdu...@apple.com>
 
+        Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext
+        https://bugs.webkit.org/show_bug.cgi?id=215238
+
+        Reviewed by Darin Adler.
+
+        Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext:
+        - https://webaudio.github.io/web-audio-api/#BaseAudioContext
+
+        This overload is kept on WebKitAudioContext for backward-compatibility when the page
+        is still using the prefixed API.
+
+        No new tests, rebaselined existing test.
+
+        * Modules/webaudio/BaseAudioContext.cpp:
+        * Modules/webaudio/BaseAudioContext.h:
+        * Modules/webaudio/BaseAudioContext.idl:
+        * Modules/webaudio/WebKitAudioContext.cpp:
+        (WebCore::WebKitAudioContext::createLegacyBuffer):
+        * Modules/webaudio/WebKitAudioContext.h:
+        * Modules/webaudio/WebKitAudioContext.idl:
+
+2020-08-06  Chris Dumez  <cdu...@apple.com>
+
         MediaStreamAudioDestinationNode should have a constructor
         https://bugs.webkit.org/show_bug.cgi?id=215233
 

Modified: trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp (265348 => 265349)


--- trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp	2020-08-06 22:11:04 UTC (rev 265349)
@@ -391,14 +391,6 @@
     return AudioBuffer::create(AudioBufferOptions {numberOfChannels, length, sampleRate});
 }
 
-ExceptionOr<Ref<AudioBuffer>> BaseAudioContext::createBuffer(ArrayBuffer& arrayBuffer, bool mixToMono)
-{
-    auto audioBuffer = AudioBuffer::createFromAudioFileData(arrayBuffer.data(), arrayBuffer.byteLength(), mixToMono, sampleRate());
-    if (!audioBuffer)
-        return Exception { SyntaxError };
-    return audioBuffer.releaseNonNull();
-}
-
 void BaseAudioContext::decodeAudioData(Ref<ArrayBuffer>&& audioData, RefPtr<AudioBufferCallback>&& successCallback, RefPtr<AudioBufferCallback>&& errorCallback)
 {
     if (!m_audioDecoder)

Modified: trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.h (265348 => 265349)


--- trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.h	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.h	2020-08-06 22:11:04 UTC (rev 265349)
@@ -123,7 +123,6 @@
     void decrementActiveSourceCount();
     
     ExceptionOr<Ref<AudioBuffer>> createBuffer(unsigned numberOfChannels, unsigned length, float sampleRate);
-    ExceptionOr<Ref<AudioBuffer>> createBuffer(ArrayBuffer&, bool mixToMono);
 
     // Asynchronous audio file data decoding.
     void decodeAudioData(Ref<ArrayBuffer>&&, RefPtr<AudioBufferCallback>&&, RefPtr<AudioBufferCallback>&&);

Modified: trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.idl (265348 => 265349)


--- trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.idl	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.idl	2020-08-06 22:11:04 UTC (rev 265349)
@@ -45,7 +45,6 @@
     attribute EventHandler onstatechange;
     
     [MayThrowException] AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate);
-    [MayThrowException] AudioBuffer createBuffer(ArrayBuffer buffer, boolean mixToMono);
 
     // Asynchronous audio file data decoding.
     // FIXME: successCallback should be optional and the callbacks should not be nullable. This should also return a Promise.

Modified: trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.cpp (265348 => 265349)


--- trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.cpp	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.cpp	2020-08-06 22:11:04 UTC (rev 265349)
@@ -199,6 +199,14 @@
     return WebKitDynamicsCompressorNode::create(*this);
 }
 
+ExceptionOr<Ref<AudioBuffer>> WebKitAudioContext::createLegacyBuffer(ArrayBuffer& arrayBuffer, bool mixToMono)
+{
+    auto audioBuffer = AudioBuffer::createFromAudioFileData(arrayBuffer.data(), arrayBuffer.byteLength(), mixToMono, sampleRate());
+    if (!audioBuffer)
+        return Exception { SyntaxError };
+    return audioBuffer.releaseNonNull();
+}
+
 void WebKitAudioContext::close(DOMPromiseDeferred<void>&& promise)
 {
     if (isOfflineContext() || isStopped()) {

Modified: trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.h (265348 => 265349)


--- trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.h	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.h	2020-08-06 22:11:04 UTC (rev 265349)
@@ -71,6 +71,7 @@
     ExceptionOr<Ref<PeriodicWave>> createPeriodicWave(Float32Array& real, Float32Array& imaginary);
     ExceptionOr<Ref<WebKitAudioBufferSourceNode>> createWebKitBufferSource();
     ExceptionOr<Ref<WebKitDynamicsCompressorNode>> createWebKitDynamicsCompressor();
+    ExceptionOr<Ref<AudioBuffer>> createLegacyBuffer(ArrayBuffer&, bool mixToMono);
 
 protected:
     explicit WebKitAudioContext(Document&);

Modified: trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.idl (265348 => 265349)


--- trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.idl	2020-08-06 21:49:57 UTC (rev 265348)
+++ trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.idl	2020-08-06 22:11:04 UTC (rev 265349)
@@ -55,7 +55,7 @@
     readonly attribute unsigned long activeSourceCount;
 
     [MayThrowException] AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long numberOfFrames, unrestricted float sampleRate);
-    [MayThrowException] AudioBuffer createBuffer(ArrayBuffer buffer, boolean mixToMono);
+    [MayThrowException, ImplementedAs=createLegacyBuffer] AudioBuffer createBuffer(ArrayBuffer buffer, boolean mixToMono);
 
     // Asynchronous audio file data decoding.
     // FIXME: successCallback should be optional and the callbacks should not be nullable. This should also return a Promise.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to