Index: Source/modules/webaudio/AudioContext.cpp |
diff --git a/Source/modules/webaudio/AudioContext.cpp b/Source/modules/webaudio/AudioContext.cpp |
index 074ca8f51269c70cad414aee773292e65d11c250..e92fae7bc331226efa5a5c1436b738bfd4a1752e 100644 |
--- a/Source/modules/webaudio/AudioContext.cpp |
+++ b/Source/modules/webaudio/AudioContext.cpp |
@@ -77,29 +77,6 @@ |
AbstractAudioContext::trace(visitor); |
} |
-ScriptPromise AudioContext::closeContext(ScriptState* scriptState) |
-{ |
- if (isContextClosed()) { |
- // We've already closed the context previously, but it hasn't yet been resolved, so just |
- // create a new promise and reject it. |
- return ScriptPromise::rejectWithDOMException( |
- scriptState, |
- DOMException::create(InvalidStateError, |
- "Cannot close a context that is being closed or has already been closed.")); |
- } |
- |
- m_closeResolver = ScriptPromiseResolver::create(scriptState); |
- ScriptPromise promise = m_closeResolver->promise(); |
- |
- // Stop the audio context. This will stop the destination node from pulling audio anymore. And |
- // since we have disconnected the destination from the audio graph, and thus has no references, |
- // the destination node can GCed if JS has no references. uninitialize() will also resolve the Promise |
- // created here. |
- uninitialize(); |
- |
- return promise; |
-} |
- |
ScriptPromise AudioContext::suspendContext(ScriptState* scriptState) |
{ |
ASSERT(isMainThread()); |
@@ -124,15 +101,6 @@ |
return promise; |
} |
-ScriptPromise AudioContext::suspendContext(ScriptState* scriptState, double suspendTime) |
-{ |
- // This CANNOT be called on AudioContext; it is to implement the pure |
- // virtual interface from AbstractAudioContext. |
- RELEASE_ASSERT_NOT_REACHED(); |
- |
- return ScriptPromise(); |
-} |
- |
ScriptPromise AudioContext::resumeContext(ScriptState* scriptState) |
{ |
ASSERT(isMainThread()); |
@@ -155,9 +123,32 @@ |
// Save the resolver which will get resolved when the destination node starts pulling on the |
// graph again. |
{ |
- AutoLocker(this); |
+ AutoLocker locker(this); |
m_resumeResolvers.append(resolver); |
} |
+ |
+ return promise; |
+} |
+ |
+ScriptPromise AudioContext::closeContext(ScriptState* scriptState) |
+{ |
+ if (isContextClosed()) { |
+ // We've already closed the context previously, but it hasn't yet been resolved, so just |
+ // create a new promise and reject it. |
+ return ScriptPromise::rejectWithDOMException( |
+ scriptState, |
+ DOMException::create(InvalidStateError, |
+ "Cannot close a context that is being closed or has already been closed.")); |
+ } |
+ |
+ m_closeResolver = ScriptPromiseResolver::create(scriptState); |
+ ScriptPromise promise = m_closeResolver->promise(); |
+ |
+ // Stop the audio context. This will stop the destination node from pulling audio anymore. And |
+ // since we have disconnected the destination from the audio graph, and thus has no references, |
+ // the destination node can GCed if JS has no references. uninitialize() will also resolve the Promise |
+ // created here. |
+ uninitialize(); |
return promise; |
} |