From 9db65192406bcec8019f4d329e8467bec7317500 Mon Sep 17 00:00:00 2001 From: Ben Turner Date: Tue, 21 Apr 2015 13:46:00 -0400 Subject: [PATCH] Bug 1155634 - Move ConnectionPool creation closer to where we actually use it and at a point guaranteed to be after QuotaManager has been started. r=khuey --- dom/indexedDB/ActorsParent.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 66ffc5ed672..ad44a4eddb6 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -11070,10 +11070,6 @@ Factory::Create(const LoggingInfo& aLoggingInfo) // If this is the first instance then we need to do some initialization. if (!sFactoryInstanceCount) { - if (!gConnectionPool) { - gConnectionPool = new ConnectionPool(); - } - MOZ_ASSERT(!gLiveDatabaseHashtable); gLiveDatabaseHashtable = new DatabaseActorHashtable(); @@ -11905,6 +11901,10 @@ Database::RecvPBackgroundIDBTransactionConstructor( return true; } + if (!gConnectionPool) { + gConnectionPool = new ConnectionPool(); + } + auto* transaction = static_cast(aActor); nsRefPtr startOp = new StartTransactionOp(transaction); @@ -17775,6 +17775,10 @@ OpenDatabaseOp::DispatchToWorkThread() return NS_ERROR_OUT_OF_MEMORY; } + if (!gConnectionPool) { + gConnectionPool = new ConnectionPool(); + } + nsRefPtr versionChangeOp = new VersionChangeOp(this); uint64_t transactionId =