Bug 1130541. r=janv, a=1.4+
authorBen Turner <bent.mozilla@gmail.com>
Fri, 06 Feb 2015 15:25:33 -0800
changeset 188740 4adc5cc8294d
parent 188739 37d0205e2747
child 188741 661413c2928e
push id792
push userryanvm@gmail.com
push dateMon, 09 Feb 2015 18:45:11 +0000
treeherdermozilla-b2g30_v1_4@4adc5cc8294d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanv, 1
bugs1130541
milestone30.0
Bug 1130541. r=janv, a=1.4+
dom/indexedDB/IDBDatabase.cpp
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -529,16 +529,17 @@ IDBDatabase::CreateObjectStore(
                             const IDBObjectStoreParameters& aOptionalParameters,
                             ErrorResult& aRv)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   IDBTransaction* transaction = AsyncConnectionHelper::GetCurrentTransaction();
 
   if (!transaction ||
+      transaction->Database() != this ||
       transaction->GetMode() != IDBTransaction::VERSION_CHANGE) {
     aRv.Throw(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
     return nullptr;
   }
 
   DatabaseInfo* databaseInfo = transaction->DBInfo();
 
   KeyPath keyPath(0);
@@ -570,16 +571,17 @@ IDBDatabase::CreateObjectStore(
 void
 IDBDatabase::DeleteObjectStore(const nsAString& aName, ErrorResult& aRv)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   IDBTransaction* transaction = AsyncConnectionHelper::GetCurrentTransaction();
 
   if (!transaction ||
+      transaction->Database() != this ||
       transaction->GetMode() != IDBTransaction::VERSION_CHANGE) {
     aRv.Throw(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
     return;
   }
 
   DatabaseInfo* info = transaction->DBInfo();
   ObjectStoreInfo* objectStoreInfo = info->GetObjectStore(aName);
   if (!objectStoreInfo) {