Skip to content

Commit

Permalink
Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
Browse files Browse the repository at this point in the history
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.
  • Loading branch information
nnethercote committed Sep 1, 2016
1 parent 9fc04a2 commit 2213884
Show file tree
Hide file tree
Showing 139 changed files with 438 additions and 357 deletions.
6 changes: 4 additions & 2 deletions caps/nsScriptSecurityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ nsScriptSecurityManager::AppStatusForPrincipal(nsIPrincipal *aPrin)
// mozbrowser frames.
bool inIsolatedMozBrowser = aPrin->GetIsInIsolatedMozBrowserElement();

NS_WARN_IF_FALSE(appId != nsIScriptSecurityManager::UNKNOWN_APP_ID,
"Asking for app status on a principal with an unknown app id");
NS_WARNING_ASSERTION(
appId != nsIScriptSecurityManager::UNKNOWN_APP_ID,
"Asking for app status on a principal with an unknown app id");

// Installed apps have a valid app id (not NO_APP_ID or UNKNOWN_APP_ID)
// and they are not inside a mozbrowser.
if (appId == nsIScriptSecurityManager::NO_APP_ID ||
Expand Down
3 changes: 2 additions & 1 deletion chrome/nsChromeRegistryChrome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ nsChromeRegistryChrome::SendRegisteredChrome(
DebugOnly<bool> success =
parents[i]->SendRegisterChrome(packages, resources, overrides,
mSelectedLocale, true);
NS_WARN_IF_FALSE(success, "couldn't reset a child's registered chrome");
NS_WARNING_ASSERTION(success,
"couldn't reset a child's registered chrome");
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6331,9 +6331,9 @@ nsDocShell::SetMixedContentChannel(nsIChannel* aMixedContentChannel)
// Get the root docshell.
nsCOMPtr<nsIDocShellTreeItem> root;
GetSameTypeRootTreeItem(getter_AddRefs(root));
NS_WARN_IF_FALSE(root.get() == static_cast<nsIDocShellTreeItem*>(this),
"Setting mMixedContentChannel on a docshell that is not "
"the root docshell");
NS_WARNING_ASSERTION(root.get() == static_cast<nsIDocShellTreeItem*>(this),
"Setting mMixedContentChannel on a docshell that is "
"not the root docshell");
}
#endif
mMixedContentChannel = aMixedContentChannel;
Expand Down Expand Up @@ -12873,7 +12873,7 @@ nsDocShell::ExtractLastVisit(nsIChannel* aChannel,
rv = props->GetPropertyAsUint32(NS_LITERAL_STRING("docshell.previousFlags"),
aChannelRedirectFlags);

NS_WARN_IF_FALSE(
NS_WARNING_ASSERTION(
NS_SUCCEEDED(rv),
"Could not fetch previous flags, URI will be treated like referrer");
}
Expand Down
3 changes: 2 additions & 1 deletion dom/base/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@ class BlobImplFile : public BlobImplBase
nsresult rv =
#endif
mFile->Remove(false);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to remove temporary DOMFile.");
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"Failed to remove temporary DOMFile.");
}
}

