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

Unified Diff: include/v8.h

Issue 1689863002: Introduce BeforeCallEnteredCallback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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') | src/api.cc » ('J')
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 081b6c3810793b92dab625578727e46271689588..ed0f5c16e45b165651f9f19307229cfc0372318b 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5009,7 +5009,8 @@ typedef void (*MemoryAllocationCallback)(ObjectSpace space,
AllocationAction action,
int size);
-// --- Leave Script Callback ---
+// --- Enter/Leave Script Callback ---
+typedef void (*BeforeCallEnteredCallback)(Isolate*);
jochen (gone - plz use gerrit) 2016/02/17 12:58:48 what's the reason we need an isolate ptr here, but
dgozman 2016/02/17 16:51:12 Passing isolate replaces the need to call Isolate:
typedef void (*CallCompletedCallback)();
jochen (gone - plz use gerrit) 2016/02/18 13:48:38 can you add an isolate* parameter here as well the
dgozman 2016/02/19 01:59:42 Done.
// --- Promise Reject Callback ---
@@ -5810,6 +5811,19 @@ class V8_EXPORT Isolate {
void SetEventLogger(LogEventCallback that);
/**
+ * Adds a callback to notify the host application right before a script
+ * is about to run. If a script re-enters the runtime during executing, the
+ * BeforeCallEnteredCallback is invoked for each re-entrance.
+ * Executing scripts inside the callback will re-trigger the callback.
+ */
+ void AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback);
+
+ /**
+ * Removes callback that was installed by AddBeforeCallEnteredCallback.
+ */
+ void RemoveBeforeCallEnteredCallback(BeforeCallEnteredCallback callback);
+
+ /**
* Adds a callback to notify the host application when a script finished
* running. If a script re-enters the runtime during executing, the
* CallCompletedCallback is only invoked when the outer-most script
@@ -5823,7 +5837,6 @@ class V8_EXPORT Isolate {
*/
void RemoveCallCompletedCallback(CallCompletedCallback callback);
-
/**
* 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') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698