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

Unified Diff: Source/modules/webaudio/AudioScheduledSourceNode.cpp

Issue 1256053006: Protect AudioScheduledSoureNode::m_startTime and m_endTime. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revert change to OscillatorNode.cpp Created 5 years, 3 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 | « Source/modules/webaudio/AudioScheduledSourceNode.h ('k') | Source/modules/webaudio/OscillatorNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioScheduledSourceNode.cpp
diff --git a/Source/modules/webaudio/AudioScheduledSourceNode.cpp b/Source/modules/webaudio/AudioScheduledSourceNode.cpp
index d853761f1b983b2da6e9abf08075d2c58e9f99da..1e84f43b897081bb28045927340e5c3a28f2bd38 100644
--- a/Source/modules/webaudio/AudioScheduledSourceNode.cpp
+++ b/Source/modules/webaudio/AudioScheduledSourceNode.cpp
@@ -153,6 +153,10 @@ void AudioScheduledSourceHandler::start(double when, ExceptionState& exceptionSt
return;
}
+ // This synchronizes with process(). updateSchedulingInfo will read some of the variables being
+ // set here.
+ MutexLocker processLocker(m_processLock);
+
// The node is started. Add a reference to keep us alive so that audio will eventually get
// played even if Javascript should drop all references to this node. The reference will get
// dropped when the source has finished playing.
@@ -186,6 +190,9 @@ void AudioScheduledSourceHandler::stop(double when, ExceptionState& exceptionSta
return;
}
+ // This synchronizes with process()
+ MutexLocker processLocker(m_processLock);
+
// stop() can be called more than once, with the last call to stop taking effect, unless the
// source has already stopped due to earlier calls to stop. No exceptions are thrown in any
// case.
« no previous file with comments | « Source/modules/webaudio/AudioScheduledSourceNode.h ('k') | Source/modules/webaudio/OscillatorNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698