Backed out changeset 369aac182bf6 (bug 1213391) for possible causing linux memory leaks on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 14 Oct 2015 11:23:07 +0200
changeset 607000 6d377ae1c22d1360ee4a6fbe1383cc616b00ba52
parent 606999 72703ed7364a2a8445d68b7603a641739871289a
child 607001 18b113d585aeb5504f732e23c99896e63a7d53e3
push id93006
push userjyavenard@mozilla.com
push dateThu, 15 Oct 2015 05:15:33 +0000
treeherdertry@45ea2a01301e [default view] [failures only]
bugs1213391
milestone43.0a2
backs out369aac182bf6dc4a14d0921890e916f8fddee2a6
Backed out changeset 369aac182bf6 (bug 1213391) for possible causing linux memory leaks on a CLOSED TREE
dom/promise/Promise.cpp
--- a/dom/promise/Promise.cpp
+++ b/dom/promise/Promise.cpp
@@ -349,17 +349,19 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Pro
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mAllocationStack)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mRejectionStack)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mFullfillmentStack)
   NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(Promise)
   if (tmp->IsBlack()) {
-    JS::ExposeValueToActiveJS(tmp->mResult);
+    if (tmp->mResult.isObject()) {
+      JS::ExposeObjectToActiveJS(&(tmp->mResult.toObject()));
+    }
     if (tmp->mAllocationStack) {
       JS::ExposeObjectToActiveJS(tmp->mAllocationStack);
     }
     if (tmp->mRejectionStack) {
       JS::ExposeObjectToActiveJS(tmp->mRejectionStack);
     }
     if (tmp->mFullfillmentStack) {
       JS::ExposeObjectToActiveJS(tmp->mFullfillmentStack);
@@ -608,17 +610,16 @@ Promise::CreateFunction(JSContext* aCx, 
 
   JS::Rooted<JSObject*> obj(aCx, JS_GetFunctionObject(func));
 
   JS::Rooted<JS::Value> promiseObj(aCx);
   if (!dom::GetOrCreateDOMReflector(aCx, aPromise, &promiseObj)) {
     return nullptr;
   }
 
-  JS::ExposeValueToActiveJS(promiseObj);
   js::SetFunctionNativeReserved(obj, SLOT_PROMISE, promiseObj);
   js::SetFunctionNativeReserved(obj, SLOT_DATA, JS::Int32Value(aTask));
 
   return obj;
 }
 
 /* static */ JSObject*
 Promise::CreateThenableFunction(JSContext* aCx, Promise* aPromise, uint32_t aTask)
@@ -636,17 +637,16 @@ Promise::CreateThenableFunction(JSContex
 
   JS::Rooted<JSObject*> obj(aCx, JS_GetFunctionObject(func));
 
   JS::Rooted<JS::Value> promiseObj(aCx);
   if (!dom::GetOrCreateDOMReflector(aCx, aPromise, &promiseObj)) {
     return nullptr;
   }
 
-  JS::ExposeValueToActiveJS(promiseObj);
   js::SetFunctionNativeReserved(obj, SLOT_PROMISE, promiseObj);
 
   return obj;
 }
 
 /* static */ already_AddRefed<Promise>
 Promise::Constructor(const GlobalObject& aGlobal, PromiseInit& aInit,
                      ErrorResult& aRv, JS::Handle<JSObject*> aDesiredProto)