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

Unified Diff: include/v8.h

Issue 2575313002: [promisehook] Implement PromiseHook (Closed)
Patch Set: reorder Created 4 years 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 | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 3a8b071099b84aa883f5c87a91034a67d701b82e..e79f9568ef5bc51b8d6ae4332ad85e407c6fb742 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5756,6 +5756,11 @@ typedef void (*BeforeCallEnteredCallback)(Isolate*);
typedef void (*CallCompletedCallback)(Isolate*);
typedef void (*DeprecatedCallCompletedCallback)();
+enum class PromiseHookType { kInit, kResolve, kBefore, kAfter };
jochen (gone - plz use gerrit) 2016/12/16 09:36:41 can you please add a comment explaining the differ
gsathya 2016/12/16 18:04:25 Done.
+
+typedef void (*PromiseHook)(PromiseHookType type, Local<Promise> promise,
jochen (gone - plz use gerrit) 2016/12/16 09:36:41 same here, what is parent?
gsathya 2016/12/16 18:04:25 Done.
+ Local<Value> parent);
+
// --- Promise Reject Callback ---
enum PromiseRejectEvent {
kPromiseRejectWithNoHandler = 0,
@@ -6867,6 +6872,12 @@ class V8_EXPORT Isolate {
DeprecatedCallCompletedCallback callback));
/**
+ * Experimental: Set the PromiseHook callback for various promise
+ * lifecycle events.
+ */
+ void SetPromiseHook(PromiseHook hook);
+
+ /**
* Set callback to notify about promise reject with no handler, or
* revocation of such a previous notification once the handler is added.
*/
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698