Bug 1491403 - Part 1: Add a promise argument to JSEnqueuePromiseJobCallback r=arai

Differential Revision: https://phabricator.services.mozilla.com/D7003

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ehsan Akhgari 2018-10-09 21:42:18 +00:00
parent a82134b465
commit 36e567732f
5 changed files with 7 additions and 3 deletions

View File

@ -189,7 +189,7 @@ typedef JSObject*
(* JSGetIncumbentGlobalCallback)(JSContext* cx);
typedef bool
(* JSEnqueuePromiseJobCallback)(JSContext* cx, JS::HandleObject job,
(* JSEnqueuePromiseJobCallback)(JSContext* cx, JS::HandleObject promise, JS::HandleObject job,
JS::HandleObject allocationSite, JS::HandleObject incumbentGlobal,
void* data);

View File

@ -1136,7 +1136,8 @@ JSContext::recoverFromOutOfMemory()
}
static bool
InternalEnqueuePromiseJobCallback(JSContext* cx, JS::HandleObject job,
InternalEnqueuePromiseJobCallback(JSContext* cx, JS::HandleObject promise,
JS::HandleObject job,
JS::HandleObject allocationSite,
JS::HandleObject incumbentGlobal, void* data)
{

View File

@ -663,7 +663,8 @@ JSRuntime::enqueuePromiseJob(JSContext* cx, HandleFunction job, HandleObject pro
allocationSite = JS::GetPromiseAllocationSite(unwrappedPromise);
}
}
return cx->enqueuePromiseJobCallback(cx, job, allocationSite, incumbentGlobal, data);
return cx->enqueuePromiseJobCallback(cx, promise, job, allocationSite,
incumbentGlobal, data);
}
void

View File

@ -260,6 +260,7 @@ CycleCollectedJSContext::GetIncumbentGlobalCallback(JSContext* aCx)
/* static */
bool
CycleCollectedJSContext::EnqueuePromiseJobCallback(JSContext* aCx,
JS::HandleObject aPromise,
JS::HandleObject aJob,
JS::HandleObject aAllocationSite,
JS::HandleObject aIncumbentGlobal,

View File

@ -113,6 +113,7 @@ private:
static JSObject* GetIncumbentGlobalCallback(JSContext* aCx);
static bool EnqueuePromiseJobCallback(JSContext* aCx,
JS::HandleObject aPromise,
JS::HandleObject aJob,
JS::HandleObject aAllocationSite,
JS::HandleObject aIncumbentGlobal,