diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index f7b81d92f0a8e..51d3b106a9df3 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -1423,7 +1423,9 @@ Connection::SpinningSynchronousClose() { RefPtr listener = new CloseListener(); rv = AsyncClose(listener); NS_ENSURE_SUCCESS(rv, rv); - MOZ_ALWAYS_TRUE(SpinEventLoopUntil([&]() { return listener->mClosed; })); + MOZ_ALWAYS_TRUE( + SpinEventLoopUntil("storage::Connection::SpinningSynchronousClose"_ns, + [&]() { return listener->mClosed; })); MOZ_ASSERT(isClosed(), "The connection should be closed at this point"); return rv; diff --git a/storage/mozStorageService.cpp b/storage/mozStorageService.cpp index a65ce9247b085..bd68fdc2c24eb 100644 --- a/storage/mozStorageService.cpp +++ b/storage/mozStorageService.cpp @@ -701,17 +701,19 @@ Service::Observe(nsISupports*, const char* aTopic, const char16_t*) { (void)os->RemoveObserver(this, sObserverTopics[i]); } - SpinEventLoopUntil([&]() -> bool { - // We must wait until all the closing connections are closed. - nsTArray> connections; - getConnections(connections); - for (auto& conn : connections) { - if (conn->isClosing()) { - return false; - } - } - return true; - }); + SpinEventLoopUntil("storage::Service::Observe(xpcom-shutdown-threads)"_ns, + [&]() -> bool { + // We must wait until all the closing connections are + // closed. + nsTArray> connections; + getConnections(connections); + for (auto& conn : connections) { + if (conn->isClosing()) { + return false; + } + } + return true; + }); #ifdef DEBUG nsTArray> connections;