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

Unified Diff: src/api.cc

Issue 1689863002: Introduce BeforeCallEnteredCallback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: V8_DEPRECATE_SOON 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 | « include/v8.h ('k') | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « include/v8.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698