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

Unified Diff: Source/modules/webaudio/ScriptProcessorNode.cpp

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
« no previous file with comments | « Source/modules/webaudio/ScriptProcessorNode.h ('k') | Source/modules/webaudio/WaveShaperNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/ScriptProcessorNode.cpp
diff --git a/Source/modules/webaudio/ScriptProcessorNode.cpp b/Source/modules/webaudio/ScriptProcessorNode.cpp
index 246a5fee66e0cc4c8255cb3e69b899bd64c00a4e..afbebae39d3540c0aeab5103fe9f75e2a174f466 100644
--- a/Source/modules/webaudio/ScriptProcessorNode.cpp
+++ b/Source/modules/webaudio/ScriptProcessorNode.cpp
@@ -40,13 +40,6 @@
namespace blink {
-#if !ENABLE(OILPAN)
-// We need a dedicated specialization for ScriptProcessorNode because it doesn't
-// inherit from RefCounted.
-template<> struct CrossThreadCopierBase<false, false, false, PassRefPtr<ScriptProcessorNode> > : public CrossThreadCopierPassThrough<PassRefPtr<ScriptProcessorNode> > {
-};
-#endif
-
static size_t chooseBufferSize()
{
// Choose a buffer size based on the audio hardware buffer size. Arbitarily make it a power of
@@ -63,7 +56,7 @@ static size_t chooseBufferSize()
return bufferSize;
}
-PassRefPtrWillBeRawPtr<ScriptProcessorNode> ScriptProcessorNode::create(AudioContext* context, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels)
+ScriptProcessorNode* ScriptProcessorNode::create(AudioContext* context, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels)
{
// Check for valid buffer size.
switch (bufferSize) {
@@ -79,19 +72,19 @@ PassRefPtrWillBeRawPtr<ScriptProcessorNode> ScriptProcessorNode::create(AudioCon
case 16384:
break;
default:
- return nullptr;
+ return 0;
}
if (!numberOfInputChannels && !numberOfOutputChannels)
- return nullptr;
+ return 0;
if (numberOfInputChannels > AudioContext::maxNumberOfChannels())
- return nullptr;
+ return 0;
if (numberOfOutputChannels > AudioContext::maxNumberOfChannels())
- return nullptr;
+ return 0;
- return adoptRefWillBeNoop(new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInputChannels, numberOfOutputChannels));
+ return adoptRefCountedGarbageCollectedWillBeNoop(new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInputChannels, numberOfOutputChannels));
}
ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels)
@@ -140,8 +133,8 @@ void ScriptProcessorNode::initialize()
// Create double buffers on both the input and output sides.
// These AudioBuffers will be directly accessed in the main thread by JavaScript.
for (unsigned i = 0; i < 2; ++i) {
- RefPtrWillBeRawPtr<AudioBuffer> inputBuffer = m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, bufferSize(), sampleRate) : nullptr;
- RefPtrWillBeRawPtr<AudioBuffer> outputBuffer = m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, bufferSize(), sampleRate) : nullptr;
+ AudioBuffer* inputBuffer = m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, bufferSize(), sampleRate) : 0;
+ AudioBuffer* outputBuffer = m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, bufferSize(), sampleRate) : 0;
m_inputBuffers.append(inputBuffer);
m_outputBuffers.append(outputBuffer);
@@ -235,7 +228,7 @@ void ScriptProcessorNode::process(size_t framesToProcess)
} else if (context()->executionContext()) {
// Fire the event on the main thread, not this one (which is the realtime audio thread).
m_doubleBufferIndexForEvent = m_doubleBufferIndex;
- context()->executionContext()->postTask(createCrossThreadTask(&ScriptProcessorNode::fireProcessEvent, PassRefPtrWillBeRawPtr<ScriptProcessorNode>(this)));
+ context()->executionContext()->postTask(createCrossThreadTask(&ScriptProcessorNode::fireProcessEvent, this));
}
swapBuffers();
« no previous file with comments | « Source/modules/webaudio/ScriptProcessorNode.h ('k') | Source/modules/webaudio/WaveShaperNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698