Make WebAudio API const-correct.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 20:01:09 +0000 (20:01 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 20:01:09 +0000 (20:01 +0000)
commitcfc0d70d383852c4c9c9e06ee02d4b6d20335dfa
tree01c6e724b43ad1b199c4dec4c82d22e910598f5d
parentbe1702851490d0b96913a836f77ab1ec3fa1caa9
Make WebAudio API const-correct.
https://bugs.webkit.org/show_bug.cgi?id=76573

Reviewed by Daniel Bates.

Source/WebCore:

No new tests; no net change in functionality, so covered by existing tests.

The non-const data() accessor was renamed mutableData() to expose const-correctness
bugs during compile time:
* platform/audio/AudioChannel.h:
(WebCore::AudioChannel::mutableData):

The following functions were made const correct:
* platform/audio/AudioArray.h:
(WebCore::AudioArray::copyToRange):
* platform/audio/AudioBus.h:
(WebCore::AudioBus::createBufferFromRange):
(WebCore::AudioBus::createBySampleRateConverting):
(WebCore::AudioBus::createByMixingToMono):
* platform/audio/FFTConvolver.cpp:
(WebCore::FFTConvolver::process):
* platform/audio/FFTConvolver.h:
* platform/audio/FFTFrame.cpp:
(WebCore::FFTFrame::doPaddedFFT):
(WebCore::FFTFrame::doFFT):
* platform/audio/FFTFrame.h:
* platform/audio/ReverbConvolverStage.cpp:
(WebCore::ReverbConvolverStage::ReverbConvolverStage):
(WebCore::ReverbConvolverStage::process):
* platform/audio/ReverbConvolverStage.h:
* platform/audio/ReverbInputBuffer.cpp:
(WebCore::ReverbInputBuffer::write):
* platform/audio/ReverbInputBuffer.h:
* platform/audio/SincResampler.cpp:
(WebCore::SincResampler::process):
* platform/audio/SincResampler.h:
* platform/audio/ZeroPole.cpp:
(WebCore::ZeroPole::process):
* platform/audio/ZeroPole.h:
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::channelByType):
* platform/audio/AudioBus.h:
(WebCore::AudioBus::gain):
* platform/audio/AudioDSPKernelProcessor.cpp:
(WebCore::AudioDSPKernelProcessor::process):
* platform/audio/AudioDSPKernelProcessor.h:
* platform/audio/AudioProcessor.h:
* platform/audio/DynamicsCompressor.cpp:
(WebCore::DynamicsCompressor::process):
* platform/audio/DynamicsCompressor.h:
* platform/audio/DynamicsCompressorKernel.cpp:
(WebCore::DynamicsCompressorKernel::process):
* platform/audio/DynamicsCompressorKernel.h:
* platform/audio/EqualPowerPanner.cpp:
(WebCore::EqualPowerPanner::pan):
* platform/audio/EqualPowerPanner.h:
* platform/audio/HRTFElevation.h:
(WebCore::HRTFElevation::numberOfAzimuths):
* platform/audio/HRTFPanner.cpp:
(WebCore::HRTFPanner::pan):
* platform/audio/HRTFPanner.h:
* platform/audio/Panner.h:
* platform/audio/Reverb.cpp:
(WebCore::Reverb::process):
* platform/audio/Reverb.h:
* platform/audio/ReverbConvolver.cpp:
(WebCore::ReverbConvolver::process):
* platform/audio/ReverbConvolver.h:
* platform/audio/ffmpeg/FFTFrameFFMPEG.cpp:
(WebCore::FFTFrame::doFFT):
* platform/audio/mkl/FFTFrameMKL.cpp:
(WebCore::FFTFrame::doFFT):

The following functions were modified to use the renamed mutableData() accessor:
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::processWithGainFromMonoStereo):
(WebCore::AudioBus::copyWithSampleAccurateGainValuesFrom):
* platform/audio/AudioChannel.cpp:
(WebCore::AudioChannel::scale):
(WebCore::AudioChannel::copyFrom):
(WebCore::AudioChannel::copyFromRange):
(WebCore::AudioChannel::sumFrom):
* platform/audio/AudioDSPKernelProcessor.cpp:
(WebCore::AudioDSPKernelProcessor::process):
* platform/audio/AudioResampler.cpp:
(WebCore::AudioResampler::process):
* platform/audio/DynamicsCompressor.cpp:
(WebCore::DynamicsCompressor::process):
* platform/audio/EqualPowerPanner.cpp:
(WebCore::EqualPowerPanner::pan):
* platform/audio/HRTFKernel.cpp:
(WebCore::extractAverageGroupDelay):
(WebCore::HRTFKernel::HRTFKernel):
(WebCore::HRTFKernel::createImpulseResponse):
* platform/audio/HRTFPanner.cpp:
(WebCore::HRTFPanner::pan):
* platform/audio/MultiChannelResampler.cpp:
(WebCore::MultiChannelResampler::process):
* platform/audio/Reverb.cpp:
(WebCore::Reverb::process):
* platform/audio/ReverbConvolver.cpp:
(WebCore::ReverbConvolver::ReverbConvolver):
(WebCore::ReverbConvolver::process):
* platform/audio/mac/AudioFileReaderMac.cpp:
(WebCore::AudioFileReader::createBus):
* platform/audio/mac/FFTFrameMac.cpp:
(WebCore::FFTFrame::doFFT):
* webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::process):
(WebCore::AudioBufferSourceNode::renderFromBuffer):
* webaudio/BiquadProcessor.cpp:
(WebCore::BiquadProcessor::process):
* webaudio/JavaScriptAudioNode.cpp:
(WebCore::JavaScriptAudioNode::process):
* webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::render):
* webaudio/RealtimeAnalyser.cpp:
(WebCore::RealtimeAnalyser::writeInput):
* webaudio/WaveShaperProcessor.cpp:
(WebCore::WaveShaperProcessor::process):

