Chromium Code Reviews| Index: src/api.cc |
| diff --git a/src/api.cc b/src/api.cc |
| index 9025b296fd092f1b375b7264145c978d794ace7b..20b27e67ad243bc6460e8d78a852d638ffaa8ac2 100644 |
| --- a/src/api.cc |
| +++ b/src/api.cc |
| @@ -7727,20 +7727,26 @@ Local<StackTrace> Exception::GetStackTrace(Local<Value> exception) { |
| // --- D e b u g S u p p o r t --- |
| -bool Debug::SetDebugEventListener(EventCallback that, Local<Value> data) { |
| - i::Isolate* isolate = i::Isolate::Current(); |
| - ENTER_V8(isolate); |
| - i::HandleScope scope(isolate); |
| - i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); |
| +bool Debug::SetDebugEventListener(Isolate* isolate, EventCallback that, |
| + Local<Value> data) { |
| + i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| + ENTER_V8(i_isolate); |
| + i::HandleScope scope(i_isolate); |
| + i::Handle<i::Object> foreign = i_isolate->factory()->undefined_value(); |
| if (that != NULL) { |
| - foreign = isolate->factory()->NewForeign(FUNCTION_ADDR(that)); |
| + foreign = i_isolate->factory()->NewForeign(FUNCTION_ADDR(that)); |
| } |
| - isolate->debug()->SetEventListener(foreign, |
| - Utils::OpenHandle(*data, true)); |
| + i_isolate->debug()->SetEventListener(foreign, Utils::OpenHandle(*data, true)); |
| return true; |
| } |
| +bool Debug::SetDebugEventListener(EventCallback that, Local<Value> data) { |
| + return SetDebugEventListener( |
| + reinterpret_cast<Isolate*>(i::Isolate::Current()), that, data); |
|
vogelheim
2015/12/02 11:38:48
Meh... reinterpret_cast-ing i::Isolate to Isolate
|
| +} |
| + |
| + |
| void Debug::DebugBreak(Isolate* isolate) { |
| reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->RequestDebugBreak(); |
| } |
| @@ -7758,10 +7764,16 @@ bool Debug::CheckDebugBreak(Isolate* isolate) { |
| } |
| +void Debug::SetMessageHandler(Isolate* isolate, |
| + v8::Debug::MessageHandler handler) { |
| + i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| + ENTER_V8(i_isolate); |
| + i_isolate->debug()->SetMessageHandler(handler); |
| +} |
| + |
| + |
| void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) { |
| - i::Isolate* isolate = i::Isolate::Current(); |
| - ENTER_V8(isolate); |
| - isolate->debug()->SetMessageHandler(handler); |
| + SetMessageHandler(reinterpret_cast<Isolate*>(i::Isolate::Current()), handler); |
| } |
| @@ -7827,15 +7839,25 @@ Local<Value> Debug::GetMirror(v8::Local<v8::Value> obj) { |
| } |
| +void Debug::ProcessDebugMessages(Isolate* isolate) { |
| + reinterpret_cast<i::Isolate*>(isolate)->debug()->ProcessDebugMessages(true); |
| +} |
| + |
| + |
| void Debug::ProcessDebugMessages() { |
| - i::Isolate::Current()->debug()->ProcessDebugMessages(true); |
| + ProcessDebugMessages(reinterpret_cast<Isolate*>(i::Isolate::Current())); |
| +} |
| + |
| + |
| +Local<Context> Debug::GetDebugContext(Isolate* isolate) { |
| + i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| + ENTER_V8(i_isolate); |
| + return Utils::ToLocal(i_isolate->debug()->GetDebugContext()); |
| } |
| Local<Context> Debug::GetDebugContext() { |
| - i::Isolate* isolate = i::Isolate::Current(); |
| - ENTER_V8(isolate); |
| - return Utils::ToLocal(isolate->debug()->GetDebugContext()); |
| + return GetDebugContext(reinterpret_cast<Isolate*>(i::Isolate::Current())); |
| } |