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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h

Issue 2929283002: Avoid AudioBufferSourceHandler data race. (Closed)
Patch Set: rename accessor Created 3 years, 6 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 | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
index 0c6df89f691751eb2c2da141ee8766d886751a6e..5cc78d303eee243a5e7321ec1949179fbe437460 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
@@ -168,8 +168,18 @@ class AudioBufferSourceHandler final : public AudioScheduledSourceHandler {
// conversion factor, and the value of playbackRate and detune AudioParams.
double ComputePlaybackRate();
+ double GetMinPlaybackRate();
+
// The minimum playbackRate value ever used for this source.
double min_playback_rate_;
+
+ // |min_playback_rate_| may be updated by the audio thread
+ // while the main thread checks if the node is in a stoppable
+ // state, hence access needs to be atomic.
+ //
+ // TODO: when the codebase adopts std::atomic<>, use it for
+ // |min_playback_rate_|.
+ Mutex min_playback_rate_mutex_;
};
class AudioBufferSourceNode final : public AudioScheduledSourceNode {
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698