mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
13 Commits
v11.0.0-ni
...
v11.0.0-ni
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48d1a70b52 | ||
|
|
5c6d8c2b7d | ||
|
|
0f44682be0 | ||
|
|
2376c45443 | ||
|
|
b665eb6d43 | ||
|
|
4e66f1b2c6 | ||
|
|
a54fcde3f4 | ||
|
|
7cc780d077 | ||
|
|
59f9d75324 | ||
|
|
cb6476fd12 | ||
|
|
e1e73fa5f5 | ||
|
|
09c0ee8f87 | ||
|
|
cf284991d8 |
@@ -418,6 +418,7 @@ step-electron-build: &step-electron-build
|
||||
fi
|
||||
cd src
|
||||
ninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
|
||||
node electron/script/check-symlinks.js
|
||||
|
||||
step-native-unittests-build: &step-native-unittests-build
|
||||
run:
|
||||
@@ -830,7 +831,7 @@ step-restore-out-cache: &step-restore-out-cache
|
||||
paths:
|
||||
- ./src/out/Default
|
||||
keys:
|
||||
- v7-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||
- v8-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||
name: Restoring out cache
|
||||
|
||||
step-set-git-cache-path: &step-set-git-cache-path
|
||||
@@ -854,7 +855,7 @@ step-save-out-cache: &step-save-out-cache
|
||||
save_cache:
|
||||
paths:
|
||||
- ./src/out/Default
|
||||
key: v7-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||
key: v8-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||
name: Persisting out cache
|
||||
|
||||
step-run-electron-only-hooks: &step-run-electron-only-hooks
|
||||
|
||||
31
BUILD.gn
31
BUILD.gn
@@ -326,7 +326,6 @@ source_set("electron_lib") {
|
||||
"//chrome/app/resources:platform_locale_settings",
|
||||
"//chrome/services/printing/public/mojom",
|
||||
"//components/certificate_transparency",
|
||||
"//components/crash/core/app",
|
||||
"//components/language/core/browser",
|
||||
"//components/net_log",
|
||||
"//components/network_hints/browser",
|
||||
@@ -434,6 +433,9 @@ source_set("electron_lib") {
|
||||
"*\bviews/*",
|
||||
]
|
||||
}
|
||||
if (!is_mas_build) {
|
||||
deps += [ "//components/crash/core/app" ]
|
||||
}
|
||||
|
||||
set_sources_assignment_filter(
|
||||
sources_assignment_filter + extra_source_filters)
|
||||
@@ -459,10 +461,13 @@ source_set("electron_lib") {
|
||||
deps += [
|
||||
"//components/remote_cocoa/app_shim",
|
||||
"//content/common:mac_helpers",
|
||||
"//third_party/crashpad/crashpad/client",
|
||||
"//ui/accelerated_widget_mac",
|
||||
]
|
||||
|
||||
if (!is_mas_build) {
|
||||
deps += [ "//third_party/crashpad/crashpad/client" ]
|
||||
}
|
||||
|
||||
libs = [
|
||||
"AVFoundation.framework",
|
||||
"Carbon.framework",
|
||||
@@ -483,6 +488,12 @@ source_set("electron_lib") {
|
||||
sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
|
||||
sources -= [ "shell/browser/auto_updater_mac.mm" ]
|
||||
defines += [ "MAS_BUILD" ]
|
||||
sources -= [
|
||||
"shell/app/electron_crash_reporter_client.cc",
|
||||
"shell/app/electron_crash_reporter_client.h",
|
||||
"shell/common/crash_keys.cc",
|
||||
"shell/common/crash_keys.h",
|
||||
]
|
||||
} else {
|
||||
libs += [
|
||||
"Squirrel.framework",
|
||||
@@ -591,13 +602,6 @@ source_set("electron_lib") {
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_remote_module) {
|
||||
sources += [
|
||||
"shell/common/api/remote/remote_callback_freer.cc",
|
||||
"shell/common/api/remote/remote_callback_freer.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_desktop_capturer) {
|
||||
if (is_component_build && !is_linux) {
|
||||
# On windows the implementation relies on unexported
|
||||
@@ -773,8 +777,10 @@ if (is_mac) {
|
||||
framework_contents = [
|
||||
"Resources",
|
||||
"Libraries",
|
||||
"Helpers",
|
||||
]
|
||||
if (!is_mas_build) {
|
||||
framework_contents += [ "Helpers" ]
|
||||
}
|
||||
public_deps = [
|
||||
":electron_framework_libraries",
|
||||
":electron_lib",
|
||||
@@ -1005,13 +1011,16 @@ if (is_mac) {
|
||||
|
||||
group("electron_symbols") {
|
||||
deps = [
|
||||
":crashpad_handler_syms",
|
||||
":electron_app_syms",
|
||||
":electron_framework_syms",
|
||||
":swiftshader_egl_syms",
|
||||
":swiftshader_gles_syms",
|
||||
]
|
||||
|
||||
if (!is_mas_build) {
|
||||
deps += [ ":crashpad_handler_syms" ]
|
||||
}
|
||||
|
||||
foreach(helper_params, content_mac_helpers) {
|
||||
_helper_target = helper_params[0]
|
||||
deps += [ ":electron_helper_syms_${_helper_target}" ]
|
||||
|
||||
2
DEPS
2
DEPS
@@ -15,7 +15,7 @@ vars = {
|
||||
'chromium_version':
|
||||
'ff6c4f4b826d66c2e32380bf5d1eb5e1fe37faef',
|
||||
'node_version':
|
||||
'v12.16.3',
|
||||
'v12.18.1',
|
||||
'nan_version':
|
||||
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
11.0.0-nightly.20200616
|
||||
11.0.0-nightly.20200619
|
||||
@@ -140,6 +140,16 @@ this event, such as launching the application for the first time, attempting
|
||||
to re-launch the application when it's already running, or clicking on the
|
||||
application's dock or taskbar icon.
|
||||
|
||||
### Event: 'did-become-active' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
|
||||
Emitted when mac application become active. Difference from `activate` event is
|
||||
that `did-become-active` is emitted every time the app becomes active, not only
|
||||
when Dock icon is clicked or application is re-launched.
|
||||
|
||||
### Event: 'continue-activity' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -12,7 +12,7 @@ See [`Menu`](menu.md) for examples.
|
||||
* `click` Function (optional) - Will be called with
|
||||
`click(menuItem, browserWindow, event)` when the menu item is clicked.
|
||||
* `menuItem` MenuItem
|
||||
* `browserWindow` [BrowserWindow](browser-window.md)
|
||||
* `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open.
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
|
||||
`click` property will be ignored. See [roles](#roles).
|
||||
|
||||
@@ -525,6 +525,8 @@ filenames = {
|
||||
"shell/common/gin_helper/function_template_extensions.h",
|
||||
"shell/common/gin_helper/locker.cc",
|
||||
"shell/common/gin_helper/locker.h",
|
||||
"shell/common/gin_helper/microtasks_scope.cc",
|
||||
"shell/common/gin_helper/microtasks_scope.h",
|
||||
"shell/common/gin_helper/object_template_builder.cc",
|
||||
"shell/common/gin_helper/object_template_builder.h",
|
||||
"shell/common/gin_helper/persistent_dictionary.cc",
|
||||
|
||||
@@ -71,7 +71,7 @@ const roles = {
|
||||
},
|
||||
pasteandmatchstyle: {
|
||||
label: 'Paste and Match Style',
|
||||
accelerator: 'Shift+CommandOrControl+V',
|
||||
accelerator: isMac ? 'Cmd+Option+Shift+V' : 'Shift+CommandOrControl+V',
|
||||
webContentsMethod: 'pasteAndMatchStyle',
|
||||
registerAccelerator: false
|
||||
},
|
||||
|
||||
@@ -14,16 +14,48 @@ if (!features.isRemoteModuleEnabled()) {
|
||||
throw new Error('remote module is disabled');
|
||||
}
|
||||
|
||||
const hasProp = {}.hasOwnProperty;
|
||||
|
||||
// The internal properties of Function.
|
||||
const FUNCTION_PROPERTIES = [
|
||||
'length', 'name', 'arguments', 'caller', 'prototype'
|
||||
];
|
||||
|
||||
type RendererFunctionId = [string, number] // [contextId, funcId]
|
||||
type FinalizerInfo = { id: RendererFunctionId, webContents: electron.WebContents, frameId: number };
|
||||
type WeakRef<T> = { deref(): T | undefined }
|
||||
type CallIntoRenderer = (...args: any[]) => void
|
||||
|
||||
// The remote functions in renderer processes.
|
||||
// id => Function
|
||||
const rendererFunctions = v8Util.createDoubleIDWeakMap<(...args: any[]) => void>();
|
||||
const rendererFunctionCache = new Map<string, WeakRef<CallIntoRenderer>>();
|
||||
// eslint-disable-next-line no-undef
|
||||
const finalizationRegistry = new (globalThis as any).FinalizationRegistry((fi: FinalizerInfo) => {
|
||||
const mapKey = fi.id[0] + '~' + fi.id[1];
|
||||
const ref = rendererFunctionCache.get(mapKey);
|
||||
if (ref !== undefined && ref.deref() === undefined) {
|
||||
rendererFunctionCache.delete(mapKey);
|
||||
if (!fi.webContents.isDestroyed()) { fi.webContents.sendToFrame(fi.frameId, 'ELECTRON_RENDERER_RELEASE_CALLBACK', fi.id[0], fi.id[1]); }
|
||||
}
|
||||
});
|
||||
|
||||
function getCachedRendererFunction (id: RendererFunctionId): CallIntoRenderer | undefined {
|
||||
const mapKey = id[0] + '~' + id[1];
|
||||
const ref = rendererFunctionCache.get(mapKey);
|
||||
if (ref !== undefined) {
|
||||
const deref = ref.deref();
|
||||
if (deref !== undefined) return deref;
|
||||
}
|
||||
}
|
||||
function setCachedRendererFunction (id: RendererFunctionId, wc: electron.WebContents, frameId: number, value: CallIntoRenderer) {
|
||||
// eslint-disable-next-line no-undef
|
||||
const wr = new (globalThis as any).WeakRef(value) as WeakRef<CallIntoRenderer>;
|
||||
const mapKey = id[0] + '~' + id[1];
|
||||
rendererFunctionCache.set(mapKey, wr);
|
||||
finalizationRegistry.register(value, {
|
||||
id,
|
||||
webContents: wc,
|
||||
frameId
|
||||
} as FinalizerInfo);
|
||||
return value;
|
||||
}
|
||||
|
||||
// Return the description of object's members:
|
||||
const getObjectMembers = function (object: any): ObjectMember[] {
|
||||
@@ -80,7 +112,7 @@ const valueToMeta = function (sender: electron.WebContents, contextId: string, v
|
||||
type = 'value';
|
||||
} else if (isPromise(value)) {
|
||||
type = 'promise';
|
||||
} else if (hasProp.call(value, 'callee') && value.length != null) {
|
||||
} else if (Object.prototype.hasOwnProperty.call(value, 'callee') && value.length != null) {
|
||||
// Treat the arguments object as array.
|
||||
type = 'array';
|
||||
} else if (optimizeSimpleObject && v8Util.getHiddenValue(value, 'simple')) {
|
||||
@@ -226,9 +258,8 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont
|
||||
const objectId: [string, number] = [contextId, meta.id];
|
||||
|
||||
// Cache the callbacks in renderer.
|
||||
if (rendererFunctions.has(objectId)) {
|
||||
return rendererFunctions.get(objectId);
|
||||
}
|
||||
const cachedFunction = getCachedRendererFunction(objectId);
|
||||
if (cachedFunction !== undefined) { return cachedFunction; }
|
||||
|
||||
const callIntoRenderer = function (this: any, ...args: any[]) {
|
||||
let succeed = false;
|
||||
@@ -242,8 +273,7 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont
|
||||
v8Util.setHiddenValue(callIntoRenderer, 'location', meta.location);
|
||||
Object.defineProperty(callIntoRenderer, 'length', { value: meta.length });
|
||||
|
||||
v8Util.setRemoteCallbackFreer(callIntoRenderer, frameId, contextId, meta.id, sender);
|
||||
rendererFunctions.set(objectId, callIntoRenderer);
|
||||
setCachedRendererFunction(objectId, sender, frameId, callIntoRenderer);
|
||||
return callIntoRenderer;
|
||||
}
|
||||
default:
|
||||
@@ -308,11 +338,12 @@ const logStack = function (contents: electron.WebContents, code: string, stack:
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_WRONG_CONTEXT_ERROR', function (event, contextId, passedContextId, id) {
|
||||
const objectId: [string, number] = [passedContextId, id];
|
||||
if (!rendererFunctions.has(objectId)) {
|
||||
const cachedFunction = getCachedRendererFunction(objectId);
|
||||
if (cachedFunction === undefined) {
|
||||
// Do nothing if the error has already been reported before.
|
||||
return;
|
||||
}
|
||||
removeRemoteListenersAndLogWarning(event.sender, rendererFunctions.get(objectId)!);
|
||||
removeRemoteListenersAndLogWarning(event.sender, cachedFunction);
|
||||
});
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_REQUIRE', function (event, contextId, moduleName, stack) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "11.0.0-nightly.20200616",
|
||||
"version": "11.0.0-nightly.20200619",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -101,3 +101,4 @@ fix_swap_global_proxies_before_initializing_the_windows_proxies.patch
|
||||
fix_default_to_ntlm_v2_in_network_service.patch
|
||||
feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch
|
||||
fix_handling_non_client_pointer_events_from_pen_on_windows_10.patch
|
||||
remove_menu_window_task_item.patch
|
||||
|
||||
20
patches/chromium/remove_menu_window_task_item.patch
Normal file
20
patches/chromium/remove_menu_window_task_item.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 4 Oct 2018 14:57:02 -0700
|
||||
Subject: fix: remove menu window from taskbar
|
||||
|
||||
Refs https://chromium-review.googlesource.com/c/chromium/src/+/2245941
|
||||
|
||||
diff --git a/ui/views/widget/widget_hwnd_utils.cc b/ui/views/widget/widget_hwnd_utils.cc
|
||||
index 40e66a212e3ea158b61f11d804a3c1644023b2d7..89f5b62f95dfec59bacf79f33895438039fac1c5 100644
|
||||
--- a/ui/views/widget/widget_hwnd_utils.cc
|
||||
+++ b/ui/views/widget/widget_hwnd_utils.cc
|
||||
@@ -118,6 +118,8 @@ void CalculateWindowStylesFromInitParams(
|
||||
else
|
||||
*style |= WS_BORDER;
|
||||
}
|
||||
+ if (!params.force_show_in_taskbar)
|
||||
+ *ex_style |= WS_EX_TOOLWINDOW;
|
||||
break;
|
||||
case Widget::InitParams::TYPE_TOOLTIP:
|
||||
*style |= WS_POPUP;
|
||||
1
patches/common/zlib/.patches
Normal file
1
patches/common/zlib/.patches
Normal file
@@ -0,0 +1 @@
|
||||
fix_export_zlib_symbols.patch
|
||||
22
patches/common/zlib/fix_export_zlib_symbols.patch
Normal file
22
patches/common/zlib/fix_export_zlib_symbols.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 1 Jun 2020 15:30:47 -0800
|
||||
Subject: fix: export zlib symbols
|
||||
|
||||
This patch sets ZLIB_DLL so that we properly export zlib symbols.
|
||||
|
||||
diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn
|
||||
index aeff252d66abe1797154b975d3b98d02cab6f4f6..5c34134486b30ae650aab93abb8da38b7aa4fe13 100644
|
||||
--- a/third_party/zlib/BUILD.gn
|
||||
+++ b/third_party/zlib/BUILD.gn
|
||||
@@ -272,6 +272,10 @@ component("zlib") {
|
||||
defines = []
|
||||
deps = []
|
||||
|
||||
+ if (is_win) {
|
||||
+ defines += [ "ZLIB_DLL" ]
|
||||
+ }
|
||||
+
|
||||
if (!use_x86_x64_optimizations && !use_arm_neon_optimizations) {
|
||||
# Apparently android_cronet bot builds with NEON disabled and
|
||||
# we also should disable optimizations for iOS@x86 (a.k.a. simulator).
|
||||
@@ -35,4 +35,6 @@ weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch
|
||||
weakrefs_split_out_finalizationregistry_cleanupsome.patch
|
||||
fix_window_c-ares_incompatibilities.patch
|
||||
chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch
|
||||
win_use_rtlgenrandom_from_advapi32_dll_directly.patch
|
||||
fix_remove_bad_semicolon_outside_fn.patch
|
||||
fix_comment_out_incompatible_crypto_modules.patch
|
||||
test_account_for_non-node_basename.patch
|
||||
|
||||
@@ -9,7 +9,7 @@ V8 v8.1.
|
||||
This is already present in Node.js v14 and can be removed when we upgrade.
|
||||
|
||||
diff --git a/src/node_serdes.cc b/src/node_serdes.cc
|
||||
index a2d185c4167a75e227cd4b2abbf5c5abc7e16acb..e918ed9d12e9fb1d13b2fc05a98cab099fb71a68 100644
|
||||
index bcdcd19b261e8815e3c0c0f150f2eda72ef47cf5..86fb822dd5bfa9da7767418e6c6f206f8e96ca73 100644
|
||||
--- a/src/node_serdes.cc
|
||||
+++ b/src/node_serdes.cc
|
||||
@@ -286,7 +286,6 @@ DeserializerContext::DeserializerContext(Environment* env,
|
||||
|
||||
@@ -7,10 +7,10 @@ This adds GN build files for Node, so we don't have to build with GYP.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e30c77dd71
|
||||
index 0000000000000000000000000000000000000000..b5ea846fd9fd46f34dd4260b67282186fddbc0be
|
||||
--- /dev/null
|
||||
+++ b/BUILD.gn
|
||||
@@ -0,0 +1,376 @@
|
||||
@@ -0,0 +1,360 @@
|
||||
+import("//electron/build/asar.gni")
|
||||
+import("//v8/gni/v8.gni")
|
||||
+
|
||||
@@ -18,9 +18,6 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
|
||||
+ # Enable the V8 inspector protocol for use with node.
|
||||
+ node_enable_inspector = true
|
||||
+
|
||||
+ # Enable diagnostic reporting withing Node.js
|
||||
+ node_report = true
|
||||
+
|
||||
+ # Build node with SSL support.
|
||||
+ # The variable is called "openssl" for parity with node's GYP build.
|
||||
+ node_use_openssl = true
|
||||
@@ -126,11 +123,6 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
|
||||
+ } else {
|
||||
+ defines += [ "NODE_USE_V8_PLATFORM=0" ]
|
||||
+ }
|
||||
+ if (node_report) {
|
||||
+ defines += [ "NODE_REPORT=1" ]
|
||||
+ } else {
|
||||
+ defines += [ "NODE_REPORT=0" ]
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+config("node_lib_config") {
|
||||
@@ -217,7 +209,7 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
|
||||
+ "deps/llhttp",
|
||||
+ "deps/nghttp2",
|
||||
+ "deps/uvwasi",
|
||||
+ "deps/zlib",
|
||||
+ "//third_party/zlib",
|
||||
+ "//third_party/brotli:dec",
|
||||
+ "//third_party/brotli:enc",
|
||||
+ "//v8:v8_libplatform",
|
||||
@@ -262,14 +254,6 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
|
||||
+ libs += [ "CoreFoundation.framework" ]
|
||||
+ }
|
||||
+
|
||||
+ if (node_report) {
|
||||
+ sources += [
|
||||
+ "src/node_report.cc",
|
||||
+ "src/node_report_module.cc",
|
||||
+ "src/node_report_utils.cc",
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
+ if (node_enable_inspector) {
|
||||
+ sources += [
|
||||
+ "src/inspector_agent.cc",
|
||||
@@ -291,7 +275,7 @@ index 0000000000000000000000000000000000000000..2d8952a1d23af0ab4b3e5de0e56ec1e3
|
||||
+ sources += [
|
||||
+ "src/node_crypto.cc",
|
||||
+ "src/node_crypto.h",
|
||||
+ "src/node_crypto_common.cc",
|
||||
+ "src/node_crypto_common.cc",
|
||||
+ "src/node_crypto_common.h",
|
||||
+ "src/node_crypto_bio.cc",
|
||||
+ "src/node_crypto_bio.h",
|
||||
@@ -837,10 +821,10 @@ index 0000000000000000000000000000000000000000..67116f2070bb9200aace81afdf0b1e7a
|
||||
+}
|
||||
diff --git a/deps/uvwasi/BUILD.gn b/deps/uvwasi/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c7128ab5eec
|
||||
index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df6369a765c07
|
||||
--- /dev/null
|
||||
+++ b/deps/uvwasi/BUILD.gn
|
||||
@@ -0,0 +1,35 @@
|
||||
@@ -0,0 +1,38 @@
|
||||
+config("uvwasi_config") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+}
|
||||
@@ -862,7 +846,7 @@ index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c71
|
||||
+ deps = [ "../../deps/uv" ]
|
||||
+
|
||||
+ public_configs = [ ":uvwasi_config" ]
|
||||
+
|
||||
+
|
||||
+ cflags_c = []
|
||||
+ if (!is_win) {
|
||||
+ cflags_c += [ "-fvisibility=hidden" ]
|
||||
@@ -871,81 +855,20 @@ index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c71
|
||||
+ sources = [
|
||||
+ "src/clocks.c",
|
||||
+ "src/fd_table.c",
|
||||
+ "src/path_resolver.c",
|
||||
+ "src/poll_oneoff.c",
|
||||
+ "src/uv_mapping.c",
|
||||
+ "src/uvwasi.c",
|
||||
+ "src/wasi_rights.c",
|
||||
+ "src/wasi_serdes.c"
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/deps/zlib/BUILD.gn b/deps/zlib/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2eaaea76280
|
||||
--- /dev/null
|
||||
+++ b/deps/zlib/BUILD.gn
|
||||
@@ -0,0 +1,58 @@
|
||||
+config("includes") {
|
||||
+ include_dirs = [ "." ]
|
||||
+}
|
||||
+
|
||||
+config("ignored_warnings") {
|
||||
+ if (is_win) {
|
||||
+ cflags = [
|
||||
+ "/wd4131", # old-style declarator
|
||||
+ "/wd4127", # conditional expression is constant
|
||||
+ "/wd4244", # possible loss of data on type conversion
|
||||
+ "/wd4996", # deprecated 'open'
|
||||
+ ]
|
||||
+ } else {
|
||||
+ cflags = [
|
||||
+ "-Wno-implicit-function-declaration",
|
||||
+ "-Wno-shift-negative-value",
|
||||
+ ]
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+source_set("zlib") {
|
||||
+ sources = [
|
||||
+ "adler32.c",
|
||||
+ "compress.c",
|
||||
+ "crc32.c",
|
||||
+ "crc32.h",
|
||||
+ "deflate.c",
|
||||
+ "deflate.h",
|
||||
+ "gzclose.c",
|
||||
+ "gzguts.h",
|
||||
+ "gzlib.c",
|
||||
+ "gzread.c",
|
||||
+ "gzwrite.c",
|
||||
+ "infback.c",
|
||||
+ "inffast.c",
|
||||
+ "inffast.h",
|
||||
+ "inffixed.h",
|
||||
+ "inflate.c",
|
||||
+ "inflate.h",
|
||||
+ "inftrees.c",
|
||||
+ "inftrees.h",
|
||||
+ "trees.c",
|
||||
+ "trees.h",
|
||||
+ "uncompr.c",
|
||||
+ "zconf.h",
|
||||
+ "zlib.h",
|
||||
+ "zutil.c",
|
||||
+ "zutil.h",
|
||||
+ ]
|
||||
+
|
||||
+ if (is_win) {
|
||||
+ defines = [ "ZLIB_DLL" ]
|
||||
+ }
|
||||
+
|
||||
+ configs += [ ":ignored_warnings" ]
|
||||
+
|
||||
+ public_configs = [ ":includes" ]
|
||||
+}
|
||||
diff --git a/filenames.json b/filenames.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf1520b376e7e
|
||||
index 0000000000000000000000000000000000000000..ca5ae6d2e24d53db37257192f3c34068ba0f8e69
|
||||
--- /dev/null
|
||||
+++ b/filenames.json
|
||||
@@ -0,0 +1,500 @@
|
||||
@@ -0,0 +1,513 @@
|
||||
+// This file is automatically generated by generate_gn_filenames_json.py
|
||||
+// DO NOT EDIT
|
||||
+{
|
||||
@@ -1161,6 +1084,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
|
||||
+ "lib/internal/fs/utils.js",
|
||||
+ "lib/internal/fs/watchers.js",
|
||||
+ "lib/internal/http.js",
|
||||
+ "lib/internal/heap_utils.js",
|
||||
+ "lib/internal/histogram.js",
|
||||
+ "lib/internal/idna.js",
|
||||
+ "lib/internal/inspector_async_hook.js",
|
||||
@@ -1235,6 +1159,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
|
||||
+ "lib/internal/vm/module.js",
|
||||
+ "lib/internal/worker.js",
|
||||
+ "lib/internal/worker/io.js",
|
||||
+ "lib/internal/watchdog.js",
|
||||
+ "lib/internal/streams/lazy_transform.js",
|
||||
+ "lib/internal/streams/async_iterator.js",
|
||||
+ "lib/internal/streams/buffer_list.js",
|
||||
@@ -1291,6 +1216,7 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
|
||||
+ "src/js_native_api_v8.h",
|
||||
+ "src/js_native_api_v8_internals.h",
|
||||
+ "src/js_stream.cc",
|
||||
+ "src/json_utils.cc",
|
||||
+ "src/module_wrap.cc",
|
||||
+ "src/node.cc",
|
||||
+ "src/node_api.cc",
|
||||
@@ -1322,7 +1248,11 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
|
||||
+ "src/node_process_events.cc",
|
||||
+ "src/node_process_methods.cc",
|
||||
+ "src/node_process_object.cc",
|
||||
+ "src/node_report.cc",
|
||||
+ "src/node_report_module.cc",
|
||||
+ "src/node_report_utils.cc",
|
||||
+ "src/node_serdes.cc",
|
||||
+ "src/node_sockaddr.cc",
|
||||
+ "src/node_stat_watcher.cc",
|
||||
+ "src/node_symbols.cc",
|
||||
+ "src/node_task_queue.cc",
|
||||
@@ -1373,6 +1303,9 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
|
||||
+ "src/histogram-inl.h",
|
||||
+ "src/http_parser_adaptor.h",
|
||||
+ "src/js_stream.h",
|
||||
+ "src/json_utils.h",
|
||||
+ "src/large_pages/node_large_page.cc",
|
||||
+ "src/large_pages/node_large_page.h",
|
||||
+ "src/memory_tracker.h",
|
||||
+ "src/memory_tracker-inl.h",
|
||||
+ "src/module_wrap.h",
|
||||
@@ -1408,8 +1341,11 @@ index 0000000000000000000000000000000000000000..c94fb6b3c4483b0b9270dcf582cdf152
|
||||
+ "src/node_perf_common.h",
|
||||
+ "src/node_platform.h",
|
||||
+ "src/node_process.h",
|
||||
+ "src/node_report.h",
|
||||
+ "src/node_revert.h",
|
||||
+ "src/node_root_certs.h",
|
||||
+ "src/node_sockaddr.h",
|
||||
+ "src/node_sockaddr-inl.h",
|
||||
+ "src/node_stat_watcher.h",
|
||||
+ "src/node_union_bytes.h",
|
||||
+ "src/node_url.h",
|
||||
@@ -1652,7 +1588,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c
|
||||
+ args = rebase_path(inputs + outputs, root_build_dir)
|
||||
+}
|
||||
diff --git a/src/node_version.h b/src/node_version.h
|
||||
index 958519fbe4a83293f5c7bfabb310d3f15d319922..935ead39a1148c22f8c778df750e0c24ceafe909 100644
|
||||
index 3d9276b8c92ad49681147b809a276c8157907b5e..2cc9fa91bf20bbde278e5d333ca485c0c159504e 100644
|
||||
--- a/src/node_version.h
|
||||
+++ b/src/node_version.h
|
||||
@@ -89,7 +89,10 @@
|
||||
|
||||
@@ -10,7 +10,7 @@ THe fix for this should land in node-gyp as discussed in above issue,
|
||||
landing this as temporary patch.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 1c753edfefa96d69c5de7d54078fa3136b244b52..71b20b28d923c39f047bf57e05558879c9d002ec 100644
|
||||
index 344466dd249323768541ae8c6c2800795845eea8..572597ef60c13dfc332c7da49b606867f0561c54 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
@@ -14,7 +14,7 @@ renderer/browser/worker/sandboxed bootstrap scripts). These are loaded
|
||||
through LoadEmbedderJavaScriptSource()
|
||||
|
||||
diff --git a/src/node_native_module.cc b/src/node_native_module.cc
|
||||
index 43c13ea30a0dc56151cba3d4597ae81b27c41300..e9a43592d558409d5fd43e2f51b22efb4e41551d 100644
|
||||
index 1b916d645d863929710ce5e4e930ec72fb426844..6d39a8858e093199fb935b68ff84388d48d6c35e 100644
|
||||
--- a/src/node_native_module.cc
|
||||
+++ b/src/node_native_module.cc
|
||||
@@ -23,6 +23,7 @@ NativeModuleLoader NativeModuleLoader::instance_;
|
||||
@@ -26,7 +26,7 @@ index 43c13ea30a0dc56151cba3d4597ae81b27c41300..e9a43592d558409d5fd43e2f51b22efb
|
||||
|
||||
NativeModuleLoader* NativeModuleLoader::GetInstance() {
|
||||
diff --git a/src/node_native_module.h b/src/node_native_module.h
|
||||
index fabaea75686161f488a03349e07049a513b98fad..5a6b01dc12fb77d5f8c26a1153ead2a1b2a8d061 100644
|
||||
index c0bce3bce42c848d63a10147ef483c9d4465f5ce..7f296e459d46b4cda51baf9887df060f0372227d 100644
|
||||
--- a/src/node_native_module.h
|
||||
+++ b/src/node_native_module.h
|
||||
@@ -44,6 +44,7 @@ class NativeModuleLoader {
|
||||
|
||||
@@ -8,10 +8,10 @@ once we stop warning and begin to unilaterally prevent non-context aware modules
|
||||
from being loaded.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index cef4e5086ca8160a7d715915f735963e369068b1..35ad9ee1a685177894bb5c13c58c16af2ccee362 100644
|
||||
index 0a7c4a47c11eb4bb360b6a46fccb4692241bd2dc..b4a0f71af5853f427a10449b52509052fbe3facd 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -86,8 +86,10 @@ function patchProcessObject(expandArgv1) {
|
||||
@@ -89,8 +89,10 @@ function patchProcessObject(expandArgv1) {
|
||||
|
||||
if (expandArgv1 && process.argv[1] && !process.argv[1].startsWith('-')) {
|
||||
// Expand process.argv[1] into a full path.
|
||||
@@ -23,10 +23,10 @@ index cef4e5086ca8160a7d715915f735963e369068b1..35ad9ee1a685177894bb5c13c58c16af
|
||||
|
||||
// TODO(joyeecheung): most of these should be deprecated and removed,
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 992482525f8bdea399528f1e5673f4efa21b7246..800c22dea9c07a4039e6e7eabeae73a9b8013e09 100644
|
||||
index e478c57af873da717c00db73d6719f806280efe1..1c949cab49224a6f1be7685acfd3ed19e11526c3 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -1104,6 +1104,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
@@ -1109,6 +1109,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (getOptionValue('--inspect-brk') && process._eval == null) {
|
||||
if (!resolvedArgv) {
|
||||
// We enter the repl if we're not given a filename argument.
|
||||
@@ -41,10 +41,10 @@ index 992482525f8bdea399528f1e5673f4efa21b7246..800c22dea9c07a4039e6e7eabeae73a9
|
||||
try {
|
||||
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f5a3ac3f5 100644
|
||||
index c1fda87ecd536f2347f5011414932ec79aebfc60..12ba5b69369e858ee9e743ef06059d6cd5541078 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -880,6 +880,15 @@ class Environment : public MemoryRetainer {
|
||||
@@ -888,6 +888,15 @@ class Environment : public MemoryRetainer {
|
||||
uint64_t thread_id = kNoThreadId);
|
||||
~Environment() override;
|
||||
|
||||
@@ -60,7 +60,7 @@ index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f
|
||||
void InitializeLibuv(bool start_profiler_idle_notifier);
|
||||
inline const std::vector<std::string>& exec_argv();
|
||||
inline const std::vector<std::string>& argv();
|
||||
@@ -1266,6 +1275,9 @@ class Environment : public MemoryRetainer {
|
||||
@@ -1271,6 +1280,9 @@ class Environment : public MemoryRetainer {
|
||||
inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
|
||||
const char* errmsg);
|
||||
|
||||
@@ -71,7 +71,7 @@ index cdcb8f5cf3b9233e6e83a99d98cfd1228bcef680..b67f1e4876f42ae37a49bbcb865c049f
|
||||
v8::Isolate* const isolate_;
|
||||
IsolateData* const isolate_data_;
|
||||
diff --git a/src/node_binding.cc b/src/node_binding.cc
|
||||
index db60617cebee83ac09371aa1e2200280e29bd772..714f973a7e984fef2e705882a3f30d8a95c33653 100644
|
||||
index 565a3fff85a25ef25ccf5c74d2ade7f5a6994b05..814f01f6144c0a0e053d2100f88e29ca2179b4a0 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -3,6 +3,7 @@
|
||||
@@ -82,7 +82,7 @@ index db60617cebee83ac09371aa1e2200280e29bd772..714f973a7e984fef2e705882a3f30d8a
|
||||
#include "util.h"
|
||||
|
||||
#if HAVE_OPENSSL
|
||||
@@ -467,10 +468,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -462,10 +463,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
if (mp != nullptr) {
|
||||
if (mp->nm_context_register_func == nullptr) {
|
||||
|
||||
@@ -7,7 +7,7 @@ This is used so that we can modify the flag at runtime where
|
||||
config can only be set at compile time.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
|
||||
index 36d06759aac57b1aa813b52c94e2168b8a8f9087..fd97a471aecc5182dfc3790286a3e01f02117937 100644
|
||||
index 4e7c3c10255a0eae4d5333f88e51cf7178163a44..a6e33757ca00771671583203c37d9b121abf489b 100644
|
||||
--- a/lib/internal/bootstrap/node.js
|
||||
+++ b/lib/internal/bootstrap/node.js
|
||||
@@ -118,7 +118,7 @@ const {
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: chore: SetHostCleanupFinalizationGroupCallback has been removed from
|
||||
V8
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 68ccef87356755a8a99283d55bf5492831a46ce0..7b370579d365204b2bd40a25e740bbc83726c376 100644
|
||||
index 60d30b7eff7329c4235024c31525107216d70d7a..21980987644c6e83029157785dea463070456c77 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -12,7 +12,6 @@ using errors::TryCatchScope;
|
||||
@@ -14,9 +14,9 @@ index 68ccef87356755a8a99283d55bf5492831a46ce0..7b370579d365204b2bd40a25e740bbc8
|
||||
using v8::EscapableHandleScope;
|
||||
-using v8::FinalizationGroup;
|
||||
using v8::Function;
|
||||
using v8::FunctionCallbackInfo;
|
||||
using v8::HandleScope;
|
||||
using v8::Isolate;
|
||||
@@ -77,15 +76,6 @@ static MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
|
||||
@@ -78,15 +77,6 @@ static MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ index 68ccef87356755a8a99283d55bf5492831a46ce0..7b370579d365204b2bd40a25e740bbc8
|
||||
-}
|
||||
-
|
||||
void* NodeArrayBufferAllocator::Allocate(size_t size) {
|
||||
void* ret;
|
||||
if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers)
|
||||
return UncheckedCalloc(size);
|
||||
@@ -228,11 +218,6 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
|
||||
@@ -255,11 +245,6 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
|
||||
s.promise_reject_callback : task_queue::PromiseRejectCallback;
|
||||
isolate->SetPromiseRejectCallback(promise_reject_cb);
|
||||
|
||||
@@ -45,10 +45,10 @@ index 68ccef87356755a8a99283d55bf5492831a46ce0..7b370579d365204b2bd40a25e740bbc8
|
||||
v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate);
|
||||
}
|
||||
diff --git a/src/env-inl.h b/src/env-inl.h
|
||||
index 5248e7062354c1deb90b58a784237e6f01335c22..e2a104c9c4562abeb579fe62c9c46ca34bf03581 100644
|
||||
index c6ef9dc13ab6f1d1a778871a62a0a98a01d84ec6..222555831aa1bf0b7b29b4b46e235c98a5dd4ac5 100644
|
||||
--- a/src/env-inl.h
|
||||
+++ b/src/env-inl.h
|
||||
@@ -1182,12 +1182,6 @@ void Environment::RemoveCleanupHook(void (*fn)(void*), void* arg) {
|
||||
@@ -1123,12 +1123,6 @@ void Environment::RemoveCleanupHook(void (*fn)(void*), void* arg) {
|
||||
cleanup_hooks_.erase(search);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ index 5248e7062354c1deb90b58a784237e6f01335c22..e2a104c9c4562abeb579fe62c9c46ca3
|
||||
const CleanupHookCallback& cb) const {
|
||||
return std::hash<void*>()(cb.arg_);
|
||||
diff --git a/src/env.cc b/src/env.cc
|
||||
index 65e4bda890461f691036005252db7e61865d2493..694bfd866a4d7f43046ea97a3e97ea503fffc21b 100644
|
||||
index c56a25f31e42aaf8bcbc0e3bb3db4f7aad0cf124..58f2372d664c4c6f8a513cb4206c24940891aa6d 100644
|
||||
--- a/src/env.cc
|
||||
+++ b/src/env.cc
|
||||
@@ -30,7 +30,6 @@ using v8::ArrayBuffer;
|
||||
@@ -73,7 +73,7 @@ index 65e4bda890461f691036005252db7e61865d2493..694bfd866a4d7f43046ea97a3e97ea50
|
||||
using v8::Function;
|
||||
using v8::FunctionTemplate;
|
||||
using v8::HandleScope;
|
||||
@@ -473,7 +472,6 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) {
|
||||
@@ -500,7 +499,6 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) {
|
||||
[](uv_async_t* async) {
|
||||
Environment* env = ContainerOf(
|
||||
&Environment::task_queues_async_, async);
|
||||
@@ -81,7 +81,7 @@ index 65e4bda890461f691036005252db7e61865d2493..694bfd866a4d7f43046ea97a3e97ea50
|
||||
env->RunAndClearNativeImmediates();
|
||||
});
|
||||
uv_unref(reinterpret_cast<uv_handle_t*>(&idle_prepare_handle_));
|
||||
@@ -1112,25 +1110,6 @@ void Environment::RunWeakRefCleanup() {
|
||||
@@ -1127,25 +1125,6 @@ void Environment::RunWeakRefCleanup() {
|
||||
isolate()->ClearKeptObjects();
|
||||
}
|
||||
|
||||
@@ -108,10 +108,10 @@ index 65e4bda890461f691036005252db7e61865d2493..694bfd866a4d7f43046ea97a3e97ea50
|
||||
void BaseObject::DeleteMe(void* data) {
|
||||
BaseObject* self = static_cast<BaseObject*>(data);
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index b67f1e4876f42ae37a49bbcb865c049f5a3ac3f5..e269c47ae3814b42fdd2792360c1acb1995e98d2 100644
|
||||
index 12ba5b69369e858ee9e743ef06059d6cd5541078..b0b9b17dd6684c10139435b85e8724e31ad4d92c 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -1125,9 +1125,7 @@ class Environment : public MemoryRetainer {
|
||||
@@ -1130,9 +1130,7 @@ class Environment : public MemoryRetainer {
|
||||
void AtExit(void (*cb)(void* arg), void* arg);
|
||||
void RunAtExitCallbacks();
|
||||
|
||||
@@ -121,7 +121,7 @@ index b67f1e4876f42ae37a49bbcb865c049f5a3ac3f5..e269c47ae3814b42fdd2792360c1acb1
|
||||
|
||||
// Strings and private symbols are shared across shared contexts
|
||||
// The getters simply proxy to the per-isolate primitive.
|
||||
@@ -1350,8 +1348,6 @@ class Environment : public MemoryRetainer {
|
||||
@@ -1355,8 +1353,6 @@ class Environment : public MemoryRetainer {
|
||||
uint64_t thread_id_;
|
||||
std::unordered_set<worker::Worker*> sub_worker_contexts_;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid
|
||||
out in memory on 64-bit machines, and will summarily fail to work.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 71b20b28d923c39f047bf57e05558879c9d002ec..0a10a734d48e0b45b0ed4502927616e46633dafb 100644
|
||||
index 572597ef60c13dfc332c7da49b606867f0561c54..db8dc7452552beb6a758d1b6175bd402b6a09d24 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -71,6 +71,9 @@
|
||||
@@ -31,7 +31,7 @@ index 71b20b28d923c39f047bf57e05558879c9d002ec..0a10a734d48e0b45b0ed4502927616e4
|
||||
['target_arch in "ppc64 s390x"', {
|
||||
'v8_enable_backtrace': 1,
|
||||
}],
|
||||
@@ -374,6 +380,12 @@
|
||||
@@ -378,6 +384,12 @@
|
||||
}],
|
||||
],
|
||||
}],
|
||||
|
||||
@@ -9,10 +9,10 @@ modules to sandboxed renderers.
|
||||
TODO(codebytere): remove and replace with a public facing API.
|
||||
|
||||
diff --git a/src/node_binding.cc b/src/node_binding.cc
|
||||
index 0facfc36cbcb784cd0a1802a7748dff3366710fd..db60617cebee83ac09371aa1e2200280e29bd772 100644
|
||||
index 91ae3530d09b162c910eef4199d89c33c9feb379..565a3fff85a25ef25ccf5c74d2ade7f5a6994b05 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -611,6 +611,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -606,6 +606,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
args.GetReturnValue().Set(exports);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ Environment on the V8 context of blink, so no new V8 context is created.
|
||||
As a result, a renderer process may have multiple Node Environments in it.
|
||||
|
||||
diff --git a/src/env.cc b/src/env.cc
|
||||
index ec50d8841ac1e360411a87b3bfc1454969696582..65e4bda890461f691036005252db7e61865d2493 100644
|
||||
index 657d711e539d81bfd03166bbaaae7f0b5db91a5f..c56a25f31e42aaf8bcbc0e3bb3db4f7aad0cf124 100644
|
||||
--- a/src/env.cc
|
||||
+++ b/src/env.cc
|
||||
@@ -383,6 +383,12 @@ Environment::Environment(IsolateData* isolate_data,
|
||||
@@ -410,6 +410,12 @@ Environment::Environment(IsolateData* isolate_data,
|
||||
// TODO(joyeecheung): deserialize when the snapshot covers the environment
|
||||
// properties.
|
||||
CreateProperties();
|
||||
@@ -41,18 +41,10 @@ index ec50d8841ac1e360411a87b3bfc1454969696582..65e4bda890461f691036005252db7e61
|
||||
|
||||
Environment::~Environment() {
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2c7fde060 100644
|
||||
index 4ff7824b0011685289716d61b02427c3e264965d..2a21c6dfe74b97c0d4ca8608486f8f35c77cc831 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "env-inl.h"
|
||||
#include "memory_tracker-inl.h"
|
||||
#include "node_binding.h"
|
||||
+#include "node_errors.h"
|
||||
#include "node_internals.h"
|
||||
#include "node_main_instance.h"
|
||||
#include "node_metadata.h"
|
||||
@@ -128,6 +129,9 @@ using v8::Undefined;
|
||||
@@ -122,6 +122,9 @@ using v8::Undefined;
|
||||
using v8::V8;
|
||||
using v8::Value;
|
||||
|
||||
@@ -62,7 +54,7 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2
|
||||
namespace per_process {
|
||||
|
||||
// node_revert.h
|
||||
@@ -343,6 +347,13 @@ MaybeLocal<Value> Environment::RunBootstrapping() {
|
||||
@@ -337,6 +340,13 @@ MaybeLocal<Value> Environment::RunBootstrapping() {
|
||||
|
||||
CHECK(!has_run_bootstrapping_code());
|
||||
|
||||
@@ -76,7 +68,7 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2
|
||||
if (BootstrapInternalLoaders().IsEmpty()) {
|
||||
return MaybeLocal<Value>();
|
||||
}
|
||||
@@ -726,7 +737,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -733,7 +743,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
binding::RegisterBuiltinModules();
|
||||
|
||||
// Make inherited handles noninheritable.
|
||||
@@ -85,9 +77,9 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2
|
||||
+ uv_disable_stdio_inheritance();
|
||||
+ }
|
||||
|
||||
#ifdef NODE_REPORT
|
||||
// Cache the original command line to be
|
||||
@@ -762,6 +775,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
// used in diagnostic reports.
|
||||
@@ -767,6 +779,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
if (exit_code != 0) return exit_code;
|
||||
}
|
||||
#endif
|
||||
@@ -96,7 +88,7 @@ index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2
|
||||
|
||||
const int exit_code = ProcessGlobalArgs(argv,
|
||||
exec_argv,
|
||||
@@ -806,6 +821,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -811,6 +825,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
}
|
||||
per_process::metadata.versions.InitializeIntlVersions();
|
||||
#endif
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: feat: add uv_loop watcher_queue code
|
||||
Electron's Node Integration works by listening to Node's backend file descriptor in a separate thread; when an event is ready the backend file descriptor will trigger a new event for it, and the main thread will then iterate the libuv loop. For certain operations (ex. adding a timeout task) the backend file descriptor isn't informed, & as a result the main thread doesn't know it needs to iterate the libuv loop so the timeout task will never execute until something else trigger a new event. This commit should be removed when https://github.com/libuv/libuv/pull/1921 is merged
|
||||
|
||||
diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h
|
||||
index 626cebabd8c9ea13410a61286e902e0b0986257b..7f1ea84a768baa0d22351456600fef20c7f3f310 100644
|
||||
index fec663136a4ff14480cc8edcf846cba320ddd4eb..653c8910d7350185d1db4d343e19236a899b3a04 100644
|
||||
--- a/deps/uv/include/uv.h
|
||||
+++ b/deps/uv/include/uv.h
|
||||
@@ -1740,6 +1740,8 @@ union uv_any_req {
|
||||
@@ -1770,6 +1770,8 @@ union uv_any_req {
|
||||
struct uv_loop_s {
|
||||
/* User data - use this for whatever. */
|
||||
void* data;
|
||||
@@ -19,10 +19,10 @@ index 626cebabd8c9ea13410a61286e902e0b0986257b..7f1ea84a768baa0d22351456600fef20
|
||||
unsigned int active_handles;
|
||||
void* handle_queue[2];
|
||||
diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c
|
||||
index 04999dce36d19383fc574a6c061b7b4d0c46f6dc..f8c523cde05fcf440423e1865920b75ad9e633a2 100644
|
||||
index 949eefae339919c36775d6c1bbca5f6f9b3b6201..454bd1bd3c2c7be34b764be39962b35e4e3066f6 100644
|
||||
--- a/deps/uv/src/unix/core.c
|
||||
+++ b/deps/uv/src/unix/core.c
|
||||
@@ -899,8 +899,11 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
|
||||
@@ -885,8 +885,11 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
|
||||
return;
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,7 @@ index 04999dce36d19383fc574a6c061b7b4d0c46f6dc..f8c523cde05fcf440423e1865920b75a
|
||||
|
||||
if (loop->watchers[w->fd] == NULL) {
|
||||
loop->watchers[w->fd] = w;
|
||||
@@ -936,8 +939,11 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
|
||||
@@ -922,8 +925,11 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
|
||||
w->events = 0;
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ index 04999dce36d19383fc574a6c061b7b4d0c46f6dc..f8c523cde05fcf440423e1865920b75a
|
||||
}
|
||||
|
||||
|
||||
@@ -954,6 +960,8 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
|
||||
@@ -940,6 +946,8 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
|
||||
void uv__io_feed(uv_loop_t* loop, uv__io_t* w) {
|
||||
if (QUEUE_EMPTY(&w->pending_queue))
|
||||
QUEUE_INSERT_TAIL(&loop->pending_queue, &w->pending_queue);
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: feat: initialize asar support
|
||||
This patch initializes asar support in Node.js.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index 1b05d6e30a0ba004ac3c1113da3ad649a6e74dcc..cef4e5086ca8160a7d715915f735963e369068b1 100644
|
||||
index 3d5e0061daa8d11a1c8c535eb0ae7179864a2d02..0a7c4a47c11eb4bb360b6a46fccb4692241bd2dc 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -67,6 +67,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
@@ -70,6 +70,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
|
||||
loadPreloadModules();
|
||||
initializeFrozenIntrinsics();
|
||||
@@ -17,7 +17,7 @@ index 1b05d6e30a0ba004ac3c1113da3ad649a6e74dcc..cef4e5086ca8160a7d715915f735963e
|
||||
}
|
||||
|
||||
function patchProcessObject(expandArgv1) {
|
||||
@@ -445,6 +446,10 @@ function loadPreloadModules() {
|
||||
@@ -440,6 +441,10 @@ function loadPreloadModules() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ common.gypi is a file that's included in the node header bundle, despite
|
||||
the fact that we do not build node with gyp.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index fd3c4738baea1c39f0deb265c684dd8bc384395e..1c753edfefa96d69c5de7d54078fa3136b244b52 100644
|
||||
index 3b9cc3e885b254c80b2ff2ba1585972ce51a1e70..344466dd249323768541ae8c6c2800795845eea8 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -73,6 +73,22 @@
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Wed, 27 May 2020 13:02:13 -0700
|
||||
Subject: fix: comment out incompatible crypto modules
|
||||
|
||||
Node.js introduced some functionality in https://github.com/nodejs/node/pull/32739
|
||||
and https://github.com/nodejs/node/pull/31178 that is not currently compatible
|
||||
with what's exposed through BoringSSL. I plan to upstream parts of this or
|
||||
otherwise introduce shims to reduce friction.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20b1b58bb0 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -5142,6 +5142,7 @@ bool DiffieHellman::Init(int primeLength, int g) {
|
||||
|
||||
bool DiffieHellman::Init(const char* p, int p_len, int g) {
|
||||
dh_.reset(DH_new());
|
||||
+#if 0
|
||||
if (p_len <= 0) {
|
||||
BNerr(BN_F_BN_GENERATE_PRIME_EX, BN_R_BITS_TOO_SMALL);
|
||||
return false;
|
||||
@@ -5150,6 +5151,7 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
|
||||
DHerr(DH_F_DH_BUILTIN_GENPARAMS, DH_R_BAD_GENERATOR);
|
||||
return false;
|
||||
}
|
||||
+#endif
|
||||
BIGNUM* bn_p =
|
||||
BN_bin2bn(reinterpret_cast<const unsigned char*>(p), p_len, nullptr);
|
||||
BIGNUM* bn_g = BN_new();
|
||||
@@ -5165,6 +5167,7 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
|
||||
|
||||
bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
|
||||
dh_.reset(DH_new());
|
||||
+#if 0
|
||||
if (p_len <= 0) {
|
||||
BNerr(BN_F_BN_GENERATE_PRIME_EX, BN_R_BITS_TOO_SMALL);
|
||||
return false;
|
||||
@@ -5187,6 +5190,7 @@ bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
|
||||
BN_free(bn_g);
|
||||
return false;
|
||||
}
|
||||
+#endif
|
||||
return VerifyContext();
|
||||
}
|
||||
|
||||
@@ -6154,6 +6158,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
EVPKeyCtxPointer Setup() override {
|
||||
EVPKeyPointer params;
|
||||
if (prime_info_.fixed_value_) {
|
||||
+#if 0
|
||||
DHPointer dh(DH_new());
|
||||
if (!dh)
|
||||
return nullptr;
|
||||
@@ -6170,6 +6175,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
params = EVPKeyPointer(EVP_PKEY_new());
|
||||
CHECK(params);
|
||||
EVP_PKEY_assign_DH(params.get(), dh.release());
|
||||
+#endif
|
||||
} else {
|
||||
EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_DH, nullptr));
|
||||
if (!param_ctx)
|
||||
@@ -6177,7 +6183,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
|
||||
if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
|
||||
return nullptr;
|
||||
-
|
||||
+#if 0
|
||||
if (EVP_PKEY_CTX_set_dh_paramgen_prime_len(param_ctx.get(),
|
||||
prime_info_.prime_size_) <= 0)
|
||||
return nullptr;
|
||||
@@ -6185,7 +6191,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
if (EVP_PKEY_CTX_set_dh_paramgen_generator(param_ctx.get(),
|
||||
generator_) <= 0)
|
||||
return nullptr;
|
||||
-
|
||||
+#endif
|
||||
EVP_PKEY* raw_params = nullptr;
|
||||
if (EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0)
|
||||
return nullptr;
|
||||
@@ -6,10 +6,10 @@ Subject: fix: don't create console window when creating process
|
||||
This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes https://github.com/nodejs/node/pull/21316
|
||||
|
||||
diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c
|
||||
index 9b7fdc1dc1b4e2b9e16e053d1aca36ef5221c460..e1010d1248a95a3927d6ed1a1affbb545c1d7201 100644
|
||||
index 73543c6ed987ceed517e8d1ce8135c1ad233795d..249336d0a23cf32e25c93d917ffb1626119c624f 100644
|
||||
--- a/deps/uv/src/win/process.c
|
||||
+++ b/deps/uv/src/win/process.c
|
||||
@@ -1099,6 +1099,9 @@ int uv_spawn(uv_loop_t* loop,
|
||||
@@ -1098,6 +1098,9 @@ int uv_spawn(uv_loop_t* loop,
|
||||
process_flags |= DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Sat, 6 Jan 2018 18:28:10 +0530
|
||||
Subject: fix: expose InternalCallbackScope
|
||||
|
||||
This commit exposes InternalCallbackScope in order to allow us access to kAllowEmptyResource for usage https://github.com/electron/electron/blob/master/atom/common/api/atom_bindings.cc\#L108. We should look to accomplish this another way so we no longer need to do this, as in verbose mode the regular CallBack Scope doesn't swallow errors and so we can otherwise use it.
|
||||
This commit exposes InternalCallbackScope in order to allow us access to its internal flags.
|
||||
|
||||
diff --git a/src/node_internals.h b/src/node_internals.h
|
||||
index 0ba13ceaea2ea2d37dcf202afa354a845f381463..97d78b4bacdbc64e03ed8eedae0995459e3cbc16 100644
|
||||
index c1555b312e2f22e191d91d34a348d2e163d85b5b..084ecfa73657d1958d7552baa896e170934639c8 100644
|
||||
--- a/src/node_internals.h
|
||||
+++ b/src/node_internals.h
|
||||
@@ -203,7 +203,7 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(
|
||||
@@ -209,7 +209,7 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(
|
||||
v8::Local<v8::Value> argv[],
|
||||
async_context asyncContext);
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead
|
||||
of v8::TracingController
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 1df70cf6a6d44dfe61bbf346494c3d361e9aa448..68ccef87356755a8a99283d55bf5492831a46ce0 100644
|
||||
index 09d71b34581268bfe17c3182029cb3949d857d48..60d30b7eff7329c4235024c31525107216d70d7a 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -331,6 +331,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
|
||||
@@ -358,6 +358,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
|
||||
return per_process::v8_platform.Platform();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: key gen APIs are not available in BoringSSL
|
||||
This will make Node's key pair generation APIs fail.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index ee42630ad06da91b6c776447cf1350bd449c7cf4..73c18d1b911bb7cf731e31e74957319d5d7c53ed 100644
|
||||
index f08d68d6b6e6303485e2c53aebc0d42708bd022a..17aeb99d586161d0af69376811b42e84a80553e3 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -267,24 +267,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
|
||||
@@ -34,7 +34,7 @@ index ee42630ad06da91b6c776447cf1350bd449c7cf4..73c18d1b911bb7cf731e31e74957319d
|
||||
V(USER) \
|
||||
|
||||
#define V(name) case ERR_LIB_##name: lib = #name "_"; break;
|
||||
@@ -6013,6 +6003,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
@@ -6082,6 +6072,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
|
||||
return nullptr;
|
||||
|
||||
@@ -42,7 +42,7 @@ index ee42630ad06da91b6c776447cf1350bd449c7cf4..73c18d1b911bb7cf731e31e74957319d
|
||||
if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0)
|
||||
return nullptr;
|
||||
|
||||
@@ -6023,6 +6014,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
@@ -6092,6 +6083,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
@@ -51,10 +51,10 @@ index ee42630ad06da91b6c776447cf1350bd449c7cf4..73c18d1b911bb7cf731e31e74957319d
|
||||
EVP_PKEY* raw_params = nullptr;
|
||||
if (EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0)
|
||||
diff --git a/src/node_crypto_common.cc b/src/node_crypto_common.cc
|
||||
index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e81053fbeb21 100644
|
||||
index 3b35ee1ff7ba8a6aac6419ba6ca13ea33e7bcf42..83f4c1127081542aad2d12b9dc45f99cbd7a106d 100644
|
||||
--- a/src/node_crypto_common.cc
|
||||
+++ b/src/node_crypto_common.cc
|
||||
@@ -237,10 +237,10 @@ int UseSNIContext(const SSLPointer& ssl, SecureContext* context) {
|
||||
@@ -239,10 +239,10 @@ int UseSNIContext(const SSLPointer& ssl, BaseObjectPtr<SecureContext> context) {
|
||||
}
|
||||
|
||||
const char* GetClientHelloALPN(const SSLPointer& ssl) {
|
||||
@@ -66,7 +66,7 @@ index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e810
|
||||
if (!SSL_client_hello_get0_ext(
|
||||
ssl.get(),
|
||||
TLSEXT_TYPE_application_layer_protocol_negotiation,
|
||||
@@ -249,17 +249,18 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
|
||||
@@ -251,17 +251,18 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
|
||||
rem < 2) {
|
||||
return nullptr;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e810
|
||||
if (!SSL_client_hello_get0_ext(
|
||||
ssl.get(),
|
||||
TLSEXT_TYPE_server_name,
|
||||
@@ -281,6 +282,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) {
|
||||
@@ -283,6 +284,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) {
|
||||
if (len + 2 > rem)
|
||||
return nullptr;
|
||||
return reinterpret_cast<const char*>(buf + 5);
|
||||
@@ -96,7 +96,7 @@ index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e810
|
||||
}
|
||||
|
||||
const char* GetServerName(SSL* ssl) {
|
||||
@@ -288,7 +291,10 @@ const char* GetServerName(SSL* ssl) {
|
||||
@@ -290,7 +293,10 @@ const char* GetServerName(SSL* ssl) {
|
||||
}
|
||||
|
||||
bool SetGroups(SecureContext* sc, const char* groups) {
|
||||
@@ -107,7 +107,7 @@ index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e810
|
||||
}
|
||||
|
||||
const char* X509ErrorCode(long err) { // NOLINT(runtime/int)
|
||||
@@ -766,13 +772,13 @@ MaybeLocal<Array> GetClientHelloCiphers(
|
||||
@@ -772,13 +778,13 @@ MaybeLocal<Array> GetClientHelloCiphers(
|
||||
Environment* env,
|
||||
const SSLPointer& ssl) {
|
||||
EscapableHandleScope scope(env->isolate());
|
||||
|
||||
19
patches/node/fix_remove_bad_semicolon_outside_fn.patch
Normal file
19
patches/node/fix_remove_bad_semicolon_outside_fn.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Wed, 27 May 2020 12:57:43 -0700
|
||||
Subject: fix: remove bad semicolon outside fn
|
||||
|
||||
Node.js introduced a bad semicolon style in
|
||||
https://github.com/nodejs/node/pull/29207. Upstreamed in
|
||||
https://github.com/nodejs/node/pull/33592.
|
||||
|
||||
diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc
|
||||
index 107a25bc977bd38e97a2310b272e495d09847ecb..3ed390678962890d90d385cf2bca9deaca023c89 100644
|
||||
--- a/src/node_watchdog.cc
|
||||
+++ b/src/node_watchdog.cc
|
||||
@@ -432,4 +432,4 @@ static void Initialize(Local<Object> target,
|
||||
|
||||
} // namespace node
|
||||
|
||||
-NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize);
|
||||
+NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize)
|
||||
@@ -8,10 +8,10 @@ by using the implementations of those functions as found in the OpenSSL repo.
|
||||
I plan to try and upstream a version of this.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index a2f7190810552261dc66fae18acade3576ff4fe8..29f4d934623889010bf00bbde59d7710916307e4 100644
|
||||
index 14029692e57b219d245d529a0be175c80f3a32de..cd763fd3755357b36e753cf778550cf2d498ed57 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -4478,7 +4478,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) {
|
||||
@@ -4522,7 +4522,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) {
|
||||
if (base_id == EVP_PKEY_DSA) {
|
||||
DSA* dsa_key = EVP_PKEY_get0_DSA(pkey.get());
|
||||
// Both r and s are computed mod q, so their width is limited by that of q.
|
||||
|
||||
@@ -7,10 +7,10 @@ This broke the build at some point. Does it still? We should probably remove
|
||||
this patch and find out!
|
||||
|
||||
diff --git a/src/node_internals.h b/src/node_internals.h
|
||||
index 97d78b4bacdbc64e03ed8eedae0995459e3cbc16..0279a4a8274f408049aae5464a7f4559ebe48110 100644
|
||||
index 084ecfa73657d1958d7552baa896e170934639c8..cb388f3a9f12949fd3ecb0406f7b550f4ca5ca7c 100644
|
||||
--- a/src/node_internals.h
|
||||
+++ b/src/node_internals.h
|
||||
@@ -371,10 +371,11 @@ class TraceEventScope {
|
||||
@@ -375,10 +375,11 @@ class TraceEventScope {
|
||||
TraceEventScope(const char* category,
|
||||
const char* name,
|
||||
void* id) : category_(category), name_(name), id_(id) {
|
||||
|
||||
@@ -7,11 +7,11 @@ async hooks are hella broken in Electron. This was checking that they weren't,
|
||||
but they are, so we just disabled the check. YOLO.
|
||||
|
||||
diff --git a/src/api/callback.cc b/src/api/callback.cc
|
||||
index 5e3fd6590332eceafad3ecf51f5f1fa84e2e50a2..a5acf1a199146e359790acd474a93d340b7738ce 100644
|
||||
index c8934e1cd33a364ba55b437b080fe2c1c0f5de6c..63c9f5d7c08bebd25bd2602ab6b97c8987a102a4 100644
|
||||
--- a/src/api/callback.cc
|
||||
+++ b/src/api/callback.cc
|
||||
@@ -111,12 +111,14 @@ void InternalCallbackScope::Close() {
|
||||
MicrotasksScope::PerformCheckpoint(env_->isolate());
|
||||
@@ -117,12 +117,14 @@ void InternalCallbackScope::Close() {
|
||||
perform_stopping_check();
|
||||
}
|
||||
|
||||
+#if 0 // FIXME(codebytere): figure out why this check fails/causes crash
|
||||
|
||||
@@ -9,10 +9,10 @@ this has to be done after the upgrade to the Node.js v8.7.0. in the very beginn
|
||||
to a native Node.js implementation of the function.
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 2a92651dd6c5a98990b0f9e996b97c3e73095d50..33f52a3c168840ea88da0e032069136e8a690830 100644
|
||||
index b1f453442bc2a35fabaa6f259091660aedad9a07..92554a374d189b3b284546b0e122940e9a175de8 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -145,6 +145,8 @@ function enrichCJSError(err) {
|
||||
@@ -144,6 +144,8 @@ function enrichCJSError(err) {
|
||||
}
|
||||
|
||||
function stat(filename) {
|
||||
|
||||
@@ -10,10 +10,10 @@ node's module code.
|
||||
(cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf)
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 0a359a3d8973bc2d7cf7563972b15459a6a1d0e8..2010aae2b734bbcf9793336678a39f945e36c5be 100644
|
||||
index fc42eb033c923fcdb7eb79e6676a191be6eb1d91..a8adb63a2e42929d040f6cdea6f01bd4c2cb1d2d 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -1250,8 +1250,8 @@ Module._initPaths = function() {
|
||||
@@ -1255,8 +1255,8 @@ Module._initPaths = function() {
|
||||
|
||||
modulePaths = paths;
|
||||
|
||||
|
||||
@@ -6,18 +6,18 @@ Subject: Override existing V8 Reallocate
|
||||
Refs https://chromium-review.googlesource.com/c/v8/v8/+/2007274.
|
||||
Reallocate has been implemented by V8 itself, so this function must now
|
||||
be overridden. This patch can be removed once the relevant version of V8
|
||||
makes its way into Node.js
|
||||
makes its way into Node.js.
|
||||
|
||||
diff --git a/src/node_internals.h b/src/node_internals.h
|
||||
index 0279a4a8274f408049aae5464a7f4559ebe48110..e5d5a6497de3386c7aa70efc1f202f79d9f7567f 100644
|
||||
index cb388f3a9f12949fd3ecb0406f7b550f4ca5ca7c..f4b5c9bb7058da2355204a7285e5f7cc70c4ffda 100644
|
||||
--- a/src/node_internals.h
|
||||
+++ b/src/node_internals.h
|
||||
@@ -115,7 +115,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {
|
||||
void* AllocateUninitialized(size_t size) override
|
||||
{ return node::UncheckedMalloc(size); }
|
||||
void Free(void* data, size_t) override { free(data); }
|
||||
- virtual void* Reallocate(void* data, size_t old_size, size_t size) {
|
||||
+ virtual void* Reallocate(void* data, size_t old_size, size_t size) override {
|
||||
return static_cast<void*>(
|
||||
UncheckedRealloc<char>(static_cast<char*>(data), size));
|
||||
void* Allocate(size_t size) override; // Defined in src/node.cc
|
||||
void* AllocateUninitialized(size_t size) override;
|
||||
void Free(void* data, size_t size) override;
|
||||
- virtual void* Reallocate(void* data, size_t old_size, size_t size);
|
||||
+ virtual void* Reallocate(void* data, size_t old_size, size_t size) override;
|
||||
virtual void RegisterPointer(void* data, size_t size) {
|
||||
total_mem_usage_.fetch_add(size, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: Pass all globals through "require"
|
||||
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 2010aae2b734bbcf9793336678a39f945e36c5be..2a92651dd6c5a98990b0f9e996b97c3e73095d50 100644
|
||||
index a8adb63a2e42929d040f6cdea6f01bd4c2cb1d2d..b1f453442bc2a35fabaa6f259091660aedad9a07 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -105,6 +105,13 @@ const {
|
||||
@@ -104,6 +104,13 @@ const {
|
||||
CHAR_COLON
|
||||
} = require('internal/constants');
|
||||
|
||||
@@ -23,7 +23,7 @@ index 2010aae2b734bbcf9793336678a39f945e36c5be..2a92651dd6c5a98990b0f9e996b97c3e
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
const relativeResolveCache = ObjectCreate(null);
|
||||
@@ -1128,10 +1135,12 @@ Module.prototype._compile = function(content, filename) {
|
||||
@@ -1133,10 +1140,12 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (requireDepth === 0) statCache = new Map();
|
||||
if (inspectorWrapper) {
|
||||
result = inspectorWrapper(compiledWrapper, thisValue, exports,
|
||||
|
||||
@@ -7,7 +7,7 @@ We use this to allow node's 'fs' module to read from ASAR files as if they were
|
||||
a real filesystem.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
|
||||
index bb9a2b177c4304496dab1f1beaedc1ae9d9f55d9..36d06759aac57b1aa813b52c94e2168b8a8f9087 100644
|
||||
index c872941b974216d94863bcbf0e597b9c09ca50e2..4e7c3c10255a0eae4d5333f88e51cf7178163a44 100644
|
||||
--- a/lib/internal/bootstrap/node.js
|
||||
+++ b/lib/internal/bootstrap/node.js
|
||||
@@ -57,6 +57,10 @@ setupBuffer();
|
||||
@@ -22,7 +22,7 @@ index bb9a2b177c4304496dab1f1beaedc1ae9d9f55d9..36d06759aac57b1aa813b52c94e2168b
|
||||
process.config = JSONParse(internalBinding('native_module').config);
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 33f52a3c168840ea88da0e032069136e8a690830..992482525f8bdea399528f1e5673f4efa21b7246 100644
|
||||
index 92554a374d189b3b284546b0e122940e9a175de8..e478c57af873da717c00db73d6719f806280efe1 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -55,10 +55,7 @@ const assert = require('internal/assert');
|
||||
@@ -37,7 +37,7 @@ index 33f52a3c168840ea88da0e032069136e8a690830..992482525f8bdea399528f1e5673f4ef
|
||||
const { safeGetenv } = internalBinding('credentials');
|
||||
const {
|
||||
makeRequireFunction,
|
||||
@@ -145,14 +142,12 @@ function enrichCJSError(err) {
|
||||
@@ -144,14 +141,12 @@ function enrichCJSError(err) {
|
||||
}
|
||||
|
||||
function stat(filename) {
|
||||
@@ -53,7 +53,7 @@ index 33f52a3c168840ea88da0e032069136e8a690830..992482525f8bdea399528f1e5673f4ef
|
||||
if (statCache !== null) statCache.set(filename, result);
|
||||
return result;
|
||||
}
|
||||
@@ -258,7 +253,7 @@ function readPackage(requestPath) {
|
||||
@@ -257,7 +252,7 @@ function readPackage(requestPath) {
|
||||
const existing = packageJsonCache.get(jsonPath);
|
||||
if (existing !== undefined) return existing;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Subject: refactor: TransferrableModule is deprecated, use CompiledWasmModule
|
||||
This is already present in Node.js v14 and can be removed when we upgrade.
|
||||
|
||||
diff --git a/src/node_messaging.cc b/src/node_messaging.cc
|
||||
index c7c46063731a5b49366d8e8702b625162b361471..a8cfbec2f5bf2387312237114ab5eb058561b898 100644
|
||||
index 16b1a97eec2dfc236d54e76ef795ce1c0b958fb8..9ed2526fc04f63d857942684dd63b1b93ef2969e 100644
|
||||
--- a/src/node_messaging.cc
|
||||
+++ b/src/node_messaging.cc
|
||||
@@ -57,7 +57,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
|
||||
|
||||
@@ -8,10 +8,10 @@ This is already present in Node.js v14 and can be removed when we upgrade.
|
||||
CL: https://chromium-review.googlesource.com/c/v8/v8/+/1868620
|
||||
|
||||
diff --git a/src/node_platform.h b/src/node_platform.h
|
||||
index bebd61b0c22644881455105eeb795e4fdbcd5ae9..df7b764237ccad425d8833c9ca746170e2c838a9 100644
|
||||
index 533ae1bcca824837aca327d4ff8f122da12d94f0..3c855afeb4019adfb5389721357abe3cd620a01c 100644
|
||||
--- a/src/node_platform.h
|
||||
+++ b/src/node_platform.h
|
||||
@@ -147,14 +147,6 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
@@ -148,14 +148,6 @@ class NodePlatform : public MultiIsolatePlatform {
|
||||
void CallOnWorkerThread(std::unique_ptr<v8::Task> task) override;
|
||||
void CallDelayedOnWorkerThread(std::unique_ptr<v8::Task> task,
|
||||
double delay_in_seconds) override;
|
||||
|
||||
@@ -8,10 +8,10 @@ The BoringSSL incompatibilities (OPENSSL_memdup) will be shimmed in and this sho
|
||||
be removed when the associated update is rolled into Chromium.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index 73c18d1b911bb7cf731e31e74957319d5d7c53ed..a2f7190810552261dc66fae18acade3576ff4fe8 100644
|
||||
index 17aeb99d586161d0af69376811b42e84a80553e3..14029692e57b219d245d529a0be175c80f3a32de 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -4966,18 +4966,6 @@ bool PublicKeyCipher::Cipher(Environment* env,
|
||||
@@ -5011,18 +5011,6 @@ bool PublicKeyCipher::Cipher(Environment* env,
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
79
patches/node/test_account_for_non-node_basename.patch
Normal file
79
patches/node/test_account_for_non-node_basename.patch
Normal file
@@ -0,0 +1,79 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 18 Jun 2020 14:40:35 -0700
|
||||
Subject: test: account for non-node basename
|
||||
|
||||
Refs https://github.com/nodejs/node/commit/edf75e4299219d57e53f98956b8e27e4945dd5d6.
|
||||
|
||||
Because Electron smoketests with Node.js' own specs, it's the case for us that the basename is
|
||||
`Electron`. These tests were failing as they're hardcoded to assume it's `node` so this makes
|
||||
them more flexible for embedders.
|
||||
|
||||
Upstreamed at https://github.com/nodejs/node/pull/33952.
|
||||
|
||||
diff --git a/test/message/eval_messages.out b/test/message/eval_messages.out
|
||||
index 8840633959a18baf9b40305d73511d47ae213978..64743d4ae67acf1f8cb28b832b1f7204ace48952 100644
|
||||
--- a/test/message/eval_messages.out
|
||||
+++ b/test/message/eval_messages.out
|
||||
@@ -55,11 +55,11 @@ ReferenceError: y is not defined
|
||||
var ______________________________________________; throw 10
|
||||
^
|
||||
10
|
||||
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
|
||||
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
|
||||
|
||||
[eval]:1
|
||||
var ______________________________________________; throw 10
|
||||
^
|
||||
10
|
||||
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
|
||||
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
|
||||
done
|
||||
diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.out
|
||||
index 72edb0b00b28cd6cf6bac51519be4fde4708b161..3c71c5683b7d949bc7b1a46e7cbd4473c40cf871 100644
|
||||
--- a/test/message/stdin_messages.out
|
||||
+++ b/test/message/stdin_messages.out
|
||||
@@ -67,11 +67,11 @@ ReferenceError: y is not defined
|
||||
let ______________________________________________; throw 10
|
||||
^
|
||||
10
|
||||
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
|
||||
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
|
||||
|
||||
[stdin]:1
|
||||
let ______________________________________________; throw 10
|
||||
^
|
||||
10
|
||||
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
|
||||
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
|
||||
done
|
||||
diff --git a/test/message/throw_error_with_getter_throw.out b/test/message/throw_error_with_getter_throw.out
|
||||
index 5daf35aad44ce37e3681d73d19c7e0eb7e7c3439..2162185e7845fcc5f716aa652e253db95462a622 100644
|
||||
--- a/test/message/throw_error_with_getter_throw.out
|
||||
+++ b/test/message/throw_error_with_getter_throw.out
|
||||
@@ -3,4 +3,4 @@
|
||||
throw { // eslint-disable-line no-throw-literal
|
||||
^
|
||||
[object Object]
|
||||
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
|
||||
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
|
||||
diff --git a/test/message/throw_null.out b/test/message/throw_null.out
|
||||
index db6cc3edf583eff7c815ea4fe24c3ecc60b03888..c97dcbfe134a22721d68f2bb5570d8e59450c3bb 100644
|
||||
--- a/test/message/throw_null.out
|
||||
+++ b/test/message/throw_null.out
|
||||
@@ -3,4 +3,4 @@
|
||||
throw null;
|
||||
^
|
||||
null
|
||||
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
|
||||
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
|
||||
diff --git a/test/message/throw_undefined.out b/test/message/throw_undefined.out
|
||||
index 016eb8ffd95e3389c93e24912d71ccb152fd99d7..4b2bfdbc5907085b19f43ba1306aaa6efc41beee 100644
|
||||
--- a/test/message/throw_undefined.out
|
||||
+++ b/test/message/throw_undefined.out
|
||||
@@ -3,4 +3,4 @@
|
||||
throw undefined;
|
||||
^
|
||||
undefined
|
||||
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
|
||||
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
|
||||
@@ -1,110 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <samuel.r.attard@gmail.com>
|
||||
Date: Tue, 9 Jun 2020 11:23:55 -0700
|
||||
Subject: win: use RtlGenRandom from advapi32.dll directly
|
||||
|
||||
At least two people have reported that `LoadLibrary("advapi32.dll")`
|
||||
fails in some configurations.
|
||||
|
||||
Libuv already links against advapi32.dll so let's sidestep the issue
|
||||
by linking to `RtlGenRandom()` directly instead of looking it up at
|
||||
runtime.
|
||||
|
||||
Fixes: #2759
|
||||
PR-URL: #2762
|
||||
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
|
||||
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
||||
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
|
||||
|
||||
Cherry-Pick: https://github.com/libuv/libuv/commit/335e8a6d128646e5a19d39dfc677f5a5a555f7cc
|
||||
|
||||
diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c
|
||||
index 4de638f5971c35aaeb9fe5e2ff67a806bbc54baf..34a898bfa425b6ba716a681541b602f3a191b258 100644
|
||||
--- a/deps/uv/src/win/util.c
|
||||
+++ b/deps/uv/src/win/util.c
|
||||
@@ -63,6 +63,9 @@
|
||||
/* Maximum environment variable size, including the terminating null */
|
||||
#define MAX_ENV_VAR_LENGTH 32767
|
||||
|
||||
+/* A RtlGenRandom() by any other name... */
|
||||
+extern BOOLEAN NTAPI SystemFunction036(PVOID Buffer, ULONG BufferLength);
|
||||
+
|
||||
/* Cached copy of the process title, plus a mutex guarding it. */
|
||||
static char *process_title;
|
||||
static CRITICAL_SECTION process_title_lock;
|
||||
@@ -1862,13 +1865,10 @@ int uv_gettimeofday(uv_timeval64_t* tv) {
|
||||
}
|
||||
|
||||
int uv__random_rtlgenrandom(void* buf, size_t buflen) {
|
||||
- if (pRtlGenRandom == NULL)
|
||||
- return UV_ENOSYS;
|
||||
-
|
||||
if (buflen == 0)
|
||||
return 0;
|
||||
|
||||
- if (pRtlGenRandom(buf, buflen) == FALSE)
|
||||
+ if (SystemFunction036(buf, buflen) == FALSE)
|
||||
return UV_EIO;
|
||||
|
||||
return 0;
|
||||
diff --git a/deps/uv/src/win/winapi.c b/deps/uv/src/win/winapi.c
|
||||
index 85a9de8a2295ec3250f9ae41f5ef6dbe72dc2a8a..bb86ec8ceac8ba3fccd02b292aca7ddfab38e187 100644
|
||||
--- a/deps/uv/src/win/winapi.c
|
||||
+++ b/deps/uv/src/win/winapi.c
|
||||
@@ -36,9 +36,6 @@ sNtQueryDirectoryFile pNtQueryDirectoryFile;
|
||||
sNtQuerySystemInformation pNtQuerySystemInformation;
|
||||
sNtQueryInformationProcess pNtQueryInformationProcess;
|
||||
|
||||
-/* Advapi32 function pointers */
|
||||
-sRtlGenRandom pRtlGenRandom;
|
||||
-
|
||||
/* Kernel32 function pointers */
|
||||
sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx;
|
||||
|
||||
@@ -54,7 +51,6 @@ void uv_winapi_init(void) {
|
||||
HMODULE powrprof_module;
|
||||
HMODULE user32_module;
|
||||
HMODULE kernel32_module;
|
||||
- HMODULE advapi32_module;
|
||||
|
||||
ntdll_module = GetModuleHandleA("ntdll.dll");
|
||||
if (ntdll_module == NULL) {
|
||||
@@ -138,12 +134,4 @@ void uv_winapi_init(void) {
|
||||
pSetWinEventHook = (sSetWinEventHook)
|
||||
GetProcAddress(user32_module, "SetWinEventHook");
|
||||
}
|
||||
-
|
||||
- advapi32_module = GetModuleHandleA("advapi32.dll");
|
||||
- if (advapi32_module == NULL) {
|
||||
- uv_fatal_error(GetLastError(), "GetModuleHandleA");
|
||||
- }
|
||||
-
|
||||
- pRtlGenRandom =
|
||||
- (sRtlGenRandom) GetProcAddress(advapi32_module, "SystemFunction036");
|
||||
}
|
||||
diff --git a/deps/uv/src/win/winapi.h b/deps/uv/src/win/winapi.h
|
||||
index fcc70652a9aedb72f92ce78b8ee21cea8933b905..322a212dd73c19378b7abda01c5b60a93cb8e1d5 100644
|
||||
--- a/deps/uv/src/win/winapi.h
|
||||
+++ b/deps/uv/src/win/winapi.h
|
||||
@@ -4589,11 +4589,6 @@ typedef NTSTATUS (NTAPI *sNtQueryInformationProcess)
|
||||
ULONG Length,
|
||||
PULONG ReturnLength);
|
||||
|
||||
-/*
|
||||
- * Advapi32 headers
|
||||
- */
|
||||
-typedef BOOLEAN (WINAPI *sRtlGenRandom)(PVOID Buffer, ULONG BufferLength);
|
||||
-
|
||||
/*
|
||||
* Kernel32 headers
|
||||
*/
|
||||
@@ -4736,9 +4731,6 @@ extern sNtQueryDirectoryFile pNtQueryDirectoryFile;
|
||||
extern sNtQuerySystemInformation pNtQuerySystemInformation;
|
||||
extern sNtQueryInformationProcess pNtQueryInformationProcess;
|
||||
|
||||
-/* Advapi32 function pointers */
|
||||
-extern sRtlGenRandom pRtlGenRandom;
|
||||
-
|
||||
/* Kernel32 function pointers */
|
||||
extern sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx;
|
||||
|
||||
42
script/check-symlinks.js
Normal file
42
script/check-symlinks.js
Normal file
@@ -0,0 +1,42 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const utils = require('./lib/utils');
|
||||
|
||||
if (process.platform !== 'darwin') {
|
||||
console.log('Not checking symlinks on non-darwin platform');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const appPath = path.resolve(__dirname, '..', '..', 'out', utils.getOutDir(), 'Electron.app');
|
||||
const visited = new Set();
|
||||
const traverse = (p) => {
|
||||
if (visited.has(p)) return;
|
||||
|
||||
visited.add(p);
|
||||
if (!fs.statSync(p).isDirectory()) return;
|
||||
|
||||
for (const child of fs.readdirSync(p)) {
|
||||
const childPath = path.resolve(p, child);
|
||||
let realPath;
|
||||
try {
|
||||
realPath = fs.realpathSync(childPath);
|
||||
} catch (err) {
|
||||
if (err.path) {
|
||||
console.error('Detected an invalid symlink');
|
||||
console.error('Source:', childPath);
|
||||
let link = fs.readlinkSync(childPath);
|
||||
if (!link.startsWith('.')) {
|
||||
link = `../${link}`;
|
||||
}
|
||||
console.error('Target:', path.resolve(childPath, link));
|
||||
process.exit(1);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
traverse(realPath);
|
||||
}
|
||||
};
|
||||
|
||||
traverse(appPath);
|
||||
@@ -160,11 +160,20 @@
|
||||
"parallel/test-worker-message-port",
|
||||
"parallel/test-worker-message-port-transfer-duplicate",
|
||||
"parallel/test-worker-message-port-transfer-target",
|
||||
"parallel/test-worker-workerdata-messageport",
|
||||
"parallel/test-worker-sharedarraybuffer-from-worker-thread",
|
||||
"parallel/test-worker-stdio",
|
||||
"parallel/test-zlib-unused-weak",
|
||||
"pseudo-tty/test-set-raw-mode-reset-process-exit",
|
||||
"pseudo-tty/test-set-raw-mode-reset-signal",
|
||||
"report/test-report-getreport",
|
||||
"report/test-report-signal",
|
||||
"report/test-report-uncaught-exception",
|
||||
"report/test-report-uncaught-exception-compat",
|
||||
"report/test-report-writereport",
|
||||
"report/test-report-worker",
|
||||
"report/test-report-uv-handles",
|
||||
"report/test-report-fatal-error",
|
||||
"sequential/test-cpu-prof-default",
|
||||
"sequential/test-cpu-prof-dir-absolute",
|
||||
"sequential/test-cpu-prof-dir-and-name",
|
||||
|
||||
@@ -3,7 +3,6 @@ Electron.app/Contents/
|
||||
Electron.app/Contents/Frameworks/
|
||||
Electron.app/Contents/Frameworks/Electron Framework.framework/
|
||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Electron Framework
|
||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Helpers
|
||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Libraries
|
||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Resources
|
||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
#include "base/strings/string_split.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "components/content_settings/core/common/content_settings_pattern.h"
|
||||
#include "components/crash/core/app/crashpad.h"
|
||||
#include "components/crash/core/common/crash_key.h"
|
||||
#include "components/crash/core/common/crash_keys.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "extensions/common/constants.h"
|
||||
@@ -33,13 +30,10 @@
|
||||
#include "services/service_manager/sandbox/switches.h"
|
||||
#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h"
|
||||
#include "shell/app/electron_content_client.h"
|
||||
#include "shell/app/electron_crash_reporter_client.h"
|
||||
#include "shell/browser/api/electron_api_crash_reporter.h"
|
||||
#include "shell/browser/electron_browser_client.h"
|
||||
#include "shell/browser/electron_gpu_client.h"
|
||||
#include "shell/browser/feature_list.h"
|
||||
#include "shell/browser/relauncher.h"
|
||||
#include "shell/common/crash_keys.h"
|
||||
#include "shell/common/electron_paths.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "shell/renderer/electron_renderer_client.h"
|
||||
@@ -64,6 +58,15 @@
|
||||
#include "v8/include/v8.h"
|
||||
#endif
|
||||
|
||||
#if !defined(MAS_BUILD)
|
||||
#include "components/crash/core/app/crashpad.h" // nogncheck
|
||||
#include "components/crash/core/common/crash_key.h"
|
||||
#include "components/crash/core/common/crash_keys.h"
|
||||
#include "shell/app/electron_crash_reporter_client.h"
|
||||
#include "shell/browser/api/electron_api_crash_reporter.h"
|
||||
#include "shell/common/crash_keys.h"
|
||||
#endif
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -18,19 +18,15 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/thread_pool/thread_pool_instance.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
#include "components/crash/core/app/crashpad.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "electron/electron_version.h"
|
||||
#include "gin/array_buffer.h"
|
||||
#include "gin/public/isolate_holder.h"
|
||||
#include "gin/v8_initializer.h"
|
||||
#include "shell/app/electron_crash_reporter_client.h"
|
||||
#include "shell/app/uv_task_runner.h"
|
||||
#include "shell/browser/api/electron_api_crash_reporter.h"
|
||||
#include "shell/browser/javascript_environment.h"
|
||||
#include "shell/browser/node_debugger.h"
|
||||
#include "shell/common/api/electron_bindings.h"
|
||||
#include "shell/common/crash_keys.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/node_bindings.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
@@ -43,6 +39,13 @@
|
||||
#include "chrome/child/v8_crashpad_support_win.h"
|
||||
#endif
|
||||
|
||||
#if !defined(MAS_BUILD)
|
||||
#include "components/crash/core/app/crashpad.h" // nogncheck
|
||||
#include "shell/app/electron_crash_reporter_client.h"
|
||||
#include "shell/browser/api/electron_api_crash_reporter.h"
|
||||
#include "shell/common/crash_keys.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
// Initialize Node.js cli options to pass to Node.js
|
||||
@@ -84,6 +87,11 @@ void SetNodeCliFlags() {
|
||||
ProcessGlobalArgs(&args, nullptr, &errors, node::kDisallowedInEnvironment);
|
||||
}
|
||||
|
||||
#if defined(MAS_BUILD)
|
||||
void SetCrashKeyStub(const std::string& key, const std::string& value) {}
|
||||
void ClearCrashKeyStub(const std::string& key) {}
|
||||
#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace electron {
|
||||
@@ -217,10 +225,15 @@ int NodeMain(int argc, char* argv[]) {
|
||||
#endif
|
||||
|
||||
reporter.SetMethod("getParameters", &GetParameters);
|
||||
#if defined(MAS_BUILD)
|
||||
reporter.SetMethod("addExtraParameter", &SetCrashKeyStub);
|
||||
reporter.SetMethod("removeExtraParameter", &ClearCrashKeyStub);
|
||||
#else
|
||||
reporter.SetMethod("addExtraParameter",
|
||||
&electron::crash_keys::SetCrashKey);
|
||||
reporter.SetMethod("removeExtraParameter",
|
||||
&electron::crash_keys::ClearCrashKey);
|
||||
#endif
|
||||
|
||||
process.Set("crashReporter", reporter);
|
||||
|
||||
@@ -238,9 +251,8 @@ int NodeMain(int argc, char* argv[]) {
|
||||
{
|
||||
v8::HandleScope scope(isolate);
|
||||
node::InternalCallbackScope callback_scope(
|
||||
env, v8::Local<v8::Object>(), {1, 0},
|
||||
node::InternalCallbackScope::kAllowEmptyResource |
|
||||
node::InternalCallbackScope::kSkipAsyncHooks);
|
||||
env, v8::Object::New(isolate), {1, 0},
|
||||
node::InternalCallbackScope::kSkipAsyncHooks);
|
||||
node::LoadEnvironment(env);
|
||||
}
|
||||
|
||||
|
||||
@@ -684,6 +684,10 @@ void App::OnUpdateUserActivityState(bool* prevent_default,
|
||||
void App::OnNewWindowForTab() {
|
||||
Emit("new-window-for-tab");
|
||||
}
|
||||
|
||||
void App::OnDidBecomeActive() {
|
||||
Emit("did-become-active");
|
||||
}
|
||||
#endif
|
||||
|
||||
bool App::CanCreateWindow(
|
||||
|
||||
@@ -106,6 +106,7 @@ class App : public ElectronBrowserClient::Delegate,
|
||||
const std::string& type,
|
||||
const base::DictionaryValue& user_info) override;
|
||||
void OnNewWindowForTab() override;
|
||||
void OnDidBecomeActive() override;
|
||||
#endif
|
||||
|
||||
// content::ContentBrowserClient:
|
||||
|
||||
@@ -16,25 +16,28 @@
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "components/crash/core/app/crashpad.h"
|
||||
#include "components/crash/core/common/crash_key.h"
|
||||
#include "components/upload_list/crash_upload_list.h"
|
||||
#include "components/upload_list/text_log_upload_list.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "gin/arguments.h"
|
||||
#include "gin/data_object_builder.h"
|
||||
#include "services/service_manager/embedder/switches.h"
|
||||
#include "shell/app/electron_crash_reporter_client.h"
|
||||
#include "shell/common/crash_keys.h"
|
||||
#include "shell/common/electron_paths.h"
|
||||
#include "shell/common/gin_converters/callback_converter.h"
|
||||
#include "shell/common/gin_converters/file_path_converter.h"
|
||||
#include "shell/common/gin_converters/time_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "third_party/crashpad/crashpad/client/crashpad_info.h"
|
||||
|
||||
#if !defined(MAS_BUILD)
|
||||
#include "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h"
|
||||
#include "components/crash/core/app/crashpad.h" // nogncheck
|
||||
#include "components/crash/core/common/crash_key.h"
|
||||
#include "shell/app/electron_crash_reporter_client.h"
|
||||
#include "shell/common/crash_keys.h"
|
||||
#include "third_party/crashpad/crashpad/client/crashpad_info.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#include "components/crash/core/app/breakpad_linux.h"
|
||||
@@ -62,6 +65,14 @@ namespace api {
|
||||
|
||||
namespace crash_reporter {
|
||||
|
||||
#if defined(MAS_BUILD)
|
||||
namespace {
|
||||
|
||||
void NoOp() {}
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
bool IsCrashReporterEnabled() {
|
||||
return g_crash_reporter_initialized;
|
||||
}
|
||||
@@ -203,8 +214,13 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
dict.SetMethod("start", &electron::api::crash_reporter::Start);
|
||||
#if defined(MAS_BUILD)
|
||||
dict.SetMethod("addExtraParameter", &electron::api::crash_reporter::NoOp);
|
||||
dict.SetMethod("removeExtraParameter", &electron::api::crash_reporter::NoOp);
|
||||
#else
|
||||
dict.SetMethod("addExtraParameter", &electron::crash_keys::SetCrashKey);
|
||||
dict.SetMethod("removeExtraParameter", &electron::crash_keys::ClearCrashKey);
|
||||
#endif
|
||||
dict.SetMethod("getParameters", &GetParameters);
|
||||
dict.SetMethod("getUploadedReports", &GetUploadedReports);
|
||||
dict.SetMethod("setUploadToServer", &SetUploadToServer);
|
||||
|
||||
@@ -135,8 +135,6 @@ class JSChunkedDataPipeGetter : public gin::Wrappable<JSChunkedDataPipeGetter>,
|
||||
data_producer_ = std::make_unique<mojo::DataPipeProducer>(std::move(pipe));
|
||||
|
||||
v8::HandleScope handle_scope(isolate_);
|
||||
v8::MicrotasksScope script_scope(isolate_,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
auto maybe_wrapper = GetWrapper(isolate_);
|
||||
v8::Local<v8::Value> wrapper;
|
||||
if (!maybe_wrapper.ToLocal(&wrapper)) {
|
||||
|
||||
@@ -1226,18 +1226,6 @@ void WebContents::MessageHost(const std::string& channel,
|
||||
InvokeCallback(), channel, std::move(arguments));
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_REMOTE_MODULE)
|
||||
void WebContents::DereferenceRemoteJSObject(const std::string& context_id,
|
||||
int object_id) {
|
||||
base::ListValue args;
|
||||
args.Append(context_id);
|
||||
args.Append(object_id);
|
||||
EmitWithSender("-ipc-message", bindings_.dispatch_context(), InvokeCallback(),
|
||||
/* internal */ true, "ELECTRON_BROWSER_DEREFERENCE",
|
||||
std::move(args));
|
||||
}
|
||||
#endif
|
||||
|
||||
void WebContents::UpdateDraggableRegions(
|
||||
std::vector<mojom::DraggableRegionPtr> regions) {
|
||||
for (ExtendedWebContentsObserver& observer : observers_)
|
||||
|
||||
@@ -597,10 +597,6 @@ class WebContents : public gin_helper::TrackableObject<WebContents>,
|
||||
blink::CloneableMessage arguments) override;
|
||||
void MessageHost(const std::string& channel,
|
||||
blink::CloneableMessage arguments) override;
|
||||
#if BUILDFLAG(ENABLE_REMOTE_MODULE)
|
||||
void DereferenceRemoteJSObject(const std::string& context_id,
|
||||
int object_id) override;
|
||||
#endif
|
||||
void UpdateDraggableRegions(
|
||||
std::vector<mojom::DraggableRegionPtr> regions) override;
|
||||
void SetTemporaryZoomLevel(double level) override;
|
||||
|
||||
@@ -262,6 +262,11 @@ void Browser::NewWindowForTab() {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnNewWindowForTab();
|
||||
}
|
||||
|
||||
void Browser::DidBecomeActive() {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnDidBecomeActive();
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -240,6 +240,9 @@ class Browser : public WindowListObserver {
|
||||
#if defined(OS_MACOSX)
|
||||
// Tell the application to create a new window for a tab.
|
||||
void NewWindowForTab();
|
||||
|
||||
// Tell the application that application did become active
|
||||
void DidBecomeActive();
|
||||
#endif // defined(OS_MACOSX)
|
||||
|
||||
// Tell the application that application is activated with visible/invisible
|
||||
|
||||
@@ -82,6 +82,9 @@ class BrowserObserver : public base::CheckedObserver {
|
||||
const base::DictionaryValue& user_info) {}
|
||||
// User clicked the native macOS new tab button. (macOS only)
|
||||
virtual void OnNewWindowForTab() {}
|
||||
|
||||
// Browser did become active.
|
||||
virtual void OnDidBecomeActive() {}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
@@ -169,12 +169,12 @@
|
||||
#include "content/public/common/child_process_host.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) && !defined(MAS_BUILD)
|
||||
#include "base/debug/leak_annotations.h"
|
||||
#include "components/crash/content/browser/crash_handler_host_linux.h"
|
||||
#include "components/crash/core/app/breakpad_linux.h"
|
||||
#include "components/crash/core/app/crash_switches.h"
|
||||
#include "components/crash/core/app/crashpad.h"
|
||||
#include "components/crash/core/app/breakpad_linux.h" // nogncheck
|
||||
#include "components/crash/core/app/crash_switches.h" // nogncheck
|
||||
#include "components/crash/core/app/crashpad.h" // nogncheck
|
||||
#endif
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
@@ -90,6 +90,7 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
|
||||
|
||||
Browser* browser() { return browser_.get(); }
|
||||
BrowserProcessImpl* browser_process() { return fake_browser_process_.get(); }
|
||||
NodeEnvironment* node_env() { return node_env_.get(); }
|
||||
|
||||
protected:
|
||||
// content::BrowserMainParts:
|
||||
|
||||
@@ -57,6 +57,8 @@ class NodeEnvironment {
|
||||
explicit NodeEnvironment(node::Environment* env);
|
||||
~NodeEnvironment();
|
||||
|
||||
node::Environment* env() { return env_; }
|
||||
|
||||
private:
|
||||
node::Environment* env_;
|
||||
|
||||
|
||||
@@ -89,6 +89,10 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(NSNotification*)notification {
|
||||
electron::Browser::Get()->DidBecomeActive();
|
||||
}
|
||||
|
||||
- (NSMenu*)applicationDockMenu:(NSApplication*)sender {
|
||||
if (menu_controller_)
|
||||
return [menu_controller_ menu];
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/microtasks_runner.h"
|
||||
|
||||
#include "shell/browser/electron_browser_main_parts.h"
|
||||
#include "shell/browser/javascript_environment.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace electron {
|
||||
@@ -15,7 +19,22 @@ void MicrotasksRunner::WillProcessTask(const base::PendingTask& pending_task,
|
||||
|
||||
void MicrotasksRunner::DidProcessTask(const base::PendingTask& pending_task) {
|
||||
v8::Isolate::Scope scope(isolate_);
|
||||
v8::MicrotasksScope::PerformCheckpoint(isolate_);
|
||||
// In the browser process we follow Node.js microtask policy of kExplicit
|
||||
// and let the MicrotaskRunner which is a task observer for chromium UI thread
|
||||
// scheduler run the micotask checkpoint. This worked fine because Node.js
|
||||
// also runs microtasks through its task queue, but after
|
||||
// https://github.com/electron/electron/issues/20013 Node.js now performs its
|
||||
// own microtask checkpoint and it may happen is some situations that there is
|
||||
// contention for performing checkpoint between Node.js and chromium, ending
|
||||
// up Node.js dealying its callbacks. To fix this, now we always lets Node.js
|
||||
// handle the checkpoint in the browser process.
|
||||
{
|
||||
auto* node_env = electron::ElectronBrowserMainParts::Get()->node_env();
|
||||
v8::HandleScope scope(isolate_);
|
||||
node::InternalCallbackScope microtasks_scope(
|
||||
node_env->env(), v8::Object::New(isolate_), {0, 0},
|
||||
node::InternalCallbackScope::kNoFlags);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -50,8 +50,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 11,0,0,20200616
|
||||
PRODUCTVERSION 11,0,0,20200616
|
||||
FILEVERSION 11,0,0,20200619
|
||||
PRODUCTVERSION 11,0,0,20200619
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
#include "ui/views/controls/menu/menu_runner.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -49,11 +48,7 @@ NotifyIcon::NotifyIcon(NotifyIconHost* host,
|
||||
HWND window,
|
||||
UINT message,
|
||||
GUID guid)
|
||||
: host_(host),
|
||||
icon_id_(id),
|
||||
window_(window),
|
||||
message_id_(message),
|
||||
weak_factory_(this) {
|
||||
: host_(host), icon_id_(id), window_(window), message_id_(message) {
|
||||
guid_ = guid;
|
||||
is_using_guid_ = guid != GUID_DEFAULT;
|
||||
NOTIFYICONDATA icon_data;
|
||||
@@ -213,26 +208,10 @@ void NotifyIcon::PopUpContextMenu(const gfx::Point& pos,
|
||||
if (pos.IsOrigin())
|
||||
rect.set_origin(display::Screen::GetScreen()->GetCursorScreenPoint());
|
||||
|
||||
// Create a widget for the menu, otherwise we get no keyboard events, which
|
||||
// is required for accessibility.
|
||||
widget_.reset(new views::Widget());
|
||||
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
|
||||
params.ownership =
|
||||
views::Widget::InitParams::Ownership::WIDGET_OWNS_NATIVE_WIDGET;
|
||||
params.bounds = gfx::Rect(0, 0, 0, 0);
|
||||
params.force_software_compositing = true;
|
||||
params.z_order = ui::ZOrderLevel::kFloatingUIElement;
|
||||
|
||||
widget_->Init(std::move(params));
|
||||
|
||||
widget_->Show();
|
||||
widget_->Activate();
|
||||
menu_runner_.reset(new views::MenuRunner(
|
||||
menu_model != nullptr ? menu_model : menu_model_,
|
||||
views::MenuRunner::CONTEXT_MENU | views::MenuRunner::HAS_MNEMONICS,
|
||||
base::BindRepeating(&NotifyIcon::OnContextMenuClosed,
|
||||
weak_factory_.GetWeakPtr())));
|
||||
menu_runner_->RunMenuAt(widget_.get(), NULL, rect,
|
||||
menu_runner_.reset(
|
||||
new views::MenuRunner(menu_model != nullptr ? menu_model : menu_model_,
|
||||
views::MenuRunner::HAS_MNEMONICS));
|
||||
menu_runner_->RunMenuAt(nullptr, nullptr, rect,
|
||||
views::MenuAnchorPosition::kTopLeft,
|
||||
ui::MENU_SOURCE_MOUSE);
|
||||
}
|
||||
@@ -273,8 +252,4 @@ void NotifyIcon::InitIconData(NOTIFYICONDATA* icon_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyIcon::OnContextMenuClosed() {
|
||||
widget_->Close();
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/win/scoped_gdi_object.h"
|
||||
#include "shell/browser/ui/tray_icon.h"
|
||||
#include "shell/browser/ui/win/notify_icon_host.h"
|
||||
@@ -25,8 +24,7 @@ class Point;
|
||||
|
||||
namespace views {
|
||||
class MenuRunner;
|
||||
class Widget;
|
||||
} // namespace views
|
||||
}
|
||||
|
||||
namespace electron {
|
||||
|
||||
@@ -75,7 +73,6 @@ class NotifyIcon : public TrayIcon {
|
||||
|
||||
private:
|
||||
void InitIconData(NOTIFYICONDATA* icon_data);
|
||||
void OnContextMenuClosed();
|
||||
|
||||
// The tray that owns us. Weak.
|
||||
NotifyIconHost* host_;
|
||||
@@ -104,12 +101,6 @@ class NotifyIcon : public TrayIcon {
|
||||
// Context menu associated with this icon (if any).
|
||||
std::unique_ptr<views::MenuRunner> menu_runner_;
|
||||
|
||||
// Temporary widget for the context menu, needed for keyboard event capture.
|
||||
std::unique_ptr<views::Widget> widget_;
|
||||
|
||||
// WeakPtrFactory for CloseClosure safety.
|
||||
base::WeakPtrFactory<NotifyIcon> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NotifyIcon);
|
||||
};
|
||||
|
||||
|
||||
@@ -15,13 +15,6 @@ interface ElectronRenderer {
|
||||
|
||||
ReceivePostMessage(string channel, blink.mojom.TransferableMessage message);
|
||||
|
||||
// This is an API specific to the "remote" module, and will ultimately be
|
||||
// replaced by generic IPC once WeakRef is generally available.
|
||||
[EnableIf=enable_remote_module]
|
||||
DereferenceRemoteJSCallback(
|
||||
string context_id,
|
||||
int32 object_id);
|
||||
|
||||
NotifyUserActivation();
|
||||
|
||||
TakeHeapSnapshot(handle file) => (bool success);
|
||||
@@ -79,13 +72,6 @@ interface ElectronBrowser {
|
||||
string channel,
|
||||
blink.mojom.CloneableMessage arguments);
|
||||
|
||||
// This is an API specific to the "remote" module, and will ultimately be
|
||||
// replaced by generic IPC once WeakRef is generally available.
|
||||
[EnableIf=enable_remote_module]
|
||||
DereferenceRemoteJSObject(
|
||||
string context_id,
|
||||
int32 object_id);
|
||||
|
||||
UpdateDraggableRegions(
|
||||
array<DraggableRegion> regions);
|
||||
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
#include "url/origin.h"
|
||||
#include "v8/include/v8-profiler.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_REMOTE_MODULE)
|
||||
#include "shell/common/api/remote/remote_callback_freer.h"
|
||||
#endif
|
||||
|
||||
namespace std {
|
||||
|
||||
// The hash function used by DoubleIDWeakMap.
|
||||
@@ -144,13 +140,6 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||
dict.SetMethod("deleteHiddenValue", &DeleteHiddenValue);
|
||||
dict.SetMethod("getObjectHash", &GetObjectHash);
|
||||
dict.SetMethod("takeHeapSnapshot", &TakeHeapSnapshot);
|
||||
#if BUILDFLAG(ENABLE_REMOTE_MODULE)
|
||||
dict.SetMethod("setRemoteCallbackFreer",
|
||||
&electron::RemoteCallbackFreer::BindTo);
|
||||
dict.SetMethod(
|
||||
"createDoubleIDWeakMap",
|
||||
&electron::api::KeyWeakMap<std::pair<std::string, int32_t>>::Create);
|
||||
#endif
|
||||
dict.SetMethod("requestGarbageCollectionForTesting",
|
||||
&RequestGarbageCollectionForTesting);
|
||||
dict.SetMethod("isSameOrigin", &IsSameOrigin);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "shell/common/gin_converters/file_path_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/locker.h"
|
||||
#include "shell/common/gin_helper/microtasks_scope.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/heap_snapshot.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
@@ -131,9 +132,10 @@ void ElectronBindings::OnCallNextTick(uv_async_t* handle) {
|
||||
node::Environment* env = *it;
|
||||
gin_helper::Locker locker(env->isolate());
|
||||
v8::Context::Scope context_scope(env->context());
|
||||
node::InternalCallbackScope scope(
|
||||
env, v8::Local<v8::Object>(), {0, 0},
|
||||
node::InternalCallbackScope::kAllowEmptyResource);
|
||||
v8::HandleScope handle_scope(env->isolate());
|
||||
node::InternalCallbackScope scope(env, v8::Object::New(env->isolate()),
|
||||
{0, 0},
|
||||
node::InternalCallbackScope::kNoFlags);
|
||||
}
|
||||
|
||||
self->pending_next_ticks_.clear();
|
||||
@@ -271,8 +273,7 @@ void ElectronBindings::DidReceiveMemoryDump(
|
||||
v8::Isolate* isolate = promise.isolate();
|
||||
gin_helper::Locker locker(isolate);
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::MicrotasksScope script_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate, true);
|
||||
v8::Context::Scope context_scope(
|
||||
v8::Local<v8::Context>::New(isolate, context));
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
// Copyright (c) 2016 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/common/api/remote/remote_callback_freer.h"
|
||||
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "electron/shell/common/api/api.mojom.h"
|
||||
#include "mojo/public/cpp/bindings/associated_remote.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
// static
|
||||
void RemoteCallbackFreer::BindTo(v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> target,
|
||||
int frame_id,
|
||||
const std::string& context_id,
|
||||
int object_id,
|
||||
content::WebContents* web_contents) {
|
||||
new RemoteCallbackFreer(isolate, target, frame_id, context_id, object_id,
|
||||
web_contents);
|
||||
}
|
||||
|
||||
RemoteCallbackFreer::RemoteCallbackFreer(v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> target,
|
||||
int frame_id,
|
||||
const std::string& context_id,
|
||||
int object_id,
|
||||
content::WebContents* web_contents)
|
||||
: ObjectLifeMonitor(isolate, target),
|
||||
content::WebContentsObserver(web_contents),
|
||||
frame_id_(frame_id),
|
||||
context_id_(context_id),
|
||||
object_id_(object_id) {}
|
||||
|
||||
RemoteCallbackFreer::~RemoteCallbackFreer() = default;
|
||||
|
||||
void RemoteCallbackFreer::RunDestructor() {
|
||||
auto frames = web_contents()->GetAllFrames();
|
||||
auto iter = std::find_if(frames.begin(), frames.end(), [this](auto* f) {
|
||||
return f->GetRoutingID() == frame_id_;
|
||||
});
|
||||
|
||||
if (iter != frames.end() && (*iter)->IsRenderFrameLive()) {
|
||||
mojo::AssociatedRemote<mojom::ElectronRenderer> electron_renderer;
|
||||
(*iter)->GetRemoteAssociatedInterfaces()->GetInterface(&electron_renderer);
|
||||
electron_renderer->DereferenceRemoteJSCallback(context_id_, object_id_);
|
||||
}
|
||||
|
||||
Observe(nullptr);
|
||||
}
|
||||
|
||||
void RemoteCallbackFreer::RenderViewDeleted(content::RenderViewHost*) {
|
||||
delete this;
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) 2016 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef SHELL_COMMON_API_REMOTE_REMOTE_CALLBACK_FREER_H_
|
||||
#define SHELL_COMMON_API_REMOTE_REMOTE_CALLBACK_FREER_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "content/public/browser/web_contents_observer.h"
|
||||
#include "shell/common/api/object_life_monitor.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
class RemoteCallbackFreer : public ObjectLifeMonitor,
|
||||
public content::WebContentsObserver {
|
||||
public:
|
||||
static void BindTo(v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> target,
|
||||
int frame_id,
|
||||
const std::string& context_id,
|
||||
int object_id,
|
||||
content::WebContents* web_conents);
|
||||
|
||||
protected:
|
||||
RemoteCallbackFreer(v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> target,
|
||||
int frame_id,
|
||||
const std::string& context_id,
|
||||
int object_id,
|
||||
content::WebContents* web_conents);
|
||||
~RemoteCallbackFreer() override;
|
||||
|
||||
void RunDestructor() override;
|
||||
|
||||
// content::WebContentsObserver:
|
||||
void RenderViewDeleted(content::RenderViewHost*) override;
|
||||
|
||||
private:
|
||||
int frame_id_;
|
||||
std::string context_id_;
|
||||
int object_id_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(RemoteCallbackFreer);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_COMMON_API_REMOTE_REMOTE_CALLBACK_FREER_H_
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "shell/common/gin_converters/std_converter.h"
|
||||
#include "shell/common/gin_helper/function_template.h"
|
||||
#include "shell/common/gin_helper/locker.h"
|
||||
|
||||
#include "shell/common/gin_helper/microtasks_scope.h"
|
||||
// Implements safe convertions between JS functions and base::Callback.
|
||||
|
||||
namespace gin_helper {
|
||||
@@ -48,8 +48,7 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> {
|
||||
v8::EscapableHandleScope handle_scope(isolate);
|
||||
if (!function.IsAlive())
|
||||
return v8::Null(isolate);
|
||||
v8::MicrotasksScope script_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate, true);
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
@@ -73,8 +72,7 @@ struct V8FunctionInvoker<void(ArgTypes...)> {
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
if (!function.IsAlive())
|
||||
return;
|
||||
v8::MicrotasksScope script_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate, true);
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
@@ -97,8 +95,7 @@ struct V8FunctionInvoker<ReturnType(ArgTypes...)> {
|
||||
ReturnType ret = ReturnType();
|
||||
if (!function.IsAlive())
|
||||
return ret;
|
||||
v8::MicrotasksScope script_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate, true);
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "shell/common/gin_helper/event_emitter_caller.h"
|
||||
|
||||
#include "shell/common/gin_helper/locker.h"
|
||||
#include "shell/common/gin_helper/microtasks_scope.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
namespace gin_helper {
|
||||
@@ -16,8 +17,7 @@ v8::Local<v8::Value> CallMethodWithArgs(v8::Isolate* isolate,
|
||||
const char* method,
|
||||
ValueVector* args) {
|
||||
// Perform microtask checkpoint after running JavaScript.
|
||||
v8::MicrotasksScope script_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate, true);
|
||||
// Use node::MakeCallback to call the callback, and it will also run pending
|
||||
// tasks in Node.js.
|
||||
v8::MaybeLocal<v8::Value> ret = node::MakeCallback(
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "shell/common/gin_helper/arguments.h"
|
||||
#include "shell/common/gin_helper/destroyable.h"
|
||||
#include "shell/common/gin_helper/error_thrower.h"
|
||||
#include "shell/common/gin_helper/microtasks_scope.h"
|
||||
|
||||
// This file is forked from gin/function_template.h with 2 differences:
|
||||
// 1. Support for additional types of arguments.
|
||||
@@ -214,8 +215,7 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
|
||||
|
||||
template <typename ReturnType>
|
||||
void DispatchToCallback(base::Callback<ReturnType(ArgTypes...)> callback) {
|
||||
v8::MicrotasksScope script_scope(args_->isolate(),
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(args_->isolate(), true);
|
||||
args_->Return(
|
||||
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...));
|
||||
}
|
||||
@@ -224,8 +224,7 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
|
||||
// expression to foo. As a result, we must specialize the case of Callbacks
|
||||
// that have the void return type.
|
||||
void DispatchToCallback(base::Callback<void(ArgTypes...)> callback) {
|
||||
v8::MicrotasksScope script_scope(args_->isolate(),
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(args_->isolate(), true);
|
||||
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...);
|
||||
}
|
||||
|
||||
|
||||
24
shell/common/gin_helper/microtasks_scope.cc
Normal file
24
shell/common/gin_helper/microtasks_scope.cc
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2020 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/common/gin_helper/microtasks_scope.h"
|
||||
|
||||
#include "shell/common/gin_helper/locker.h"
|
||||
|
||||
namespace gin_helper {
|
||||
|
||||
MicrotasksScope::MicrotasksScope(v8::Isolate* isolate,
|
||||
bool ignore_browser_checkpoint) {
|
||||
if (Locker::IsBrowserProcess()) {
|
||||
if (!ignore_browser_checkpoint)
|
||||
v8::MicrotasksScope::PerformCheckpoint(isolate);
|
||||
} else {
|
||||
v8_microtasks_scope_ = std::make_unique<v8::MicrotasksScope>(
|
||||
isolate, v8::MicrotasksScope::kRunMicrotasks);
|
||||
}
|
||||
}
|
||||
|
||||
MicrotasksScope::~MicrotasksScope() = default;
|
||||
|
||||
} // namespace gin_helper
|
||||
31
shell/common/gin_helper/microtasks_scope.h
Normal file
31
shell/common/gin_helper/microtasks_scope.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2020 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef SHELL_COMMON_GIN_HELPER_MICROTASKS_SCOPE_H_
|
||||
#define SHELL_COMMON_GIN_HELPER_MICROTASKS_SCOPE_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace gin_helper {
|
||||
|
||||
// In the browser process runs v8::MicrotasksScope::PerformCheckpoint
|
||||
// In the render process creates a v8::MicrotasksScope.
|
||||
class MicrotasksScope {
|
||||
public:
|
||||
explicit MicrotasksScope(v8::Isolate* isolate,
|
||||
bool ignore_browser_checkpoint = false);
|
||||
~MicrotasksScope();
|
||||
|
||||
private:
|
||||
std::unique_ptr<v8::MicrotasksScope> v8_microtasks_scope_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MicrotasksScope);
|
||||
};
|
||||
|
||||
} // namespace gin_helper
|
||||
|
||||
#endif // SHELL_COMMON_GIN_HELPER_MICROTASKS_SCOPE_H_
|
||||
@@ -26,8 +26,7 @@ PromiseBase& PromiseBase::operator=(PromiseBase&&) = default;
|
||||
v8::Maybe<bool> PromiseBase::Reject() {
|
||||
gin_helper::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
v8::MicrotasksScope script_scope(isolate(),
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate());
|
||||
v8::Context::Scope context_scope(GetContext());
|
||||
|
||||
return GetInner()->Reject(GetContext(), v8::Undefined(isolate()));
|
||||
@@ -36,8 +35,7 @@ v8::Maybe<bool> PromiseBase::Reject() {
|
||||
v8::Maybe<bool> PromiseBase::Reject(v8::Local<v8::Value> except) {
|
||||
gin_helper::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
v8::MicrotasksScope script_scope(isolate(),
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate());
|
||||
v8::Context::Scope context_scope(GetContext());
|
||||
|
||||
return GetInner()->Reject(GetContext(), except);
|
||||
@@ -46,8 +44,7 @@ v8::Maybe<bool> PromiseBase::Reject(v8::Local<v8::Value> except) {
|
||||
v8::Maybe<bool> PromiseBase::RejectWithErrorMessage(base::StringPiece message) {
|
||||
gin_helper::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
v8::MicrotasksScope script_scope(isolate(),
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate());
|
||||
v8::Context::Scope context_scope(GetContext());
|
||||
|
||||
v8::Local<v8::Value> error =
|
||||
@@ -90,8 +87,7 @@ v8::Local<v8::Promise> Promise<void>::ResolvedPromise(v8::Isolate* isolate) {
|
||||
v8::Maybe<bool> Promise<void>::Resolve() {
|
||||
gin_helper::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
v8::MicrotasksScope script_scope(isolate(),
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate());
|
||||
v8::Context::Scope context_scope(GetContext());
|
||||
|
||||
return GetInner()->Resolve(GetContext(), v8::Undefined(isolate()));
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "shell/common/gin_converters/std_converter.h"
|
||||
#include "shell/common/gin_helper/locker.h"
|
||||
#include "shell/common/gin_helper/microtasks_scope.h"
|
||||
|
||||
namespace gin_helper {
|
||||
|
||||
@@ -110,8 +111,7 @@ class Promise : public PromiseBase {
|
||||
v8::Maybe<bool> Resolve(const RT& value) {
|
||||
gin_helper::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
v8::MicrotasksScope script_scope(isolate(),
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(isolate());
|
||||
v8::Context::Scope context_scope(GetContext());
|
||||
|
||||
return GetInner()->Resolve(GetContext(),
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/event_emitter_caller.h"
|
||||
#include "shell/common/gin_helper/locker.h"
|
||||
#include "shell/common/gin_helper/microtasks_scope.h"
|
||||
#include "shell/common/mac/main_application_bundle.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
@@ -475,8 +476,7 @@ void NodeBindings::UvRunOnce() {
|
||||
v8::Context::Scope context_scope(env->context());
|
||||
|
||||
// Perform microtask checkpoint after running JavaScript.
|
||||
v8::MicrotasksScope script_scope(env->isolate(),
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
gin_helper::MicrotasksScope microtasks_scope(env->isolate());
|
||||
|
||||
if (browser_env_ != BrowserEnvironment::BROWSER)
|
||||
TRACE_EVENT_BEGIN0("devtools.timeline", "FunctionCall");
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "shell/common/crash_keys.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
#if !defined(MAS_BUILD)
|
||||
#include "shell/common/crash_keys.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
v8::Local<v8::Value> GetParameters(v8::Isolate* isolate) {
|
||||
|
||||
@@ -209,33 +209,6 @@ void ElectronApiServiceImpl::ReceivePostMessage(
|
||||
0);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_REMOTE_MODULE)
|
||||
void ElectronApiServiceImpl::DereferenceRemoteJSCallback(
|
||||
const std::string& context_id,
|
||||
int32_t object_id) {
|
||||
const auto* channel = "ELECTRON_RENDERER_RELEASE_CALLBACK";
|
||||
if (!document_created_)
|
||||
return;
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
if (!frame)
|
||||
return;
|
||||
|
||||
v8::Isolate* isolate = blink::MainThreadIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
|
||||
v8::Local<v8::Context> context = renderer_client_->GetContext(frame, isolate);
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
||||
base::ListValue args;
|
||||
args.AppendString(context_id);
|
||||
args.AppendInteger(object_id);
|
||||
|
||||
v8::Local<v8::Value> v8_args = gin::ConvertToV8(isolate, args);
|
||||
EmitIPCEvent(context, true /* internal */, channel, {}, v8_args,
|
||||
0 /* sender_id */);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ElectronApiServiceImpl::NotifyUserActivation() {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
if (frame)
|
||||
|
||||
@@ -35,10 +35,6 @@ class ElectronApiServiceImpl : public mojom::ElectronRenderer,
|
||||
int32_t sender_id) override;
|
||||
void ReceivePostMessage(const std::string& channel,
|
||||
blink::TransferableMessage message) override;
|
||||
#if BUILDFLAG(ENABLE_REMOTE_MODULE)
|
||||
void DereferenceRemoteJSCallback(const std::string& context_id,
|
||||
int32_t object_id) override;
|
||||
#endif
|
||||
void NotifyUserActivation() override;
|
||||
void TakeHeapSnapshot(mojo::ScopedHandle file,
|
||||
TakeHeapSnapshotCallback callback) override;
|
||||
|
||||
@@ -288,6 +288,8 @@ describe('session module', () => {
|
||||
const { item, itemUrl, itemFilename } = await downloadPrevented;
|
||||
expect(itemUrl).to.equal(url);
|
||||
expect(itemFilename).to.equal('mockFile.txt');
|
||||
// Delay till the next tick.
|
||||
await new Promise(resolve => setImmediate(() => resolve()));
|
||||
expect(() => item.getURL()).to.throw('DownloadItem used after being destroyed');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -597,28 +597,50 @@ describe('webContents module', () => {
|
||||
// On Mac, zooming isn't done with the mouse wheel.
|
||||
ifdescribe(process.platform !== 'darwin')('zoom-changed', () => {
|
||||
afterEach(closeAllWindows);
|
||||
it('is emitted with the correct zooming info', async () => {
|
||||
it('is emitted with the correct zoom-in info', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
await w.loadFile(path.join(fixturesPath, 'pages', 'base-page.html'));
|
||||
|
||||
const testZoomChanged = async ({ zoomingIn }: { zoomingIn: boolean }) => {
|
||||
const testZoomChanged = async () => {
|
||||
w.webContents.sendInputEvent({
|
||||
type: 'mouseWheel',
|
||||
x: 300,
|
||||
y: 300,
|
||||
deltaX: 0,
|
||||
deltaY: zoomingIn ? 1 : -1,
|
||||
deltaY: 1,
|
||||
wheelTicksX: 0,
|
||||
wheelTicksY: zoomingIn ? 1 : -1,
|
||||
wheelTicksY: 1,
|
||||
modifiers: ['control', 'meta']
|
||||
});
|
||||
|
||||
const [, zoomDirection] = await emittedOnce(w.webContents, 'zoom-changed');
|
||||
expect(zoomDirection).to.equal(zoomingIn ? 'in' : 'out');
|
||||
expect(zoomDirection).to.equal('in');
|
||||
};
|
||||
|
||||
await testZoomChanged({ zoomingIn: true });
|
||||
await testZoomChanged({ zoomingIn: false });
|
||||
await testZoomChanged();
|
||||
});
|
||||
|
||||
it('is emitted with the correct zoom-out info', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
await w.loadFile(path.join(fixturesPath, 'pages', 'base-page.html'));
|
||||
|
||||
const testZoomChanged = async () => {
|
||||
w.webContents.sendInputEvent({
|
||||
type: 'mouseWheel',
|
||||
x: 300,
|
||||
y: 300,
|
||||
deltaX: 0,
|
||||
deltaY: -1,
|
||||
wheelTicksX: 0,
|
||||
wheelTicksY: -1,
|
||||
modifiers: ['control', 'meta']
|
||||
});
|
||||
|
||||
const [, zoomDirection] = await emittedOnce(w.webContents, 'zoom-changed');
|
||||
expect(zoomDirection).to.equal('out');
|
||||
};
|
||||
|
||||
await testZoomChanged();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -323,4 +323,18 @@ describe('node feature', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('performs microtask checkpoint correctly', (done) => {
|
||||
const f3 = async () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
reject(new Error('oops'));
|
||||
});
|
||||
};
|
||||
|
||||
process.once('unhandledRejection', () => done('catch block is delayed to next tick'));
|
||||
|
||||
setTimeout(() => {
|
||||
f3().catch(() => done());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
4
spec/fixtures/api/gpu-info.js
vendored
4
spec/fixtures/api/gpu-info.js
vendored
@@ -9,11 +9,11 @@ app.whenReady().then(() => {
|
||||
app.getGPUInfo(infoType).then(
|
||||
(gpuInfo) => {
|
||||
console.log(JSON.stringify(gpuInfo));
|
||||
app.exit(0);
|
||||
setImmediate(() => app.exit(0));
|
||||
},
|
||||
(error) => {
|
||||
console.error(error);
|
||||
app.exit(1);
|
||||
setImmediate(() => app.exit(1));
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
3
typings/internal-ambient.d.ts
vendored
3
typings/internal-ambient.d.ts
vendored
@@ -38,13 +38,10 @@ declare namespace NodeJS {
|
||||
setHiddenValue<T>(obj: any, key: string, value: T): void;
|
||||
deleteHiddenValue(obj: any, key: string): void;
|
||||
requestGarbageCollectionForTesting(): void;
|
||||
createDoubleIDWeakMap<V>(): ElectronInternal.KeyWeakMap<[string, number], V>;
|
||||
setRemoteCallbackFreer(fn: Function, frameId: number, contextId: String, id: number, sender: any): void
|
||||
weaklyTrackValue(value: any): void;
|
||||
clearWeaklyTrackedValues(): void;
|
||||
getWeaklyTrackedValues(): any[];
|
||||
addRemoteObjectRef(contextId: string, id: number): void;
|
||||
setRemoteCallbackFreer(fn: Function, contextId: string, id: number, sender: any): void
|
||||
}
|
||||
|
||||
type DataPipe = {
|
||||
|
||||
@@ -73,6 +73,9 @@ steps:
|
||||
sudo gdk-pixbuf-query-loaders --update-cache
|
||||
cd src
|
||||
export ELECTRON_OUT_DIR=Default
|
||||
unset ELECTRON_DISABLE_SANDBOX
|
||||
sudo chown root out/Default/chrome-sandbox
|
||||
sudo chmod 4755 out/Default/chrome-sandbox
|
||||
(cd electron && node script/yarn test -- --enable-logging)
|
||||
displayName: 'Run Electron tests'
|
||||
timeoutInMinutes: 20
|
||||
|
||||
@@ -2,7 +2,7 @@ resources:
|
||||
containers:
|
||||
- container: arm32v7-test-container
|
||||
image: electronjs/build:arm32v7-697b894f36d127155e020f4e8ad4b2e5f6a09613
|
||||
options: --shm-size 128m
|
||||
options: --shm-size 128m --cap-add SYS_ADMIN
|
||||
|
||||
jobs:
|
||||
- job: Test_Arm32v7
|
||||
|
||||
@@ -2,7 +2,7 @@ resources:
|
||||
containers:
|
||||
- container: arm64v8-test-container
|
||||
image: electronjs/build:arm64v8-697b894f36d127155e020f4e8ad4b2e5f6a09613
|
||||
options: --shm-size 128m
|
||||
options: --shm-size 128m --cap-add SYS_ADMIN
|
||||
|
||||
jobs:
|
||||
- job: Test_Arm64
|
||||
|
||||
Reference in New Issue
Block a user