Bug 1130541, r=janv.
authorBen Turner <bent.mozilla@gmail.com>
Fri, 06 Feb 2015 15:25:33 -0800
changeset 227949 2565e56e117c
parent 227948 a62c7b38ad6b
child 227950 133c9c6c0c29
push id28249
push userphilringnalda@gmail.com
push date2015-02-07 16:46 +0000
treeherdermozilla-central@94f30665f300 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanv
bugs1130541
milestone38.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 1130541, r=janv.
dom/indexedDB/IDBDatabase.cpp
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -515,16 +515,17 @@ IDBDatabase::CreateObjectStore(
                             const IDBObjectStoreParameters& aOptionalParameters,
                             ErrorResult& aRv)
 {
   AssertIsOnOwningThread();
 
   IDBTransaction* transaction = IDBTransaction::GetCurrent();
 
   if (!transaction ||
+      transaction->Database() != this ||
       transaction->GetMode() != IDBTransaction::VERSION_CHANGE) {
     aRv.Throw(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
     return nullptr;
   }
 
   MOZ_ASSERT(transaction->IsOpen());
 
   KeyPath keyPath(0);
@@ -590,16 +591,17 @@ IDBDatabase::CreateObjectStore(
 void
 IDBDatabase::DeleteObjectStore(const nsAString& aName, ErrorResult& aRv)
 {
   AssertIsOnOwningThread();
 
   IDBTransaction* transaction = IDBTransaction::GetCurrent();
 
   if (!transaction ||
+      transaction->Database() != this ||
       transaction->GetMode() != IDBTransaction::VERSION_CHANGE) {
     aRv.Throw(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
     return;
   }
 
   MOZ_ASSERT(transaction->IsOpen());
 
   nsTArray<ObjectStoreSpec>& specArray = mSpec->objectStores();