static void SetMessageHandler(MessageHandler handler,
bool message_handler_thread = false);
static void SetMessageHandler2(MessageHandler2 handler);
+
+ // If no isolate is provided the default isolate is
+ // used.
static void SendCommand(const uint16_t* command, int length,
- ClientData* client_data = NULL);
+ ClientData* client_data = NULL,
+ Isolate* isolate = NULL);
// Dispatch interface.
static void SetHostDispatchHandler(HostDispatchHandler handler,
void Debug::SendCommand(const uint16_t* command, int length,
- ClientData* client_data) {
- if (!i::Isolate::Current()->IsInitialized()) return;
- i::Isolate::Current()->debugger()->ProcessCommand(
- i::Vector<const uint16_t>(command, length), client_data);
+ ClientData* client_data,
+ Isolate* isolate) {
+ // If no isolate is supplied, use the default isolate.
+ if (isolate != NULL) {
+ i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ internal_isolate->debugger()->ProcessCommand(
+ i::Vector<const uint16_t>(command, length), client_data);
+ } else {
+ i::Isolate::GetDefaultIsolateDebugger()->ProcessCommand(
+ i::Vector<const uint16_t>(command, length), client_data);
+ }
}