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

Unified Diff: third_party/WebKit/Source/platform/audio/PushPullFIFO.cpp

Issue 2777903005: Add WebThread in AudioDestination to support AudioWorkletThread (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/platform/audio/PushPullFIFO.cpp
diff --git a/third_party/WebKit/Source/platform/audio/PushPullFIFO.cpp b/third_party/WebKit/Source/platform/audio/PushPullFIFO.cpp
index 73b1ef44bf04591cdc283b1de4bf808e7b6e8ee8..575b2c7e2e41886d126d1e52c846433873d7455b 100644
--- a/third_party/WebKit/Source/platform/audio/PushPullFIFO.cpp
+++ b/third_party/WebKit/Source/platform/audio/PushPullFIFO.cpp
@@ -34,6 +34,8 @@ PushPullFIFO::~PushPullFIFO() {}
// Push the data from |inputBus| to FIFO. The size of push is determined by
// the length of |inputBus|.
void PushPullFIFO::push(const AudioBus* inputBus) {
+ MutexLocker locker(m_lock);
+
CHECK(inputBus);
CHECK_EQ(inputBus->length(), AudioUtilities::kRenderQuantumFrames);
SECURITY_CHECK(inputBus->length() <= m_fifoLength);
@@ -83,6 +85,8 @@ void PushPullFIFO::push(const AudioBus* inputBus) {
// Pull the data out of FIFO to |outputBus|. If remaining frame in the FIFO
// is less than the frames to pull, provides remaining frame plus the silence.
void PushPullFIFO::pull(AudioBus* outputBus, size_t framesRequested) {
+ MutexLocker locker(m_lock);
+
#if OS(ANDROID)
if (!outputBus) {
// Log when outputBus or FIFO object is invalid. (crbug.com/692423)

Powered by Google App Engine
This is Rietveld 408576698