Bug 958867 - Consistent OwningObject handling in IDBFactory::Create methods. r=bent, a=bajaj
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sun, 12 Jan 2014 04:45:15 +0200
changeset 175041 2cffd1ae3ca37828bb4408ac05cefba4ca5fa4cf
parent 175040 a56419a7fe488c9714c1f3bad54ebe2dee21790c
child 175042 824b7285697d84535ced3d8339531d5323f596ac
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent, bajaj
bugs958867
milestone28.0a2
Bug 958867 - Consistent OwningObject handling in IDBFactory::Create methods. r=bent, a=bajaj
dom/indexedDB/IDBFactory.cpp
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -203,16 +203,19 @@ IDBFactory::Create(JSContext* aCx,
   nsRefPtr<IDBFactory> factory = new IDBFactory();
   factory->mGroup = group;
   factory->mASCIIOrigin = origin;
   factory->mPrivilege = privilege;
   factory->mDefaultPersistenceType = defaultPersistenceType;
   factory->mOwningObject = aOwningObject;
   factory->mContentParent = aContentParent;
 
+  mozilla::HoldJSObjects(factory.get());
+  factory->mRootedOwningObject = true;
+
   if (!IndexedDatabaseManager::IsMainProcess()) {
     ContentChild* contentChild = ContentChild::GetSingleton();
     NS_ENSURE_TRUE(contentChild, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
 
     IndexedDBChild* actor = new IndexedDBChild(origin);
 
     contentChild->SendPIndexedDBConstructor(actor);