Changeset 269039 in webkit
- Timestamp:
- Oct 27, 2020 8:26:01 AM (21 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webaudio/suspend-context-while-interrupted-expected.txt (added)
-
LayoutTests/webaudio/suspend-context-while-interrupted.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioContext.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r269036 r269039 1 2020-10-27 Chris Dumez <cdumez@apple.com> 2 3 AudioContext.suspend() should not reject promise when audio session is interrupted 4 https://bugs.webkit.org/show_bug.cgi?id=218235 5 6 Reviewed by Darin Adler. 7 8 Add layout test coverage. 9 10 * webaudio/suspend-context-while-interrupted-expected.txt: Added. 11 * webaudio/suspend-context-while-interrupted.html: Added. 12 1 13 2020-10-27 Zalan Bujtas <zalan@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r269038 r269039 1 2020-10-27 Chris Dumez <cdumez@apple.com> 2 3 AudioContext.suspend() should not reject promise when audio session is interrupted 4 https://bugs.webkit.org/show_bug.cgi?id=218235 5 6 Reviewed by Darin Adler. 7 8 AudioContext.suspend() should not reject promise when audio session is interrupted. Being 9 "interrupted" is an internal WebKit concept and rejecting the promise here is confusing 10 to Web developers. 11 12 We now no longer throw when AudioContext.suspend() is called while interrupted. Instead, 13 we set the 'wasSuspendedByJavascript' flag and register a state change listener to resolve 14 the promise when the state changes to "suspended". 15 16 When the interruption ends, AudioContext::mayResumePlayback() gets called with 17 shouldResume=false, causing us to update the state from "interrupted" to "suspended", 18 which resolves the suspend promise. 19 20 Test: webaudio/suspend-context-while-interrupted.html 21 22 * Modules/webaudio/AudioContext.cpp: 23 (WebCore::AudioContext::suspendRendering): 24 1 25 2020-10-27 Antti Koivisto <antti@apple.com> 2 26 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r268999 r269039 210 210 } 211 211 212 if (isStopped() || state() == State::Closed || state() == State::Interrupted ||!destinationNode()) {212 if (isStopped() || state() == State::Closed || !destinationNode()) { 213 213 promise.reject(Exception { InvalidStateError, "Context is closed"_s }); 214 214 return;
Note: See TracChangeset
for help on using the changeset viewer.