| Index: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
|
| diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
|
| index d34708fca6f560a67e6822d45ff8eecc16cf8a20..d0acd8dbd40e27c20f1486655552d659e763b0ab 100644
|
| --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
|
| +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
|
| @@ -770,6 +770,7 @@ void BaseAudioContext::resolvePromisesForResumeOnMainThread() {
|
| resolver->reject(DOMException::create(
|
| InvalidStateError, "Cannot resume a context that has been closed"));
|
| } else {
|
| + setContextState(Running);
|
| resolver->resolve();
|
| }
|
| }
|
| @@ -871,14 +872,16 @@ ExecutionContext* BaseAudioContext::getExecutionContext() const {
|
| }
|
|
|
| void BaseAudioContext::startRendering() {
|
| - // This is called for both online and offline contexts.
|
| + // This is called for both online and offline contexts. The caller
|
| + // must set the context state appropriately. In particular, resuming
|
| + // a context should wait until the context has actually resumed to
|
| + // set the state.
|
| DCHECK(isMainThread());
|
| DCHECK(m_destinationNode);
|
| DCHECK(isAllowedToStart());
|
|
|
| if (m_contextState == Suspended) {
|
| destination()->audioDestinationHandler().startRendering();
|
| - setContextState(Running);
|
| }
|
| }
|
|
|
|
|