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

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

Issue 385953003: Revert of WebAudio: Remove AudioNode::RefType. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | Source/modules/webaudio/AudioNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioNode.h
diff --git a/Source/modules/webaudio/AudioNode.h b/Source/modules/webaudio/AudioNode.h
index d49f8faa45d4e3f15a7f429e300b847c61bfa70f..cfbb2d1fe3a54b5c70114106f77f5f2f27284e26 100644
--- a/Source/modules/webaudio/AudioNode.h
+++ b/Source/modules/webaudio/AudioNode.h
@@ -93,21 +93,17 @@
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();
- void deref();
-
- // This object has been connected to another object. This might have
- // existing connections from others.
- // This function must be called after acquiring a connection reference.
- void makeConnection();
- // This object will be disconnected from another object. This might have
- // remaining connections from others.
- // This function must be called before releasing a connection reference.
- void breakConnection();
+ void ref(RefType refType = RefTypeNormal);
+ void deref(RefType refType = RefTypeNormal);
// 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();
+ void finishDeref(RefType refType);
// 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).
@@ -229,7 +225,6 @@
// Ref-counting
volatile int m_normalRefCount;
volatile int m_connectionRefCount;
- bool m_wasDisconnected;
bool m_isMarkedForDeletion;
bool m_isDisabled;
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | Source/modules/webaudio/AudioNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698