Chromium Code Reviews| Index: Source/modules/webaudio/AudioContext.h |
| diff --git a/Source/modules/webaudio/AudioContext.h b/Source/modules/webaudio/AudioContext.h |
| index 3377ce6497d2fc0b3bc80a36a085a82d99a24942..dda904f2b7a84daa3f33c740bad5151d800a934f 100644 |
| --- a/Source/modules/webaudio/AudioContext.h |
| +++ b/Source/modules/webaudio/AudioContext.h |
| @@ -25,6 +25,8 @@ |
| #ifndef AudioContext_h |
| #define AudioContext_h |
| +#include "bindings/core/v8/ScriptPromise.h" |
| +#include "bindings/core/v8/ScriptPromiseResolver.h" |
| #include "core/dom/ActiveDOMObject.h" |
| #include "core/events/EventListener.h" |
| #include "modules/EventTargetModules.h" |
| @@ -128,6 +130,10 @@ public: |
| OscillatorNode* createOscillator(); |
| PeriodicWave* createPeriodicWave(Float32Array* real, Float32Array* imag, ExceptionState&); |
| + // Pause/Resume |
| + void suspendContext(); |
| + ScriptPromise resumeContext(ScriptState*); |
| + |
| // When a source node has no more processing to do (has finished playing), then it tells the context to dereference it. |
| void notifyNodeFinishedProcessing(AudioNode*); |
| @@ -166,6 +172,9 @@ public: |
| unsigned connectionCount() const { return m_connectionCount; } |
| + void resolvePromisesForResume(); |
| + void resolvePromisesForResumeOnMainThread(); |
|
yhirano
2014/10/08 01:12:14
These function can be private.
|
| + |
| // |
| // Thread Safety and Graph Locking: |
| // |
| @@ -274,6 +283,13 @@ private: |
| // AudioNode::breakConnection() when we remove an AudioNode from this. |
| HeapVector<Member<AudioNode> > m_referencedNodes; |
| + GC_PLUGIN_IGNORE("http://crbug.com/404527") |
| + Vector<RefPtr<ScriptPromiseResolver> > m_resumePromises; |
| + // True if we're in the process of resolving promises for resume(). Resolving can take some |
| + // time and the audio context process loop is very fast, so we don't want to call resolve an |
| + // excessive number of times. |
| + bool m_isResolvingResumePromises; |
| + |
| class AudioNodeDisposer { |
| public: |
| explicit AudioNodeDisposer(AudioNode& node) : m_node(node) { } |