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

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

Issue 2798973002: Resume() should return if context is already running (Closed)
Patch Set: Address review comments. Created 3 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 | « third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-suspend-resume.html ('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/AudioContext.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
index 4813a821ca2a026289282b9bd70bfca354b2ad3d..2db59467ace58dad8aedb139fd7fe4cbf6a0445c 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
@@ -155,6 +155,12 @@ ScriptPromise AudioContext::resumeContext(ScriptState* scriptState) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
+ // If we're already running, just resolve; nothing else needs to be
+ // done.
+ if (contextState() == Running) {
+ resolver->resolve();
+ return promise;
+ }
// Restart the destination node to pull on the audio graph.
if (destination()) {
maybeUnlockUserGesture();
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-suspend-resume.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698