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

Unified Diff: include/v8.h

Issue 1731773005: Introduce MicrotasksCompletedCallback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: DCHECK Created 4 years, 10 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 | « 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 6d1c8d87eefe7294a03bb37dd38b7de7f88ff865..d9c2cca14db21e52b88a540c38a7ffa16ec08529 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5047,7 +5047,8 @@ class PromiseRejectMessage {
typedef void (*PromiseRejectCallback)(PromiseRejectMessage message);
-// --- Microtask Callback ---
+// --- Microtasks Callbacks ---
+typedef void (*MicrotasksCompletedCallback)(Isolate*);
typedef void (*MicrotaskCallback)(void* data);
// --- Failed Access Check Callback ---
@@ -5888,6 +5889,25 @@ class V8_EXPORT Isolate {
bool WillAutorunMicrotasks() const;
/**
+ * Experimental: adds a callback to notify the host application after
+ * microtasks were run. The callback is triggered by explicit RunMicrotasks
+ * call or automatic microtasks execution (see SetAutorunMicrotasks).
+ *
+ * Callback will trigger even if microtasks were attempted to run,
+ * but the microtasks queue was empty and no single microtask was actually
+ * executed.
+ *
+ * Executing scriptsinside the callback will not re-trigger microtasks and
+ * the callback.
+ */
+ void AddMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
+
+ /**
+ * Removes callback that was installed by AddMicrotasksCompletedCallback.
+ */
+ void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
+
+ /**
* Sets a callback for counting the number of times a feature of V8 is used.
*/
void SetUseCounterCallback(UseCounterCallback callback);
« 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