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

Unified Diff: third_party/WebKit/Source/platform/audio/AudioResamplerKernel.cpp

Issue 2803073002: Convert RELEASE_ASSERT()/ASSERT(...) to CHECK()/DCHECK_op(...) in platform/audio (Closed)
Patch Set: Removing DCHECK_IS_ON from FFTFrameOpenMAXDLAndroid.cpp Created 3 years, 8 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: third_party/WebKit/Source/platform/audio/AudioResamplerKernel.cpp
diff --git a/third_party/WebKit/Source/platform/audio/AudioResamplerKernel.cpp b/third_party/WebKit/Source/platform/audio/AudioResamplerKernel.cpp
index 3a9486182c9dfd6fbb9ea1242f78fd6b0ddb82ac..973a1cb6d2e0f2da5a527feda405c224feb97c70 100644
--- a/third_party/WebKit/Source/platform/audio/AudioResamplerKernel.cpp
+++ b/third_party/WebKit/Source/platform/audio/AudioResamplerKernel.cpp
@@ -46,7 +46,7 @@ AudioResamplerKernel::AudioResamplerKernel(AudioResampler* resampler)
float* AudioResamplerKernel::getSourcePointer(
size_t framesToProcess,
size_t* numberOfSourceFramesNeededP) {
- ASSERT(framesToProcess <= MaxFramesToProcess);
+ DCHECK_LE(framesToProcess, MaxFramesToProcess);
// Calculate the next "virtual" index. After process() is called,
// m_virtualReadIndex will equal this value.
@@ -75,7 +75,7 @@ float* AudioResamplerKernel::getSourcePointer(
}
void AudioResamplerKernel::process(float* destination, size_t framesToProcess) {
- ASSERT(framesToProcess <= MaxFramesToProcess);
+ DCHECK_LE(framesToProcess, MaxFramesToProcess);
float* source = m_sourceBuffer.data();
@@ -92,11 +92,11 @@ void AudioResamplerKernel::process(float* destination, size_t framesToProcess) {
double virtualReadIndex = m_virtualReadIndex;
// Sanity check source buffer access.
- ASSERT(framesToProcess > 0);
- ASSERT(virtualReadIndex >= 0 &&
- 1 + static_cast<unsigned>(virtualReadIndex +
- (framesToProcess - 1) * rate) <
- m_sourceBuffer.size());
+ DCHECK_GT(framesToProcess, 0u);
+ DCHECK_GE(virtualReadIndex, 0);
+ DCHECK_LT(1 + static_cast<unsigned>(virtualReadIndex +
+ (framesToProcess - 1) * rate),
+ m_sourceBuffer.size());
// Do the linear interpolation.
int n = framesToProcess;

Powered by Google App Engine
This is Rietveld 408576698