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

Unified Diff: Source/modules/webaudio/OfflineAudioContext.cpp

Issue 1111213002: Treat a stopped AudioContext as closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: startRendering() doesn't (directly) raise an exception Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/OfflineAudioContext.cpp
diff --git a/Source/modules/webaudio/OfflineAudioContext.cpp b/Source/modules/webaudio/OfflineAudioContext.cpp
index b79d2e5d259e5b22a4e383ac40f362a34e7231f1..d3488419e947e373d50f13cb105be0fb0604d178 100644
--- a/Source/modules/webaudio/OfflineAudioContext.cpp
+++ b/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -101,6 +101,16 @@ OfflineAudioContext::~OfflineAudioContext()
ScriptPromise OfflineAudioContext::startOfflineRendering(ScriptState* scriptState)
{
+ // Calling close() on an OfflineAudioContext is not supported/allowed,
+ // but it might well have been stopped by its execution context.
+ if (isContextClosed()) {
+ return ScriptPromise::rejectWithDOMException(
+ scriptState,
+ DOMException::create(
+ InvalidStateError,
+ "cannot call startRendering on an OfflineAudioContext in a stopped state."));
+ }
+
if (m_offlineResolver) {
// Can't call startRendering more than once. Return a rejected promise now.
return ScriptPromise::rejectWithDOMException(
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698