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

Unified Diff: third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp

Issue 2159403002: Replace ASSERT with DCHECK in WebAudio (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/modules/webaudio/MediaElementAudioSourceNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
index 9659b0903d61a1929ec894491a5b2519d9f51dab..6d7e11a7b962061d33a4c1c6ee873c23bf8d1176 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
@@ -45,7 +45,7 @@ MediaElementAudioSourceHandler::MediaElementAudioSourceHandler(AudioNode& node,
, m_maybePrintCORSMessage(!m_passesCurrentSrcCORSAccessCheck)
, m_currentSrcString(mediaElement.currentSrc().getString())
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
// Default to stereo. This could change depending on what the media element
// .src is set to.
addOutput(2);
@@ -109,7 +109,7 @@ void MediaElementAudioSourceHandler::setFormat(size_t numberOfChannels, float so
bool MediaElementAudioSourceHandler::passesCORSAccessCheck()
{
- ASSERT(mediaElement());
+ DCHECK(mediaElement());
return (mediaElement()->webMediaPlayer() && mediaElement()->webMediaPlayer()->didPassCORSAccessCheck())
|| m_passesCurrentSrcCORSAccessCheck;
@@ -117,7 +117,7 @@ bool MediaElementAudioSourceHandler::passesCORSAccessCheck()
void MediaElementAudioSourceHandler::onCurrentSrcChanged(const KURL& currentSrc)
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
// Synchronize with process().
Locker<MediaElementAudioSourceHandler> locker(*this);
@@ -133,7 +133,7 @@ void MediaElementAudioSourceHandler::onCurrentSrcChanged(const KURL& currentSrc)
bool MediaElementAudioSourceHandler::passesCurrentSrcCORSAccessCheck(const KURL& currentSrc)
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
return context()->getSecurityOrigin() && context()->getSecurityOrigin()->canRequest(currentSrc);
}
@@ -163,11 +163,11 @@ void MediaElementAudioSourceHandler::process(size_t numberOfFrames)
// Grab data from the provider so that the element continues to make progress, even if
// we're going to output silence anyway.
if (m_multiChannelResampler.get()) {
- ASSERT(m_sourceSampleRate != sampleRate());
+ DCHECK_NE(m_sourceSampleRate, sampleRate());
m_multiChannelResampler->process(&provider, outputBus, numberOfFrames);
} else {
// Bypass the resampler completely if the source is at the context's sample-rate.
- ASSERT(m_sourceSampleRate == sampleRate());
+ DCHECK_EQ(m_sourceSampleRate, sampleRate());
provider.provideInput(outputBus, numberOfFrames);
}
// Output silence if we don't have access to the element.

Powered by Google App Engine
This is Rietveld 408576698