Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Issue 1006963003: AudioContext.decodeAudioData returns a Promise (Closed)

Created:
5 years, 9 months ago by Raymond Toy
Modified:
5 years, 8 months ago
Reviewers:
haraken, tkent, yhirano, hongchan
CC:
blink-reviews
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

AudioContext.decodeAudioData returns a Promise See the spec: http://webaudio.github.io/web-audio-api/#widl-AudioContext-decodeAudioData-Promise-AudioBuffer--ArrayBuffer-audioData-DecodeSuccessCallback-successCallback-DecodeErrorCallback-errorCallback A few other issues are also fixed: No longer throw an error if the audio data arg is null. This is supposed to reject the promise and also call the errorcallback. The error callback is supposed to be invoked with the error. Previously, we just used null. BUG=420107, 464130 TEST=decode-audio-data-promise.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193648

Patch Set 1 #

Patch Set 2 : Add additional test #

Patch Set 3 : Fix idl; small cleanups #

Total comments: 3

Patch Set 4 : Error callback invoked with error, not null. #

Total comments: 9

Patch Set 5 : Update after review #

Patch Set 6 : Compile with oilpan #

Total comments: 8

Patch Set 7 : Update for review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+352 lines, -38 lines) Patch
M LayoutTests/webaudio/decode-audio-data-basic.html View 1 2 3 1 chunk +7 lines, -6 lines 0 comments Download
M LayoutTests/webaudio/decode-audio-data-basic-expected.txt View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
A LayoutTests/webaudio/decode-audio-data-promise.html View 1 2 3 4 5 6 1 chunk +232 lines, -0 lines 0 comments Download
A LayoutTests/webaudio/decode-audio-data-promise-expected.txt View 1 2 3 4 5 6 1 chunk +18 lines, -0 lines 0 comments Download
M LayoutTests/webaudio/dom-exceptions.html View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M LayoutTests/webaudio/dom-exceptions-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M Source/modules/webaudio/AsyncAudioDecoder.h View 1 2 3 4 2 chunks +5 lines, -3 lines 0 comments Download
M Source/modules/webaudio/AsyncAudioDecoder.cpp View 1 2 3 4 5 2 chunks +25 lines, -11 lines 0 comments Download
M Source/modules/webaudio/AudioBufferCallback.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/webaudio/AudioBufferCallback.idl View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/webaudio/AudioContext.h View 1 2 3 4 4 chunks +9 lines, -1 line 0 comments Download
M Source/modules/webaudio/AudioContext.cpp View 1 2 3 4 5 6 9 chunks +50 lines, -12 lines 0 comments Download
M Source/modules/webaudio/AudioContext.idl View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (4 generated)
Raymond Toy
PTAL
5 years, 9 months ago (2015-03-20 20:19:55 UTC) #2
hongchan
LGTM with nits. Just a suggestion: can pass & fail checks in |decode-audio-data-promise.html| refactored? Not ...
5 years, 9 months ago (2015-03-23 16:18:49 UTC) #3
Raymond Toy
On 2015/03/23 16:18:49, hoch wrote: > LGTM with nits. > > Just a suggestion: can ...
5 years, 9 months ago (2015-03-23 18:44:57 UTC) #4
Raymond Toy
https://codereview.chromium.org/1006963003/diff/40001/LayoutTests/webaudio/decode-audio-data-basic-expected.txt File LayoutTests/webaudio/decode-audio-data-basic-expected.txt (right): https://codereview.chromium.org/1006963003/diff/40001/LayoutTests/webaudio/decode-audio-data-basic-expected.txt#newcode1 LayoutTests/webaudio/decode-audio-data-basic-expected.txt:1: CONSOLE ERROR: line 21: Uncaught (in promise) NotSupportedError: invalid ...
5 years, 9 months ago (2015-03-23 18:45:20 UTC) #5
Raymond Toy
PTAL. haraken@: For the oilpan related changes yhirano@: For the Promise usage. tkent@: As API ...
5 years, 8 months ago (2015-04-07 22:39:09 UTC) #7
tkent
Public API change LGTM. This was already approved in blink-dev. https://codereview.chromium.org/1006963003/diff/60001/Source/modules/webaudio/AudioContext.cpp File Source/modules/webaudio/AudioContext.cpp (right): https://codereview.chromium.org/1006963003/diff/60001/Source/modules/webaudio/AudioContext.cpp#newcode115 ...
5 years, 8 months ago (2015-04-07 23:24:48 UTC) #8
haraken
https://codereview.chromium.org/1006963003/diff/60001/Source/modules/webaudio/AsyncAudioDecoder.h File Source/modules/webaudio/AsyncAudioDecoder.h (right): https://codereview.chromium.org/1006963003/diff/60001/Source/modules/webaudio/AsyncAudioDecoder.h#newcode59 Source/modules/webaudio/AsyncAudioDecoder.h:59: RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; Since AsyncAudioDecoder is not on-heap, this needs ...
5 years, 8 months ago (2015-04-07 23:39:14 UTC) #9
yhirano
https://codereview.chromium.org/1006963003/diff/60001/Source/modules/webaudio/AudioContext.cpp File Source/modules/webaudio/AudioContext.cpp (right): https://codereview.chromium.org/1006963003/diff/60001/Source/modules/webaudio/AudioContext.cpp#newcode157 Source/modules/webaudio/AudioContext.cpp:157: for (auto& resolver : m_audioDecoderResolvers) { On 2015/04/07 23:39:14, ...
5 years, 8 months ago (2015-04-08 03:19:27 UTC) #10
Raymond Toy
https://codereview.chromium.org/1006963003/diff/60001/Source/modules/webaudio/AsyncAudioDecoder.h File Source/modules/webaudio/AsyncAudioDecoder.h (right): https://codereview.chromium.org/1006963003/diff/60001/Source/modules/webaudio/AsyncAudioDecoder.h#newcode59 Source/modules/webaudio/AsyncAudioDecoder.h:59: RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; On 2015/04/07 23:39:14, haraken wrote: > > ...
5 years, 8 months ago (2015-04-08 16:47:11 UTC) #11
haraken
Oilpan part LGTM.
5 years, 8 months ago (2015-04-09 00:43:43 UTC) #12
yhirano
This is not a problem of this issue, but I think having a promise-capable test ...
5 years, 8 months ago (2015-04-10 04:55:23 UTC) #13
Raymond Toy
https://codereview.chromium.org/1006963003/diff/100001/Source/modules/webaudio/AudioContext.h File Source/modules/webaudio/AudioContext.h (right): https://codereview.chromium.org/1006963003/diff/100001/Source/modules/webaudio/AudioContext.h#newcode439 Source/modules/webaudio/AudioContext.h:439: WillBeHeapVector<RefPtrWillBeMember<ScriptPromiseResolver>> m_audioDecoderResolvers; On 2015/04/10 04:55:23, yhirano wrote: > Is ...
5 years, 8 months ago (2015-04-10 20:54:57 UTC) #14
Raymond Toy
https://codereview.chromium.org/1006963003/diff/100001/LayoutTests/webaudio/decode-audio-data-promise.html File LayoutTests/webaudio/decode-audio-data-promise.html (right): https://codereview.chromium.org/1006963003/diff/100001/LayoutTests/webaudio/decode-audio-data-promise.html#newcode129 LayoutTests/webaudio/decode-audio-data-promise.html:129: p = context.decodeAudioData(request.response, On 2015/04/10 04:55:23, yhirano wrote: > ...
5 years, 8 months ago (2015-04-10 21:00:45 UTC) #15
yhirano
lgtm
5 years, 8 months ago (2015-04-11 01:13:43 UTC) #16
Raymond Toy
On 2015/04/11 01:13:43, yhirano wrote: > lgtm Thanks, everyone!
5 years, 8 months ago (2015-04-13 16:09:19 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1006963003/120001
5 years, 8 months ago (2015-04-13 16:09:56 UTC) #20
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://src.chromium.org/viewvc/blink?view=rev&revision=193648
5 years, 8 months ago (2015-04-13 20:01:27 UTC) #21
Raymond Toy
5 years, 8 months ago (2015-04-20 20:51:11 UTC) #22
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:120001) has been created in
https://chromiumcodereview.appspot.com/1097873003/ by rtoy@chromium.org.

The reason for reverting is: Causes problems noted in issue  477089.

Powered by Google App Engine
This is Rietveld 408576698