Bug 1130541. r=janv, a=2.0+
authorBen Turner <bent.mozilla@gmail.com>
Fri, 06 Feb 2015 15:25:33 -0800
changeset 204466 2ca6a9e7cb81
parent 204465 3b33c4f48906
child 204467 6dd961f4a9d2
child 204725 b23d848b8639
push id654
push userryanvm@gmail.com
push dateMon, 09 Feb 2015 18:44:44 +0000
treeherdermozilla-b2g32_v2_0@2ca6a9e7cb81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanv, 2
bugs1130541
milestone32.0
Bug 1130541. r=janv, a=2.0+
dom/indexedDB/IDBDatabase.cpp
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -530,16 +530,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);
@@ -571,16 +572,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) {