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

Unified Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.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/OfflineAudioContext.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
index 442ccda69a65ab96389e88daa3460365b309356c..16308a91a9c644995180c8352e9086ce78d46895 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -149,7 +149,7 @@ DEFINE_TRACE(OfflineAudioContext)
ScriptPromise OfflineAudioContext::startOfflineRendering(ScriptState* scriptState)
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
// Calling close() on an OfflineAudioContext is not supported/allowed,
// but it might well have been stopped by its execution context.
@@ -181,7 +181,7 @@ ScriptPromise OfflineAudioContext::startOfflineRendering(ScriptState* scriptStat
"cannot call startRendering more than once"));
}
- ASSERT(!m_isRenderingStarted);
+ DCHECK(!m_isRenderingStarted);
m_completeResolver = ScriptPromiseResolver::create(scriptState);
@@ -213,7 +213,7 @@ ScriptPromise OfflineAudioContext::suspendContext(ScriptState* scriptState)
ScriptPromise OfflineAudioContext::suspendContext(ScriptState* scriptState, double when)
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
@@ -280,7 +280,7 @@ ScriptPromise OfflineAudioContext::suspendContext(ScriptState* scriptState, doub
ScriptPromise OfflineAudioContext::resumeContext(ScriptState* scriptState)
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
@@ -306,7 +306,7 @@ ScriptPromise OfflineAudioContext::resumeContext(ScriptState* scriptState)
return promise;
}
- ASSERT(contextState() == AudioContextState::Suspended);
+ DCHECK_EQ(contextState(), AudioContextState::Suspended);
// If the context is suspended, resume rendering by setting the state to
// "Running". and calling startRendering(). Note that resuming is possible
@@ -322,7 +322,7 @@ ScriptPromise OfflineAudioContext::resumeContext(ScriptState* scriptState)
void OfflineAudioContext::fireCompletionEvent()
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
// We set the state to closed here so that the oncomplete event handler sees
// that the context has been closed.
@@ -330,7 +330,7 @@ void OfflineAudioContext::fireCompletionEvent()
AudioBuffer* renderedBuffer = renderTarget();
- ASSERT(renderedBuffer);
+ DCHECK(renderedBuffer);
if (!renderedBuffer)
return;
@@ -349,7 +349,7 @@ void OfflineAudioContext::fireCompletionEvent()
bool OfflineAudioContext::handlePreOfflineRenderTasks()
{
- ASSERT(isAudioThread());
+ DCHECK(isAudioThread());
// OfflineGraphAutoLocker here locks the audio graph for this scope. Note
// that this locker does not use tryLock() inside because the timing of
@@ -367,7 +367,7 @@ bool OfflineAudioContext::handlePreOfflineRenderTasks()
void OfflineAudioContext::handlePostOfflineRenderTasks()
{
- ASSERT(isAudioThread());
+ DCHECK(isAudioThread());
// OfflineGraphAutoLocker here locks the audio graph for the same reason
// above in |handlePreOfflineRenderTasks|.
@@ -387,7 +387,7 @@ OfflineAudioDestinationHandler& OfflineAudioContext::destinationHandler()
void OfflineAudioContext::resolveSuspendOnMainThread(size_t frame)
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
// Suspend the context first. This will fire onstatechange event.
setContextState(Suspended);
@@ -410,7 +410,7 @@ void OfflineAudioContext::resolveSuspendOnMainThread(size_t frame)
void OfflineAudioContext::rejectPendingResolvers()
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
// Wait until the suspend map is available for removal.
AutoLocker locker(this);
@@ -423,14 +423,14 @@ void OfflineAudioContext::rejectPendingResolvers()
}
m_scheduledSuspends.clear();
- ASSERT(m_resumeResolvers.size() == 0);
+ DCHECK_EQ(static_cast<int>(m_resumeResolvers.size()), 0);
Raymond Toy 2016/07/25 16:56:53 DCHECK_EQ(..., 0u)
HyungwookLee 2016/07/26 00:42:40 Done.
rejectPendingDecodeAudioDataResolvers();
}
bool OfflineAudioContext::shouldSuspend()
{
- ASSERT(isAudioThread());
+ DCHECK(isAudioThread());
// Note that the GraphLock is required before this check. Since this needs
// to run on the audio thread, OfflineGraphAutoLocker must be used.

Powered by Google App Engine
This is Rietveld 408576698