Bug 1130541. r=janv, a=abillings
authorBen Turner <bent.mozilla@gmail.com>
Fri, 06 Feb 2015 15:25:33 -0800
changeset 243720 cb5d2bbf9234
parent 243719 f430d5f985d3
child 243721 130e59d97b15
push id4449
push userryanvm@gmail.com
push date2015-02-09 15:46 +0000
treeherdermozilla-beta@130e59d97b15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanv, abillings
bugs1130541
milestone36.0
Bug 1130541. r=janv, a=abillings
dom/indexedDB/IDBDatabase.cpp
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -453,16 +453,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);
@@ -520,16 +521,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();