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

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

Issue 2615463002: Use atomics when accessing m_didSetLooping (Closed)
Patch Set: Fix typo. Created 3 years, 12 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 16b15388769489016d3029f7c2dd77f185e21951..2d2739acb3fb2b9a6e91ee3f5f90a2ae8090737b 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
@@ -83,7 +83,7 @@ class AudioBufferSourceHandler final : public AudioScheduledSourceHandler {
bool loop() const { return m_isLooping; }
void setLoop(bool looping) {
m_isLooping = looping;
- m_didSetLooping = m_didSetLooping || looping;
+ setDidSetLooping(looping);
}
// Loop times in seconds.
@@ -133,6 +133,12 @@ class AudioBufferSourceHandler final : public AudioScheduledSourceHandler {
RefPtr<AudioParamHandler> m_playbackRate;
RefPtr<AudioParamHandler> m_detune;
+ bool didSetLooping() const { return acquireLoad(&m_didSetLooping); }
+ void setDidSetLooping(bool loop) {
+ bool newLooping = didSetLooping() || loop;
+ releaseStore(&m_didSetLooping, newLooping);
+ }
+
// If m_isLooping is false, then this node will be done playing and become
// inactive after it reaches the end of the sample data in the buffer. If
// true, it will wrap around to the start of the buffer each time it reaches
@@ -140,7 +146,7 @@ class AudioBufferSourceHandler final : public AudioScheduledSourceHandler {
bool m_isLooping;
// True if the source .loop attribute was ever set.
- bool m_didSetLooping;
+ int m_didSetLooping;
double m_loopStart;
double m_loopEnd;
« 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