Chromium Code Reviews| 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); |