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

Unified Diff: Source/modules/webaudio/AudioNode.h

Issue 349213007: WebAudio: Remove AudioNode::RefType. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
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;

Powered by Google App Engine
This is Rietveld 408576698