Source/WebKit/chromium:

The following functions were modified to use the renamed mutableData() accessor:
* src/AudioDestinationChromium.cpp:
(WebCore::AudioDestinationChromium::FIFO::fillBuffer):
(WebCore::AudioDestinationChromium::FIFO::consume):
* src/WebAudioData.cpp:
(WebCore::WebAudioBus::channelData):
* src/WebMediaPlayerClientImpl.cpp:
(WebKit::WebMediaPlayerClientImpl::AudioSourceProviderImpl::provideInput):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
54 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/audio/AudioArray.h
Source/WebCore/platform/audio/AudioBus.cpp
Source/WebCore/platform/audio/AudioBus.h
Source/WebCore/platform/audio/AudioChannel.cpp
Source/WebCore/platform/audio/AudioChannel.h
Source/WebCore/platform/audio/AudioDSPKernelProcessor.cpp
Source/WebCore/platform/audio/AudioDSPKernelProcessor.h
Source/WebCore/platform/audio/AudioProcessor.h
Source/WebCore/platform/audio/AudioResampler.cpp
Source/WebCore/platform/audio/DynamicsCompressor.cpp
Source/WebCore/platform/audio/DynamicsCompressor.h
Source/WebCore/platform/audio/DynamicsCompressorKernel.cpp
Source/WebCore/platform/audio/DynamicsCompressorKernel.h
Source/WebCore/platform/audio/EqualPowerPanner.cpp
Source/WebCore/platform/audio/EqualPowerPanner.h
Source/WebCore/platform/audio/FFTConvolver.cpp
Source/WebCore/platform/audio/FFTConvolver.h
Source/WebCore/platform/audio/FFTFrame.cpp
Source/WebCore/platform/audio/FFTFrame.h
Source/WebCore/platform/audio/HRTFElevation.h
Source/WebCore/platform/audio/HRTFKernel.cpp
Source/WebCore/platform/audio/HRTFPanner.cpp
Source/WebCore/platform/audio/HRTFPanner.h
Source/WebCore/platform/audio/MultiChannelResampler.cpp
Source/WebCore/platform/audio/Panner.h
Source/WebCore/platform/audio/Reverb.cpp
Source/WebCore/platform/audio/Reverb.h
Source/WebCore/platform/audio/ReverbConvolver.cpp
Source/WebCore/platform/audio/ReverbConvolver.h
Source/WebCore/platform/audio/ReverbConvolverStage.cpp
Source/WebCore/platform/audio/ReverbConvolverStage.h
Source/WebCore/platform/audio/ReverbInputBuffer.cpp
Source/WebCore/platform/audio/ReverbInputBuffer.h
Source/WebCore/platform/audio/SincResampler.cpp
Source/WebCore/platform/audio/SincResampler.h
Source/WebCore/platform/audio/ZeroPole.cpp
Source/WebCore/platform/audio/ZeroPole.h
Source/WebCore/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp
Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp
Source/WebCore/platform/audio/mac/FFTFrameMac.cpp
Source/WebCore/platform/audio/mkl/FFTFrameMKL.cpp
Source/WebCore/webaudio/AudioBufferSourceNode.cpp
Source/WebCore/webaudio/BiquadProcessor.cpp
Source/WebCore/webaudio/BiquadProcessor.h
Source/WebCore/webaudio/JavaScriptAudioNode.cpp
Source/WebCore/webaudio/OfflineAudioDestinationNode.cpp
Source/WebCore/webaudio/RealtimeAnalyser.cpp
Source/WebCore/webaudio/WaveShaperProcessor.cpp
Source/WebCore/webaudio/WaveShaperProcessor.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/AudioDestinationChromium.cpp
Source/WebKit/chromium/src/WebAudioBus.cpp
Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp