Chromium Code Reviews| Index: Source/modules/webaudio/AudioScheduledSourceNode.h |
| diff --git a/Source/modules/webaudio/AudioScheduledSourceNode.h b/Source/modules/webaudio/AudioScheduledSourceNode.h |
| index 11c3e5196ff65c116e8ad6e1ebc1b4e48cf37065..752cf51e5c60596c875bd7b05d4f807f12e11e72 100644 |
| --- a/Source/modules/webaudio/AudioScheduledSourceNode.h |
| +++ b/Source/modules/webaudio/AudioScheduledSourceNode.h |
| @@ -103,6 +103,33 @@ protected: |
| void notifyEnded(); |
| + // Both |m_startTime| and |m_endTime| are accessed from both the main thread and the audio |
| + // thread. Use the setters and getters to protect the access to these! |
| + |
| + double startTime() const |
| + { |
| + return acquireLoad(&m_startTime); |
|
tkent
2015/08/07 01:10:03
I'm not sure acquireLoad and releaseStore are enou
Raymond Toy
2015/08/07 15:45:00
Hmm. I perhaps erroneously assumed floating-point
tkent
2015/08/11 00:45:19
Alternative would be a normal mutex, or a spin loc
|
| + } |
| + |
| + void setStartTime(double newStartTime) |
| + { |
| + releaseStore(&m_startTime, newStartTime); |
| + } |
| + |
| + double endTime() const |
| + { |
| + return acquireLoad(&m_endTime); |
| + } |
| + |
| + void setEndTime(double newEndTime) |
| + { |
| + releaseStore(&m_endTime, newEndTime); |
| + } |
| + |
| + bool m_hasEndedListener; |
| + |
| + static const double UnknownTime; |
| +private: |
| // m_startTime is the time to start playing based on the context's timeline (0 or a time less than the context's current time means "now"). |
| double m_startTime; // in seconds |
| @@ -111,10 +138,6 @@ protected: |
| // has been reached. |
| double m_endTime; // in seconds |
| - bool m_hasEndedListener; |
| - |
| - static const double UnknownTime; |
| -private: |
| // This is accessed by both the main thread and audio thread. Use the setter and getter to |
| // protect the access to this! |
| int m_playbackState; |