Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp |
| diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp |
| index bcdae9ae5313d3cb6a05abc663267b226e3c5d45..0aa13e19d10e14c1223e2625d3dfb4c93de92b55 100644 |
| --- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp |
| +++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp |
| @@ -154,11 +154,11 @@ bool AudioBufferSourceHandler::renderSilenceAndFinishIfNotLooping(AudioBus*, uns |
| bool AudioBufferSourceHandler::renderFromBuffer(AudioBus* bus, unsigned destinationFrameOffset, size_t numberOfFrames) |
| { |
| - ASSERT(context()->isAudioThread()); |
| + DCHECK(context()->isAudioThread()); |
| // Basic sanity checking |
| - ASSERT(bus); |
| - ASSERT(buffer()); |
| + DCHECK(bus); |
| + DCHECK(buffer()); |
| if (!bus || !buffer()) |
| return false; |
| @@ -166,7 +166,7 @@ bool AudioBufferSourceHandler::renderFromBuffer(AudioBus* bus, unsigned destinat |
| unsigned busNumberOfChannels = bus->numberOfChannels(); |
| bool channelCountGood = numberOfChannels && numberOfChannels == busNumberOfChannels; |
| - ASSERT(channelCountGood); |
| + DCHECK(channelCountGood); |
| if (!channelCountGood) |
| return false; |
| @@ -174,12 +174,12 @@ bool AudioBufferSourceHandler::renderFromBuffer(AudioBus* bus, unsigned destinat |
| size_t destinationLength = bus->length(); |
| bool isLengthGood = destinationLength <= 4096 && numberOfFrames <= 4096; |
| - ASSERT(isLengthGood); |
| + DCHECK(isLengthGood); |
| if (!isLengthGood) |
| return false; |
| bool isOffsetGood = destinationFrameOffset <= destinationLength && destinationFrameOffset + numberOfFrames <= destinationLength; |
| - ASSERT(isOffsetGood); |
| + DCHECK(isOffsetGood); |
| if (!isOffsetGood) |
| return false; |
| @@ -243,9 +243,9 @@ bool AudioBufferSourceHandler::renderFromBuffer(AudioBus* bus, unsigned destinat |
| const float** sourceChannels = m_sourceChannels.get(); |
| float** destinationChannels = m_destinationChannels.get(); |
| - ASSERT(virtualReadIndex >= 0); |
| - ASSERT(virtualDeltaFrames >= 0); |
| - ASSERT(virtualEndFrame >= 0); |
| + DCHECK_GE(virtualReadIndex, 0); |
| + DCHECK_GE(virtualDeltaFrames, 0); |
| + DCHECK_GE(virtualEndFrame, 0); |
| // Optimize for the very common case of playing back with computedPlaybackRate == 1. |
| // We can avoid the linear interpolation. |
| @@ -267,9 +267,9 @@ bool AudioBufferSourceHandler::renderFromBuffer(AudioBus* bus, unsigned destinat |
| readIndex += framesThisTime; |
| framesToProcess -= framesThisTime; |
| - // It can happen that framesThisTime is 0. Assert that we will actually exit the loop in |
| + // It can happen that framesThisTime is 0. DCHECK that we will actually exit the loop in |
|
Raymond Toy
2016/08/10 16:29:15
The original "Assert" was correct.
|
| // this case. framesThisTime is 0 only if readIndex >= endFrame; |
| - ASSERT(framesThisTime ? true : readIndex >= endFrame); |
| + DCHECK(framesThisTime ? true : readIndex >= endFrame); |
| // Wrap-around. |
| if (readIndex >= endFrame) { |
| @@ -334,7 +334,7 @@ bool AudioBufferSourceHandler::renderFromBuffer(AudioBus* bus, unsigned destinat |
| void AudioBufferSourceHandler::setBuffer(AudioBuffer* buffer, ExceptionState& exceptionState) |
| { |
| - ASSERT(isMainThread()); |
| + DCHECK(isMainThread()); |
| if (m_buffer) { |
| exceptionState.throwDOMException( |
| @@ -393,7 +393,7 @@ unsigned AudioBufferSourceHandler::numberOfChannels() |
| void AudioBufferSourceHandler::clampGrainParameters(const AudioBuffer* buffer) |
| { |
| - ASSERT(buffer); |
| + DCHECK(buffer); |
| // We have a buffer so we can clip the offset and duration to lie within the buffer. |
| double bufferDuration = buffer->duration(); |
| @@ -440,7 +440,7 @@ void AudioBufferSourceHandler::start(double when, double grainOffset, double gra |
| void AudioBufferSourceHandler::startSource(double when, double grainOffset, double grainDuration, bool isDurationGiven, ExceptionState& exceptionState) |
| { |
| - ASSERT(isMainThread()); |
| + DCHECK(isMainThread()); |
| context()->recordUserGestureState(); |
| @@ -531,7 +531,7 @@ double AudioBufferSourceHandler::computePlaybackRate() |
| finalPlaybackRate = clampTo(finalPlaybackRate, 0.0, MaxRate); |
| bool isPlaybackRateValid = !std::isnan(finalPlaybackRate) && !std::isinf(finalPlaybackRate); |
| - ASSERT(isPlaybackRateValid); |
| + DCHECK(isPlaybackRateValid); |
| if (!isPlaybackRateValid) |
| finalPlaybackRate = 1.0; |