Chromium Code Reviews| Index: Source/modules/webaudio/AudioNode.h |
| diff --git a/Source/modules/webaudio/AudioNode.h b/Source/modules/webaudio/AudioNode.h |
| index e66ed7d33167556ae2e58fc74c751dce002a4ba0..c0a73dbb8f4aa94bb10e0acf45dd4b1919fd2298 100644 |
| --- a/Source/modules/webaudio/AudioNode.h |
| +++ b/Source/modules/webaudio/AudioNode.h |
| @@ -94,17 +94,19 @@ public: |
| String nodeTypeName() const; |
| void setNodeType(NodeType); |
| - // We handle our own ref-counting because of the threading issues and subtle nature of |
| - // how AudioNodes can continue processing (playing one-shot sound) after there are no more |
| - // JavaScript references to the object. |
| - enum RefType { RefTypeNormal, RefTypeConnection }; |
| - |
| // Can be called from main thread or context's audio thread. |
| - void ref(RefType refType = RefTypeNormal); |
| - void deref(RefType refType = RefTypeNormal); |
| + void ref(); |
| + void deref(); |
| + |
| + void wasConnected(); |
|
Raymond Toy
2014/07/09 22:10:34
Add a comment on what wasConnected() does and when
tkent
2014/07/10 08:07:42
Will do
|
| + // This will be disconnected from an object. This might have remaining |
| + // connections from others. |
| + // This function should be called before releasing connection-type |
|
Raymond Toy
2014/07/09 22:10:34
"should" or "must" be called?
tkent
2014/07/10 08:07:42
must. Will update.
|
| + // references. |
| + void willBeDisconnected(); |
| // Can be called from main thread or context's audio thread. It must be called while the context's graph lock is held. |
| - void finishDeref(RefType refType); |
| + void finishDeref(); |
| // The AudioNodeInput(s) (if any) will already have their input data available when process() is called. |
| // Subclasses will take this input data and put the results in the AudioBus(s) of its AudioNodeOutput(s) (if any). |
| @@ -226,6 +228,7 @@ private: |
| // Ref-counting |
| volatile int m_normalRefCount; |
| volatile int m_connectionRefCount; |
| + bool m_wasDisconnected; |
| bool m_isMarkedForDeletion; |
| bool m_isDisabled; |