Compare commits

...

35 Commits

Author SHA1 Message Date
Electron Bot
349da6af7f Bump v9.0.0-nightly.20200108 2020-01-08 07:31:48 -08:00
Samuel Attard
e18acb4380 build: document electron goma usage and add the external binaries (#21622) 2020-01-07 10:35:52 -08:00
Shogun Sea
0a850fbc5d docs: Update react devtool version in document (#21601)
* docs: update react devtool version in document

* bump react devtool version ref to 4.3.0
2020-01-07 09:14:49 -05:00
Milan Burda
31c93fec67 fix: load window-setup in sandboxed renderer (#21416) 2020-01-06 22:23:03 +01:00
Shelley Vohr
d56f67b7af refactor: throw error for getLastCrashReport if crashReporter not started (#21643) 2020-01-06 11:00:27 -05:00
Electron Bot
7d2c97b671 Bump v9.0.0-nightly.20200106 2020-01-06 07:33:51 -08:00
Electron Bot
fb1131d531 Bump v9.0.0-nightly.20200105 2020-01-05 07:31:32 -08:00
Electron Bot
1abd24aa28 Bump v9.0.0-nightly.20200104 2020-01-04 07:33:32 -08:00
Kilian Valkhof
8dc4a20069 docs: fix typos in security.md (#21665) 2020-01-03 11:11:01 -05:00
Angel_Kitty
70029aa069 chore: update license year (#21657) 2020-01-03 11:10:23 -05:00
Electron Bot
b2071d2966 Bump v9.0.0-nightly.20200103 2020-01-03 07:31:59 -08:00
Electron Bot
35a7f76205 Bump v9.0.0-nightly.20200102 2020-01-02 07:31:08 -08:00
Electron Bot
55d8c4d937 Bump v9.0.0-nightly.20200101 2020-01-01 07:31:32 -08:00
Electron Bot
7b4a5a9f3a Bump v9.0.0-nightly.20191231 2019-12-31 07:32:05 -08:00
Shelley Vohr
fbb10beb40 fix: highlight defaulted button correctly (#21642) 2019-12-31 05:48:43 -08:00
Lutz Roeder
ed6a3877a4 fix: SimpleURLLoaderWrapper redirects (#21630) 2019-12-31 10:47:08 +11:00
Shelley Vohr
181eecd03e docs: fix shell.openPath documentation (#21641) 2019-12-30 11:40:30 -08:00
David Sanders
85382d8f1d fix: improve error handling in npm install (#21589)
* fix: improve error handling in npm install

* chore: simplify logic
2019-12-30 09:48:54 -08:00
Electron Bot
b41fb2e554 Bump v9.0.0-nightly.20191230 2019-12-30 07:32:58 -08:00
Electron Bot
659c4548eb Bump v9.0.0-nightly.20191229 2019-12-29 07:31:35 -08:00
Electron Bot
2497afcf94 Bump v9.0.0-nightly.20191228 2019-12-28 07:31:28 -08:00
Electron Bot
bf266b4479 Bump v9.0.0-nightly.20191226 2019-12-26 07:32:16 -08:00
Electron Bot
4324e4ce1d Bump v9.0.0-nightly.20191225 2019-12-25 07:31:32 -08:00
Electron Bot
a158c80377 Bump v9.0.0-nightly.20191224 2019-12-24 07:31:28 -08:00
Electron Bot
69f37356c1 Bump v9.0.0-nightly.20191223 2019-12-23 07:31:10 -08:00
Electron Bot
023c9a67fd Bump v9.0.0-nightly.20191222 2019-12-22 07:32:10 -08:00
Electron Bot
020cbf3595 Bump v9.0.0-nightly.20191221 2019-12-21 07:31:35 -08:00
Electron Bot
7161b2f57c Bump v9.0.0-nightly.20191220 2019-12-20 07:34:03 -08:00
Electron Bot
e02879d809 chore: bump node in DEPS to v12.14.0 (#21579) 2019-12-19 19:25:57 -08:00
Shelley Vohr
087cb1d592 refactor: update node main instance management (#21562) 2019-12-19 13:29:09 -08:00
Electron Bot
58b816431d Bump v9.0.0-nightly.20191219 2019-12-19 07:31:49 -08:00
Jeremy Apthorp
682b5d7d01 fix: set enable_negotiate_port to false in allowNTLMCredentialsForDomains (#21571)
* fix: set enable_negotiate_port to false in allowNTLMCredentialsForDomains

* read commandline switch
2019-12-19 05:53:49 -08:00
Shelley Vohr
5e244aa505 chore: make release branch pattern more robust (#21568) 2019-12-18 14:57:46 -08:00
John Kleinschmidt
b6214fdddf build: free up macos disk space on Mac publish (#21569) 2019-12-18 14:54:52 -08:00
Electron Bot
8ffc58bdba chore: bump node to v12.13.1 (master) (#21198)
* chore: bump node in DEPS to v12.13.1

* chore: remove redundant patches

* disable node tests

disable prepareStackTrack test since Node.js won't handle our case, and disable new es-module tests since it's still flagged and requires flags to run properly

* fix missing files

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: don't error if can't find advapi32.dll

* fixup! chore: bump node in DEPS to v12.13.1

* Disable native tests for now
2019-12-18 09:49:09 -08:00
40 changed files with 272 additions and 817 deletions

View File

@@ -445,6 +445,9 @@ step-electron-publish: &step-electron-publish
run:
name: Publish Electron Dist
command: |
if [ "`uname`" == "Darwin" ]; then
rm -rf src/out/Default/obj
fi
cd src/electron
if [ "$UPLOAD_TO_S3" == "1" ]; then
echo 'Uploading Electron release distribution to S3'

2
DEPS
View File

@@ -13,7 +13,7 @@ vars = {
'chromium_version':
'd0c764fc71894cc24d3bb17a7406ba6c6cc6dc29',
'node_version':
'v12.13.0',
'v12.14.0',
'nan_version':
'2ee313aaca52e2b478965ac50eb5082520380d1b',

View File

@@ -1 +1 @@
9.0.0-nightly.20191218
9.0.0-nightly.20200108

View File

@@ -1,4 +1,4 @@
Copyright (c) 2013-2019 GitHub Inc.
Copyright (c) 2013-2020 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

2
build/args/goma.gn Normal file
View File

@@ -0,0 +1,2 @@
goma_dir = rebase_path("//electron/external_binaries/goma")
use_goma = true

View File

@@ -28,10 +28,7 @@ Show the given file in a file manager. If possible, select the file.
* `path` String
Returns `Promise<Object>` - Resolve with an object containing the following:
* `success` Boolean - whether or not the path was successfully opened in the desktop's default manner.
* `errorMessage` String (optional) - The error message corresponding to the failure if a failure occurred, otherwise empty string.
Returns `Promise<String>` - Resolves with an string containing the error message corresponding to the failure if a failure occurred, otherwise "".
Open the given file in the desktop's default manner.

61
docs/development/goma.md Normal file
View File

@@ -0,0 +1,61 @@
# Goma
> Goma is a distributed compiler service for open-source projects such as
> Chromium and Android.
Electron has a deployment of a custom Goma Backend that we make available to
all Electron Maintainers. See the [Access](#access) section below for details
on authentication.
## Enabling Goma
Currently Electron Goma supports both Windows and Linux, we may add macOS
support at some point in the future. If you are on a supported platform
you can enable goma by importing the `goma.gn` config file when using `gn`.
```bash
gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\") import(\"//electron/build/args/goma.gn\")"
```
You must ensure that you do not have `cc_wrapper` configured, this means you
can't use `sccache` or similar technology.
Before you can use goma to build Electron you need to authenticate against
the Goma service. You only need to do this once per-machine.
```bash
cd electron/external_binaries/goma
goma_auth.py login
```
Once authenticated you need to make sure the goma daemon is running on your
machine.
```bash
cd electron/external_binaries/goma
goma_ctl.py ensure_start
```
## Building with Goma
When you are using Goma you can run `ninja` with a substantially higher `j`
value than would normally be supported by your machine. Please do not set
a value higher than **300**, we monitor the goma system and users found to
be abusing it with unreasonable concurrency will be de-activated.
```bash
ninja -C out/Testing electron -j 200
```
## Monitoring Goma
If you access [http://localhost:8088](http://localhost:8088) on your local
machine you can monitor compile jobs as they flow through the goma system.
## Access
For security and cost reasons access to Electron Goma is currently restricted
to Electron Maintainers. If you want access please head to `#access-requests` in
Slack and ping `@goma-squad` to ask for access. Please be aware that being a
maintainer does not *automatically* grant access and access is determined on a
case by case basis.

View File

@@ -34,7 +34,7 @@ Using the [React Developer Tools][react-devtools] as example:
const os = require('os')
BrowserWindow.addDevToolsExtension(
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/0.15.0_0')
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.3.0_0')
)
```

View File

@@ -241,7 +241,7 @@ prevent the use of Node primitives, `contextIsolation` must also be used.
### Why?
Context isolation allows each the scripts on running in the renderer to make
Context isolation allows each of the scripts running in the renderer to make
changes to its JavaScript environment without worrying about conflicting with
the scripts in the Electron API or the preload script.
@@ -422,8 +422,6 @@ on a page directly in the markup using a `<meta>` tag:
<meta http-equiv="Content-Security-Policy" content="default-src 'none'">
```
#### `webRequest.onHeadersReceived([filter, ]listener)`
## 7) Do Not Set `allowRunningInsecureContent` to `true`

View File

@@ -165,6 +165,7 @@ auto_filenames = {
"lib/renderer/web-view/web-view-element.ts",
"lib/renderer/web-view/web-view-impl.ts",
"lib/renderer/web-view/web-view-init.ts",
"lib/renderer/window-setup.ts",
"lib/sandboxed_renderer/api/exports/electron.ts",
"lib/sandboxed_renderer/api/module-list.ts",
"lib/sandboxed_renderer/init.js",

View File

@@ -398,7 +398,7 @@ class ClientRequest extends Writable {
this.emit('redirect', statusCode, newMethod, newUrl, headers)
} finally {
this._followRedirectCb = null
if (!_followRedirect) {
if (!_followRedirect && !this._aborted) {
this._die(new Error('Redirect was cancelled'))
}
}

View File

@@ -75,8 +75,10 @@ const mergeBrowserWindowOptions = function (embedder, options) {
}
}
// Sets correct openerId here to give correct options to 'new-window' event handler
options.webPreferences.openerId = embedder.id
if (!webPreferences.nativeWindowOpen) {
// Sets correct openerId here to give correct options to 'new-window' event handler
options.webPreferences.openerId = embedder.id
}
return options
}

View File

@@ -112,11 +112,15 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event)
contentScripts = getContentScripts()
}
const webPreferences = event.sender.getLastWebPreferences() || {}
return {
contentScripts,
preloadScripts: await Promise.all(preloadPaths.map(path => getPreloadScript(path))),
isRemoteModuleEnabled: isRemoteModuleEnabled(event.sender),
isWebViewTagEnabled: guestViewManager.isWebViewTagEnabled(event.sender),
guestInstanceId: webPreferences.guestInstanceId,
openerId: webPreferences.openerId,
process: {
arch: process.arch,
platform: process.platform,

View File

@@ -54,7 +54,12 @@ class CrashReporter {
}
getUploadedReports () {
return binding.getUploadedReports(this.getCrashesDirectory())
const crashDir = this.getCrashesDirectory()
if (!crashDir) {
throw new Error('crashReporter has not been started')
}
return binding.getUploadedReports(crashDir)
}
getCrashesDirectory () {

View File

@@ -177,7 +177,7 @@ class BrowserWindowProxy {
export const windowSetup = (
guestInstanceId: number, openerId: number, isHiddenPage: boolean, usesNativeWindowOpen: boolean
) => {
if (guestInstanceId == null) {
if (!process.sandboxed && guestInstanceId == null) {
// Override default window.close.
window.close = function () {
ipcRendererInternal.send('ELECTRON_BROWSER_WINDOW_CLOSE')
@@ -197,10 +197,10 @@ export const windowSetup = (
return null
}
}
}
if (openerId != null) {
window.opener = getOrCreateProxy(openerId)
}
if (openerId != null) {
window.opener = getOrCreateProxy(openerId)
}
// But we do not support prompt().
@@ -208,43 +208,47 @@ export const windowSetup = (
throw new Error('prompt() is and will not be supported.')
}
ipcRendererInternal.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (
_event, sourceId: number, message: any, sourceOrigin: string
) {
// Manually dispatch event instead of using postMessage because we also need to
// set event.source.
//
// Why any? We can't construct a MessageEvent and we can't
// use `as MessageEvent` because you're not supposed to override
// data, origin, and source
const event: any = document.createEvent('Event')
event.initEvent('message', false, false)
if (!usesNativeWindowOpen || openerId != null) {
ipcRendererInternal.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (
_event, sourceId: number, message: any, sourceOrigin: string
) {
// Manually dispatch event instead of using postMessage because we also need to
// set event.source.
//
// Why any? We can't construct a MessageEvent and we can't
// use `as MessageEvent` because you're not supposed to override
// data, origin, and source
const event: any = document.createEvent('Event')
event.initEvent('message', false, false)
event.data = message
event.origin = sourceOrigin
event.source = getOrCreateProxy(sourceId)
event.data = message
event.origin = sourceOrigin
event.source = getOrCreateProxy(sourceId)
window.dispatchEvent(event as MessageEvent)
})
window.history.back = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
window.dispatchEvent(event as MessageEvent)
})
}
window.history.forward = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD')
}
if (!process.sandboxed) {
window.history.back = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
}
window.history.go = function (offset: number) {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset)
}
window.history.forward = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD')
}
Object.defineProperty(window.history, 'length', {
get: function () {
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH')
},
set () {}
})
window.history.go = function (offset: number) {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset)
}
Object.defineProperty(window.history, 'length', {
get: function () {
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH')
},
set () {}
})
}
if (guestInstanceId != null) {
// Webview `document.visibilityState` tracks window visibility (and ignores

View File

@@ -30,7 +30,13 @@ const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-rendere
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils')
const {
contentScripts, preloadScripts, isRemoteModuleEnabled, isWebViewTagEnabled, process: processProps
contentScripts,
preloadScripts,
isRemoteModuleEnabled,
isWebViewTagEnabled,
guestInstanceId,
openerId,
process: processProps
} = ipcRendererUtils.invokeSync('ELECTRON_BROWSER_SANDBOX_LOAD')
process.isRemoteModuleEnabled = isRemoteModuleEnabled
@@ -109,6 +115,11 @@ function preloadRequire (module) {
const { hasSwitch } = process.electronBinding('command_line')
const contextIsolation = hasSwitch('context-isolation')
const isHiddenPage = hasSwitch('hidden-page')
const usesNativeWindowOpen = true
// The arguments to be passed to isolated world.
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen }
switch (window.location.protocol) {
case 'devtools:': {
@@ -127,6 +138,10 @@ switch (window.location.protocol) {
break
}
default: {
// Override default web functions.
const { windowSetup } = require('@electron/internal/renderer/window-setup')
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
// Inject content scripts.
if (!process.electronBinding('features').isExtensionsEnabled()) {
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
@@ -134,14 +149,17 @@ switch (window.location.protocol) {
}
}
const guestInstanceId = binding.guestInstanceId && parseInt(binding.guestInstanceId)
// Load webview tag implementation.
if (process.isMainFrame) {
const { webViewInit } = require('@electron/internal/renderer/web-view/web-view-init')
webViewInit(contextIsolation, isWebViewTagEnabled, guestInstanceId)
}
// Pass the arguments to isolatedWorld.
if (contextIsolation) {
v8Util.setHiddenValue(global, 'isolated-world-args', isolatedWorldArgs)
}
// Wrap the script into a function executed in global scope. It won't have
// access to the current scope, so we'll expose a few objects as arguments:
//

View File

@@ -8,22 +8,13 @@ const path = require('path')
const extract = require('extract-zip')
const { downloadArtifact } = require('@electron/get')
let installedVersion = null
try {
installedVersion = fs.readFileSync(path.join(__dirname, 'dist', 'version'), 'utf-8').replace(/^v/, '')
} catch (ignored) {
// do nothing
}
if (process.env.ELECTRON_SKIP_BINARY_DOWNLOAD) {
process.exit(0)
}
const platformPath = getPlatformPath()
const electronPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist', platformPath)
if (installedVersion === version && fs.existsSync(electronPath)) {
if (isInstalled()) {
process.exit(0)
}
@@ -35,22 +26,44 @@ downloadArtifact({
cacheRoot: process.env.electron_config_cache,
platform: process.env.npm_config_platform || process.platform,
arch: process.env.npm_config_arch || process.arch
}).then((zipPath) => extractFile(zipPath)).catch((err) => onerror(err))
}).then(extractFile).catch(err => {
console.error(err.stack)
process.exit(1)
})
function isInstalled () {
try {
if (fs.readFileSync(path.join(__dirname, 'dist', 'version'), 'utf-8').replace(/^v/, '') !== version) {
return false
}
if (fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8') !== platformPath) {
return false
}
} catch (ignored) {
return false
}
const electronPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist', platformPath)
return fs.existsSync(electronPath)
}
// unzips and makes path.txt point at the correct executable
function extractFile (zipPath) {
extract(zipPath, { dir: path.join(__dirname, 'dist') }, function (err) {
if (err) return onerror(err)
fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, function (err) {
if (err) return onerror(err)
return new Promise((resolve, reject) => {
extract(zipPath, { dir: path.join(__dirname, 'dist') }, err => {
if (err) return reject(err)
fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, err => {
if (err) return reject(err)
resolve()
})
})
})
}
function onerror (err) {
throw err
}
function getPlatformPath () {
const platform = process.env.npm_config_platform || os.platform()

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "9.0.0-nightly.20191218",
"version": "9.0.0-nightly.20200108",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {

View File

@@ -19,7 +19,6 @@ fixme_remove_async_id_assertion_check.patch
fixme_comment_trace_event_macro.patch
fix_key_gen_apis_are_not_available_in_boringssl.patch
fix_do_not_define_debugoptions_s_constructors_in_header.patch
src_disable_node_use_v8_platform_in_node_options.patch
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
@@ -27,14 +26,7 @@ inherit_electron_crashpad_pipe_name_in_child_process.patch
chore_read_nobrowserglobals_from_global_not_process.patch
chore_split_createenvironment_into_createenvironment_and.patch
chore_handle_default_configuration_not_being_set_in_the_electron_env.patch
fsevents-stop-using-fsevents-to-watch-files.patch
fsevents-regression-in-watching.patch
build_bring_back_node_with_ltcg_configuration.patch
revert_tls_add_option_to_override_signature_algorithms.patch
revert_crypto_add_oaeplabel_option.patch
fix_windows_compilation_on_libuv_setsockopt.patch
fix_don_t_use_node-controlled_preparestacktrace.patch
fix_remove_uses_of_node_use_v8_platform.patch
fix_call_initializecontextruntime_in_initializecontext.patch
refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch
enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch

View File

@@ -886,7 +886,7 @@ new file mode 100644
index 0000000000000000000000000000000000000000..5eb839f45aca3ed73d69b43a34c438ce254a2c6b
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,446 @@
@@ -0,0 +1,448 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
@@ -1106,6 +1106,7 @@ index 0000000000000000000000000000000000000000..5eb839f45aca3ed73d69b43a34c438ce
+ "lib/internal/repl/history.js",
+ "lib/internal/repl/utils.js",
+ "lib/internal/socket_list.js",
+ "lib/internal/source_map/prepare_stack_trace.js",
+ "lib/internal/source_map/source_map.js",
+ "lib/internal/source_map/source_map_cache.js",
+ "lib/internal/test/binding.js",
@@ -1139,6 +1140,7 @@ index 0000000000000000000000000000000000000000..5eb839f45aca3ed73d69b43a34c438ce
+ "lib/internal/streams/state.js",
+ "lib/internal/streams/pipeline.js",
+ "lib/internal/streams/end-of-stream.js",
+ "lib/internal/streams/from.js",
+ "deps/v8/tools/splaytree.js",
+ "deps/v8/tools/codemap.js",
+ "deps/v8/tools/consarray.js",

View File

@@ -1,39 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 22 Oct 2019 11:00:01 -0700
Subject: fix: call InitializeContextRuntime in InitializeContext
Since https://github.com/nodejs/node/commit/1ec4154e507ba71d7aefca0a6e5c155be34e989a,
we observed a crash in renderer process initialization becuase we don't
directly call NewContext, and so InitializeContext would not create primordials
correctly and the following error would occur:
node::Environment::CreateProperties(): Assertion `primordials->IsObject()' failed.
This fixes that. See https://github.com/electron/electron/pull/20684.
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 50886f4a998f1e7f346a6b7fad91ce49c3a7cdff..6ec07527ad7a806f889d884507e9def1cf68b4c8 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -371,8 +371,6 @@ Local<Context> NewContext(Isolate* isolate,
return Local<Context>();
}
- InitializeContextRuntime(context);
-
return context;
}
@@ -457,6 +455,11 @@ bool InitializeContext(Local<Context> context) {
}
}
+ // This must be called here because embedders don't necessarily run
+ // NewContext, so when InitializeContext is called this might never
+ // otherwise be called
+ InitializeContextRuntime(context);
+
return true;
}

View File

@@ -29,7 +29,7 @@ index c0c15a88c028d9c70081aa75fabf63d1d78014e6..03919d450b3373983d647165ee93c006
+DebugOptions& DebugOptions::operator=(DebugOptions&&) = default;
+
void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
#if !NODE_USE_V8_PLATFORM
#if !NODE_USE_V8_PLATFORM && !HAVE_INSPECTOR
if (inspector_enabled) {
diff --git a/src/node_options.h b/src/node_options.h
index 40c19ea6ff4d98a1a1da59bca76087209445af81..4ce5551284bb5b1b4194905a9fe619f852933405 100644

View File

@@ -1,32 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 17 Oct 2019 15:15:12 -0700
Subject: fix: don't use node-controlled prepareStackTrace
At the moment, Electron uses the v8 version of Error.prepareStackTrace as
defined in v7.9.74 (where https://crbug.com/v8/7848 has been fixed) and
not the one polyfilled by Node.js. As a result, we were experiencing failures
in parallel/test-buffer-constructor-outside-node-modules.js because
the polyfilled prepareStackTrace was not being run and thus code
inside that function would never be executed.
Upstreamed at https://github.com/nodejs/node/pull/30014.
diff --git a/lib/internal/util.js b/lib/internal/util.js
index 58502f3b7a7a937c896ff6d32a90a45c6912e3b3..e91362cc3a8a6c5d2462a017f177bebfd607a850 100644
--- a/lib/internal/util.js
+++ b/lib/internal/util.js
@@ -340,10 +340,10 @@ function isInsideNodeModules() {
// the perf implications should be okay.
getStructuredStack = runInNewContext(`(function() {
Error.stackTraceLimit = Infinity;
+ Error.prepareStackTrace = (err, trace) => trace;
+
return function structuredStack() {
- const e = new Error();
- overrideStackTrace.set(e, (err, trace) => trace);
- return e.stack;
+ return new Error().stack;
};
})()`, { overrideStackTrace }, { filename: 'structured-stack' });
}

View File

@@ -1,131 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Fri, 18 Oct 2019 11:20:16 -0700
Subject: fix: remove uses of NODE_USE_V8_PLATFORM
Electron makes use of HAVE_INSPECTOR but does not run with
NODE_USE_V8_PLATFORM so this prevented some Inspector code from
running properly on our end; specifically, this caused a crash in
test/parallel/test-inspector-connect-main-thread.js.
Upstreamed at https://github.com/nodejs/node/pull/30029.
diff --git a/src/env.h b/src/env.h
index 1df2907fe0bc8a4a2bee3c569bfa535465d9f289..084833e467fb815adbd7ee39c2cfd2e79ba96f62 100644
--- a/src/env.h
+++ b/src/env.h
@@ -869,7 +869,7 @@ class Environment : public MemoryRetainer {
void CreateProperties();
// Should be called before InitializeInspector()
void InitializeDiagnostics();
-#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
+#if HAVE_INSPECTOR
// If the environment is created for a worker, pass parent_handle and
// the ownership if transferred into the Environment.
int InitializeInspector(inspector::ParentInspectorHandle* parent_handle);
diff --git a/src/node.cc b/src/node.cc
index 9b43d7676e5e106318b58bfe443651cc49780068..461f736beacec67b35c89a42319f99178a1e38e9 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -224,7 +224,7 @@ MaybeLocal<Value> ExecuteBootstrapper(Environment* env,
return scope.EscapeMaybe(result);
}
-#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
+#if HAVE_INSPECTOR
int Environment::InitializeInspector(
inspector::ParentInspectorHandle* parent_handle) {
std::string inspector_path;
@@ -258,7 +258,7 @@ int Environment::InitializeInspector(
return 0;
}
-#endif // HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
+#endif // HAVE_INSPECTOR
void Environment::InitializeDiagnostics() {
isolate_->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc
index e41e0c1fb6fe1f2ca8a8ebef8834a53d1875ac15..be53b585f0a106c6fd5675e805284291d295f205 100644
--- a/src/node_main_instance.cc
+++ b/src/node_main_instance.cc
@@ -204,7 +204,7 @@ std::unique_ptr<Environment> NodeMainInstance::CreateMainEnvironment(
// TODO(joyeecheung): when we snapshot the bootstrapped context,
// the inspector and diagnostics setup should after after deserialization.
-#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
+#if HAVE_INSPECTOR
*exit_code = env->InitializeInspector(nullptr);
#endif
if (*exit_code != 0) {
diff --git a/src/node_worker.cc b/src/node_worker.cc
index 3dce5e25980ce2c6f17cda02dab9c0f8b4fab813..c8b2e1699f26ac9bfeb373653d35271f9b6c841f 100644
--- a/src/node_worker.cc
+++ b/src/node_worker.cc
@@ -8,7 +8,7 @@
#include "util-inl.h"
#include "async_wrap-inl.h"
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
+#if HAVE_INSPECTOR
#include "inspector/worker_inspector.h" // ParentInspectorHandle
#endif
@@ -41,7 +41,7 @@ namespace worker {
namespace {
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
+#if HAVE_INSPECTOR
void WaitForWorkerInspectorToStop(Environment* child) {
child->inspector_agent()->WaitForDisconnect();
child->inspector_agent()->Stop();
@@ -84,7 +84,7 @@ Worker::Worker(Environment* env,
Number::New(env->isolate(), static_cast<double>(thread_id_)))
.Check();
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
+#if HAVE_INSPECTOR
inspector_parent_handle_ =
env->inspector_agent()->GetParentHandle(thread_id_, url);
#endif
@@ -195,7 +195,7 @@ void Worker::Run() {
Locker locker(isolate_);
Isolate::Scope isolate_scope(isolate_);
SealHandleScope outer_seal(isolate_);
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
+#if HAVE_INSPECTOR
bool inspector_started = false;
#endif
@@ -227,7 +227,7 @@ void Worker::Run() {
env_->stop_sub_worker_contexts();
env_->RunCleanup();
RunAtExit(env_.get());
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
+#if HAVE_INSPECTOR
if (inspector_started)
WaitForWorkerInspectorToStop(env_.get());
#endif
@@ -272,7 +272,7 @@ void Worker::Run() {
if (is_stopped()) return;
{
env_->InitializeDiagnostics();
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
+#if HAVE_INSPECTOR
env_->InitializeInspector(inspector_parent_handle_.release());
inspector_started = true;
#endif
diff --git a/src/node_worker.h b/src/node_worker.h
index ffc4f19882cc2629252c504119649f17dd8dbaff..77f68801e7c24731c63c8cfaf00dcd422b837f29 100644
--- a/src/node_worker.h
+++ b/src/node_worker.h
@@ -65,7 +65,7 @@ class Worker : public AsyncWrap {
bool start_profiler_idle_notifier_;
uv_thread_t tid_;
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
+#if HAVE_INSPECTOR
std::unique_ptr<inspector::ParentInspectorHandle> inspector_parent_handle_;
#endif

View File

@@ -1,21 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 16 Oct 2019 09:07:57 -0700
Subject: fix: windows compilation on libuv setsockopt
Upstreamed in https://github.com/libuv/libuv/pull/2520.
This patch should be removed when Node.js rolls onto libuv v1.33.0.
diff --git a/deps/uv/src/win/tcp.c b/deps/uv/src/win/tcp.c
index 81e48136a3b9ef13b1b95d87a68ab3ba98f9aeb9..fd34c623d8c543a01b70a17184b09bb4e29081eb 100644
--- a/deps/uv/src/win/tcp.c
+++ b/deps/uv/src/win/tcp.c
@@ -556,7 +556,7 @@ int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb) {
if (handle->flags & UV_HANDLE_SHUTTING)
return UV_EINVAL;
- if (0 != setsockopt(handle->socket, SOL_SOCKET, SO_LINGER, &l, sizeof(l)))
+ if (0 != setsockopt(handle->socket, SOL_SOCKET, SO_LINGER, (const char*)&l, sizeof(l)))
return uv_translate_sys_error(WSAGetLastError());
uv_close((uv_handle_t*) handle, close_cb);

View File

@@ -1,161 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jameson Nash <vtjnash@gmail.com>
Date: Sat, 7 Sep 2019 20:45:39 -0400
Subject: fsevents: regression in watching /
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This case got lost by accident in
https://github.com/libuv/libuv/pull/2082,
preventing the realpath `/` from ever matching.
Fixes: https://github.com/nodejs/node/issues/28917
PR-URL: https://github.com/libuv/libuv/pull/2460
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
diff --git a/deps/uv/src/unix/fsevents.c b/deps/uv/src/unix/fsevents.c
index ddacda31fef87eee131fc2ee2ff46cc88be429d9..deeaa63d4730de9aa17ee87923acd96d6507a55d 100644
--- a/deps/uv/src/unix/fsevents.c
+++ b/deps/uv/src/unix/fsevents.c
@@ -263,10 +263,12 @@ static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef,
if (len < handle->realpath_len)
continue;
+ /* Make sure that realpath actually named a directory,
+ * (unless watching root, which alone keeps a trailing slash on the realpath)
+ * or that we matched the whole string */
if (handle->realpath_len != len &&
+ handle->realpath_len > 1 &&
path[handle->realpath_len] != '/')
- /* Make sure that realpath actually named a directory,
- * or that we matched the whole string */
continue;
if (memcmp(path, handle->realpath, handle->realpath_len) != 0)
diff --git a/deps/uv/test/test-fs-event.c b/deps/uv/test/test-fs-event.c
index 4b8bb1ef03e54407cba8eef85179039632cc3f28..7725c3af94edd5d62bb960912262d38aefa6676e 100644
--- a/deps/uv/test/test-fs-event.c
+++ b/deps/uv/test/test-fs-event.c
@@ -47,6 +47,7 @@ static const char file_prefix[] = "fsevent-";
static const int fs_event_file_count = 16;
#if defined(__APPLE__) || defined(_WIN32)
static const char file_prefix_in_subdir[] = "subdir";
+static int fs_multievent_cb_called;
#endif
static uv_timer_t timer;
static int timer_cb_called;
@@ -280,7 +281,7 @@ static void fs_event_cb_dir_multi_file_in_subdir(uv_fs_event_t* handle,
if (filename && strcmp(filename, file_prefix_in_subdir) == 0)
return;
#endif
- fs_event_cb_called++;
+ fs_multievent_cb_called++;
ASSERT(handle == &fs_event);
ASSERT(status == 0);
ASSERT(events == UV_CHANGE || events == UV_RENAME);
@@ -298,7 +299,7 @@ static void fs_event_cb_dir_multi_file_in_subdir(uv_fs_event_t* handle,
if (fs_event_created + fs_event_removed == fs_event_file_count) {
/* Once we've processed all create events, delete all files */
ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files_in_subdir, 1, 0));
- } else if (fs_event_cb_called == 2 * fs_event_file_count) {
+ } else if (fs_multievent_cb_called == 2 * fs_event_file_count) {
/* Once we've processed all create and delete events, stop watching */
uv_close((uv_handle_t*) &timer, close_cb);
uv_close((uv_handle_t*) handle, close_cb);
@@ -393,6 +394,21 @@ static void timer_cb_watch_twice(uv_timer_t* handle) {
uv_close((uv_handle_t*) handle, NULL);
}
+static void fs_event_cb_close(uv_fs_event_t* handle,
+ const char* filename,
+ int events,
+ int status) {
+ ASSERT(status == 0);
+
+ ASSERT(fs_event_cb_called < 3);
+ ++fs_event_cb_called;
+
+ if (fs_event_cb_called == 3) {
+ uv_close((uv_handle_t*) handle, close_cb);
+ }
+}
+
+
TEST_IMPL(fs_event_watch_dir) {
#if defined(NO_FS_EVENTS)
RETURN_SKIP(NO_FS_EVENTS);
@@ -434,10 +450,12 @@ TEST_IMPL(fs_event_watch_dir) {
return 0;
}
+
TEST_IMPL(fs_event_watch_dir_recursive) {
#if defined(__APPLE__) || defined(_WIN32)
uv_loop_t* loop;
int r;
+ uv_fs_event_t fs_event_root;
/* Setup */
loop = uv_default_loop();
@@ -451,17 +469,37 @@ TEST_IMPL(fs_event_watch_dir_recursive) {
r = uv_fs_event_init(loop, &fs_event);
ASSERT(r == 0);
- r = uv_fs_event_start(&fs_event, fs_event_cb_dir_multi_file_in_subdir, "watch_dir", UV_FS_EVENT_RECURSIVE);
+ r = uv_fs_event_start(&fs_event,
+ fs_event_cb_dir_multi_file_in_subdir,
+ "watch_dir",
+ UV_FS_EVENT_RECURSIVE);
ASSERT(r == 0);
r = uv_timer_init(loop, &timer);
ASSERT(r == 0);
r = uv_timer_start(&timer, fs_event_create_files_in_subdir, 100, 0);
ASSERT(r == 0);
+#ifndef _WIN32
+ /* Also try to watch the root directory.
+ * This will be noisier, so we're just checking for any couple events to happen. */
+ r = uv_fs_event_init(loop, &fs_event_root);
+ ASSERT(r == 0);
+ r = uv_fs_event_start(&fs_event_root,
+ fs_event_cb_close,
+ "/",
+ UV_FS_EVENT_RECURSIVE);
+ ASSERT(r == 0);
+#else
+ fs_event_cb_called += 3;
+ close_cb_called += 1;
+ (void)fs_event_root;
+#endif
+
uv_run(loop, UV_RUN_DEFAULT);
- ASSERT(fs_event_cb_called == fs_event_created + fs_event_removed);
- ASSERT(close_cb_called == 2);
+ ASSERT(fs_multievent_cb_called == fs_event_created + fs_event_removed);
+ ASSERT(fs_event_cb_called == 3);
+ ASSERT(close_cb_called == 3);
/* Cleanup */
fs_event_unlink_files_in_subdir(NULL);
@@ -870,18 +908,6 @@ TEST_IMPL(fs_event_close_with_pending_event) {
return 0;
}
-static void fs_event_cb_close(uv_fs_event_t* handle, const char* filename,
- int events, int status) {
- ASSERT(status == 0);
-
- ASSERT(fs_event_cb_called < 3);
- ++fs_event_cb_called;
-
- if (fs_event_cb_called == 3) {
- uv_close((uv_handle_t*) handle, close_cb);
- }
-}
-
TEST_IMPL(fs_event_close_in_callback) {
#if defined(NO_FS_EVENTS)
RETURN_SKIP(NO_FS_EVENTS);

View File

@@ -1,123 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jameson Nash <vtjnash@gmail.com>
Date: Sat, 7 Sep 2019 14:55:40 -0400
Subject: fsevents: stop using fsevents to watch files
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Goes back to just using it to watch folders,
but keeps the other logic changes around.
Refs: https://github.com/libuv/libuv/pull/387
Refs: https://github.com/libuv/libuv/pull/2082
Refs: https://github.com/libuv/libuv/pull/1572
Refs: https://github.com/nodejs/node/issues/29460
Fixes: https://github.com/libuv/libuv/issues/2488
Closes: https://github.com/libuv/libuv/pull/2452
PR-URL: https://github.com/libuv/libuv/pull/2459
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
diff --git a/deps/uv/src/unix/kqueue.c b/deps/uv/src/unix/kqueue.c
index c04e7a485cf992beec501144e04ff068c17b9494..ad09f4031318cafe08faed3f0a6373e2bb598672 100644
--- a/deps/uv/src/unix/kqueue.c
+++ b/deps/uv/src/unix/kqueue.c
@@ -454,10 +454,26 @@ int uv_fs_event_start(uv_fs_event_t* handle,
const char* path,
unsigned int flags) {
int fd;
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ struct stat statbuf;
+#endif
if (uv__is_active(handle))
return UV_EINVAL;
+ handle->cb = cb;
+ handle->path = uv__strdup(path);
+ if (handle->path == NULL)
+ return UV_ENOMEM;
+
+ /* TODO open asynchronously - but how do we report back errors? */
+ fd = open(handle->path, O_RDONLY);
+ if (fd == -1) {
+ uv__free(handle->path);
+ handle->path = NULL;
+ return UV__ERR(errno);
+ }
+
#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
/* Nullify field to perform checks later */
handle->cf_cb = NULL;
@@ -465,14 +481,17 @@ int uv_fs_event_start(uv_fs_event_t* handle,
handle->realpath_len = 0;
handle->cf_flags = flags;
+ if (fstat(fd, &statbuf))
+ goto fallback;
+ /* FSEvents works only with directories */
+ if (!(statbuf.st_mode & S_IFDIR))
+ goto fallback;
+
if (!uv__has_forked_with_cfrunloop) {
int r;
- /* The fallback fd is not used */
+ /* The fallback fd is no longer needed */
+ uv__close_nocheckstdio(fd);
handle->event_watcher.fd = -1;
- handle->path = uv__strdup(path);
- if (handle->path == NULL)
- return UV_ENOMEM;
- handle->cb = cb;
r = uv__fsevents_init(handle);
if (r == 0) {
uv__handle_start(handle);
@@ -482,20 +501,9 @@ int uv_fs_event_start(uv_fs_event_t* handle,
}
return r;
}
+fallback:
#endif /* #if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */
- /* TODO open asynchronously - but how do we report back errors? */
- fd = open(path, O_RDONLY);
- if (fd == -1)
- return UV__ERR(errno);
-
- handle->path = uv__strdup(path);
- if (handle->path == NULL) {
- uv__close_nocheckstdio(fd);
- return UV_ENOMEM;
- }
-
- handle->cb = cb;
uv__handle_start(handle);
uv__io_init(&handle->event_watcher, uv__fs_event, fd);
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
@@ -514,7 +522,7 @@ int uv_fs_event_stop(uv_fs_event_t* handle) {
uv__handle_stop(handle);
#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
- if (!uv__has_forked_with_cfrunloop)
+ if (!uv__has_forked_with_cfrunloop && handle->cf_cb != NULL)
r = uv__fsevents_close(handle);
#endif
diff --git a/deps/uv/test/test-fs-event.c b/deps/uv/test/test-fs-event.c
index ea34bd63a70625c3e2c60d5a1bbb087c5f0bbb2e..4b8bb1ef03e54407cba8eef85179039632cc3f28 100644
--- a/deps/uv/test/test-fs-event.c
+++ b/deps/uv/test/test-fs-event.c
@@ -656,6 +656,12 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
/* Setup */
remove("watch_file");
create_file("watch_file");
+#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_12)
+ /* Empirically, kevent seems to (sometimes) report the preceeding
+ * create_file events prior to macOS 10.11.6 in the subsequent fs_event_start
+ * So let the system settle before running the test. */
+ uv_sleep(1100);
+#endif
r = uv_fs_event_init(loop, &fs_event);
ASSERT(r == 0);

View File

@@ -1,162 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 15 Oct 2019 11:21:13 -0700
Subject: Revert "tls: add option to override signature algorithms"
This partially reverts commit 6272f82c07e913a76a316a786c9aadbc09f953ff.
Upstreamed at https://boringssl-review.googlesource.com/c/boringssl/+/38404
and can be removed when that is merged and rolled into Chromium.
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 2c702d2f051d6b8f59ac53a4e2729ee02ba98a47..d7eff663a5d7465d33f53930868edca6cb89bf49 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -470,7 +470,6 @@ void SecureContext::Initialize(Environment* env, Local<Object> target) {
env->SetProtoMethod(t, "addRootCerts", AddRootCerts);
env->SetProtoMethod(t, "setCipherSuites", SetCipherSuites);
env->SetProtoMethod(t, "setCiphers", SetCiphers);
- env->SetProtoMethod(t, "setSigalgs", SetSigalgs);
env->SetProtoMethod(t, "setECDHCurve", SetECDHCurve);
env->SetProtoMethod(t, "setDHParam", SetDHParam);
env->SetProtoMethod(t, "setMaxProto", SetMaxProto);
@@ -739,23 +738,6 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
}
}
-void SecureContext::SetSigalgs(const FunctionCallbackInfo<Value>& args) {
- SecureContext* sc;
- ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
- Environment* env = sc->env();
- ClearErrorOnReturn clear_error_on_return;
-
- CHECK_EQ(args.Length(), 1);
- CHECK(args[0]->IsString());
-
- const node::Utf8Value sigalgs(env->isolate(), args[0]);
-
- int rv = SSL_CTX_set1_sigalgs_list(sc->ctx_.get(), *sigalgs);
-
- if (rv == 0) {
- return ThrowCryptoError(env, ERR_get_error());
- }
-}
#ifndef OPENSSL_NO_ENGINE
// Helpers for the smart pointer.
@@ -1748,7 +1730,6 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {
env->SetProtoMethodNoSideEffect(t, "isSessionReused", IsSessionReused);
env->SetProtoMethodNoSideEffect(t, "verifyError", VerifyError);
env->SetProtoMethodNoSideEffect(t, "getCipher", GetCipher);
- env->SetProtoMethodNoSideEffect(t, "getSharedSigalgs", GetSharedSigalgs);
env->SetProtoMethod(t, "endParser", EndParser);
env->SetProtoMethod(t, "certCbDone", CertCbDone);
env->SetProtoMethod(t, "renegotiate", Renegotiate);
@@ -2685,88 +2666,6 @@ void SSLWrap<Base>::GetCipher(const FunctionCallbackInfo<Value>& args) {
}
-template <class Base>
-void SSLWrap<Base>::GetSharedSigalgs(const FunctionCallbackInfo<Value>& args) {
- Base* w;
- ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
- Environment* env = w->ssl_env();
- std::vector<Local<Value>> ret_arr;
-
- SSL* ssl = w->ssl_.get();
- int nsig = SSL_get_shared_sigalgs(ssl, 0, nullptr, nullptr, nullptr, nullptr,
- nullptr);
-
- for (int i = 0; i < nsig; i++) {
- int hash_nid;
- int sign_nid;
- std::string sig_with_md;
-
- SSL_get_shared_sigalgs(ssl, i, &sign_nid, &hash_nid, nullptr, nullptr,
- nullptr);
-
- switch (sign_nid) {
- case EVP_PKEY_RSA:
- sig_with_md = "RSA+";
- break;
-
- case EVP_PKEY_RSA_PSS:
- sig_with_md = "RSA-PSS+";
- break;
-
- case EVP_PKEY_DSA:
- sig_with_md = "DSA+";
- break;
-
- case EVP_PKEY_EC:
- sig_with_md = "ECDSA+";
- break;
-
- case NID_ED25519:
- sig_with_md = "Ed25519+";
- break;
-
- case NID_ED448:
- sig_with_md = "Ed448+";
- break;
-
- case NID_id_GostR3410_2001:
- sig_with_md = "gost2001+";
- break;
-
- case NID_id_GostR3410_2012_256:
- sig_with_md = "gost2012_256+";
- break;
-
- case NID_id_GostR3410_2012_512:
- sig_with_md = "gost2012_512+";
- break;
-
- default:
- const char* sn = OBJ_nid2sn(sign_nid);
-
- if (sn != nullptr) {
- sig_with_md = std::string(sn) + "+";
- } else {
- sig_with_md = "UNDEF+";
- }
- break;
- }
-
- const char* sn_hash = OBJ_nid2sn(hash_nid);
- if (sn_hash != nullptr) {
- sig_with_md += std::string(sn_hash);
- } else {
- sig_with_md += "UNDEF";
- }
-
- ret_arr.push_back(OneByteString(env->isolate(), sig_with_md.c_str()));
- }
-
- args.GetReturnValue().Set(
- Array::New(env->isolate(), ret_arr.data(), ret_arr.size()));
-}
-
-
template <class Base>
void SSLWrap<Base>::GetProtocol(const FunctionCallbackInfo<Value>& args) {
Base* w;
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 206a19119a73216ffe16f935ee6a9423bff6865f..6aa4654d5deb07e6e97507c2b746b577ea8a0b17 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -129,7 +129,6 @@ class SecureContext : public BaseObject {
static void AddRootCerts(const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetCipherSuites(const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetCiphers(const v8::FunctionCallbackInfo<v8::Value>& args);
- static void SetSigalgs(const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetECDHCurve(const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetDHParam(const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -255,7 +254,6 @@ class SSLWrap {
static void IsSessionReused(const v8::FunctionCallbackInfo<v8::Value>& args);
static void VerifyError(const v8::FunctionCallbackInfo<v8::Value>& args);
static void GetCipher(const v8::FunctionCallbackInfo<v8::Value>& args);
- static void GetSharedSigalgs(const v8::FunctionCallbackInfo<v8::Value>& args);
static void EndParser(const v8::FunctionCallbackInfo<v8::Value>& args);
static void CertCbDone(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Renegotiate(const v8::FunctionCallbackInfo<v8::Value>& args);

View File

@@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nitish Sakhawalkar <nitsakh@icloud.com>
Date: Thu, 4 Apr 2019 16:45:35 -0700
Subject: src: Disable NODE_USE_V8_PLATFORM in node_options
Electron does not set NODE_USE_V8_PLATFORM. If inspector is enabled when NODE_USE_V8_PLATFORM is false, then there's an error. We want to ignore that, use our own v8 platform but still use the node inspector
diff --git a/src/node_options.cc b/src/node_options.cc
index 03919d450b3373983d647165ee93c006eb5f2902..b9db121250c77e1bc8c35af336361ee444c271e4 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -33,7 +33,7 @@ DebugOptions& DebugOptions::operator=(const DebugOptions&) = default;
DebugOptions& DebugOptions::operator=(DebugOptions&&) = default;
void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
-#if !NODE_USE_V8_PLATFORM
+#if 0
if (inspector_enabled) {
errors->push_back("Inspector is not available when Node is compiled "
"--without-v8-platform");

View File

@@ -43,6 +43,21 @@
"url": "sccache-win32-x64.zip",
"platform": "win32",
"sha": "b6a20fd1c2026f3792e7286bc768a7ebc261847b76449b49f55455e1f841fecd"
},
{
"url": "goma-win.zip",
"platform": "win32",
"sha": "f97c88aa5d49395ae20387b6329ad406fd019f5fb4aac4ba639ca928b7151f6b"
},
{
"url": "goma-linux.tgz",
"platform": "linux",
"sha": "1cb3099a40f6200ae57216efa26af795c587b6ac7ae97955d1078d0b1e3011a6"
},
{
"url": "goma-mac.tgz",
"platform": "darwin",
"sha": "da1e7de82fbf3b99f1a9d0f9bf51b25e75e8778fec180deb72cff873813d717c"
}
]
}

View File

@@ -5,6 +5,8 @@ const path = require('path')
const ELECTRON_DIR = path.resolve(__dirname, '..', '..')
const SRC_DIR = path.resolve(ELECTRON_DIR, '..')
const RELEASE_BRANCH_PATTERN = /(\d)+-(?:(?:[0-9]+-x$)|(?:x+-y$))/
require('colors')
const pass = '✓'.green
const fail = '✗'.red
@@ -66,7 +68,7 @@ async function handleGitCall (args, gitDir) {
async function getCurrentBranch (gitDir) {
let branch = await handleGitCall(['rev-parse', '--abbrev-ref', 'HEAD'], gitDir)
if (branch !== 'master' && !branch.match(/[0-9]+-[0-9]+-x$/) && !branch.match(/[0-9]+-x-y$/)) {
if (branch !== 'master' && !RELEASE_BRANCH_PATTERN.test(branch)) {
const lastCommit = await handleGitCall(['rev-parse', 'HEAD'], gitDir)
const branches = (await handleGitCall([
'branch',
@@ -75,7 +77,7 @@ async function getCurrentBranch (gitDir) {
'--remote'
], gitDir)).split('\n')
branch = branches.filter(b => b.trim() === 'master' || b.trim().match(/^[0-9]+-[0-9]+-x$/) || b.trim().match(/^[0-9]+-x-y$/))[0]
branch = branches.filter(b => b.trim() === 'master' || RELEASE_BRANCH_PATTERN.test(b.trim()))[0]
if (!branch) {
console.log(`${fail} no release branch exists for this ref`)
process.exit(1)

View File

@@ -12,6 +12,7 @@
"parallel/test-bootstrap-modules",
"parallel/test-buffer-backing-arraybuffer",
"parallel/test-buffer-constructor-node-modules-paths",
"parallel/test-buffer-constructor-outside-node-modules",
"parallel/test-child-process-fork-exec-path",
"parallel/test-cli-bad-options",
"parallel/test-cli-node-print-help",
@@ -191,6 +192,7 @@
"async-hooks/test-timers.setInterval",
"async-hooks/test-late-hook-enable",
"es-module/test-esm-cjs-main",
"es-module/test-cjs-esm-warn",
"es-module/test-esm-json-cache",
"es-module/test-esm-snapshot",
"es-module/test-esm-no-extension",

View File

@@ -35,8 +35,9 @@ const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx'
const runners = new Map([
['main', { description: 'Main process specs', run: runMainProcessElectronTests }],
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }],
['native', { description: 'Native specs', run: runNativeElectronTests }]
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }]
// TODO(codebytere): refactor native tests to only depend on what we need
/* ['native', { description: 'Native specs', run: runNativeElectronTests }] */
])
const specHashPath = path.resolve(__dirname, '../spec/.hash')

View File

@@ -5,6 +5,7 @@ import errno
import hashlib
import json
import os
import tarfile
from lib.config import PLATFORM, get_target_arch
from lib.util import add_exec_bit, download, extract_zip, rm_rf, \
@@ -51,8 +52,12 @@ def main():
temp_path = download_binary(base_url, version, binary['url'], binary['sha'])
# We assume that all binaries are in zip archives.
extract_zip(temp_path, output_dir)
if temp_path.endswith('.zip'):
extract_zip(temp_path, output_dir)
else:
tar = tarfile.open(temp_path, "r:gz")
tar.extractall(output_dir)
tar.close()
# Hack alert. Set exec bit for sccache binaries.
# https://bugs.python.org/issue15795

View File

@@ -116,28 +116,40 @@ int NodeMain(int argc, char* argv[]) {
}
node::LoadEnvironment(env);
v8::Isolate* isolate = env->isolate();
bool more;
do {
more = uv_run(env->event_loop(), UV_RUN_ONCE);
gin_env.platform()->DrainTasks(env->isolate());
if (more == false) {
node::EmitBeforeExit(env);
{
v8::SealHandleScope seal(isolate);
bool more;
do {
uv_run(env->event_loop(), UV_RUN_DEFAULT);
gin_env.platform()->DrainTasks(env->isolate());
more = uv_loop_alive(env->event_loop());
if (more && !env->is_stopping())
continue;
if (!uv_loop_alive(env->event_loop())) {
EmitBeforeExit(env);
}
// Emit `beforeExit` if the loop became alive either after emitting
// event, or after running some callbacks.
more = uv_loop_alive(env->event_loop());
if (uv_run(env->event_loop(), UV_RUN_NOWAIT) != 0)
more = true;
}
} while (more == true);
} while (more && !env->is_stopping());
}
node_debugger.Stop();
exit_code = node::EmitExit(env);
env->set_can_call_into_js(false);
node::RunAtExit(env);
v8::Isolate* isolate = env->isolate();
node::ResetStdio();
env->set_can_call_into_js(false);
env->stop_sub_worker_contexts();
env->RunCleanup();
node::RunAtExit(env);
node::FreeEnvironment(env);
node::FreeIsolateData(isolate_data);

View File

@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/guid.h"
#include "base/strings/string_number_conversions.h"
@@ -521,6 +522,9 @@ void Session::AllowNTLMCredentialsForDomains(const std::string& domains) {
network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params =
network::mojom::HttpAuthDynamicParams::New();
auth_dynamic_params->server_allowlist = domains;
auth_dynamic_params->enable_negotiate_port =
base::CommandLine::ForCurrentProcess()->HasSwitch(
electron::switches::kEnableAuthNegotiatePort);
content::GetNetworkService()->ConfigureHttpAuthPrefs(
std::move(auth_dynamic_params));
}

View File

@@ -50,8 +50,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 9,0,0,20191218
PRODUCTVERSION 9,0,0,20191218
FILEVERSION 9,0,0,20200108
PRODUCTVERSION 9,0,0,20200108
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L

View File

@@ -59,9 +59,11 @@ NSAlert* CreateNSAlert(const MessageBoxSettings& settings) {
int button_count = static_cast<int>([ns_buttons count]);
if (settings.default_id >= 0 && settings.default_id < button_count) {
// Focus the button at default_id if the user opted to do so.
// The first button added gets set as the default selected.
// So remove that default, and make the requested button the default.
// Highlight the button at default_id
[[ns_buttons objectAtIndex:settings.default_id] highlight:YES];
// The first button added gets set as the default selected, so remove
// that and set the button @ default_id to be default.
[[ns_buttons objectAtIndex:0] setKeyEquivalent:@""];
[[ns_buttons objectAtIndex:settings.default_id] setKeyEquivalent:@"\r"];
}

View File

@@ -141,12 +141,6 @@ void AtomSandboxedRendererClient::InitializeBindings(
process.SetReadOnly("sandboxed", true);
process.SetReadOnly("type", "renderer");
process.SetReadOnly("isMainFrame", is_main_frame);
// Pass in CLI flags needed to setup the renderer
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kGuestInstanceID))
b.Set(options::kGuestInstanceID,
command_line->GetSwitchValueASCII(switches::kGuestInstanceID));
}
void AtomSandboxedRendererClient::RenderFrameCreated(

View File

@@ -766,22 +766,27 @@ describe('chromium features', () => {
describe('when opened from main window', () => {
for (const { parent, child, nodeIntegration, nativeWindowOpen, openerAccessible } of table) {
const description = `when parent=${s(parent)} opens child=${s(child)} with nodeIntegration=${nodeIntegration} nativeWindowOpen=${nativeWindowOpen}, child should ${openerAccessible ? '' : 'not '}be able to access opener`
it(description, async () => {
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, nativeWindowOpen } })
await w.loadURL(parent)
const childOpenerLocation = await w.webContents.executeJavaScript(`new Promise(resolve => {
window.addEventListener('message', function f(e) {
resolve(e.data)
for (const sandboxPopup of [false, true]) {
const description = `when parent=${s(parent)} opens child=${s(child)} with nodeIntegration=${nodeIntegration} nativeWindowOpen=${nativeWindowOpen} sandboxPopup=${sandboxPopup}, child should ${openerAccessible ? '' : 'not '}be able to access opener`
it(description, async () => {
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, nativeWindowOpen } })
w.webContents.once('new-window', (e, url, frameName, disposition, options) => {
options!.webPreferences!.sandbox = sandboxPopup
})
window.open(${JSON.stringify(child)}, "", "show=no,nodeIntegration=${nodeIntegration ? 'yes' : 'no'}")
})`)
if (openerAccessible) {
expect(childOpenerLocation).to.be.a('string')
} else {
expect(childOpenerLocation).to.be.null()
}
})
await w.loadURL(parent)
const childOpenerLocation = await w.webContents.executeJavaScript(`new Promise(resolve => {
window.addEventListener('message', function f(e) {
resolve(e.data)
})
window.open(${JSON.stringify(child)}, "", "show=no,nodeIntegration=${nodeIntegration ? 'yes' : 'no'}")
})`)
if (openerAccessible) {
expect(childOpenerLocation).to.be.a('string')
} else {
expect(childOpenerLocation).to.be.null()
}
})
}
}
})