Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 1e8e1cd17fbd144d542b80ea3fca0f1690844d89..b33decae64f3fe6e027fcf3f63cdec20924574a1 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -168,6 +168,7 @@ class CallDepthScope { |
isolate_->IncrementJsCallsFromApiCounter(); |
isolate_->handle_scope_implementer()->IncrementCallDepth(); |
if (!context_.IsEmpty()) context_->Enter(); |
+ if (do_callback_) isolate_->FireBeforeCallEnteredCallback(); |
} |
~CallDepthScope() { |
if (!context_.IsEmpty()) context_->Exit(); |
@@ -7372,6 +7373,20 @@ void Isolate::SetEventLogger(LogEventCallback that) { |
} |
+void Isolate::AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback) { |
+ if (callback == NULL) return; |
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
+ isolate->AddBeforeCallEnteredCallback(callback); |
+} |
+ |
+ |
+void Isolate::RemoveBeforeCallEnteredCallback( |
+ BeforeCallEnteredCallback callback) { |
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
+ isolate->RemoveBeforeCallEnteredCallback(callback); |
+} |
+ |
+ |
void Isolate::AddCallCompletedCallback(CallCompletedCallback callback) { |
if (callback == NULL) return; |
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
@@ -7385,6 +7400,19 @@ void Isolate::RemoveCallCompletedCallback(CallCompletedCallback callback) { |
} |
+void Isolate::AddCallCompletedCallback( |
+ DeprecatedCallCompletedCallback callback) { |
+ AddCallCompletedCallback(reinterpret_cast<CallCompletedCallback>(callback)); |
+} |
+ |
+ |
+void Isolate::RemoveCallCompletedCallback( |
+ DeprecatedCallCompletedCallback callback) { |
+ RemoveCallCompletedCallback( |
+ reinterpret_cast<CallCompletedCallback>(callback)); |
+} |
+ |
+ |
void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { |
if (callback == NULL) return; |
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |