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

Unified Diff: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp

Issue 2717613007: Set "Running" state only when actually running (Closed)
Patch Set: State must be set AFTER startRendering(). Created 3 years, 9 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 | « third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698