mirror of
https://github.com/electron/electron.git
synced 2026-01-28 08:48:14 -05:00
feat: upgrade to Node 12 (#17838)
* fix: add boringssl backport to support node upgrade * fix: Update node_includes.h, add DCHECK macros * fix: Update node Debug Options parser usage * fix: Fix asar setup * fix: using v8Util in isolated context * fix: make "process" available in preload scripts * fix: use proper options parser and remove setting of _breakFirstLine _breakFirstLine was being set on the process, but that has changed in node 12 and so is no longer needed. Node will handle it properly when --inspect-brk is provided * chore: update node dep sha * fix: process.binding => _linkedBinding in sandboxed isolated preload * fix: make original-fs work with streams * build: override node module version * fix: use _linkedBinding in content_script/init.js * chore: update node ref in DEPS * build: node_module_version should be 73
This commit is contained in:
@@ -37,13 +37,13 @@ void NodeDebugger::Start() {
|
||||
}
|
||||
|
||||
node::DebugOptions options;
|
||||
node::options_parser::DebugOptionsParser options_parser;
|
||||
std::vector<std::string> exec_args;
|
||||
std::vector<std::string> v8_args;
|
||||
std::vector<std::string> errors;
|
||||
|
||||
node::options_parser::DebugOptionsParser::instance.Parse(
|
||||
&args, &exec_args, &v8_args, &options,
|
||||
node::options_parser::kDisallowedInEnvironment, &errors);
|
||||
options_parser.Parse(&args, &exec_args, &v8_args, &options,
|
||||
node::options_parser::kDisallowedInEnvironment, &errors);
|
||||
|
||||
if (!errors.empty()) {
|
||||
// TODO(jeremy): what's the appropriate behaviour here?
|
||||
@@ -51,13 +51,6 @@ void NodeDebugger::Start() {
|
||||
<< base::JoinString(errors, " ");
|
||||
}
|
||||
|
||||
// Set process._debugWaitConnect if --inspect-brk was specified to stop
|
||||
// the debugger on the first line
|
||||
if (options.wait_for_connect()) {
|
||||
mate::Dictionary process(env_->isolate(), env_->process_object());
|
||||
process.Set("_breakFirstLine", true);
|
||||
}
|
||||
|
||||
const char* path = "";
|
||||
if (inspector->Start(path, options,
|
||||
std::make_shared<node::HostPort>(options.host_port),
|
||||
|
||||
@@ -117,16 +117,11 @@ class Archive : public mate::Wrappable<Archive> {
|
||||
DISALLOW_COPY_AND_ASSIGN(Archive);
|
||||
};
|
||||
|
||||
void InitAsarSupport(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> source,
|
||||
v8::Local<v8::Value> require) {
|
||||
void InitAsarSupport(v8::Isolate* isolate, v8::Local<v8::Value> require) {
|
||||
// Evaluate asar_init.js.
|
||||
std::vector<v8::Local<v8::String>> asar_init_params = {
|
||||
node::FIXED_ONE_BYTE_STRING(isolate, "source"),
|
||||
node::FIXED_ONE_BYTE_STRING(isolate, "require")};
|
||||
|
||||
std::vector<v8::Local<v8::Value>> asar_init_args = {source, require};
|
||||
|
||||
std::vector<v8::Local<v8::Value>> asar_init_args = {require};
|
||||
node::per_process::native_module_loader.CompileAndCall(
|
||||
isolate->GetCurrentContext(), "electron/js2c/asar_init",
|
||||
&asar_init_params, &asar_init_args, nullptr);
|
||||
|
||||
@@ -25,6 +25,13 @@
|
||||
#pragma push_macro("CHECK_LE")
|
||||
#pragma push_macro("CHECK_LT")
|
||||
#pragma push_macro("CHECK_NE")
|
||||
#pragma push_macro("DCHECK")
|
||||
#pragma push_macro("DCHECK_EQ")
|
||||
#pragma push_macro("DCHECK_GE")
|
||||
#pragma push_macro("DCHECK_GT")
|
||||
#pragma push_macro("DCHECK_LE")
|
||||
#pragma push_macro("DCHECK_LT")
|
||||
#pragma push_macro("DCHECK_NE")
|
||||
#pragma push_macro("DISALLOW_COPY_AND_ASSIGN")
|
||||
#pragma push_macro("LIKELY")
|
||||
#pragma push_macro("NO_RETURN")
|
||||
@@ -38,6 +45,13 @@
|
||||
#undef CHECK_LE
|
||||
#undef CHECK_LT
|
||||
#undef CHECK_NE
|
||||
#undef DCHECK
|
||||
#undef DCHECK_EQ
|
||||
#undef DCHECK_GE
|
||||
#undef DCHECK_GT
|
||||
#undef DCHECK_LE
|
||||
#undef DCHECK_LT
|
||||
#undef DCHECK_NE
|
||||
#undef DISALLOW_COPY_AND_ASSIGN
|
||||
#undef LIKELY
|
||||
#undef NO_RETURN
|
||||
@@ -67,6 +81,13 @@
|
||||
#pragma pop_macro("CHECK_LE")
|
||||
#pragma pop_macro("CHECK_LT")
|
||||
#pragma pop_macro("CHECK_NE")
|
||||
#pragma pop_macro("DCHECK")
|
||||
#pragma pop_macro("DCHECK_EQ")
|
||||
#pragma pop_macro("DCHECK_GE")
|
||||
#pragma pop_macro("DCHECK_GT")
|
||||
#pragma pop_macro("DCHECK_LE")
|
||||
#pragma pop_macro("DCHECK_LT")
|
||||
#pragma pop_macro("DCHECK_NE")
|
||||
#pragma pop_macro("DISALLOW_COPY_AND_ASSIGN")
|
||||
#pragma pop_macro("LIKELY")
|
||||
#pragma pop_macro("NO_RETURN")
|
||||
|
||||
@@ -372,6 +372,9 @@ v8::Local<v8::Promise> ExecuteJavaScriptInIsolatedWorld(
|
||||
blink::WebLocalFrame::kSynchronous;
|
||||
args->GetNext(&scriptExecutionType);
|
||||
|
||||
// Debugging tip: if you see a crash stack trace beginning from this call,
|
||||
// then it is very likely that some exception happened when executing the
|
||||
// "content_script/init.js" script.
|
||||
GetRenderFrame(window)->GetWebFrame()->RequestExecuteScriptInIsolatedWorld(
|
||||
world_id, &sources.front(), sources.size(), has_user_gesture,
|
||||
scriptExecutionType, new ScriptExecutionCallback(std::move(promise)));
|
||||
|
||||
@@ -245,7 +245,7 @@ void AtomSandboxedRendererClient::SetupMainWorldOverrides(
|
||||
auto* isolate = context->GetIsolate();
|
||||
|
||||
mate::Dictionary process = mate::Dictionary::CreateEmpty(isolate);
|
||||
process.SetMethod("binding", GetBinding);
|
||||
process.SetMethod("_linkedBinding", GetBinding);
|
||||
|
||||
std::vector<v8::Local<v8::String>> isolated_bundle_params = {
|
||||
node::FIXED_ONE_BYTE_STRING(isolate, "nodeProcess"),
|
||||
@@ -267,7 +267,7 @@ void AtomSandboxedRendererClient::SetupExtensionWorldOverrides(
|
||||
auto* isolate = context->GetIsolate();
|
||||
|
||||
mate::Dictionary process = mate::Dictionary::CreateEmpty(isolate);
|
||||
process.SetMethod("binding", GetBinding);
|
||||
process.SetMethod("_linkedBinding", GetBinding);
|
||||
|
||||
std::vector<v8::Local<v8::String>> isolated_bundle_params = {
|
||||
node::FIXED_ONE_BYTE_STRING(isolate, "nodeProcess"),
|
||||
|
||||
Reference in New Issue
Block a user