Initialize isolate holder in standalone node mode

This commit is contained in:
deepak1556 2017-12-12 09:41:58 +05:30 committed by Cheng Zhao
parent 88e53b1b5e
commit e30131f30b
2 changed files with 5 additions and 3 deletions

View file

@ -45,6 +45,8 @@ int NodeMain(int argc, char *argv[]) {
// V8 requires a task scheduler apparently // V8 requires a task scheduler apparently
base::TaskScheduler::CreateAndStartWithDefaultParams("Electron"); base::TaskScheduler::CreateAndStartWithDefaultParams("Electron");
// Initialize gin::IsolateHolder.
JavascriptEnvironment::Initialize();
JavascriptEnvironment gin_env; JavascriptEnvironment gin_env;
int exec_argc; int exec_argc;

View file

@ -49,11 +49,11 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
v8::Locker locker(isolate()); v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate()); v8::HandleScope handle_scope(isolate());
std::unique_ptr<base::Value> result = base::JSONReader::Read(message); std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message);
if (!result || !result->is_dict()) if (!parsed_message || !parsed_message->is_dict())
return; return;
base::DictionaryValue* dict = base::DictionaryValue* dict =
static_cast<base::DictionaryValue*>(result.get()); static_cast<base::DictionaryValue*>(parsed_message.get());
int id; int id;
if (!dict->GetInteger("id", &id)) { if (!dict->GetInteger("id", &id)) {
std::string method; std::string method;