Expand Down
3 changes: 2 additions & 1 deletion dom/base/SameProcessMessageQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ SameProcessMessageQueue::~SameProcessMessageQueue()
// This code should run during shutdown, and we should already have pumped the
// event loop. So we should only see messages here if someone is sending
// messages pretty late in shutdown.
NS_WARN_IF_FALSE(mQueue.IsEmpty(), "Shouldn't send messages during shutdown");
NS_WARNING_ASSERTION(mQueue.IsEmpty(),
"Shouldn't send messages during shutdown");
sSingleton = nullptr;
}

Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsDOMMutationObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ nsDOMMutationObserver::Observe(nsINode& aTarget,

#ifdef DEBUG
for (int32_t i = 0; i < mReceivers.Count(); ++i) {
NS_WARN_IF_FALSE(mReceivers[i]->Target(),
"All the receivers should have a target!");
NS_WARNING_ASSERTION(mReceivers[i]->Target(),
"All the receivers should have a target!");
}
#endif
}
Expand Down
12 changes: 8 additions & 4 deletions dom/base/nsDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10341,7 +10341,8 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer)
if (sheet->IsGecko()) {
RefPtr<CSSStyleSheet> clonedSheet =
sheet->AsGecko()->Clone(nullptr, nullptr, clonedDoc, nullptr);
NS_WARN_IF_FALSE(clonedSheet, "Cloning a stylesheet didn't work!");
NS_WARNING_ASSERTION(clonedSheet,
"Cloning a stylesheet didn't work!");
if (clonedSheet) {
clonedDoc->AddStyleSheet(clonedSheet);
}
Expand All @@ -10360,7 +10361,8 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer)
if (sheet->IsGecko()) {
RefPtr<CSSStyleSheet> clonedSheet =
sheet->AsGecko()->Clone(nullptr, nullptr, clonedDoc, nullptr);
NS_WARN_IF_FALSE(clonedSheet, "Cloning a stylesheet didn't work!");
NS_WARNING_ASSERTION(clonedSheet,
"Cloning a stylesheet didn't work!");
if (clonedSheet) {
clonedDoc->AddOnDemandBuiltInUASheet(clonedSheet);
}
Expand Down Expand Up @@ -12416,8 +12418,10 @@ nsDocument::SetPointerLock(Element* aElement, int aCursorStyle)
nsIFrame* rootFrame = shell->GetRootFrame();
if (!NS_WARN_IF(!rootFrame)) {
widget = rootFrame->GetNearestWidget();
NS_WARN_IF_FALSE(widget, "SetPointerLock(): Unable to find widget "
"in shell->GetRootFrame()->GetNearestWidget();");
NS_WARNING_ASSERTION(
widget,
"SetPointerLock(): Unable to find widget in "
"shell->GetRootFrame()->GetNearestWidget();");
if (aElement && !widget) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsFrameLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2229,8 +2229,8 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
// Check that we're still in the docshell tree.
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
mDocShell->GetTreeOwner(getter_AddRefs(treeOwner));
NS_WARN_IF_FALSE(treeOwner,
"Trying to load a new url to a docshell without owner!");
NS_WARNING_ASSERTION(treeOwner,
"Trying to load a new url to a docshell without owner!");
NS_ENSURE_STATE(treeOwner);

if (mDocShell->ItemType() != nsIDocShellTreeItem::typeContent) {
Expand Down
6 changes: 3 additions & 3 deletions dom/base/nsGenericDOMDataNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,9 +970,9 @@ nsGenericDOMDataNode::GetWholeText(nsAString& aWholeText)
return GetData(aWholeText);

int32_t index = parent->IndexOf(this);
NS_WARN_IF_FALSE(index >= 0,
"Trying to use .wholeText with an anonymous"
"text node child of a binding parent?");
NS_WARNING_ASSERTION(index >= 0,
"Trying to use .wholeText with an anonymous"
"text node child of a binding parent?");
NS_ENSURE_TRUE(index >= 0, NS_ERROR_DOM_NOT_SUPPORTED_ERR);
int32_t first =
FirstLogicallyAdjacentTextNode(parent, index);
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsGlobalWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6534,7 +6534,7 @@ nsGlobalWindow::FinishFullscreenChange(bool aIsFullscreen)
ErrorResult rv;
mWakeLock = pmService->NewWakeLock(NS_LITERAL_STRING("DOM_Fullscreen"),
AsOuter()->GetCurrentInnerWindow(), rv);
NS_WARN_IF_FALSE(!rv.Failed(), "Failed to lock the wakelock");
NS_WARNING_ASSERTION(!rv.Failed(), "Failed to lock the wakelock");
rv.SuppressException();
} else if (mWakeLock && !mFullScreen) {
ErrorResult rv;
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsInProcessTabChildGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ nsInProcessTabChildGlobal::Init()
nsresult rv =
#endif
InitTabChildGlobal();
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Couldn't initialize nsInProcessTabChildGlobal");
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"Couldn't initialize nsInProcessTabChildGlobal");
mMessageManager = new nsFrameMessageManager(this,
nullptr,
dom::ipc::MM_CHILD);
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsPlainTextSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ nsPlainTextSerializer::~nsPlainTextSerializer()
{
delete[] mTagStack;
delete[] mOLStack;
NS_WARN_IF_FALSE(mHeadLevel == 0, "Wrong head level!");
NS_WARNING_ASSERTION(mHeadLevel == 0, "Wrong head level!");
}

NS_IMPL_ISUPPORTS(nsPlainTextSerializer,
Expand Down
6 changes: 3 additions & 3 deletions dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ SendRequest(BluetoothReplyRunnable* aRunnable, const Request& aRequest)
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aRunnable);

NS_WARN_IF_FALSE(sBluetoothChild,
"Calling methods on BluetoothServiceChildProcess during "
"shutdown!");
NS_WARNING_ASSERTION(
sBluetoothChild,
"Calling methods on BluetoothServiceChildProcess during shutdown!");

if (sBluetoothChild) {
BluetoothRequestChild* actor = new BluetoothRequestChild(aRunnable);
Expand Down
4 changes: 2 additions & 2 deletions dom/cellbroadcast/CellBroadcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ CellBroadcast::CellBroadcast(nsPIDOMWindowInner* aWindow,
{
mListener = new Listener(this);
DebugOnly<nsresult> rv = aService->RegisterListener(mListener);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Failed registering Cell Broadcast callback");
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"Failed registering Cell Broadcast callback");
}

CellBroadcast::~CellBroadcast()
Expand Down
4 changes: 2 additions & 2 deletions dom/crypto/WebCryptoThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ WebCryptoThreadPool::Initialize()
MOZ_ASSERT(!gInstance, "More than one instance!");

gInstance = new WebCryptoThreadPool();
NS_WARN_IF_FALSE(gInstance, "Failed create thread pool!");
NS_WARNING_ASSERTION(gInstance, "Failed create thread pool!");

if (gInstance && NS_FAILED(gInstance->Init())) {
NS_WARNING("Failed to initialize thread pool!");
Expand Down Expand Up @@ -90,7 +90,7 @@ WebCryptoThreadPool::Shutdown()
}

nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
NS_WARN_IF_FALSE(obs, "Failed to retrieve observer service!");
NS_WARNING_ASSERTION(obs, "Failed to retrieve observer service!");

if (obs) {
if (NS_FAILED(obs->RemoveObserver(this,
Expand Down
2 changes: 1 addition & 1 deletion dom/events/EventDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class EventTargetChainItem

bool IsValid()
{
NS_WARN_IF_FALSE(!!(mTarget), "Event target is not valid!");
NS_WARNING_ASSERTION(!!(mTarget), "Event target is not valid!");
return !!(mTarget);
}

Expand Down
14 changes: 8 additions & 6 deletions dom/events/EventListenerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,10 @@ EventListenerManager::AddEventListenerInternal(
if (window) {
#ifdef DEBUG
nsCOMPtr<nsIDocument> d = window->GetExtantDoc();
NS_WARN_IF_FALSE(!nsContentUtils::IsChromeDoc(d),
"Please do not use pointerenter/leave events in chrome. "
"They are slower than pointerover/out!");
NS_WARNING_ASSERTION(
!nsContentUtils::IsChromeDoc(d),
"Please do not use pointerenter/leave events in chrome. "
"They are slower than pointerover/out!");
#endif
window->SetHasPointerEnterLeaveEventListeners();
}
Expand All @@ -400,9 +401,10 @@ EventListenerManager::AddEventListenerInternal(
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
#ifdef DEBUG
nsCOMPtr<nsIDocument> d = window->GetExtantDoc();
NS_WARN_IF_FALSE(!nsContentUtils::IsChromeDoc(d),
"Please do not use mouseenter/leave events in chrome. "
"They are slower than mouseover/out!");
NS_WARNING_ASSERTION(
!nsContentUtils::IsChromeDoc(d),
"Please do not use mouseenter/leave events in chrome. "
"They are slower than mouseover/out!");
#endif
window->SetHasMouseEnterLeaveEventListeners();
}
Expand Down
12 changes: 6 additions & 6 deletions dom/events/EventStateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,12 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
return NS_ERROR_NULL_POINTER;
}

NS_WARN_IF_FALSE(!aTargetFrame ||
!aTargetFrame->GetContent() ||
aTargetFrame->GetContent() == aTargetContent ||
aTargetFrame->GetContent()->GetFlattenedTreeParent() == aTargetContent ||
aTargetFrame->IsGeneratedContentFrame(),
"aTargetFrame should be related with aTargetContent");
NS_WARNING_ASSERTION(
!aTargetFrame || !aTargetFrame->GetContent() ||
aTargetFrame->GetContent() == aTargetContent ||
aTargetFrame->GetContent()->GetFlattenedTreeParent() == aTargetContent ||
aTargetFrame->IsGeneratedContentFrame(),
"aTargetFrame should be related with aTargetContent");
#if DEBUG
if (aTargetFrame && aTargetFrame->IsGeneratedContentFrame()) {
nsCOMPtr<nsIContent> targetContent;
Expand Down
3 changes: 2 additions & 1 deletion dom/events/WheelHandlingHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ WheelTransaction::SetTimeout()
DebugOnly<nsresult> rv =
sTimer->InitWithFuncCallback(OnTimeout, nullptr, GetTimeoutTime(),
nsITimer::TYPE_ONE_SHOT);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "nsITimer::InitWithFuncCallback failed");
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"nsITimer::InitWithFuncCallback failed");
}

/* static */ nsIntPoint
Expand Down
2 changes: 1 addition & 1 deletion dom/html/HTMLMenuElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ HTMLMenuElement::CreateBuilder()
}

nsCOMPtr<nsIMenuBuilder> builder = do_CreateInstance(HTMLMENUBUILDER_CONTRACTID);
NS_WARN_IF_FALSE(builder, "No builder available");
NS_WARNING_ASSERTION(builder, "No builder available");
return builder.forget();
}

Expand Down
2 changes: 1 addition & 1 deletion dom/html/nsHTMLDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
"How did those end up different here? wyciwyg channels are "
"not nsICachingChannel");
rv = cachingChan->SetCacheTokenCachedCharset(charset);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "cannot SetMetaDataElement");
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "cannot SetMetaDataElement");
rv = NS_OK; // don't propagate error
}

