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

Unified Diff: third_party/WebKit/Source/platform/audio/AudioDestination.h

Issue 2854463002: Fix data race in AudioDestination.cpp (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/platform/audio/AudioDestination.h
diff --git a/third_party/WebKit/Source/platform/audio/AudioDestination.h b/third_party/WebKit/Source/platform/audio/AudioDestination.h
index 64797f225cfe21ea6e33bd4cbc787e338fb64ed7..f058d818f0bd10b90df575cef02d4b1e867c9764 100644
--- a/third_party/WebKit/Source/platform/audio/AudioDestination.h
+++ b/third_party/WebKit/Source/platform/audio/AudioDestination.h
@@ -106,18 +106,20 @@ class PLATFORM_EXPORT AudioDestination : public WebAudioDevice::RenderCallback {
bool IsRenderingThread();
+ // Accessed by the main thread.
std::unique_ptr<WebAudioDevice> web_audio_device_;
const unsigned number_of_output_channels_;
size_t callback_buffer_size_;
bool is_playing_;
- // Rendering thread for WebAudio graph.
- std::unique_ptr<WebThread> rendering_thread_;
-
- // Accessed by both threads: resolves the buffer size mismatch between the
- // WebAudio engine and the callback function from the actual audio device.
+ // Accessed by device and rendering threads: resolves the buffer size mismatch
+ // between the WebAudio engine and the callback function from the actual audio
+ // device.
std::unique_ptr<PushPullFIFO> fifo_;
+ // Accessed by the device thread. Rendering thread for WebAudio graph.
+ std::unique_ptr<WebThread> rendering_thread_;
+
// Accessed by device thread: to pass the data from FIFO to the device.
RefPtr<AudioBus> output_bus_;

Powered by Google App Engine
This is Rietveld 408576698