Bug 1274161 - Do not abort the transaction twice if the IDBRequest is failed due to the abortion of its transaction. r=khuey
authorBevis Tseng <btseng@mozilla.com>
Thu, 19 May 2016 15:46:15 +0800
changeset 342449 fd26cef5ff88205d6cb3896996c45f36ec305d8b
parent 342448 d0f169cdd9d1e70945cf86611449013b123ab3d4
child 342450 1c5d78c7ba432f923296cf6d664e345782cb67b1
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1274161
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1274161 - Do not abort the transaction twice if the IDBRequest is failed due to the abortion of its transaction. r=khuey
dom/indexedDB/ActorsChild.cpp
testing/web-platform/meta/IndexedDB/idbobjectstore_createIndex6-event_order.htm.ini
--- a/dom/indexedDB/ActorsChild.cpp
+++ b/dom/indexedDB/ActorsChild.cpp
@@ -737,17 +737,21 @@ DispatchErrorEvent(IDBRequest* aRequest,
   bool doDefault;
   nsresult rv = request->DispatchEvent(aEvent, &doDefault);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   MOZ_ASSERT(!transaction || transaction->IsOpen() || transaction->IsAborted());
 
-  if (transaction && transaction->IsOpen()) {
+  // Do not abort the transaction here if this request is failed due to the
+  // abortion of its transaction to ensure that the correct error cause of
+  // the abort event be set in IDBTransaction::FireCompleteOrAbortEvents() later.
+  if (transaction && transaction->IsOpen() &&
+      aErrorCode != NS_ERROR_DOM_INDEXEDDB_ABORT_ERR) {
     WidgetEvent* internalEvent = aEvent->WidgetEventPtr();
     MOZ_ASSERT(internalEvent);
 
     if (internalEvent->mFlags.mExceptionWasRaised) {
       transaction->Abort(NS_ERROR_DOM_INDEXEDDB_ABORT_ERR);
     } else if (doDefault) {
       transaction->Abort(request);
     }
deleted file mode 100644
--- a/testing/web-platform/meta/IndexedDB/idbobjectstore_createIndex6-event_order.htm.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[idbobjectstore_createIndex6-event_order.htm]
-  type: testharness
-  [IDBObjectStore.createIndex() - event order when unique constraint is triggered]
-    expected: FAIL
-