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

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

Issue 270103005: Tried to move AudioSummingJuction to oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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/AudioListener.idl ('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 5ebe221ee62803656bb0fb4e6301e83faf4d0502..5b888050ad0224dbc18203dc7b6a5625f1f1e7ac 100644
--- a/Source/modules/webaudio/AudioNode.h
+++ b/Source/modules/webaudio/AudioNode.h
@@ -50,7 +50,8 @@ class ExceptionState;
// An AudioDestinationNode has one input and no outputs and represents the final destination to the audio hardware.
// Most processing nodes such as filters will have one input and one output, although multiple inputs and outputs are possible.
-class AudioNode : public ScriptWrappable, public EventTargetWithInlineData {
+// AudioNode has its own ref-counting mechanism that use RefTypes so we cannot use RefCountedGarbageCollected.
+class AudioNode : public NoBaseWillBeGarbageCollectedFinalized<AudioNode>, public ScriptWrappable, public EventTargetWithInlineData {
public:
enum { ProcessingSizeInFrames = 128 };
@@ -179,9 +180,15 @@ public:
virtual const AtomicString& interfaceName() const OVERRIDE FINAL;
virtual ExecutionContext* executionContext() const OVERRIDE FINAL;
+ virtual void trace(Visitor*);
+
+#if ENABLE(OILPAN)
+ void clearKeepAlive();
+#endif
+
protected:
// Inputs and outputs must be created before the AudioNode is initialized.
- void addInput(PassOwnPtr<AudioNodeInput>);
+ void addInput(PassOwnPtrWillBeRawPtr<AudioNodeInput>);
void addOutput(PassOwnPtr<AudioNodeOutput>);
// Called by processIfNecessary() to cause all parts of the rendering graph connected to us to process.
@@ -195,11 +202,23 @@ protected:
private:
volatile bool m_isInitialized;
NodeType m_nodeType;
- RefPtr<AudioContext> m_context;
+ RefPtrWillBeMember<AudioContext> m_context;
float m_sampleRate;
- Vector<OwnPtr<AudioNodeInput> > m_inputs;
+ WillBeHeapVector<OwnPtrWillBeMember<AudioNodeInput> > m_inputs;
Vector<OwnPtr<AudioNodeOutput> > m_outputs;
+#if ENABLE(OILPAN)
+ // AudioNodes are in the oilpan heap but they are still reference counted at
+ // the same time. This is because we are not allowed to stop the audio
+ // thread and thus the audio thread cannot allocate objects in the oilpan
+ // heap.
+ // The m_keepAlive handle is used to keep a persistent reference to this
+ // AudioNode while someone has a reference to this AudioNode through a
+ // RefPtr.
+ GC_PLUGIN_IGNORE("http://crbug.com/353083")
+ OwnPtr<Persistent<AudioNode> > m_keepAlive;
+#endif
+
double m_lastProcessingTime;
double m_lastNonSilentTime;
« no previous file with comments | « Source/modules/webaudio/AudioListener.idl ('k') | Source/modules/webaudio/AudioNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698