diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 54343bc30a420..5d9a140fec49e 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -3442,9 +3442,7 @@ nsDocShell::MaybeCreateInitialClientSource(nsIPrincipal* aPrincipal) ClientManager::CreateSource(ClientType::Window, win->EventTargetFor(TaskCategory::Other), principal); - if (NS_WARN_IF(!mInitialClientSource)) { - return; - } + MOZ_DIAGNOSTIC_ASSERT(mInitialClientSource); // Mark the initial client as execution ready, but owned by the docshell. // If the client is actually used this will cause ClientSource to force diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index 70e75ca1f8040..5280ea70ba8a0 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -1796,9 +1796,7 @@ nsGlobalWindowInner::EnsureClientSource() mClientSource = ClientManager::CreateSource(ClientType::Window, EventTargetFor(TaskCategory::Other), mDoc->NodePrincipal()); - if (NS_WARN_IF(!mClientSource)) { - return NS_ERROR_FAILURE; - } + MOZ_DIAGNOSTIC_ASSERT(mClientSource); newClientSource = true; } @@ -1828,9 +1826,7 @@ nsGlobalWindowInner::EnsureClientSource() ClientManager::CreateSource(ClientType::Window, EventTargetFor(TaskCategory::Other), mDoc->NodePrincipal()); - if (NS_WARN_IF(!mClientSource)) { - return NS_ERROR_FAILURE; - } + MOZ_DIAGNOSTIC_ASSERT(mClientSource); newClientSource = true; } } diff --git a/dom/clients/manager/ClientChannelHelper.cpp b/dom/clients/manager/ClientChannelHelper.cpp index c1dd30b57c966..8d822766777ee 100644 --- a/dom/clients/manager/ClientChannelHelper.cpp +++ b/dom/clients/manager/ClientChannelHelper.cpp @@ -120,6 +120,7 @@ class ClientChannelHelper final : public nsIInterfaceRequestor reservedClient.reset(); reservedClient = ClientManager::CreateSource(ClientType::Window, mEventTarget, principal); + MOZ_DIAGNOSTIC_ASSERT(reservedClient); newLoadInfo->GiveReservedClientSource(Move(reservedClient)); } @@ -228,7 +229,7 @@ AddClientChannelHelper(nsIChannel* aChannel, reservedClient = ClientManager::CreateSource(ClientType::Window, aEventTarget, channelPrincipal); - NS_ENSURE_TRUE(reservedClient, NS_ERROR_FAILURE); + MOZ_DIAGNOSTIC_ASSERT(reservedClient); } RefPtr helper = diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index 391b7e678b243..aee4819911909 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -2376,9 +2376,7 @@ ServiceWorkerManager::StartControllingADocument(ServiceWorkerRegistrationInfo* a RefPtr clientHandle = ClientManager::CreateHandle(clientInfo.ref(), SystemGroup::EventTargetFor(TaskCategory::Other)); - if (clientHandle) { - ref = Move(clientHandle->Control(activeWorker->Descriptor())); - } + ref = Move(clientHandle->Control(activeWorker->Descriptor())); } } @@ -2724,9 +2722,7 @@ ServiceWorkerManager::DispatchFetchEvent(const OriginAttributes& aOriginAttribut RefPtr clientHandle = ClientManager::CreateHandle(clientInfo.ref(), SystemGroup::EventTargetFor(TaskCategory::Other)); - if (clientHandle) { - clientHandle->Control(serviceWorker->Descriptor()); - } + clientHandle->Control(serviceWorker->Descriptor()); } // But we also note the reserved state on the LoadInfo. This allows the diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 98fb0f2e3a0a1..f40f9913c9cdc 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -5332,9 +5332,7 @@ WorkerPrivate::EnsureClientSource() mClientSource = ClientManager::CreateSource(type, mWorkerHybridEventTarget, GetPrincipalInfo()); - if (!mClientSource) { - return false; - } + MOZ_DIAGNOSTIC_ASSERT(mClientSource); if (mFrozen) { mClientSource->Freeze();