Chromium Code Reviews| Index: Source/modules/webaudio/AudioContext.h |
| diff --git a/Source/modules/webaudio/AudioContext.h b/Source/modules/webaudio/AudioContext.h |
| index 4ce5c232b9851c55acb611b78d09b0acacea1e68..4c6facfedaa22255740098bc5cfad724228c0030 100644 |
| --- a/Source/modules/webaudio/AudioContext.h |
| +++ b/Source/modules/webaudio/AudioContext.h |
| @@ -106,7 +106,12 @@ public: |
| virtual bool hasPendingActivity() const override; |
| AudioDestinationNode* destination() { return m_destinationNode.get(); } |
| + // currentSampleFrame() returns the current sample frame. It should only be called from the |
| + // audio thread. |
| size_t currentSampleFrame() const { return m_destinationNode->currentSampleFrame(); } |
| + // sampleFrame() is like currentSampleFrame() but must be called from the main thread to get the |
| + // sample frame. It might be slightly behind curentSampleFrame() due to locking. |
| + size_t sampleFrame() const; |
|
hongchan
2014/12/03 18:50:47
Just a thought - can't this be shadowCurrentSample
Raymond Toy
2014/12/03 19:04:44
I'm terrible at names. m_shadowCurrentSampleFrame
hongchan
2014/12/03 19:13:29
I agree that it is too much.
How about using the
Raymond Toy
2014/12/03 19:34:21
Sounds good.
|
| double currentTime() const { return m_destinationNode->currentTime(); } |
| float sampleRate() const { return m_destinationNode->sampleRate(); } |
| String state() const; |
| @@ -396,6 +401,9 @@ private: |
| GC_PLUGIN_IGNORE("http://crbug.com/404527") |
| HashSet<AudioNode*> m_deferredCountModeChange; |
| + // Follows the destinations currentSampleFrame, but might be slightly behind due to locking. |
| + size_t m_shadowCurrentSampleFrame; |
| + |
| // This is considering 32 is large enough for multiple channels audio. |
| // It is somewhat arbitrary and could be increased if necessary. |
| enum { MaxNumberOfChannels = 32 }; |