diff options
author | tkent@chromium.org <tkent@chromium.org> | 2015-04-07 05:35:52 +0000 |
---|---|---|
committer | tkent@chromium.org <tkent@chromium.org> | 2015-04-07 05:35:52 +0000 |
commit | d70f1c1d02d75c3945c13284ff0f4ce68fb1e609 (patch) | |
tree | 5d33a4258966a707bb2f0b4287d3e105a2d8371a | |
parent | b48ac0daf4acfcd77abc021a3bf168ccff345c6c (diff) | |
download | chromium_src-d70f1c1d02d75c3945c13284ff0f4ce68fb1e609.zip chromium_src-d70f1c1d02d75c3945c13284ff0f4ce68fb1e609.tar.gz chromium_src-d70f1c1d02d75c3945c13284ff0f4ce68fb1e609.tar.bz2 |
Web Audio: Various code cleanup
- Use references instead of pointers if they are obviously not null.
- Remove AudioBufferSourceHandler::start(ExceptionState&)
It just call another overload. A callsite can call it.
- Remove redundant isContextClosed check in AudioContext::create*().
If a factory function calls another factory function, isContextClosed was
checked multiple times.
- Remove redundant hadException check in AudioContext::createDelay
DelayNode::create returns nullptr in that case.
- Fold DeferredTaskHandler::disposeOutputs into AudioHandler::dispose
- Remove obsolete comment in DeferredTaskHandler.
- Remove |autoInitialize| argument of BiquadProcessor constructor
It's always false.
BUG=
Review URL: https://codereview.chromium.org/1059763004
git-svn-id: svn://svn.chromium.org/blink/trunk@193242 bbb929c8-8fbe-4397-9dbb-9b2b20218538
41 files changed, 107 insertions, 157 deletions
diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp index 075ae43..43903af 100644 --- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp @@ -123,9 +123,9 @@ AnalyserNode::AnalyserNode(AudioContext& context, float sampleRate) setHandler(new AnalyserHandler(*this, sampleRate)); } -AnalyserNode* AnalyserNode::create(AudioContext* context, float sampleRate) +AnalyserNode* AnalyserNode::create(AudioContext& context, float sampleRate) { - return new AnalyserNode(*context, sampleRate); + return new AnalyserNode(context, sampleRate); } AnalyserHandler& AnalyserNode::analyserHandler() const diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h index 3611e50..a71d9c4 100644 --- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h +++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h @@ -68,7 +68,7 @@ private: class AnalyserNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static AnalyserNode* create(AudioContext*, float sampleRate); + static AnalyserNode* create(AudioContext&, float sampleRate); unsigned fftSize() const; void setFftSize(unsigned size, ExceptionState&); diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp index b09b015..505f3b8 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp @@ -567,14 +567,14 @@ DEFINE_TRACE(AudioBufferSourceHandler) // ---------------------------------------------------------------- AudioBufferSourceNode::AudioBufferSourceNode(AudioContext& context, float sampleRate) : AudioScheduledSourceNode(context) - , m_playbackRate(AudioParam::create(&context, 1.0)) + , m_playbackRate(AudioParam::create(context, 1.0)) { setHandler(new AudioBufferSourceHandler(*this, sampleRate, m_playbackRate->handler())); } -AudioBufferSourceNode* AudioBufferSourceNode::create(AudioContext* context, float sampleRate) +AudioBufferSourceNode* AudioBufferSourceNode::create(AudioContext& context, float sampleRate) { - return new AudioBufferSourceNode(*context, sampleRate); + return new AudioBufferSourceNode(context, sampleRate); } DEFINE_TRACE(AudioBufferSourceNode) @@ -635,7 +635,7 @@ void AudioBufferSourceNode::setLoopEnd(double loopEnd) void AudioBufferSourceNode::start(ExceptionState& exceptionState) { - audioBufferSourceHandler().start(exceptionState); + audioBufferSourceHandler().start(0, exceptionState); } void AudioBufferSourceNode::start(double when, ExceptionState& exceptionState) diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h index 0f0f5ad..2de43bf 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h @@ -60,7 +60,6 @@ public: unsigned numberOfChannels(); // Play-state - void start(ExceptionState& exceptionState) { start(0, exceptionState); } void start(double when, ExceptionState&); void start(double when, double grainOffset, ExceptionState&); void start(double when, double grainOffset, double grainDuration, ExceptionState&); @@ -150,7 +149,7 @@ private: class AudioBufferSourceNode final : public AudioScheduledSourceNode { DEFINE_WRAPPERTYPEINFO(); public: - static AudioBufferSourceNode* create(AudioContext*, float sampleRate); + static AudioBufferSourceNode* create(AudioContext&, float sampleRate); DECLARE_VIRTUAL_TRACE(); AudioBufferSourceHandler& audioBufferSourceHandler() const; diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp index 2c133d9..61e50f6 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp @@ -294,7 +294,7 @@ AudioBufferSourceNode* AudioContext::createBufferSource(ExceptionState& exceptio return nullptr; } - AudioBufferSourceNode* node = AudioBufferSourceNode::create(this, sampleRate()); + AudioBufferSourceNode* node = AudioBufferSourceNode::create(*this, sampleRate()); // Do not add a reference to this source node now. The reference will be added when start() is // called. @@ -326,7 +326,7 @@ MediaElementAudioSourceNode* AudioContext::createMediaElementSource(HTMLMediaEle return nullptr; } - MediaElementAudioSourceNode* node = MediaElementAudioSourceNode::create(this, mediaElement); + MediaElementAudioSourceNode* node = MediaElementAudioSourceNode::create(*this, *mediaElement); mediaElement->setAudioSourceNode(&node->mediaElementAudioSourceHandler()); @@ -361,7 +361,7 @@ MediaStreamAudioSourceNode* AudioContext::createMediaStreamSource(MediaStream* m // Use the first audio track in the media stream. MediaStreamTrack* audioTrack = audioTracks[0]; OwnPtr<AudioSourceProvider> provider = audioTrack->createWebAudioSource(); - MediaStreamAudioSourceNode* node = MediaStreamAudioSourceNode::create(this, mediaStream, audioTrack, provider.release()); + MediaStreamAudioSourceNode* node = MediaStreamAudioSourceNode::create(*this, *mediaStream, audioTrack, provider.release()); // FIXME: Only stereo streams are supported right now. We should be able to accept multi-channel streams. node->mediaStreamAudioSourceHandler().setFormat(2, sampleRate()); @@ -378,38 +378,23 @@ MediaStreamAudioDestinationNode* AudioContext::createMediaStreamDestination(Exce } // Set number of output channels to stereo by default. - return MediaStreamAudioDestinationNode::create(this, 2); + return MediaStreamAudioDestinationNode::create(*this, 2); } ScriptProcessorNode* AudioContext::createScriptProcessor(ExceptionState& exceptionState) { - if (isContextClosed()) { - throwExceptionForClosedState(exceptionState); - return nullptr; - } - // Set number of input/output channels to stereo by default. return createScriptProcessor(0, 2, 2, exceptionState); } ScriptProcessorNode* AudioContext::createScriptProcessor(size_t bufferSize, ExceptionState& exceptionState) { - if (isContextClosed()) { - throwExceptionForClosedState(exceptionState); - return nullptr; - } - // Set number of input/output channels to stereo by default. return createScriptProcessor(bufferSize, 2, 2, exceptionState); } ScriptProcessorNode* AudioContext::createScriptProcessor(size_t bufferSize, size_t numberOfInputChannels, ExceptionState& exceptionState) { - if (isContextClosed()) { - throwExceptionForClosedState(exceptionState); - return nullptr; - } - // Set number of output channels to stereo by default. return createScriptProcessor(bufferSize, numberOfInputChannels, 2, exceptionState); } @@ -423,7 +408,7 @@ ScriptProcessorNode* AudioContext::createScriptProcessor(size_t bufferSize, size return nullptr; } - ScriptProcessorNode* node = ScriptProcessorNode::create(this, sampleRate(), bufferSize, numberOfInputChannels, numberOfOutputChannels); + ScriptProcessorNode* node = ScriptProcessorNode::create(*this, sampleRate(), bufferSize, numberOfInputChannels, numberOfOutputChannels); if (!node) { if (!numberOfInputChannels && !numberOfOutputChannels) { @@ -463,7 +448,7 @@ StereoPannerNode* AudioContext::createStereoPanner(ExceptionState& exceptionStat return nullptr; } - return StereoPannerNode::create(this, sampleRate()); + return StereoPannerNode::create(*this, sampleRate()); } BiquadFilterNode* AudioContext::createBiquadFilter(ExceptionState& exceptionState) @@ -474,7 +459,7 @@ BiquadFilterNode* AudioContext::createBiquadFilter(ExceptionState& exceptionStat return nullptr; } - return BiquadFilterNode::create(this, sampleRate()); + return BiquadFilterNode::create(*this, sampleRate()); } WaveShaperNode* AudioContext::createWaveShaper(ExceptionState& exceptionState) @@ -485,7 +470,7 @@ WaveShaperNode* AudioContext::createWaveShaper(ExceptionState& exceptionState) return nullptr; } - return WaveShaperNode::create(this); + return WaveShaperNode::create(*this); } PannerNode* AudioContext::createPanner(ExceptionState& exceptionState) @@ -496,7 +481,7 @@ PannerNode* AudioContext::createPanner(ExceptionState& exceptionState) return nullptr; } - return PannerNode::create(this, sampleRate()); + return PannerNode::create(*this, sampleRate()); } ConvolverNode* AudioContext::createConvolver(ExceptionState& exceptionState) @@ -507,7 +492,7 @@ ConvolverNode* AudioContext::createConvolver(ExceptionState& exceptionState) return nullptr; } - return ConvolverNode::create(this, sampleRate()); + return ConvolverNode::create(*this, sampleRate()); } DynamicsCompressorNode* AudioContext::createDynamicsCompressor(ExceptionState& exceptionState) @@ -518,7 +503,7 @@ DynamicsCompressorNode* AudioContext::createDynamicsCompressor(ExceptionState& e return nullptr; } - return DynamicsCompressorNode::create(this, sampleRate()); + return DynamicsCompressorNode::create(*this, sampleRate()); } AnalyserNode* AudioContext::createAnalyser(ExceptionState& exceptionState) @@ -529,7 +514,7 @@ AnalyserNode* AudioContext::createAnalyser(ExceptionState& exceptionState) return nullptr; } - return AnalyserNode::create(this, sampleRate()); + return AnalyserNode::create(*this, sampleRate()); } GainNode* AudioContext::createGain(ExceptionState& exceptionState) @@ -540,16 +525,11 @@ GainNode* AudioContext::createGain(ExceptionState& exceptionState) return nullptr; } - return GainNode::create(this, sampleRate()); + return GainNode::create(*this, sampleRate()); } DelayNode* AudioContext::createDelay(ExceptionState& exceptionState) { - if (isContextClosed()) { - throwExceptionForClosedState(exceptionState); - return nullptr; - } - const double defaultMaxDelayTime = 1; return createDelay(defaultMaxDelayTime, exceptionState); } @@ -562,19 +542,11 @@ DelayNode* AudioContext::createDelay(double maxDelayTime, ExceptionState& except return nullptr; } - DelayNode* node = DelayNode::create(this, sampleRate(), maxDelayTime, exceptionState); - if (exceptionState.hadException()) - return nullptr; - return node; + return DelayNode::create(*this, sampleRate(), maxDelayTime, exceptionState); } ChannelSplitterNode* AudioContext::createChannelSplitter(ExceptionState& exceptionState) { - if (isContextClosed()) { - throwExceptionForClosedState(exceptionState); - return nullptr; - } - const unsigned ChannelSplitterDefaultNumberOfOutputs = 6; return createChannelSplitter(ChannelSplitterDefaultNumberOfOutputs, exceptionState); } @@ -588,7 +560,7 @@ ChannelSplitterNode* AudioContext::createChannelSplitter(size_t numberOfOutputs, return nullptr; } - ChannelSplitterNode* node = ChannelSplitterNode::create(this, sampleRate(), numberOfOutputs); + ChannelSplitterNode* node = ChannelSplitterNode::create(*this, sampleRate(), numberOfOutputs); if (!node) { exceptionState.throwDOMException( @@ -604,11 +576,6 @@ ChannelSplitterNode* AudioContext::createChannelSplitter(size_t numberOfOutputs, ChannelMergerNode* AudioContext::createChannelMerger(ExceptionState& exceptionState) { - if (isContextClosed()) { - throwExceptionForClosedState(exceptionState); - return nullptr; - } - const unsigned ChannelMergerDefaultNumberOfInputs = 6; return createChannelMerger(ChannelMergerDefaultNumberOfInputs, exceptionState); } @@ -621,7 +588,7 @@ ChannelMergerNode* AudioContext::createChannelMerger(size_t numberOfInputs, Exce return nullptr; } - ChannelMergerNode* node = ChannelMergerNode::create(this, sampleRate(), numberOfInputs); + ChannelMergerNode* node = ChannelMergerNode::create(*this, sampleRate(), numberOfInputs); if (!node) { exceptionState.throwDOMException( @@ -643,7 +610,7 @@ OscillatorNode* AudioContext::createOscillator(ExceptionState& exceptionState) return nullptr; } - OscillatorNode* node = OscillatorNode::create(this, sampleRate()); + OscillatorNode* node = OscillatorNode::create(*this, sampleRate()); // Do not add a reference to this source node now. The reference will be added when start() is // called. @@ -1010,14 +977,6 @@ void AudioContext::unregisterLiveNode(AudioNode& node) m_liveNodes.remove(&node); } -void DeferredTaskHandler::disposeOutputs(AudioHandler& node) -{ - ASSERT(isGraphOwner()); - ASSERT(isMainThread()); - for (unsigned i = 0; i < node.numberOfOutputs(); ++i) - node.output(i)->dispose(); -} - void DeferredTaskHandler::markSummingJunctionDirty(AudioSummingJunction* summingJunction) { ASSERT(isGraphOwner()); diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.h b/third_party/WebKit/Source/modules/webaudio/AudioContext.h index 7db4997..6e17e01 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContext.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.h @@ -109,7 +109,6 @@ public: void markAudioNodeOutputDirty(AudioNodeOutput*); void removeMarkedAudioNodeOutput(AudioNodeOutput*); - void disposeOutputs(AudioHandler&); // In AudioNode::breakConnection() and deref(), a tryLock() is used for // calling actual processing, but if it fails keep track here. @@ -174,13 +173,8 @@ private: HashSet<AudioHandler*> m_deferredCountModeChange; // These two HashSet must be accessed only when the graph lock is held. - // Oilpan: These HashSet should be HeapHashSet<WeakMember<AudioNodeOutput>> - // ideally. But it's difficult to lock them correctly during GC. - // Oilpan: Since items are added to these hash sets by the audio thread (not - // registered to Oilpan), we cannot use HeapHashSets. - GC_PLUGIN_IGNORE("http://crbug.com/404527") + // These raw pointers are safe because their destructors unregister them. HashSet<AudioSummingJunction*> m_dirtySummingJunctions; - GC_PLUGIN_IGNORE("http://crbug.com/404527") HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs; // Only accessed in the audio thread. diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp index b123e6e..5b3c78e 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp @@ -100,7 +100,8 @@ void AudioHandler::dispose() context()->handler().removeChangedChannelCountMode(this); context()->handler().removeAutomaticPullNode(this); - context()->handler().disposeOutputs(*this); + for (auto& output : m_outputs) + output->dispose(); } String AudioHandler::nodeTypeName() const diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp index ffd14c9..f202e0c 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp @@ -194,15 +194,14 @@ void AudioParamHandler::disconnect(AudioNodeOutput& output) // ---------------------------------------------------------------- -AudioParam::AudioParam(AudioContext* context, double defaultValue) +AudioParam::AudioParam(AudioContext& context, double defaultValue) : m_handler(AudioParamHandler::create(context, defaultValue)) , m_context(context) { } -AudioParam* AudioParam::create(AudioContext* context, double defaultValue) +AudioParam* AudioParam::create(AudioContext& context, double defaultValue) { - ASSERT(context); return new AudioParam(context, defaultValue); } diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.h b/third_party/WebKit/Source/modules/webaudio/AudioParam.h index efd4e22..6052e1a 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParam.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.h @@ -54,7 +54,7 @@ public: static const double DefaultSmoothingConstant; static const double SnapThreshold; - static PassRefPtr<AudioParamHandler> create(AudioContext* context, double defaultValue) + static PassRefPtr<AudioParamHandler> create(AudioContext& context, double defaultValue) { return adoptRef(new AudioParamHandler(context, defaultValue)); } @@ -100,12 +100,12 @@ public: void disconnect(AudioNodeOutput&); private: - AudioParamHandler(AudioContext* context, double defaultValue) - : AudioSummingJunction(context->handler()) + AudioParamHandler(AudioContext& context, double defaultValue) + : AudioSummingJunction(context.handler()) , m_value(defaultValue) , m_defaultValue(defaultValue) , m_smoothedValue(defaultValue) - , m_context(*context) { } + , m_context(context) { } // sampleAccurate corresponds to a-rate (audio rate) vs. k-rate in the Web Audio specification. void calculateFinalValues(float* values, unsigned numberOfValues, bool sampleAccurate); @@ -128,7 +128,7 @@ private: class AudioParam final : public GarbageCollectedFinalized<AudioParam>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: - static AudioParam* create(AudioContext*, double defaultValue); + static AudioParam* create(AudioContext&, double defaultValue); DECLARE_TRACE(); // |handler| always returns a valid object. AudioParamHandler& handler() const { return *m_handler; } @@ -146,7 +146,7 @@ public: void cancelScheduledValues(double startTime, ExceptionState&); private: - AudioParam(AudioContext*, double defaultValue); + AudioParam(AudioContext&, double defaultValue); RefPtr<AudioParamHandler> m_handler; Member<AudioContext> m_context; diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp index e9e3631..0957cf2 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp @@ -28,14 +28,14 @@ namespace blink { -BiquadFilterNode::BiquadFilterNode(AudioContext* context, float sampleRate) - : AudioNode(*context) +BiquadFilterNode::BiquadFilterNode(AudioContext& context, float sampleRate) + : AudioNode(context) , m_frequency(AudioParam::create(context, 350.0)) , m_q(AudioParam::create(context, 1)) , m_gain(AudioParam::create(context, 0.0)) , m_detune(AudioParam::create(context, 0.0)) { - setHandler(new AudioBasicProcessorHandler(AudioHandler::NodeTypeBiquadFilter, *this, sampleRate, adoptPtr(new BiquadProcessor(sampleRate, 1, m_frequency->handler(), m_q->handler(), m_gain->handler(), m_detune->handler(), false)))); + setHandler(new AudioBasicProcessorHandler(AudioHandler::NodeTypeBiquadFilter, *this, sampleRate, adoptPtr(new BiquadProcessor(sampleRate, 1, m_frequency->handler(), m_q->handler(), m_gain->handler(), m_detune->handler())))); } DEFINE_TRACE(BiquadFilterNode) diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h index b28dd33..172e003 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h +++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h @@ -48,7 +48,7 @@ public: ALLPASS = 7 }; - static BiquadFilterNode* create(AudioContext* context, float sampleRate) + static BiquadFilterNode* create(AudioContext& context, float sampleRate) { return new BiquadFilterNode(context, sampleRate); } @@ -67,7 +67,7 @@ public: void getFrequencyResponse(const DOMFloat32Array* frequencyHz, DOMFloat32Array* magResponse, DOMFloat32Array* phaseResponse); private: - BiquadFilterNode(AudioContext*, float sampleRate); + BiquadFilterNode(AudioContext&, float sampleRate); BiquadProcessor* biquadProcessor() const; bool setType(unsigned); // Returns true on success. diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadProcessor.cpp b/third_party/WebKit/Source/modules/webaudio/BiquadProcessor.cpp index afa46c9..e67f9b5 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadProcessor.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BiquadProcessor.cpp @@ -30,7 +30,7 @@ namespace blink { -BiquadProcessor::BiquadProcessor(float sampleRate, size_t numberOfChannels, AudioParamHandler& frequency, AudioParamHandler& q, AudioParamHandler& gain, AudioParamHandler& detune, bool autoInitialize) +BiquadProcessor::BiquadProcessor(float sampleRate, size_t numberOfChannels, AudioParamHandler& frequency, AudioParamHandler& q, AudioParamHandler& gain, AudioParamHandler& detune) : AudioDSPKernelProcessor(sampleRate, numberOfChannels) , m_type(LowPass) , m_parameter1(frequency) @@ -40,8 +40,6 @@ BiquadProcessor::BiquadProcessor(float sampleRate, size_t numberOfChannels, Audi , m_filterCoefficientsDirty(true) , m_hasSampleAccurateValues(false) { - if (autoInitialize) - initialize(); } BiquadProcessor::~BiquadProcessor() diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadProcessor.h b/third_party/WebKit/Source/modules/webaudio/BiquadProcessor.h index f333a3c..5255ffd 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadProcessor.h +++ b/third_party/WebKit/Source/modules/webaudio/BiquadProcessor.h @@ -49,7 +49,7 @@ public: Allpass = 7 }; - BiquadProcessor(float sampleRate, size_t numberOfChannels, AudioParamHandler& frequency, AudioParamHandler& q, AudioParamHandler& gain, AudioParamHandler& detune, bool autoInitialize); + BiquadProcessor(float sampleRate, size_t numberOfChannels, AudioParamHandler& frequency, AudioParamHandler& q, AudioParamHandler& gain, AudioParamHandler& detune); virtual ~BiquadProcessor(); virtual PassOwnPtr<AudioDSPKernel> createKernel() override; diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.cpp b/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.cpp index f1f9e4e..ed14245 100644 --- a/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.cpp @@ -130,11 +130,11 @@ ChannelMergerNode::ChannelMergerNode(AudioContext& context, float sampleRate, un setHandler(new ChannelMergerHandler(*this, sampleRate, numberOfInputs)); } -ChannelMergerNode* ChannelMergerNode::create(AudioContext* context, float sampleRate, unsigned numberOfInputs) +ChannelMergerNode* ChannelMergerNode::create(AudioContext& context, float sampleRate, unsigned numberOfInputs) { if (!numberOfInputs || numberOfInputs > AudioContext::maxNumberOfChannels()) return nullptr; - return new ChannelMergerNode(*context, sampleRate, numberOfInputs); + return new ChannelMergerNode(context, sampleRate, numberOfInputs); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.h b/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.h index e2edf67..0eddddf 100644 --- a/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.h +++ b/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.h @@ -48,7 +48,7 @@ public: class ChannelMergerNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static ChannelMergerNode* create(AudioContext*, float sampleRate, unsigned numberOfInputs); + static ChannelMergerNode* create(AudioContext&, float sampleRate, unsigned numberOfInputs); private: ChannelMergerNode(AudioContext&, float sampleRate, unsigned numberOfInputs); diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp index 93b00d4..df042c2 100644 --- a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp @@ -75,11 +75,11 @@ ChannelSplitterNode::ChannelSplitterNode(AudioContext& context, float sampleRate setHandler(new ChannelSplitterHandler(*this, sampleRate, numberOfOutputs)); } -ChannelSplitterNode* ChannelSplitterNode::create(AudioContext* context, float sampleRate, unsigned numberOfOutputs) +ChannelSplitterNode* ChannelSplitterNode::create(AudioContext& context, float sampleRate, unsigned numberOfOutputs) { if (!numberOfOutputs || numberOfOutputs > AudioContext::maxNumberOfChannels()) return nullptr; - return new ChannelSplitterNode(*context, sampleRate, numberOfOutputs); + return new ChannelSplitterNode(context, sampleRate, numberOfOutputs); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h index e29a7a2d..41260fe 100644 --- a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h +++ b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h @@ -43,7 +43,7 @@ public: class ChannelSplitterNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static ChannelSplitterNode* create(AudioContext*, float sampleRate, unsigned numberOfOutputs); + static ChannelSplitterNode* create(AudioContext&, float sampleRate, unsigned numberOfOutputs); private: ChannelSplitterNode(AudioContext&, float sampleRate, unsigned numberOfOutputs); diff --git a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp index 4252e79..191436c 100644 --- a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp @@ -195,9 +195,9 @@ ConvolverNode::ConvolverNode(AudioContext& context, float sampleRate) setHandler(new ConvolverHandler(*this, sampleRate)); } -ConvolverNode* ConvolverNode::create(AudioContext* context, float sampleRate) +ConvolverNode* ConvolverNode::create(AudioContext& context, float sampleRate) { - return new ConvolverNode(*context, sampleRate); + return new ConvolverNode(context, sampleRate); } ConvolverHandler& ConvolverNode::convolverHandler() const diff --git a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.h b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.h index f9d97de..64d4801 100644 --- a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.h +++ b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.h @@ -73,7 +73,7 @@ private: class ConvolverNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static ConvolverNode* create(AudioContext*, float sampleRate); + static ConvolverNode* create(AudioContext&, float sampleRate); AudioBuffer* buffer() const; void setBuffer(AudioBuffer*, ExceptionState&); diff --git a/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp b/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp index 6958ff0..9a423b1 100644 --- a/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp @@ -35,14 +35,14 @@ namespace blink { const double maximumAllowedDelayTime = 180; -DelayNode::DelayNode(AudioContext* context, float sampleRate, double maxDelayTime) - : AudioNode(*context) +DelayNode::DelayNode(AudioContext& context, float sampleRate, double maxDelayTime) + : AudioNode(context) , m_delayTime(AudioParam::create(context, 0.0)) { setHandler(new AudioBasicProcessorHandler(AudioHandler::NodeTypeDelay, *this, sampleRate, adoptPtr(new DelayProcessor(sampleRate, 1, m_delayTime->handler(), maxDelayTime)))); } -DelayNode* DelayNode::create(AudioContext* context, float sampleRate, double maxDelayTime, ExceptionState& exceptionState) +DelayNode* DelayNode::create(AudioContext& context, float sampleRate, double maxDelayTime, ExceptionState& exceptionState) { if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime) { exceptionState.throwDOMException( diff --git a/third_party/WebKit/Source/modules/webaudio/DelayNode.h b/third_party/WebKit/Source/modules/webaudio/DelayNode.h index d64f998..494dea7 100644 --- a/third_party/WebKit/Source/modules/webaudio/DelayNode.h +++ b/third_party/WebKit/Source/modules/webaudio/DelayNode.h @@ -36,12 +36,12 @@ class ExceptionState; class DelayNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static DelayNode* create(AudioContext*, float sampleRate, double maxDelayTime, ExceptionState&); + static DelayNode* create(AudioContext&, float sampleRate, double maxDelayTime, ExceptionState&); DECLARE_VIRTUAL_TRACE(); AudioParam* delayTime(); private: - DelayNode(AudioContext*, float sampleRate, double maxDelayTime); + DelayNode(AudioContext&, float sampleRate, double maxDelayTime); Member<AudioParam> m_delayTime; }; diff --git a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp index 8fe6fdc..98ade09 100644 --- a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp @@ -125,19 +125,19 @@ double DynamicsCompressorHandler::latencyTime() const DynamicsCompressorNode::DynamicsCompressorNode(AudioContext& context, float sampleRate) : AudioNode(context) - , m_threshold(AudioParam::create(&context, -24)) - , m_knee(AudioParam::create(&context, 30)) - , m_ratio(AudioParam::create(&context, 12)) - , m_reduction(AudioParam::create(&context, 0)) - , m_attack(AudioParam::create(&context, 0.003)) - , m_release(AudioParam::create(&context, 0.250)) + , m_threshold(AudioParam::create(context, -24)) + , m_knee(AudioParam::create(context, 30)) + , m_ratio(AudioParam::create(context, 12)) + , m_reduction(AudioParam::create(context, 0)) + , m_attack(AudioParam::create(context, 0.003)) + , m_release(AudioParam::create(context, 0.250)) { setHandler(new DynamicsCompressorHandler(*this, sampleRate, m_threshold->handler(), m_knee->handler(), m_ratio->handler(), m_reduction->handler(), m_attack->handler(), m_release->handler())); } -DynamicsCompressorNode* DynamicsCompressorNode::create(AudioContext* context, float sampleRate) +DynamicsCompressorNode* DynamicsCompressorNode::create(AudioContext& context, float sampleRate) { - return new DynamicsCompressorNode(*context, sampleRate); + return new DynamicsCompressorNode(context, sampleRate); } DEFINE_TRACE(DynamicsCompressorNode) diff --git a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.h b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.h index 6701cd8..ea7c707 100644 --- a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.h +++ b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.h @@ -61,7 +61,7 @@ private: class DynamicsCompressorNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static DynamicsCompressorNode* create(AudioContext*, float sampleRate); + static DynamicsCompressorNode* create(AudioContext&, float sampleRate); DECLARE_VIRTUAL_TRACE(); AudioParam* threshold() const; diff --git a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp index d0f4fe1..1b046e6 100644 --- a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp @@ -108,14 +108,14 @@ void GainHandler::checkNumberOfChannelsForInput(AudioNodeInput* input) GainNode::GainNode(AudioContext& context, float sampleRate) : AudioNode(context) - , m_gain(AudioParam::create(&context, 1.0)) + , m_gain(AudioParam::create(context, 1.0)) { setHandler(new GainHandler(*this, sampleRate, m_gain->handler())); } -GainNode* GainNode::create(AudioContext* context, float sampleRate) +GainNode* GainNode::create(AudioContext& context, float sampleRate) { - return new GainNode(*context, sampleRate); + return new GainNode(context, sampleRate); } AudioParam* GainNode::gain() const diff --git a/third_party/WebKit/Source/modules/webaudio/GainNode.h b/third_party/WebKit/Source/modules/webaudio/GainNode.h index db783f8..e03d19e 100644 --- a/third_party/WebKit/Source/modules/webaudio/GainNode.h +++ b/third_party/WebKit/Source/modules/webaudio/GainNode.h @@ -57,7 +57,7 @@ private: class GainNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static GainNode* create(AudioContext*, float sampleRate); + static GainNode* create(AudioContext&, float sampleRate); DECLARE_VIRTUAL_TRACE(); AudioParam* gain() const; diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp index ecf6d24..cd83fa5 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp @@ -37,7 +37,7 @@ namespace blink { -MediaElementAudioSourceHandler::MediaElementAudioSourceHandler(AudioNode& node, HTMLMediaElement* mediaElement) +MediaElementAudioSourceHandler::MediaElementAudioSourceHandler(AudioNode& node, HTMLMediaElement& mediaElement) : AudioHandler(NodeTypeMediaElementAudioSource, node, node.context()->sampleRate()) , m_mediaElement(mediaElement) , m_sourceNumberOfChannels(0) @@ -164,15 +164,15 @@ DEFINE_TRACE(MediaElementAudioSourceHandler) // ---------------------------------------------------------------- -MediaElementAudioSourceNode::MediaElementAudioSourceNode(AudioContext& context, HTMLMediaElement* mediaElement) +MediaElementAudioSourceNode::MediaElementAudioSourceNode(AudioContext& context, HTMLMediaElement& mediaElement) : AudioSourceNode(context) { setHandler(new MediaElementAudioSourceHandler(*this, mediaElement)); } -MediaElementAudioSourceNode* MediaElementAudioSourceNode::create(AudioContext* context, HTMLMediaElement* mediaElement) +MediaElementAudioSourceNode* MediaElementAudioSourceNode::create(AudioContext& context, HTMLMediaElement& mediaElement) { - return new MediaElementAudioSourceNode(*context, mediaElement); + return new MediaElementAudioSourceNode(context, mediaElement); } MediaElementAudioSourceHandler& MediaElementAudioSourceNode::mediaElementAudioSourceHandler() const diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h index db1919c..fa5204d 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h +++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h @@ -42,7 +42,7 @@ class HTMLMediaElement; class MediaElementAudioSourceHandler final : public AudioHandler, public AudioSourceProviderClient { USING_GARBAGE_COLLECTED_MIXIN(MediaElementAudioSourceHandler); public: - MediaElementAudioSourceHandler(AudioNode&, HTMLMediaElement*); + MediaElementAudioSourceHandler(AudioNode&, HTMLMediaElement&); virtual ~MediaElementAudioSourceHandler(); HTMLMediaElement* mediaElement() { return m_mediaElement.get(); } @@ -77,13 +77,13 @@ private: class MediaElementAudioSourceNode final : public AudioSourceNode { DEFINE_WRAPPERTYPEINFO(); public: - static MediaElementAudioSourceNode* create(AudioContext*, HTMLMediaElement*); + static MediaElementAudioSourceNode* create(AudioContext&, HTMLMediaElement&); MediaElementAudioSourceHandler& mediaElementAudioSourceHandler() const; HTMLMediaElement* mediaElement() const; private: - MediaElementAudioSourceNode(AudioContext&, HTMLMediaElement*); + MediaElementAudioSourceNode(AudioContext&, HTMLMediaElement&); }; } // namespace blink diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp index 9548fee..dc41ab2 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp @@ -82,9 +82,9 @@ MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext& c setHandler(new MediaStreamAudioDestinationHandler(*this, numberOfChannels)); } -MediaStreamAudioDestinationNode* MediaStreamAudioDestinationNode::create(AudioContext* context, size_t numberOfChannels) +MediaStreamAudioDestinationNode* MediaStreamAudioDestinationNode::create(AudioContext& context, size_t numberOfChannels) { - return new MediaStreamAudioDestinationNode(*context, numberOfChannels); + return new MediaStreamAudioDestinationNode(context, numberOfChannels); } MediaStream* MediaStreamAudioDestinationNode::stream() const diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.h b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.h index 38f6901..6181142 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.h +++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.h @@ -61,7 +61,7 @@ private: class MediaStreamAudioDestinationNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static MediaStreamAudioDestinationNode* create(AudioContext*, size_t numberOfChannels); + static MediaStreamAudioDestinationNode* create(AudioContext&, size_t numberOfChannels); MediaStream* stream() const; private: diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp index 5454237..8cf5fac 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp @@ -33,7 +33,7 @@ namespace blink { -MediaStreamAudioSourceHandler::MediaStreamAudioSourceHandler(AudioNode& node, MediaStream* mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSourceProvider> audioSourceProvider) +MediaStreamAudioSourceHandler::MediaStreamAudioSourceHandler(AudioNode& node, MediaStream& mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSourceProvider> audioSourceProvider) : AudioHandler(NodeTypeMediaStreamAudioSource, node, node.context()->sampleRate()) , m_mediaStream(mediaStream) , m_audioTrack(audioTrack) @@ -120,15 +120,15 @@ DEFINE_TRACE(MediaStreamAudioSourceHandler) // ---------------------------------------------------------------- -MediaStreamAudioSourceNode::MediaStreamAudioSourceNode(AudioContext& context, MediaStream* mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSourceProvider> audioSourceProvider) +MediaStreamAudioSourceNode::MediaStreamAudioSourceNode(AudioContext& context, MediaStream& mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSourceProvider> audioSourceProvider) : AudioSourceNode(context) { setHandler(new MediaStreamAudioSourceHandler(*this, mediaStream, audioTrack, audioSourceProvider)); } -MediaStreamAudioSourceNode* MediaStreamAudioSourceNode::create(AudioContext* context, MediaStream* mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSourceProvider> audioSourceProvider) +MediaStreamAudioSourceNode* MediaStreamAudioSourceNode::create(AudioContext& context, MediaStream& mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSourceProvider> audioSourceProvider) { - return new MediaStreamAudioSourceNode(*context, mediaStream, audioTrack, audioSourceProvider); + return new MediaStreamAudioSourceNode(context, mediaStream, audioTrack, audioSourceProvider); } MediaStreamAudioSourceHandler& MediaStreamAudioSourceNode::mediaStreamAudioSourceHandler() const diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h index 4264451..b385afe 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h +++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h @@ -42,7 +42,7 @@ class AudioContext; class MediaStreamAudioSourceHandler final : public AudioHandler, public AudioSourceProviderClient { USING_GARBAGE_COLLECTED_MIXIN(MediaStreamAudioSourceHandler); public: - MediaStreamAudioSourceHandler(AudioNode&, MediaStream*, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); + MediaStreamAudioSourceHandler(AudioNode&, MediaStream&, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); virtual ~MediaStreamAudioSourceHandler(); MediaStream* mediaStream() { return m_mediaStream.get(); } @@ -74,13 +74,13 @@ private: class MediaStreamAudioSourceNode final : public AudioSourceNode { DEFINE_WRAPPERTYPEINFO(); public: - static MediaStreamAudioSourceNode* create(AudioContext*, MediaStream*, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); + static MediaStreamAudioSourceNode* create(AudioContext&, MediaStream&, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); MediaStreamAudioSourceHandler& mediaStreamAudioSourceHandler() const; MediaStream* mediaStream() const; private: - MediaStreamAudioSourceNode(AudioContext&, MediaStream*, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); + MediaStreamAudioSourceNode(AudioContext&, MediaStream&, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); }; } // namespace blink diff --git a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp index c16ecf6..8074db7 100644 --- a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp @@ -343,16 +343,16 @@ DEFINE_TRACE(OscillatorHandler) OscillatorNode::OscillatorNode(AudioContext& context, float sampleRate) : AudioScheduledSourceNode(context) // Use musical pitch standard A440 as a default. - , m_frequency(AudioParam::create(&context, 440)) + , m_frequency(AudioParam::create(context, 440)) // Default to no detuning. - , m_detune(AudioParam::create(&context, 0)) + , m_detune(AudioParam::create(context, 0)) { setHandler(new OscillatorHandler(*this, sampleRate, m_frequency->handler(), m_detune->handler())); } -OscillatorNode* OscillatorNode::create(AudioContext* context, float sampleRate) +OscillatorNode* OscillatorNode::create(AudioContext& context, float sampleRate) { - return new OscillatorNode(*context, sampleRate); + return new OscillatorNode(context, sampleRate); } DEFINE_TRACE(OscillatorNode) diff --git a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.h b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.h index 9e0bf91..8dcd5af 100644 --- a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.h +++ b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.h @@ -102,7 +102,7 @@ private: class OscillatorNode final : public AudioScheduledSourceNode { DEFINE_WRAPPERTYPEINFO(); public: - static OscillatorNode* create(AudioContext*, float sampleRate); + static OscillatorNode* create(AudioContext&, float sampleRate); DECLARE_VIRTUAL_TRACE(); String type() const; diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp index 36ad422..e2cd990 100644 --- a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp @@ -589,9 +589,9 @@ PannerNode::PannerNode(AudioContext& context, float sampelRate) setHandler(new PannerHandler(*this, sampelRate)); } -PannerNode* PannerNode::create(AudioContext* context, float sampleRate) +PannerNode* PannerNode::create(AudioContext& context, float sampleRate) { - return new PannerNode(*context, sampleRate); + return new PannerNode(context, sampleRate); } PannerHandler& PannerNode::pannerHandler() const diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.h b/third_party/WebKit/Source/modules/webaudio/PannerNode.h index b1eff63..7028e44 100644 --- a/third_party/WebKit/Source/modules/webaudio/PannerNode.h +++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.h @@ -153,7 +153,7 @@ private: class PannerNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static PannerNode* create(AudioContext*, float sampleRate); + static PannerNode* create(AudioContext&, float sampleRate); PannerHandler& pannerHandler() const; String panningModel() const; diff --git a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp index 00240dd..2e42e1f 100644 --- a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp @@ -281,7 +281,7 @@ static size_t chooseBufferSize() return bufferSize; } -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) { @@ -309,7 +309,7 @@ ScriptProcessorNode* ScriptProcessorNode::create(AudioContext* context, float sa if (numberOfOutputChannels > AudioContext::maxNumberOfChannels()) return nullptr; - return new ScriptProcessorNode(*context, sampleRate, bufferSize, numberOfInputChannels, numberOfOutputChannels); + return new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInputChannels, numberOfOutputChannels); } size_t ScriptProcessorNode::bufferSize() const diff --git a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.h b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.h index 25f00cf..95fabf2 100644 --- a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.h +++ b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.h @@ -97,7 +97,7 @@ public: // latency. Higher numbers will be necessary to avoid audio breakup and // glitches. // The value chosen must carefully balance between latency and audio quality. - static ScriptProcessorNode* create(AudioContext*, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels); + static ScriptProcessorNode* create(AudioContext&, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels); DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess); size_t bufferSize() const; diff --git a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp index 21e16fe..d3a1419 100644 --- a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp @@ -153,14 +153,14 @@ void StereoPannerHandler::setChannelCountMode(const String& mode, ExceptionState StereoPannerNode::StereoPannerNode(AudioContext& context, float sampleRate) : AudioNode(context) - , m_pan(AudioParam::create(&context, 0)) + , m_pan(AudioParam::create(context, 0)) { setHandler(new StereoPannerHandler(*this, sampleRate, m_pan->handler())); } -StereoPannerNode* StereoPannerNode::create(AudioContext* context, float sampleRate) +StereoPannerNode* StereoPannerNode::create(AudioContext& context, float sampleRate) { - return new StereoPannerNode(*context, sampleRate); + return new StereoPannerNode(context, sampleRate); } DEFINE_TRACE(StereoPannerNode) diff --git a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.h b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.h index 4f4bc48..b78d70e 100644 --- a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.h +++ b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.h @@ -37,7 +37,7 @@ private: class StereoPannerNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static StereoPannerNode* create(AudioContext*, float sampleRate); + static StereoPannerNode* create(AudioContext&, float sampleRate); DECLARE_VIRTUAL_TRACE(); AudioParam* pan() const; diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp index bc3c734..3c3446a 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp @@ -33,10 +33,10 @@ namespace blink { -WaveShaperNode::WaveShaperNode(AudioContext* context) - : AudioNode(*context) +WaveShaperNode::WaveShaperNode(AudioContext& context) + : AudioNode(context) { - setHandler(new AudioBasicProcessorHandler(AudioHandler::NodeTypeWaveShaper, *this, context->sampleRate(), adoptPtr(new WaveShaperProcessor(context->sampleRate(), 1)))); + setHandler(new AudioBasicProcessorHandler(AudioHandler::NodeTypeWaveShaper, *this, context.sampleRate(), adoptPtr(new WaveShaperProcessor(context.sampleRate(), 1)))); handler().initialize(); } diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h index ffc989b..28ffc31 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h @@ -37,7 +37,7 @@ class ExceptionState; class WaveShaperNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); public: - static WaveShaperNode* create(AudioContext* context) + static WaveShaperNode* create(AudioContext& context) { return new WaveShaperNode(context); } @@ -50,7 +50,7 @@ public: String oversample() const; private: - explicit WaveShaperNode(AudioContext*); + explicit WaveShaperNode(AudioContext&); WaveShaperProcessor* waveShaperProcessor() const; }; |