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

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: Rebase Created 4 years, 4 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 c6159234ce692139fd2d27fc24b52ba51bbbb818..c8f2b1d34bf435c36e27e14e2d22f1bb8b522705 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
@@ -44,7 +44,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);
@@ -108,7 +108,7 @@ void MediaElementAudioSourceHandler::setFormat(size_t numberOfChannels, float so
bool MediaElementAudioSourceHandler::passesCORSAccessCheck()
{
- ASSERT(mediaElement());
+ DCHECK(mediaElement());
return (mediaElement()->webMediaPlayer() && mediaElement()->webMediaPlayer()->didPassCORSAccessCheck())
|| m_passesCurrentSrcCORSAccessCheck;
@@ -116,7 +116,7 @@ bool MediaElementAudioSourceHandler::passesCORSAccessCheck()
void MediaElementAudioSourceHandler::onCurrentSrcChanged(const KURL& currentSrc)
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
// Synchronize with process().
Locker<MediaElementAudioSourceHandler> locker(*this);
@@ -132,7 +132,7 @@ void MediaElementAudioSourceHandler::onCurrentSrcChanged(const KURL& currentSrc)
bool MediaElementAudioSourceHandler::passesCurrentSrcCORSAccessCheck(const KURL& currentSrc)
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
return context()->getSecurityOrigin() && context()->getSecurityOrigin()->canRequest(currentSrc);
}
@@ -162,11 +162,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