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

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

Issue 438293003: Enable Oilpan by default for webaudio/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 8bf98958866bcfb454808e36db0afaa9a729f0a6..d2219d6b72fa72104c6bc3f5a9c8c71b0e8c1426 100644
--- a/Source/modules/webaudio/AudioNode.h
+++ b/Source/modules/webaudio/AudioNode.h
@@ -50,7 +50,7 @@ class ExceptionState;
// Most processing nodes such as filters will have one input and one output, although multiple inputs and outputs are possible.
// AudioNode has its own ref-counting mechanism that use RefTypes so we cannot use RefCountedGarbageCollected.
-class AudioNode : public NoBaseWillBeGarbageCollectedFinalized<AudioNode>, public EventTargetWithInlineData {
+class AudioNode : public GarbageCollectedFinalized<AudioNode>, public EventTargetWithInlineData {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioNode);
public:
enum { ProcessingSizeInFrames = 128 };
@@ -97,12 +97,6 @@ public:
String nodeTypeName() const;
void setNodeType(NodeType);
-#if !ENABLE(OILPAN)
- // Can be called from main thread or context's audio thread.
- void ref();
- void deref();
-#endif
-
// 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.
@@ -198,7 +192,7 @@ public:
protected:
// Inputs and outputs must be created before the AudioNode is initialized.
void addInput();
- void addOutput(PassOwnPtrWillBeRawPtr<AudioNodeOutput>);
+ void addOutput(AudioNodeOutput*);
// Called by processIfNecessary() to cause all parts of the rendering graph connected to us to process.
// Each rendering quantum, the audio data for each of the AudioNode's inputs will be available after this method is called.
@@ -211,10 +205,10 @@ protected:
private:
volatile bool m_isInitialized;
NodeType m_nodeType;
- RefPtrWillBeMember<AudioContext> m_context;
+ Member<AudioContext> m_context;
float m_sampleRate;
- WillBeHeapVector<OwnPtrWillBeMember<AudioNodeInput> > m_inputs;
- WillBeHeapVector<OwnPtrWillBeMember<AudioNodeOutput> > m_outputs;
+ HeapVector<Member<AudioNodeInput> > m_inputs;
+ HeapVector<Member<AudioNodeOutput> > m_outputs;
double m_lastProcessingTime;
double m_lastNonSilentTime;
@@ -222,6 +216,16 @@ private:
#if !ENABLE(OILPAN)
// Ref-counting
volatile int m_normalRefCount;
+
+ // 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("")
+ Persistent<AudioNode> m_keepAlive;
#endif
volatile int m_connectionRefCount;
@@ -235,6 +239,10 @@ private:
static unsigned s_instanceCount;
#if !ENABLE(OILPAN)
+ // Can be called from main thread or context's audio thread.
+ void ref();
+ void deref();
+
virtual void refEventTarget() OVERRIDE FINAL { ref(); }
virtual void derefEventTarget() OVERRIDE FINAL { deref(); }
#endif

Powered by Google App Engine
This is Rietveld 408576698