Expand Down
4 changes: 2 additions & 2 deletions dom/icc/IccListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ IccListener::IccListener(IccManager* aIccManager, uint32_t aClientId)
}

DebugOnly<nsresult> rv = mHandler->RegisterListener(this);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Failed registering icc listener with Icc Handler");
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"Failed registering icc listener with Icc Handler");
}

IccListener::~IccListener()
Expand Down
32 changes: 18 additions & 14 deletions dom/indexedDB/ActorsParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13257,16 +13257,19 @@ Factory::Create(const LoggingInfo& aLoggingInfo)
if (loggingInfo) {
MOZ_ASSERT(aLoggingInfo.backgroundChildLoggingId() == loggingInfo->Id());
#if !DISABLE_ASSERTS_FOR_FUZZING
NS_WARN_IF_FALSE(aLoggingInfo.nextTransactionSerialNumber() ==
loggingInfo->mLoggingInfo.nextTransactionSerialNumber(),
"NextTransactionSerialNumber doesn't match!");
NS_WARN_IF_FALSE(aLoggingInfo.nextVersionChangeTransactionSerialNumber() ==
loggingInfo->mLoggingInfo.
nextVersionChangeTransactionSerialNumber(),
"NextVersionChangeTransactionSerialNumber doesn't match!");
NS_WARN_IF_FALSE(aLoggingInfo.nextRequestSerialNumber() ==
loggingInfo->mLoggingInfo.nextRequestSerialNumber(),
"NextRequestSerialNumber doesn't match!");
NS_WARNING_ASSERTION(
aLoggingInfo.nextTransactionSerialNumber() ==
loggingInfo->mLoggingInfo.nextTransactionSerialNumber(),
"NextTransactionSerialNumber doesn't match!");
NS_WARNING_ASSERTION(
aLoggingInfo.nextVersionChangeTransactionSerialNumber() ==
loggingInfo->mLoggingInfo.
nextVersionChangeTransactionSerialNumber(),
"NextVersionChangeTransactionSerialNumber doesn't match!");
NS_WARNING_ASSERTION(
aLoggingInfo.nextRequestSerialNumber() ==
loggingInfo->mLoggingInfo.nextRequestSerialNumber(),
"NextRequestSerialNumber doesn't match!");
#endif // !DISABLE_ASSERTS_FOR_FUZZING
} else {
loggingInfo = new DatabaseLoggingInfo(aLoggingInfo);
Expand Down Expand Up @@ -23089,19 +23092,20 @@ CommitOp::Run()
if (NS_SUCCEEDED(mResultCode)) {
if (fileRefcountFunction) {
mResultCode = fileRefcountFunction->WillCommit();
NS_WARN_IF_FALSE(NS_SUCCEEDED(mResultCode), "WillCommit() failed!");
NS_WARNING_ASSERTION(NS_SUCCEEDED(mResultCode),
"WillCommit() failed!");
}

if (NS_SUCCEEDED(mResultCode)) {
mResultCode = WriteAutoIncrementCounts();
NS_WARN_IF_FALSE(NS_SUCCEEDED(mResultCode),
"WriteAutoIncrementCounts() failed!");
NS_WARNING_ASSERTION(NS_SUCCEEDED(mResultCode),
"WriteAutoIncrementCounts() failed!");

if (NS_SUCCEEDED(mResultCode)) {
AssertForeignKeyConsistency(connection);

mResultCode = connection->CommitWriteTransaction();
NS_WARN_IF_FALSE(NS_SUCCEEDED(mResultCode), "Commit failed!");
NS_WARNING_ASSERTION(NS_SUCCEEDED(mResultCode), "Commit failed!");

if (NS_SUCCEEDED(mResultCode) &&
mTransaction->GetMode() == IDBTransaction::READ_WRITE_FLUSH) {
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/Blob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ class BlobParent::OpenStreamRunnable final
mIOTarget.swap(ioTarget);

DebugOnly<nsresult> rv = stream->Close();
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to close stream!");
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Failed to close stream!");

MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(NewRunnableMethod(ioTarget, &nsIThread::Shutdown)));

Expand Down
3 changes: 2 additions & 1 deletion dom/jsurl/nsJSProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,8 @@ nsJSChannel::SetExecuteAsync(bool aIsAsync)
mIsAsync = aIsAsync;
}
// else ignore this call
NS_WARN_IF_FALSE(!mIsActive, "Calling SetExecuteAsync on active channel?");
NS_WARNING_ASSERTION(!mIsActive,
"Calling SetExecuteAsync on active channel?");

return NS_OK;
}
Expand Down
5 changes: 3 additions & 2 deletions dom/media/AudioBufferUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ class AudioCallbackBufferWrapper
// all the streams were ended (no mixer callback occured).
// XXX Remove this warning, or find a way to avoid it if the mixer callback
// isn't called.
NS_WARN_IF_FALSE(Available() == 0 || mSampleWriteOffset == 0,
"Audio Buffer is not full by the end of the callback.");
NS_WARNING_ASSERTION(
Available() == 0 || mSampleWriteOffset == 0,
"Audio Buffer is not full by the end of the callback.");
// Make sure the data returned is always set and not random!
if (Available()) {
PodZero(mBuffer + mSampleWriteOffset, FramesToSamples(CHANNELS, Available()));
Expand Down
5 changes: 3 additions & 2 deletions dom/media/AudioSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,9 @@ class AudioSegment : public MediaSegmentBase<AudioSegment, AudioChunk> {
void Mix(AudioMixer& aMixer, uint32_t aChannelCount, uint32_t aSampleRate);

int ChannelCount() {
NS_WARN_IF_FALSE(!mChunks.IsEmpty(),
"Cannot query channel count on a AudioSegment with no chunks.");
NS_WARNING_ASSERTION(
!mChunks.IsEmpty(),
"Cannot query channel count on a AudioSegment with no chunks.");
// Find the first chunk that has non-zero channels. A chunk that hs zero
// channels is just silence and we can simply discard it.
for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) {
Expand Down
Loading

0 comments on commit 2213884

Please sign in to comment.