Bug 1403023 - Set mSentCommitOrAbort to true when HoldWorker call fails to silence the destructor assertion (this is a followup fix for bug 1399322); r=asuth
authorJan Varga <jan.varga@gmail.com>
Fri, 29 Sep 2017 08:48:47 +0200
changeset 383631 946b9c995ec331f4f96360409fd8d2fc49e46838
parent 383630 3baddc8863b2898efff2f52db657e5d997ebf1b5
child 383632 02eed89f56e3006140d475855d0d22e742f79ab2
child 383715 1bdf078c4a147b32648ed2d5d8f9c4375ddcd4f3
child 383786 710b592482eea53c22ea092f5ec038524a539e9f
push id32596
push userarchaeopteryx@coole-files.de
push dateFri, 29 Sep 2017 09:47:22 +0000
treeherdermozilla-central@946b9c995ec3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1403023, 1399322
milestone58.0a1
first release with
nightly linux32
946b9c995ec3 / 58.0a1 / 20170929100122 / files
nightly linux64
946b9c995ec3 / 58.0a1 / 20170929100122 / files
nightly mac
946b9c995ec3 / 58.0a1 / 20170929100122 / files
nightly win32
946b9c995ec3 / 58.0a1 / 20170929100122 / files
nightly win64
946b9c995ec3 / 58.0a1 / 20170929100122 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1403023 - Set mSentCommitOrAbort to true when HoldWorker call fails to silence the destructor assertion (this is a followup fix for bug 1399322); r=asuth
dom/indexedDB/IDBTransaction.cpp
--- a/dom/indexedDB/IDBTransaction.cpp
+++ b/dom/indexedDB/IDBTransaction.cpp
@@ -234,16 +234,21 @@ IDBTransaction::Create(JSContext* aCx, I
     WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
     MOZ_ASSERT(workerPrivate);
 
     workerPrivate->AssertIsOnWorkerThread();
 
     nsAutoPtr<WorkerHolder> workerHolder(
       new WorkerHolder(workerPrivate, transaction));
     if (NS_WARN_IF(!workerHolder->HoldWorker(workerPrivate, Canceling))) {
+      // Silence the destructor assertion if we never made this object live.
+#ifdef DEBUG
+      MOZ_ASSERT(!transaction->mSentCommitOrAbort);
+      transaction->mSentCommitOrAbort = true;
+#endif
       return nullptr;
     }
 
     transaction->mWorkerHolder = Move(workerHolder);
   }
 
   nsCOMPtr<nsIRunnable> runnable = do_QueryObject(transaction);
   nsContentUtils::RunInMetastableState(runnable.forget());