Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Unified Diff: src/js/promise.js

Issue 2450763002: [promises] remove PromiseEnqueue (Closed)
Patch Set: fmt Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/contexts.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index 36c3af75e816892b329a9569a8a04d3e37947664..2594195c43bf4a85de8adf5242e9606d7630586f 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -146,7 +146,7 @@ function FulfillPromise(promise, status, value, promiseQueue) {
var tasks = GET_PRIVATE(promise, promiseQueue);
if (!IS_UNDEFINED(tasks)) {
var deferred = GET_PRIVATE(promise, promiseDeferredReactionSymbol);
- PromiseEnqueue(value, tasks, deferred, status);
+ %EnqueuePromiseReactionJob(value, tasks, deferred, status);
}
PromiseSet(promise, status, value);
}
@@ -176,7 +176,7 @@ function PromiseHandle(value, handler, deferred) {
}
}
-function PromiseEnqueue(value, tasks, deferreds, status) {
+function PromiseDebugGetInfo(deferreds, status) {
var id, name, instrumenting = DEBUG_IS_ACTIVE;
if (instrumenting) {
@@ -199,7 +199,7 @@ function PromiseEnqueue(value, tasks, deferreds, status) {
%DebugAsyncTaskEvent("enqueue", id, name);
}
}
- %EnqueuePromiseReactionJob(value, tasks, deferreds, id, name);
+ return [id, name];
}
function PromiseAttachCallbacks(promise, deferred, onResolve, onReject) {
@@ -388,8 +388,8 @@ function PerformPromiseThen(promise, onResolve, onReject, resultCapability) {
PromiseAttachCallbacks(promise, resultCapability, onResolve, onReject);
break;
case kFulfilled:
- PromiseEnqueue(GET_PRIVATE(promise, promiseResultSymbol),
- onResolve, resultCapability, kFulfilled);
+ %EnqueuePromiseReactionJob(GET_PRIVATE(promise, promiseResultSymbol),
+ onResolve, resultCapability, kFulfilled);
break;
case kRejected:
if (!HAS_DEFINED_PRIVATE(promise, promiseHasHandlerSymbol)) {
@@ -397,8 +397,8 @@ function PerformPromiseThen(promise, onResolve, onReject, resultCapability) {
// Revoke previously triggered reject event.
%PromiseRevokeReject(promise);
}
- PromiseEnqueue(GET_PRIVATE(promise, promiseResultSymbol),
- onReject, resultCapability, kRejected);
+ %EnqueuePromiseReactionJob(GET_PRIVATE(promise, promiseResultSymbol),
+ onReject, resultCapability, kRejected);
break;
}
@@ -657,7 +657,8 @@ utils.InstallFunctions(GlobalPromise.prototype, DONT_ENUM, [
"promise_reject", DoRejectPromise,
"promise_resolve", ResolvePromise,
"promise_then", PromiseThen,
- "promise_handle", PromiseHandle
+ "promise_handle", PromiseHandle,
+ "promise_debug_get_info", PromiseDebugGetInfo
]);
// This allows extras to create promises quickly without building extra
« no previous file with comments | « src/contexts.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698