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

Unified Diff: src/isolate.cc

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
« src/api.cc ('K') | « src/isolate.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index e0f2b1df329e7cb7dcb466ea3a242b6c2522b36c..f92ff4f58215ab36951d38b982ca353ff74003f2 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2609,6 +2609,31 @@ Handle<JSObject> Isolate::GetSymbolRegistry() {
}
+void Isolate::AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback) {
+ for (int i = 0; i < before_call_entered_callbacks_.length(); i++) {
+ if (callback == before_call_entered_callbacks_.at(i)) return;
+ }
+ before_call_entered_callbacks_.Add(callback);
+}
+
+
+void Isolate::RemoveBeforeCallEnteredCallback(
+ BeforeCallEnteredCallback callback) {
+ for (int i = 0; i < before_call_entered_callbacks_.length(); i++) {
+ if (callback == before_call_entered_callbacks_.at(i)) {
+ before_call_entered_callbacks_.Remove(i);
+ }
+ }
+}
+
+
+void Isolate::FireBeforeCallEnteredCallback() {
+ for (int i = 0; i < before_call_entered_callbacks_.length(); i++) {
+ before_call_entered_callbacks_.at(i)(reinterpret_cast<v8::Isolate*>(this));
+ }
+}
+
+
void Isolate::AddCallCompletedCallback(CallCompletedCallback callback) {
for (int i = 0; i < call_completed_callbacks_.length(); i++) {
if (callback == call_completed_callbacks_.at(i)) return;
« src/api.cc ('K') | « src/isolate.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698