Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp |
| diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp |
| index 1b310a9db147308bf597838d58b70511ed36e1ad..8bb00da84edd7ae0f69b19191b0eb77ae198476e 100644 |
| --- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp |
| +++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp |
| @@ -212,6 +212,7 @@ ScriptPromise OfflineAudioContext::startOfflineRendering( |
| // Start rendering and return the promise. |
| is_rendering_started_ = true; |
| SetContextState(kRunning); |
| + DestinationHandler().InitializeOfflineRenderThread(); |
| DestinationHandler().StartRendering(); |
| return complete_resolver_->Promise(); |
| @@ -230,13 +231,6 @@ ScriptPromise OfflineAudioContext::suspendContext(ScriptState* script_state, |
| ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); |
| ScriptPromise promise = resolver->Promise(); |
| - // The render thread does not exist; reject the promise. |
| - if (!DestinationHandler().OfflineRenderThread()) { |
|
Raymond Toy
2017/05/23 17:05:01
What happened before if I try to suspend a context
hongchan
2017/05/23 18:10:38
A good catch. My mistake. I forgot to revert this
Raymond Toy
2017/05/23 18:14:41
In that case, we want to include a test for this w
|
| - resolver->Reject(DOMException::Create(kInvalidStateError, |
| - "the rendering is already finished")); |
| - return promise; |
| - } |
| - |
| // The specified suspend time is negative; reject the promise. |
| if (when < 0) { |
| resolver->Reject(DOMException::Create( |