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

Unified Diff: src/api.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
« include/v8.h ('K') | « 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 b7dcd446c154e9d232ada47575fe5c227775e07a..767cc61bc702c457385c900044717d51d6597f47 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -164,6 +164,7 @@ class CallDepthScope {
do_callback_(do_callback) {
// TODO(dcarney): remove this when blink stops crashing.
DCHECK(!isolate_->external_caught_exception());
+ if (do_callback_) isolate_->FireBeforeCallEnteredCallback();
dgozman 2016/02/11 02:08:49 I think I'd move this call after context->Enter()
isolate_->IncrementJsCallsFromApiCounter();
isolate_->handle_scope_implementer()->IncrementCallDepth();
if (!context_.IsEmpty()) context_->Enter();
@@ -7371,6 +7372,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);
« include/v8.h ('K') | « include/v8.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698