diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d096be785d..b5f0183fee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -367,3 +367,13 @@ jobs: generate-symbols: false upload-to-storage: '0' secrets: inherit + + gha-done: + name: GitHub Actions Completed + runs-on: ubuntu-latest + needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64, windows-x64, windows-x86, windows-arm64] + if: always() && !contains(needs.*.result, 'failure') + steps: + - name: GitHub Actions Jobs Done + run: | + echo "All GitHub Actions Jobs are done" diff --git a/.github/workflows/pipeline-segment-electron-test.yml b/.github/workflows/pipeline-segment-electron-test.yml index b2ef56c5a0..330c880c36 100644 --- a/.github/workflows/pipeline-segment-electron-test.yml +++ b/.github/workflows/pipeline-segment-electron-test.yml @@ -204,7 +204,7 @@ jobs: if [ "${{ inputs.is-asan }}" == "true" ]; then cd .. ASAN_SYMBOLIZE="$PWD/tools/valgrind/asan/asan_symbolize.py --executable-path=$PWD/out/Default/electron" - export ASAN_OPTIONS="symbolize=0 handle_abort=1" + export ASAN_OPTIONS="symbolize=0 handle_abort=1 detect_container_overflow=0" export G_SLICE=always-malloc export NSS_DISABLE_ARENA_FREE_LIST=1 export NSS_DISABLE_UNLOAD=1 diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc index d3f83a5217..aa44ae70b8 100644 --- a/.markdownlint-cli2.jsonc +++ b/.markdownlint-cli2.jsonc @@ -5,6 +5,9 @@ "autolink": false, "shortcut": false }, + "MD049": { + "style": "underscore" + }, "no-angle-brackets": true, "no-curly-braces": true, "no-inline-html": { diff --git a/BUILD.gn b/BUILD.gn index b0c54bf6bc..38c67abbdf 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -9,7 +9,7 @@ import("//pdf/features.gni") import("//ppapi/buildflags/buildflags.gni") import("//printing/buildflags/buildflags.gni") import("//testing/test.gni") -import("//third_party/electron_node/electron_node.gni") +import("//third_party/electron_node/node.gni") import("//third_party/ffmpeg/ffmpeg_options.gni") import("//tools/generate_library_loader/generate_library_loader.gni") import("//tools/grit/grit_rule.gni") @@ -408,7 +408,7 @@ action("electron_generate_node_defines") { source_set("electron_lib") { configs += [ "//v8:external_startup_data", - "//third_party/electron_node:node_internals", + "//third_party/electron_node:node_external_config", ] public_configs = [ @@ -483,7 +483,7 @@ source_set("electron_lib") { "//third_party/blink/public:blink_devtools_inspector_resources", "//third_party/blink/public/platform/media", "//third_party/boringssl", - "//third_party/electron_node:node_lib", + "//third_party/electron_node:libnode", "//third_party/inspector_protocol:crdtp", "//third_party/leveldatabase", "//third_party/libyuv", @@ -865,7 +865,7 @@ if (is_mac) { ":electron_framework_resources", ":electron_swiftshader_library", ":electron_xibs", - "//third_party/electron_node:node_lib", + "//third_party/electron_node:libnode", ] if (!is_mas_build) { deps += [ ":electron_crashpad_helper" ] @@ -1189,7 +1189,7 @@ if (is_mac) { "//components/crash/core/app", "//content:sandbox_helper_win", "//electron/buildflags", - "//third_party/electron_node:node_lib", + "//third_party/electron_node:libnode", "//ui/strings", ] diff --git a/DEPS b/DEPS index a28c0b14ec..08517cdcf9 100644 --- a/DEPS +++ b/DEPS @@ -2,9 +2,9 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '132.0.6789.0', + '132.0.6807.0', 'node_version': - 'v20.18.0', + 'v22.9.0', 'nan_version': 'e14bdcd1f72d62bca1d541b66da43130384ec213', 'squirrel.mac_version': diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index 6bd1168269..2ea86ce0f5 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -188,7 +188,6 @@ static_library("chrome") { "//components/keyed_service/content", "//components/paint_preview/buildflags", "//components/proxy_config", - "//components/services/language_detection/public/mojom", "//content/public/browser", "//services/strings", ] diff --git a/docs/api/app.md b/docs/api/app.md index 2a137c2983..d465922ce8 100755 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -1302,23 +1302,24 @@ Returns `Object`: Set the app's login item settings. To work with Electron's `autoUpdater` on Windows, which uses [Squirrel][Squirrel-Windows], -you'll want to set the launch path to Update.exe, and pass arguments that specify your -application name. For example: +you'll want to set the launch path to your executable's name but a directory up, which is +a stub application automatically generated by Squirrel which will automatically launch the +latest version. ``` js const { app } = require('electron') const path = require('node:path') const appFolder = path.dirname(process.execPath) -const updateExe = path.resolve(appFolder, '..', 'Update.exe') -const exeName = path.basename(process.execPath) +const ourExeName = path.basename(process.execPath) +const stubLauncher = path.resolve(appFolder, '..', ourExeName) app.setLoginItemSettings({ openAtLogin: true, - path: updateExe, + path: stubLauncher, args: [ - '--processStart', `"${exeName}"`, - '--process-start-args', '"--hidden"' + // You might want to pass a parameter here indicating that this + // app was launched via login, but you don't have to ] }) ``` diff --git a/docs/api/structures/base-window-options.md b/docs/api/structures/base-window-options.md index 808d1609f9..771445be06 100644 --- a/docs/api/structures/base-window-options.md +++ b/docs/api/structures/base-window-options.md @@ -49,7 +49,7 @@ * `show` boolean (optional) - Whether window should be shown when created. Default is `true`. * `frame` boolean (optional) - Specify `false` to create a - [frameless window](../../tutorial/window-customization.md#create-frameless-windows). Default is `true`. + [frameless window](../../tutorial/custom-window-styles.md#frameless-windows). Default is `true`. * `parent` BaseWindow (optional) - Specify parent window. Default is `null`. * `modal` boolean (optional) - Whether this is a modal window. This only works when the window is a child window. Default is `false`. @@ -70,7 +70,7 @@ is only implemented on Windows and macOS. * `darkTheme` boolean (optional) - Forces using dark theme for the window, only works on some GTK+3 desktop environments. Default is `false`. -* `transparent` boolean (optional) - Makes the window [transparent](../../tutorial/window-customization.md#create-transparent-windows). +* `transparent` boolean (optional) - Makes the window [transparent](../../tutorial/custom-window-styles.md#transparent-windows). Default is `false`. On Windows, does not work unless the window is frameless. * `type` string (optional) - The type of window, default is normal window. See more about this below. diff --git a/docs/api/web-frame.md b/docs/api/web-frame.md index 7097acbbb7..b0148f4bfe 100644 --- a/docs/api/web-frame.md +++ b/docs/api/web-frame.md @@ -182,7 +182,7 @@ dispatch errors of isolated worlds to foreign worlds. ### `webFrame.setIsolatedWorldInfo(worldId, info)` -* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here. +* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electron's `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here. * `info` Object * `securityOrigin` string (optional) - Security origin for the isolated world. * `csp` string (optional) - Content Security Policy for the isolated world. diff --git a/docs/experimental.md b/docs/experimental.md index 33a66579c4..4d35388e2b 100644 --- a/docs/experimental.md +++ b/docs/experimental.md @@ -1,6 +1,6 @@ # Experimental APIs -Some of Electrons APIs are tagged with `_Experimental_` in the documentation. +Some of Electron's APIs are tagged with `_Experimental_` in the documentation. This tag indicates that the API may not be considered stable and the API may be removed or modified more frequently than other APIs with less warning. diff --git a/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/index.html b/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/index.html new file mode 100644 index 0000000000..389fd9e760 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/index.html @@ -0,0 +1,14 @@ + + + + + + + + Custom Titlebar App + + + +
Cool titlebar
+ + \ No newline at end of file diff --git a/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/main.js b/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/main.js new file mode 100644 index 0000000000..b862cdf970 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/main.js @@ -0,0 +1,16 @@ +const { app, BrowserWindow } = require('electron') + +function createWindow () { + const win = new BrowserWindow({ + // remove the default titlebar + titleBarStyle: 'hidden', + // expose window controlls in Windows/Linux + ...(process.platform !== 'darwin' ? { titleBarOverlay: true } : {}) + }) + + win.loadFile('index.html') +} + +app.whenReady().then(() => { + createWindow() +}) diff --git a/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/styles.css b/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/styles.css new file mode 100644 index 0000000000..b5a046efdb --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region/styles.css @@ -0,0 +1,12 @@ +body { + margin: 0; +} +.titlebar { + height: 30px; + background: blue; + color: white; + display: flex; + justify-content: center; + align-items: center; + app-region: drag; +} \ No newline at end of file diff --git a/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/index.html b/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/index.html new file mode 100644 index 0000000000..389fd9e760 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/index.html @@ -0,0 +1,14 @@ + + + + + + + + Custom Titlebar App + + + +
Cool titlebar
+ + \ No newline at end of file diff --git a/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/main.js b/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/main.js new file mode 100644 index 0000000000..b862cdf970 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/main.js @@ -0,0 +1,16 @@ +const { app, BrowserWindow } = require('electron') + +function createWindow () { + const win = new BrowserWindow({ + // remove the default titlebar + titleBarStyle: 'hidden', + // expose window controlls in Windows/Linux + ...(process.platform !== 'darwin' ? { titleBarOverlay: true } : {}) + }) + + win.loadFile('index.html') +} + +app.whenReady().then(() => { + createWindow() +}) diff --git a/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/styles.css b/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/styles.css new file mode 100644 index 0000000000..1f61248a97 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar/styles.css @@ -0,0 +1,12 @@ +body { + margin: 0; +} + +.titlebar { + height: 30px; + background: blue; + color: white; + display: flex; + justify-content: center; + align-items: center; +} \ No newline at end of file diff --git a/docs/fiddles/features/window-customization/custom-title-bar/native-window-controls/main.js b/docs/fiddles/features/window-customization/custom-title-bar/native-window-controls/main.js new file mode 100644 index 0000000000..fc59d41ca1 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/native-window-controls/main.js @@ -0,0 +1,15 @@ +const { app, BrowserWindow } = require('electron') + +function createWindow () { + const win = new BrowserWindow({ + // remove the default titlebar + titleBarStyle: 'hidden', + // expose window controlls in Windows/Linux + ...(process.platform !== 'darwin' ? { titleBarOverlay: true } : {}) + }) + win.loadURL('https://example.com') +} + +app.whenReady().then(() => { + createWindow() +}) diff --git a/docs/fiddles/features/window-customization/custom-title-bar/remove-title-bar/main.js b/docs/fiddles/features/window-customization/custom-title-bar/remove-title-bar/main.js new file mode 100644 index 0000000000..f85ee63f59 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/remove-title-bar/main.js @@ -0,0 +1,13 @@ +const { app, BrowserWindow } = require('electron') + +function createWindow () { + const win = new BrowserWindow({ + // remove the default titlebar + titleBarStyle: 'hidden' + }) + win.loadURL('https://example.com') +} + +app.whenReady().then(() => { + createWindow() +}) diff --git a/docs/fiddles/features/window-customization/custom-title-bar/starter-code/main.js b/docs/fiddles/features/window-customization/custom-title-bar/starter-code/main.js new file mode 100644 index 0000000000..314899176a --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-title-bar/starter-code/main.js @@ -0,0 +1,10 @@ +const { app, BrowserWindow } = require('electron') + +function createWindow () { + const win = new BrowserWindow({}) + win.loadURL('https://example.com') +} + +app.whenReady().then(() => { + createWindow() +}) diff --git a/docs/fiddles/features/window-customization/custom-window-styles/frameless-windows/main.js b/docs/fiddles/features/window-customization/custom-window-styles/frameless-windows/main.js new file mode 100644 index 0000000000..86e486b1ee --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-window-styles/frameless-windows/main.js @@ -0,0 +1,14 @@ +const { app, BrowserWindow } = require('electron') + +function createWindow () { + const win = new BrowserWindow({ + width: 300, + height: 200, + frame: false + }) + win.loadURL('https://example.com') +} + +app.whenReady().then(() => { + createWindow() +}) diff --git a/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/index.html b/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/index.html new file mode 100644 index 0000000000..7c3dc93bdd --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/index.html @@ -0,0 +1,15 @@ + + + + + + + + Transparent Hello World + + +
+
Hello World!
+
+ + \ No newline at end of file diff --git a/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/main.js b/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/main.js new file mode 100644 index 0000000000..42e63cf4d2 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/main.js @@ -0,0 +1,16 @@ +const { app, BrowserWindow } = require('electron') + +function createWindow () { + const win = new BrowserWindow({ + width: 100, + height: 100, + resizable: false, + frame: false, + transparent: true + }) + win.loadFile('index.html') +} + +app.whenReady().then(() => { + createWindow() +}) diff --git a/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/styles.css b/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/styles.css new file mode 100644 index 0000000000..361a8d8798 --- /dev/null +++ b/docs/fiddles/features/window-customization/custom-window-styles/transparent-windows/styles.css @@ -0,0 +1,16 @@ +body { + margin: 0; + padding: 0; + background-color: rgba(0, 0, 0, 0); /* Transparent background */ +} +.white-circle { + width: 100px; + height: 100px; + background-color: white; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + app-region: drag; + user-select: none; +} \ No newline at end of file diff --git a/docs/images/frameless-window.png b/docs/images/frameless-window.png new file mode 100644 index 0000000000..586242c19b Binary files /dev/null and b/docs/images/frameless-window.png differ diff --git a/docs/images/transparent-window-mission-control.png b/docs/images/transparent-window-mission-control.png new file mode 100644 index 0000000000..444d87ddb4 Binary files /dev/null and b/docs/images/transparent-window-mission-control.png differ diff --git a/docs/images/transparent-window.png b/docs/images/transparent-window.png new file mode 100644 index 0000000000..8d5e517081 Binary files /dev/null and b/docs/images/transparent-window.png differ diff --git a/docs/tutorial/custom-title-bar.md b/docs/tutorial/custom-title-bar.md new file mode 100644 index 0000000000..9f9966eaf1 --- /dev/null +++ b/docs/tutorial/custom-title-bar.md @@ -0,0 +1,176 @@ +# Custom Title Bar + +## Basic tutorial + +Application windows have a default [chrome][] applied by the OS. Not to be confused +with the Google Chrome browser, window _chrome_ refers to the parts of the window (e.g. +title bar, toolbars, controls) that are not a part of the main web content. While the +default title bar provided by the OS chrome is sufficent for simple use cases, many +applications opt to remove it. Implementing a custom title bar can help your application +feel more modern and consistent across platforms. + +You can follow along with this tutorial by opening Fiddle with the following starter code. + +```fiddle docs/fiddles/features/window-customization/custom-title-bar/starter-code + +``` + +### Remove the default title bar + +Let’s start by configuring a window with native window controls and a hidden title bar. +To remove the default title bar, set the [`BaseWindowContructorOptions`][] `titleBarStyle` +param in the `BrowserWindow` constructor to `'hidden'`. + +```fiddle docs/fiddles/features/window-customization/custom-title-bar/remove-title-bar + +``` + +### Add native window controls _Windows_ _Linux_ + +On macOS, setting `titleBarStyle: 'hidden'` removes the title bar while keeping the window’s +traffic light controls available in the upper left hand corner. However on Windows and Linux, +you’ll need to add window controls back into your `BrowserWindow` by setting the +[`BaseWindowContructorOptions`][] `titleBarOverlay` param in the `BrowserWindow` constructor. + +```fiddle docs/fiddles/features/window-customization/custom-title-bar/native-window-controls + +``` + +Setting `titleBarOverlay: true` is the simplest way to expose window controls back into +your `BrowserWindow`. If you’re interested in customizing the window controls further, +check out the sections [Custom traffic lights][] and [Custom window controls][] that cover +this in more detail. + +### Create a custom title bar + +Now, let’s implement a simple custom title bar in the `webContents` of our `BrowserWindow`. +There’s nothing fancy here, just HTML and CSS! + +```fiddle docs/fiddles/features/window-customization/custom-title-bar/custom-title-bar + +``` + +Currently our application window can’t be moved. Since we’ve removed the default title bar, +the application needs to tell Electron which regions are draggable. We’ll do this by adding +the CSS style `app-region: drag` to the custom title bar. Now we can drag the custom title +bar to reposition our app window! + +```fiddle docs/fiddles/features/window-customization/custom-title-bar/custom-drag-region + +``` + +For more information around how to manage drag regions defined by your electron application, +see the [Custom draggable regions][] section below. + +Congratulations, you've just implemented a basic custom title bar! + +## Advanced window customization + +### Custom traffic lights _macOS_ + +#### Customize the look of your traffic lights _macOS_ + +The `customButtonsOnHover` title bar style will hide the traffic lights until you hover +over them. This is useful if you want to create custom traffic lights in your HTML but still +use the native UI to control the window. + +```js +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover' }) +``` + +#### Customize the traffic light position _macOS_ + +To modify the position of the traffic light window controls, there are two configuration +options available. + +Applying `hiddenInset` title bar style will shift the vertical inset of the traffic lights +by a fixed amount. + +```js title='main.js' +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ titleBarStyle: 'hiddenInset' }) +``` + +If you need more granular control over the positioning of the traffic lights, you can pass +a set of coordinates to the `trafficLightPosition` option in the `BrowserWindow` +constructor. + +```js title='main.js' +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + trafficLightPosition: { x: 10, y: 10 } +}) +``` + +#### Show and hide the traffic lights programmatically _macOS_ + +You can also show and hide the traffic lights programmatically from the main process. +The `win.setWindowButtonVisibility` forces traffic lights to be show or hidden depending +on the value of its boolean parameter. + +```js title='main.js' +const { BrowserWindow } = require('electron') +const win = new BrowserWindow() +// hides the traffic lights +win.setWindowButtonVisibility(false) +``` + +:::note +Given the number of APIs available, there are many ways of achieving this. For instance, +combining `frame: false` with `win.setWindowButtonVisibility(true)` will yield the same +layout outcome as setting `titleBarStyle: 'hidden'`. +::: + +#### Custom window controls + +The [Window Controls Overlay API][] is a web standard that gives web apps the ability to +customize their title bar region when installed on desktop. Electron exposes this API +through the `titleBarOverlay` option in the `BrowserWindow` constructor. When `titleBarOverlay` +is enabled, the window controls become exposed in their default position, and DOM elements +cannot use the area underneath this region. + +:::note +`titleBarOverlay` requires the `titleBarStyle` param in the `BrowserWindow` constructor +to have a value other than `default`. +::: + +The custom title bar tutorial covers a [basic example][Add native window controls] of exposing +window controls by setting `titleBarOverlay: true`. The height, color (_Windows_ _Linux_), and +symbol colors (_Windows_) of the window controls can be customized further by setting +`titleBarOverlay` to an object. + +The value passed to the `height` property must be an integer. The `color` and `symbolColor` +properties accept `rgba()`, `hsla()`, and `#RRGGBBAA` color formats and support transparency. +If a color option is not specified, the color will default to its system color for the window +control buttons. Similarly, if the height option is not specified, the window controls will +default to the standard system height: + +```js title='main.js' +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: { + color: '#2f3241', + symbolColor: '#74b1be', + height: 60 + } +}) +``` + +:::note +Once your title bar overlay is enabled from the main process, you can access the overlay's +color and dimension values from a renderer using a set of readonly +[JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. +::: + +[Add native window controls]: #add-native-window-controls-windows-linux +[`BaseWindowContructorOptions`]: ../api/structures/base-window-options.md +[chrome]: https://developer.mozilla.org/en-US/docs/Glossary/Chrome +[Custom draggable regions]: ./custom-window-interactions.md#custom-draggable-regions +[Custom traffic lights]: #custom-traffic-lights-macos +[Custom window controls]: #custom-window-controls +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[Window Controls Overlay API]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md diff --git a/docs/tutorial/custom-window-interactions.md b/docs/tutorial/custom-window-interactions.md new file mode 100644 index 0000000000..6801594b94 --- /dev/null +++ b/docs/tutorial/custom-window-interactions.md @@ -0,0 +1,107 @@ +# Custom Window Interactions + +## Custom draggable regions + +By default, windows are dragged using the title bar provided by the OS chrome. Apps +that remove the default title bar need to use the `app-region` CSS property to define +specific areas that can be used to drag the window. Setting `app-region: drag` marks +a rectagular area as draggable. + +It is important to note that draggable areas ignore all pointer events. For example, +a button element that overlaps a draggable region will not emit mouse clicks or mouse +enter/exit events within that overlapping area. Setting `app-region: no-drag` reenables +pointer events by excluding a rectagular area from a draggable region. + +To make the whole window draggable, you can add `app-region: drag` as +`body`'s style: + +```css title='styles.css' +body { + app-region: drag; +} +``` + +And note that if you have made the whole window draggable, you must also mark +buttons as non-draggable, otherwise it would be impossible for users to click on +them: + +```css title='styles.css' +button { + app-region: no-drag; +} +``` + +If you're only setting a custom title bar as draggable, you also need to make all +buttons in title bar non-draggable. + +### Tip: disable text selection + +When creating a draggable region, the dragging behavior may conflict with text selection. +For example, when you drag the title bar, you may accidentally select its text contents. +To prevent this, you need to disable text selection within a draggable area like this: + +```css +.titlebar { + user-select: none; + app-region: drag; +} +``` + +### Tip: disable context menus + +On some platforms, the draggable area will be treated as a non-client frame, so +when you right click on it, a system menu will pop up. To make the context menu +behave correctly on all platforms, you should never use a custom context menu on +draggable areas. + +## Click-through windows + +To create a click-through window, i.e. making the window ignore all mouse +events, you can call the [win.setIgnoreMouseEvents(ignore)][ignore-mouse-events] +API: + +```js title='main.js' +const { BrowserWindow } = require('electron') +const win = new BrowserWindow() +win.setIgnoreMouseEvents(true) +``` + +### Forward mouse events _macOS_ _Windows_ + +Ignoring mouse messages makes the web contents oblivious to mouse movement, +meaning that mouse movement events will not be emitted. On Windows and macOS, an +optional parameter can be used to forward mouse move messages to the web page, +allowing events such as `mouseleave` to be emitted: + +```js title='main.js' +const { BrowserWindow, ipcMain } = require('electron') +const path = require('node:path') + +const win = new BrowserWindow({ + webPreferences: { + preload: path.join(__dirname, 'preload.js') + } +}) + +ipcMain.on('set-ignore-mouse-events', (event, ignore, options) => { + const win = BrowserWindow.fromWebContents(event.sender) + win.setIgnoreMouseEvents(ignore, options) +}) +``` + +```js title='preload.js' +window.addEventListener('DOMContentLoaded', () => { + const el = document.getElementById('clickThroughElement') + el.addEventListener('mouseenter', () => { + ipcRenderer.send('set-ignore-mouse-events', true, { forward: true }) + }) + el.addEventListener('mouseleave', () => { + ipcRenderer.send('set-ignore-mouse-events', false) + }) +}) +``` + +This makes the web page click-through when over the `#clickThroughElement` element, +and returns to normal outside it. + +[ignore-mouse-events]: ../api/browser-window.md#winsetignoremouseeventsignore-options diff --git a/docs/tutorial/custom-window-styles.md b/docs/tutorial/custom-window-styles.md new file mode 100644 index 0000000000..0dd641ce61 --- /dev/null +++ b/docs/tutorial/custom-window-styles.md @@ -0,0 +1,49 @@ +# Custom Window Styles + +## Frameless windows + +![Frameless Window](../images/frameless-window.png) + +A frameless window removes all [chrome][] applied by the OS, including window controls. + +To create a frameless window, set the [`BaseWindowContructorOptions`][] `frame` param in the `BrowserWindow` constructor to `false`. + +```fiddle docs/fiddles/features/window-customization/custom-window-styles/frameless-windows + +``` + +## Transparent windows + +![Transparent Window](../images/transparent-window.png) +![Transparent Window in macOS Mission Control](../images/transparent-window-mission-control.png) + +To create a fully transparent window, set the [`BaseWindowContructorOptions`][] `transparent` param in the `BrowserWindow` constructor to `true`. + +The following fiddle takes advantage of a tranparent window and CSS styling to create +the illusion of a circular window. + +```fiddle docs/fiddles/features/window-customization/custom-window-styles/transparent-windows + +``` + +### Limitations + +* You cannot click through the transparent area. See + [#1335](https://github.com/electron/electron/issues/1335) for details. +* Transparent windows are not resizable. Setting `resizable` to `true` may make + a transparent window stop working on some platforms. +* The CSS [`blur()`][] filter only applies to the window's web contents, so there is + no way to apply blur effect to the content below the window (i.e. other applications + open on the user's system). +* The window will not be transparent when DevTools is opened. +* On _Windows_: + * Transparent windows will not work when DWM is disabled. + * Transparent windows can not be maximized using the Windows system menu or by double + clicking the title bar. The reasoning behind this can be seen on + PR [#28207](https://github.com/electron/electron/pull/28207). +* On _macOS_: + * The native window shadow will not be shown on a transparent window. + +[`BaseWindowContructorOptions`]: ../api/structures/base-window-options.md +[`blur()`]: https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/blur() +[chrome]: https://developer.mozilla.org/en-US/docs/Glossary/Chrome diff --git a/docs/tutorial/multithreading.md b/docs/tutorial/multithreading.md index eb2bcc9e47..ab70b88a50 100644 --- a/docs/tutorial/multithreading.md +++ b/docs/tutorial/multithreading.md @@ -42,7 +42,7 @@ safe. The only way to load a native module safely for now, is to make sure the app loads no native modules after the Web Workers get started. -```js @ts-expect-error=[1] +```js process.dlopen = () => { throw new Error('Load native module is not safe') } diff --git a/docs/tutorial/window-customization.md b/docs/tutorial/window-customization.md index bb35aa5249..71840bdaec 100644 --- a/docs/tutorial/window-customization.md +++ b/docs/tutorial/window-customization.md @@ -1,269 +1,17 @@ # Window Customization -The `BrowserWindow` module is the foundation of your Electron application, and it exposes -many APIs that can change the look and behavior of your browser windows. In this -tutorial, we will be going over the various use-cases for window customization on -macOS, Windows, and Linux. +The [`BrowserWindow`][] module is the foundation of your Electron application, and +it exposes many APIs that let you customize the look and behavior of your app’s windows. +This section covers how to implement various use cases for window customization on macOS, +Windows, and Linux. -## Create frameless windows +:::info +`BrowserWindow` is a subclass of the [`BaseWindow`][] module. Both modules allow +you to create and manage application windows in Electron, with the main difference +being that `BrowserWindow` supports a single, full size web view while `BaseWindow` +supports composing many web views. `BaseWindow` can be used interchangeably with `BrowserWindow` +in the examples of the documents in this section. +::: -A frameless window is a window that has no [chrome][]. Not to be confused with the Google -Chrome browser, window _chrome_ refers to the parts of the window (e.g. toolbars, controls) -that are not a part of the web page. - -To create a frameless window, you need to set `frame` to `false` in the `BrowserWindow` -constructor. - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow({ frame: false }) -``` - -## Apply custom title bar styles _macOS_ _Windows_ - -Title bar styles allow you to hide most of a BrowserWindow's chrome while keeping the -system's native window controls intact and can be configured with the `titleBarStyle` -option in the `BrowserWindow` constructor. - -Applying the `hidden` title bar style results in a hidden title bar and a full-size -content window. - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow({ titleBarStyle: 'hidden' }) -``` - -### Control the traffic lights _macOS_ - -On macOS, applying the `hidden` title bar style will still expose the standard window -controls (“traffic lights”) in the top left. - -#### Customize the look of your traffic lights _macOS_ - -The `customButtonsOnHover` title bar style will hide the traffic lights until you hover -over them. This is useful if you want to create custom traffic lights in your HTML but still -use the native UI to control the window. - -```js -const { BrowserWindow } = require('electron') -const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover' }) -``` - -#### Customize the traffic light position _macOS_ - -To modify the position of the traffic light window controls, there are two configuration -options available. - -Applying `hiddenInset` title bar style will shift the vertical inset of the traffic lights -by a fixed amount. - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow({ titleBarStyle: 'hiddenInset' }) -``` - -If you need more granular control over the positioning of the traffic lights, you can pass -a set of coordinates to the `trafficLightPosition` option in the `BrowserWindow` -constructor. - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow({ - titleBarStyle: 'hidden', - trafficLightPosition: { x: 10, y: 10 } -}) -``` - -#### Show and hide the traffic lights programmatically _macOS_ - -You can also show and hide the traffic lights programmatically from the main process. -The `win.setWindowButtonVisibility` forces traffic lights to be show or hidden depending -on the value of its boolean parameter. - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow() -// hides the traffic lights -win.setWindowButtonVisibility(false) -``` - -> Note: Given the number of APIs available, there are many ways of achieving this. For instance, -> combining `frame: false` with `win.setWindowButtonVisibility(true)` will yield the same -> layout outcome as setting `titleBarStyle: 'hidden'`. - -## Window Controls Overlay - -The [Window Controls Overlay API][] is a web standard that gives web apps the ability to -customize their title bar region when installed on desktop. Electron exposes this API -through the `BrowserWindow` constructor option `titleBarOverlay`. - -This option only works whenever a custom `titlebarStyle` is applied. -When `titleBarOverlay` is enabled, the window controls become exposed in their default -position, and DOM elements cannot use the area underneath this region. - -The `titleBarOverlay` option accepts two different value formats. - -Specifying `true` on either platform will result in an overlay region with default -system colors: - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow({ - titleBarStyle: 'hidden', - titleBarOverlay: true -}) -``` - -On either platform `titleBarOverlay` can also be an object. The height of the overlay can be specified with the `height` property. On Windows and Linux, the color of the overlay and can be specified using the `color` property. On Windows and Linux, the color of the overlay and its symbols can be specified using the `color` and `symbolColor` properties respectively. The `rgba()`, `hsla()`, and `#RRGGBBAA` color formats are supported to apply transparency. - -If a color option is not specified, the color will default to its system color for the window control buttons. Similarly, if the height option is not specified it will default to the default height: - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow({ - titleBarStyle: 'hidden', - titleBarOverlay: { - color: '#2f3241', - symbolColor: '#74b1be', - height: 60 - } -}) -``` - -> Note: Once your title bar overlay is enabled from the main process, you can access the overlay's -> color and dimension values from a renderer using a set of readonly -> [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. - -## Create transparent windows - -By setting the `transparent` option to `true`, you can make a fully transparent window. - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow({ transparent: true }) -``` - -### Limitations - -* You cannot click through the transparent area. See - [#1335](https://github.com/electron/electron/issues/1335) for details. -* Transparent windows are not resizable. Setting `resizable` to `true` may make - a transparent window stop working on some platforms. -* The CSS [`blur()`][] filter only applies to the window's web contents, so there is no way to apply - blur effect to the content below the window (i.e. other applications open on - the user's system). -* The window will not be transparent when DevTools is opened. -* On _Windows_: - * Transparent windows will not work when DWM is disabled. - * Transparent windows can not be maximized using the Windows system menu or by double - clicking the title bar. The reasoning behind this can be seen on - PR [#28207](https://github.com/electron/electron/pull/28207). -* On _macOS_: - * The native window shadow will not be shown on a transparent window. - -## Create click-through windows - -To create a click-through window, i.e. making the window ignore all mouse -events, you can call the [win.setIgnoreMouseEvents(ignore)][ignore-mouse-events] -API: - -```js title='main.js' -const { BrowserWindow } = require('electron') -const win = new BrowserWindow() -win.setIgnoreMouseEvents(true) -``` - -### Forward mouse events _macOS_ _Windows_ - -Ignoring mouse messages makes the web contents oblivious to mouse movement, -meaning that mouse movement events will not be emitted. On Windows and macOS, an -optional parameter can be used to forward mouse move messages to the web page, -allowing events such as `mouseleave` to be emitted: - -```js title='main.js' -const { BrowserWindow, ipcMain } = require('electron') -const path = require('node:path') - -const win = new BrowserWindow({ - webPreferences: { - preload: path.join(__dirname, 'preload.js') - } -}) - -ipcMain.on('set-ignore-mouse-events', (event, ignore, options) => { - const win = BrowserWindow.fromWebContents(event.sender) - win.setIgnoreMouseEvents(ignore, options) -}) -``` - -```js title='preload.js' -window.addEventListener('DOMContentLoaded', () => { - const el = document.getElementById('clickThroughElement') - el.addEventListener('mouseenter', () => { - ipcRenderer.send('set-ignore-mouse-events', true, { forward: true }) - }) - el.addEventListener('mouseleave', () => { - ipcRenderer.send('set-ignore-mouse-events', false) - }) -}) -``` - -This makes the web page click-through when over the `#clickThroughElement` element, -and returns to normal outside it. - -## Set custom draggable region - -By default, the frameless window is non-draggable. Apps need to specify -`-webkit-app-region: drag` in CSS to tell Electron which regions are draggable -(like the OS's standard titlebar), and apps can also use -`-webkit-app-region: no-drag` to exclude the non-draggable area from the - draggable region. Note that only rectangular shapes are currently supported. - -To make the whole window draggable, you can add `-webkit-app-region: drag` as -`body`'s style: - -```css title='styles.css' -body { - -webkit-app-region: drag; -} -``` - -And note that if you have made the whole window draggable, you must also mark -buttons as non-draggable, otherwise it would be impossible for users to click on -them: - -```css title='styles.css' -button { - -webkit-app-region: no-drag; -} -``` - -If you're only setting a custom titlebar as draggable, you also need to make all -buttons in titlebar non-draggable. - -### Tip: disable text selection - -When creating a draggable region, the dragging behavior may conflict with text selection. -For example, when you drag the titlebar, you may accidentally select its text contents. -To prevent this, you need to disable text selection within a draggable area like this: - -```css -.titlebar { - -webkit-user-select: none; - -webkit-app-region: drag; -} -``` - -### Tip: disable context menus - -On some platforms, the draggable area will be treated as a non-client frame, so -when you right click on it, a system menu will pop up. To make the context menu -behave correctly on all platforms, you should never use a custom context menu on -draggable areas. - -[`blur()`]: https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/blur() -[chrome]: https://developer.mozilla.org/en-US/docs/Glossary/Chrome -[ignore-mouse-events]: ../api/browser-window.md#winsetignoremouseeventsignore-options -[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables -[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis -[Window Controls Overlay API]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md +[`BaseWindow`]: ../api/base-window.md +[`BrowserWindow`]: ../api/browser-window.md diff --git a/filenames.gni b/filenames.gni index 039f60c9ac..cdfbac8b43 100644 --- a/filenames.gni +++ b/filenames.gni @@ -675,7 +675,6 @@ filenames = { "shell/common/node_includes.h", "shell/common/node_util.cc", "shell/common/node_util.h", - "shell/common/options_switches.cc", "shell/common/options_switches.h", "shell/common/platform_util.cc", "shell/common/platform_util.h", diff --git a/filenames.libcxx.gni b/filenames.libcxx.gni index d680308876..e18f728140 100644 --- a/filenames.libcxx.gni +++ b/filenames.libcxx.gni @@ -236,6 +236,7 @@ libcxx_headers = [ "//third_party/libc++/src/include/__bit/rotate.h", "//third_party/libc++/src/include/__bit_reference", "//third_party/libc++/src/include/__charconv/chars_format.h", + "//third_party/libc++/src/include/__charconv/from_chars_floating_point.h", "//third_party/libc++/src/include/__charconv/from_chars_integral.h", "//third_party/libc++/src/include/__charconv/from_chars_result.h", "//third_party/libc++/src/include/__charconv/tables.h", @@ -969,7 +970,6 @@ libcxx_headers = [ "//third_party/libc++/src/include/limits", "//third_party/libc++/src/include/list", "//third_party/libc++/src/include/locale", - "//third_party/libc++/src/include/locale.h", "//third_party/libc++/src/include/map", "//third_party/libc++/src/include/math.h", "//third_party/libc++/src/include/mdspan", @@ -1000,7 +1000,6 @@ libcxx_headers = [ "//third_party/libc++/src/include/stdbool.h", "//third_party/libc++/src/include/stddef.h", "//third_party/libc++/src/include/stdexcept", - "//third_party/libc++/src/include/stdint.h", "//third_party/libc++/src/include/stdio.h", "//third_party/libc++/src/include/stdlib.h", "//third_party/libc++/src/include/stop_token", diff --git a/lib/node/asar-fs-wrapper.ts b/lib/node/asar-fs-wrapper.ts index aebd5b3021..a46b97290f 100644 --- a/lib/node/asar-fs-wrapper.ts +++ b/lib/node/asar-fs-wrapper.ts @@ -841,6 +841,27 @@ export const wrapFsWithAsar = (fs: Record) => { return files; }; + const modBinding = internalBinding('modules'); + const { readPackageJSON } = modBinding; + internalBinding('modules').readPackageJSON = ( + jsonPath: string, + isESM: boolean, + base: undefined | string, + specifier: undefined | string + ) => { + const pathInfo = splitPath(jsonPath); + if (!pathInfo.isAsar) return readPackageJSON(jsonPath, isESM, base, specifier); + const { asarPath, filePath } = pathInfo; + + const archive = getOrCreateArchive(asarPath); + if (!archive) return undefined; + + const realPath = archive.copyFileOut(filePath); + if (!realPath) return undefined; + + return readPackageJSON(realPath, isESM, base, specifier); + }; + const binding = internalBinding('fs'); const { internalModuleReadJSON, kUsePromises } = binding; internalBinding('fs').internalModuleReadJSON = (pathArgument: string) => { diff --git a/npm/package.json b/npm/package.json index 69015766c5..96fd3c3ad0 100644 --- a/npm/package.json +++ b/npm/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@electron/get": "^2.0.0", - "@types/node": "^20.9.0", + "@types/node": "^22.7.7", "extract-zip": "^2.0.1" }, "engines": { diff --git a/package.json b/package.json index e908da7982..12b3f777d2 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@octokit/rest": "^20.0.2", "@primer/octicons": "^10.0.0", "@types/minimist": "^1.2.5", - "@types/node": "^20.9.0", + "@types/node": "^22.7.7", "@types/semver": "^7.5.8", "@types/stream-json": "^1.7.7", "@types/temp": "^0.9.4", @@ -39,7 +39,6 @@ "folder-hash": "^2.1.1", "got": "^11.8.5", "husky": "^8.0.1", - "lint": "^1.1.2", "lint-staged": "^10.2.11", "markdownlint-cli2": "^0.13.0", "minimist": "^1.2.8", diff --git a/patches/boringssl/revert_track_ssl_error_zero_return_explicitly.patch b/patches/boringssl/revert_track_ssl_error_zero_return_explicitly.patch index a1a8f5edfc..64dc1d88c5 100644 --- a/patches/boringssl/revert_track_ssl_error_zero_return_explicitly.patch +++ b/patches/boringssl/revert_track_ssl_error_zero_return_explicitly.patch @@ -20,7 +20,7 @@ index 7de8923518dbfb69fef62d7781f906b30cf62155..7a4310d6d8e85f07f0ae6c97726d909c case ssl_open_record_error: diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc -index f0b3872e95d21646e6fb943f012a11287c1cf5a8..1f7bd4b503f6f4406248c1b48c2dc87f84e903c6 100644 +index e74f8866efebc36b574999fa3c0c51f2f7ac82b7..f3322906e042518295a0b17e1a19bd21c8edaff1 100644 --- a/ssl/ssl_lib.cc +++ b/ssl/ssl_lib.cc @@ -1337,7 +1337,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) { diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 6d6c1c02eb..4be3b0aff0 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -133,4 +133,6 @@ osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch chore_partial_revert_of.patch fix_software_compositing_infinite_loop.patch -ui_add_missing_shortcut_text_for_vkey_command_on_linux.patch +disable_elf_crel_on_linux_arm.patch +fix_don_t_use_forward_declaration_header.patch +revert_mojo_force_blink_headers_to_only_be_included_in_blink.patch diff --git a/patches/chromium/accelerator.patch b/patches/chromium/accelerator.patch index 83c6240c06..57c7838e8e 100644 --- a/patches/chromium/accelerator.patch +++ b/patches/chromium/accelerator.patch @@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc 3. Ctrl-Shift-= and Ctrl-Plus show up as such diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc -index dc4bea32e76b41521240ad14e313aa2492539e30..32a3fc0843656eaa87b85dd63ac1ade6d83b6e5b 100644 +index 91709fe9dece5baeca989c1b25d83342c0ac6ac6..ed1ff076b1db6b77d0684bae1931714bf575ebe8 100644 --- a/ui/base/accelerators/accelerator.cc +++ b/ui/base/accelerators/accelerator.cc @@ -12,6 +12,7 @@ diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 52e4ede72e..47d59a04a0 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -23,10 +23,10 @@ index ad0092ef2e13853e4bb8b923481559a043b00ab7..1c2dfd23f18733e21312992877ae1499 int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 6e8b3fbcc9c553a725bbd8e5a710be6be239a88b..ba7cb724f30582b51fd53cad99271b0651eff08c 100644 +index fc56ff48a7b15653fcf5a035a72fe60d1c55e33a..6f4a8800fe82ffd273497cf054f93d0ba0c47804 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4781,6 +4781,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4793,6 +4793,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -40,7 +40,7 @@ index 6e8b3fbcc9c553a725bbd8e5a710be6be239a88b..ba7cb724f30582b51fd53cad99271b06 int world_id) { for (auto& observer : observers_) diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h -index 764763cb6967cb365882083fc4c0572869cc962a..85d682d3233bd10fbe54a050280649e3a82f9a00 100644 +index 0980dad73ed2d5cbcbabee8f7d6fc827bb31b623..fcc651f75677ad1ae25e4edc5e2ae9a82ddd31d0 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h @@ -651,6 +651,8 @@ class CONTENT_EXPORT RenderFrameImpl @@ -53,10 +53,10 @@ index 764763cb6967cb365882083fc4c0572869cc962a..85d682d3233bd10fbe54a050280649e3 int world_id) override; void DidChangeScrollOffset() override; diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h -index 8ebdaf39d5cc0539b24b843d82937adbe12a51d1..201d2bfaf21a92274d475d9a790ca9334ffbdd92 100644 +index a706d9f12083b8ea9e30d9d95498f1d2c20ed08e..f96a4fe8431da364ca6c5649b18f8d418f799086 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h -@@ -664,6 +664,9 @@ class BLINK_EXPORT WebLocalFrameClient { +@@ -665,6 +665,9 @@ class BLINK_EXPORT WebLocalFrameClient { virtual void DidCreateScriptContext(v8::Local, int32_t world_id) {} @@ -79,7 +79,7 @@ index f7e0144c74f879e9b29871d7c372b99e127966bb..c3cd7b77ed282f212a56d151dc3fbec3 if (World().IsMainWorld()) { probe::DidCreateMainWorldContext(GetFrame()); diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h -index 4864efd047b38c19ac4b35cf4a2a46218347433c..4abcf88eba9e8e52f4041e0826094a8015915eaf 100644 +index d4fe8d76a94eeb27aed8f2261394edc0acdf5694..5af657a1f20949fb4df7b101aa27ed0cd29c89ca 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h @@ -301,6 +301,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient { @@ -92,7 +92,7 @@ index 4864efd047b38c19ac4b35cf4a2a46218347433c..4abcf88eba9e8e52f4041e0826094a80 int32_t world_id) = 0; virtual bool AllowScriptExtensions() = 0; diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc -index bb6090802668ec1886083eaf2645c8745c0ee8c3..0679fabb71a1717f0676a8a08a91a853f617e46f 100644 +index 0975fc371a20d21df2dd9d08986c665237d6d38f..63c365ed8dd65f6b15b3d887aa2d7f2f18111eb7 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc @@ -294,6 +294,13 @@ void LocalFrameClientImpl::DidCreateScriptContext( @@ -110,7 +110,7 @@ index bb6090802668ec1886083eaf2645c8745c0ee8c3..0679fabb71a1717f0676a8a08a91a853 v8::Local context, int32_t world_id) { diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h -index b9aff56f283b10e899c2291f90615cbd3795454c..59f040cead445b02442404c787c1015cc3029b94 100644 +index 526a61b4e9ecb3f0343dcafa6b17e7b24c8db830..5b16f232c651c428ebc150b427dedd73fcd25e2f 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h @@ -83,6 +83,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient { @@ -123,7 +123,7 @@ index b9aff56f283b10e899c2291f90615cbd3795454c..59f040cead445b02442404c787c1015c int32_t world_id) override; diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h -index 3756c89c0ae70a802506aeac66ea26093831d88f..0d65071421e21edd77de0d2463061e6a05049121 100644 +index fb56366d4d8cf46dee3403081be752f86d0713c8..4e5954fe78c3a240dba043b4746b706c1de981cd 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.h +++ b/third_party/blink/renderer/core/loader/empty_clients.h @@ -415,6 +415,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { diff --git a/patches/chromium/add_electron_deps_to_license_credits_file.patch b/patches/chromium/add_electron_deps_to_license_credits_file.patch index 3e39e71a0f..4d2304a996 100644 --- a/patches/chromium/add_electron_deps_to_license_credits_file.patch +++ b/patches/chromium/add_electron_deps_to_license_credits_file.patch @@ -7,10 +7,10 @@ Ensure that licenses for the dependencies introduced by Electron are included in `LICENSES.chromium.html` diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py -index f72e5cdb2a889775e7d72b8dea992ac562c5dde3..03dda85dd9b390ee1ad69c1a5325e7588cfcd741 100755 +index 2a65975667a9fbedc0f9f108abb67dc6038eaf47..d6205d9fd0eea97d5ed85c2c4994d20c174379a7 100755 --- a/tools/licenses/licenses.py +++ b/tools/licenses/licenses.py -@@ -335,6 +335,31 @@ SPECIAL_CASES = { +@@ -336,6 +336,31 @@ SPECIAL_CASES = { "License": "Apache 2.0", "License File": ["//third_party/dawn/third_party/khronos/LICENSE"], }, diff --git a/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch b/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch index 189c70ae8c..cbf2c030a2 100644 --- a/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch +++ b/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch @@ -8,10 +8,10 @@ decorations in maximized mode where needed, preventing empty space caused by decoration shadows and rounded titlebars around the window while maximized. diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc -index 69fdf309dbb71e1d2a2d258d15df1ffde3b14841..57052ded8b7d52932b1a217c2f6cb97abd65c2a5 100644 +index ed304ba70b9924678b7318ca5f7c946b1bd90ea7..efdaefadf4c982eb859d7ddb56fc216b9077a25d 100644 --- a/ui/gtk/gtk_ui.cc +++ b/ui/gtk/gtk_ui.cc -@@ -584,11 +584,12 @@ std::unique_ptr GtkUi::CreateNavButtonProvider() { +@@ -583,11 +583,12 @@ std::unique_ptr GtkUi::CreateNavButtonProvider() { } ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, diff --git a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch index 32611a6cdf..b78465da03 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -23,10 +23,10 @@ index e392efaf2e1ac3cfbef2d787ba40f0491b67f3cc..d45c7570484a7c1bfca25c860a1ddd2d return receiver_.BindNewEndpointAndPassDedicatedRemote(); } diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc -index b1196c76de2092b41c139b040cef0915b9a1015e..5583bcd62964a2d9d5ed6223034b4201d5bc7932 100644 +index faf4f898e475dd4f3e30dfc75d87ca8d5d3e1cdf..d551e3e858460d3088efb8754f274e512d0aa62e 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc -@@ -760,6 +760,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { +@@ -755,6 +755,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque); } @@ -39,7 +39,7 @@ index b1196c76de2092b41c139b040cef0915b9a1015e..5583bcd62964a2d9d5ed6223034b4201 return is_active(); } diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h -index 961e55732d9c3aa5437e9cc6eca7a2c8d06bd335..f0fc8d303dc9de2419d5f5d769657faf98caa22a 100644 +index 5fb8a3dc69dc5fc5bfa08e01d8f03707a23c9274..41774b60b8cb7e0a22cedc597dc07ad15c96988c 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h @@ -135,6 +135,7 @@ class CONTENT_EXPORT RenderViewHostImpl @@ -51,10 +51,10 @@ index 961e55732d9c3aa5437e9cc6eca7a2c8d06bd335..f0fc8d303dc9de2419d5f5d769657faf void SendRendererPreferencesToRenderer( const blink::RendererPreferences& preferences); diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc -index dff505e44145b630c03715bf4c2e5ff8a264602e..233a352c5c2cb5ce66fc67989a0d93a3d08523c6 100644 +index 86778acd91c50902d9e07da9e94eaecc6626509f..d2454381351253e76c48d651ac09cecc9b9d219b 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -585,8 +585,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) { +@@ -586,8 +586,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) { // OnShowWithPageVisibility will not call NotifyHostAndDelegateOnWasShown, // which updates `visibility_`, unless the host is hidden. Make sure no update // is needed. @@ -116,10 +116,10 @@ index 746af7113a66d26de389237ebd90ec9e6a569cc3..f2f14184eafc919a303da6679a516bdd // Visibility ----------------------------------------------------------- diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc -index b5281ba47164159d10ca16b7641cfdc8a4bfbbef..734c055e1828d790f2abb80243bc10fa1f4d6e5e 100644 +index fb7d3474e5191637f63e50a8efb3af8749b5de3d..fcf0fde51cf30a3797a7627a9170f8534700d59b 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -2447,6 +2447,10 @@ void WebViewImpl::SetPageLifecycleStateInternal( +@@ -2451,6 +2451,10 @@ void WebViewImpl::SetPageLifecycleStateInternal( TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal", "old_state", old_state, "new_state", new_state); @@ -130,7 +130,7 @@ index b5281ba47164159d10ca16b7641cfdc8a4bfbbef..734c055e1828d790f2abb80243bc10fa bool storing_in_bfcache = new_state->is_in_back_forward_cache && !old_state->is_in_back_forward_cache; bool restoring_from_bfcache = !new_state->is_in_back_forward_cache && -@@ -3969,10 +3973,23 @@ PageScheduler* WebViewImpl::Scheduler() const { +@@ -3973,10 +3977,23 @@ PageScheduler* WebViewImpl::Scheduler() const { return GetPage()->GetPageScheduler(); } diff --git a/patches/chromium/allow_in-process_windows_to_have_different_web_prefs.patch b/patches/chromium/allow_in-process_windows_to_have_different_web_prefs.patch index 1e3b70b41c..1af964c5d7 100644 --- a/patches/chromium/allow_in-process_windows_to_have_different_web_prefs.patch +++ b/patches/chromium/allow_in-process_windows_to_have_different_web_prefs.patch @@ -8,7 +8,7 @@ WebPreferences of in-process child windows, rather than relying on process-level command line switches, as before. diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc -index 5b6208ca0f024410ca9b86444675abdd0a342bae..11d722a381ce5e8a1de8178be7ded89e8a235b91 100644 +index f17c7ae24086ab0112bd1245291f6f512a74e223..a1a23d263e4842996c0f8dde4dca8d8b35802fda 100644 --- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc +++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc @@ -147,6 +147,19 @@ bool StructTraitsaccelerated_video_decode_enabled = data.accelerated_video_decode_enabled(); diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h -index 27cc511b84dfe970fd9eff520b81446ce3ba497a..e021e693bb56704e208a3bb46e523a62b01b62c3 100644 +index 95e6b4c64bca410586378c88df288ef2bb0c6992..783c44be399a3bcf251b52c47340c26d6d962747 100644 --- a/third_party/blink/public/common/web_preferences/web_preferences.h +++ b/third_party/blink/public/common/web_preferences/web_preferences.h -@@ -10,6 +10,7 @@ +@@ -9,6 +9,7 @@ + #include #include - #include "build/build_config.h" +#include "base/files/file_path.h" + #include "build/build_config.h" #include "net/nqe/effective_connection_type.h" #include "third_party/blink/public/common/common_export.h" - #include "third_party/blink/public/mojom/css/preferred_color_scheme.mojom-shared.h" -@@ -437,6 +438,20 @@ struct BLINK_COMMON_EXPORT WebPreferences { - // blocking user's access to the background web content. - bool modal_context_menu = true; +@@ -442,6 +443,20 @@ struct BLINK_COMMON_EXPORT WebPreferences { + // when feature DynamicSafeAreaInsets is enabled. + bool dynamic_safe_area_insets_enabled = false; + // Begin Electron-specific WebPreferences. + bool context_isolation = false; @@ -65,7 +65,7 @@ index 27cc511b84dfe970fd9eff520b81446ce3ba497a..e021e693bb56704e208a3bb46e523a62 // chrome, except for the cases where it would require lots of extra work for // the embedder to use the same default value. diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h -index cc2d2e176476332546b76d33adedbbf760c6e9f6..27b936b9512c4cbd15085a6792b03af970c9f9f7 100644 +index 68f936bc7103accc4521da0a12e5e0fad05cc86c..24f209d5694cdf7128a8fb58af4957f0905058a0 100644 --- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h +++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h @@ -6,6 +6,7 @@ @@ -130,7 +130,7 @@ index cc2d2e176476332546b76d33adedbbf760c6e9f6..27b936b9512c4cbd15085a6792b03af9 return r.cookie_enabled; } diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom -index 9cfafc5d0f2bfdef2baaa0bb5c559427636e994b..b5727e31336980ea3a6003d2be78632c55ef5c75 100644 +index f3f00b8430d131627191e0e689ab54256600e852..c88a348b9b991081609d5085890a0c2538555569 100644 --- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom +++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom @@ -9,6 +9,7 @@ import "third_party/blink/public/mojom/css/preferred_contrast.mojom"; diff --git a/patches/chromium/boringssl_build_gn.patch b/patches/chromium/boringssl_build_gn.patch index e14cbb93b3..b65eb9ea73 100644 --- a/patches/chromium/boringssl_build_gn.patch +++ b/patches/chromium/boringssl_build_gn.patch @@ -6,7 +6,7 @@ Subject: boringssl BUILD.gn Build BoringSSL with some extra functions that nodejs needs. diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn -index 52e239f60fa67cf0f8c9b44edf2b1801d1f64f0e..38e5f41084ac9d58328a281197ae0d6df678047e 100644 +index 94fdb1c388172f2c9ccf459421bc05b536863409..a926b80d4d373ca2aad785c207325f2687d4b611 100644 --- a/third_party/boringssl/BUILD.gn +++ b/third_party/boringssl/BUILD.gn @@ -48,6 +48,21 @@ all_sources = bcm_internal_headers + bcm_sources + crypto_internal_headers + @@ -29,5 +29,5 @@ index 52e239f60fa67cf0f8c9b44edf2b1801d1f64f0e..38e5f41084ac9d58328a281197ae0d6d +} + if (enable_rust) { - rust_bindgen("raw_bssl_sys_bindings") { - header = "src/rust/bssl-sys/wrapper.h" + rust_bindgen_generator("raw_bssl_sys_bindings") { + output_name = "bindgen" diff --git a/patches/chromium/build_add_electron_tracing_category.patch b/patches/chromium/build_add_electron_tracing_category.patch index db0dcba553..9f00827899 100644 --- a/patches/chromium/build_add_electron_tracing_category.patch +++ b/patches/chromium/build_add_electron_tracing_category.patch @@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us to introduce a new Electron category for Electron-specific tracing. diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h -index bf7628ed923556b471c9758311d6d62ea6056125..39a7cc14091bb43967e0c6413a035353701b856a 100644 +index 1db01356c9a65072ce3296e571375b878af7deba..0a1f926fc599f5f926e88a71618e194f94a5ae7a 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h @@ -88,6 +88,7 @@ diff --git a/patches/chromium/build_allow_electron_to_use_exec_script.patch b/patches/chromium/build_allow_electron_to_use_exec_script.patch index c8b4c3a439..ef798e6bf1 100644 --- a/patches/chromium/build_allow_electron_to_use_exec_script.patch +++ b/patches/chromium/build_allow_electron_to_use_exec_script.patch @@ -6,15 +6,34 @@ Subject: build: allow electron to use exec_script This is similar to the //build usecase so we're OK adding ourselves here diff --git a/.gn b/.gn -index 44a11ec90ec9b67cf22b6d529c6843e6b6af12bc..783dd77dcdf92ec32cc6594b739eab9738f3e3ba 100644 +index 44a11ec90ec9b67cf22b6d529c6843e6b6af12bc..3e880eed02ca57db10d734d6a7566e0a977433a5 100644 --- a/.gn +++ b/.gn -@@ -172,4 +172,8 @@ exec_script_whitelist = +@@ -172,4 +172,27 @@ exec_script_whitelist = "//tools/grit/grit_rule.gni", "//tools/gritsettings/BUILD.gn", + + "//electron/BUILD.gn", ++ "//third_party/electron_node/deps/ada/unofficial.gni", + "//third_party/electron_node/deps/base64/BUILD.gn", + "//third_party/electron_node/deps/base64/unofficial.gni", ++ "//third_party/electron_node/node.gni", ++ "//third_party/electron_node/unofficial.gni", ++ "//third_party/electron_node/deps/brotli/unofficial.gni", ++ "//third_party/electron_node/deps/cares/unofficial.gni", ++ "//third_party/electron_node/deps/googletest/unofficial.gni", ++ "//third_party/electron_node/deps/histogram/unofficial.gni", ++ "//third_party/electron_node/deps/llhttp/unofficial.gni", ++ "//third_party/electron_node/deps/nbytes/unofficial.gni", ++ "//third_party/electron_node/deps/ncrypto/unofficial.gni", ++ "//third_party/electron_node/deps/nghttp2/unofficial.gni", ++ "//third_party/electron_node/deps/ngtcp2/unofficial.gni", ++ "//third_party/electron_node/deps/openssl/unofficial.gni", ++ "//third_party/electron_node/deps/simdutf/unofficial.gni", ++ "//third_party/electron_node/deps/simdjson/unofficial.gni", ++ "//third_party/electron_node/deps/sqlite/unofficial.gni", ++ "//third_party/electron_node/deps/uv/unofficial.gni", ++ "//third_party/electron_node/deps/uvwasi/unofficial.gni", ++ "//third_party/electron_node/src/inspector/unofficial.gni", ] diff --git a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch index ea61b5d0c8..42ea504107 100644 --- a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch +++ b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch @@ -11,7 +11,7 @@ if we ever align our .pak file generation with Chrome we can remove this patch. diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index f40c70d840845fdb6171ab6ba4cdcf92dbfd9965..7d762b40f44d8dc3cd1cb63c56a188f9bdced1fe 100644 +index 9580623c57cb02f7e924742c6cb1638676881115..ad80d8e63dfebbbdb8eaa63bfe38a6f86df9afb6 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -200,11 +200,16 @@ if (!is_android && !is_mac) { @@ -33,10 +33,10 @@ index f40c70d840845fdb6171ab6ba4cdcf92dbfd9965..7d762b40f44d8dc3cd1cb63c56a188f9 "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 246010af5d09afcdd46188c70f74e24fc093a4b6..7b154ad07b3740e6e5f48bc8b5eafec0ab8be5c2 100644 +index 24d79d56b396463f147af3a1419f7a8e61219981..d175ec932a06303a6fc474c8e3f842a36c1358e3 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4518,7 +4518,7 @@ static_library("browser") { +@@ -4514,7 +4514,7 @@ static_library("browser") { ] } @@ -46,10 +46,10 @@ index 246010af5d09afcdd46188c70f74e24fc093a4b6..7b154ad07b3740e6e5f48bc8b5eafec0 # than here in :chrome_dll. deps += [ "//chrome:packed_resources_integrity_header" ] diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index 29029bfcb44f6f6b34ea37b80a611000c3bf3d28..c3c472d62a9d9c3b4b3edd43f6f270fe8b0720b8 100644 +index c553a996b3f0fe7633fc5012f3126da0ad510300..2741a72627a6c60a76f84c19317ffbe11a8e051b 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -6753,9 +6753,12 @@ test("unit_tests") { +@@ -6766,9 +6766,12 @@ test("unit_tests") { "//chrome/notification_helper", ] @@ -63,7 +63,7 @@ index 29029bfcb44f6f6b34ea37b80a611000c3bf3d28..c3c472d62a9d9c3b4b3edd43f6f270fe "//chrome//services/util_win:unit_tests", "//chrome/app:chrome_dll_resources", "//chrome/app:win_unit_tests", -@@ -7696,6 +7699,10 @@ test("unit_tests") { +@@ -7709,6 +7712,10 @@ test("unit_tests") { "../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc", ] @@ -74,7 +74,7 @@ index 29029bfcb44f6f6b34ea37b80a611000c3bf3d28..c3c472d62a9d9c3b4b3edd43f6f270fe sources += [ # The importer code is not used on Android. "../common/importer/firefox_importer_utils_unittest.cc", -@@ -7748,7 +7755,6 @@ test("unit_tests") { +@@ -7761,7 +7768,6 @@ test("unit_tests") { # Non-android deps for "unit_tests" target. deps += [ "../browser/screen_ai:screen_ai_install_state", diff --git a/patches/chromium/build_gn.patch b/patches/chromium/build_gn.patch index dcdc0db4e8..ad4d11cfe7 100644 --- a/patches/chromium/build_gn.patch +++ b/patches/chromium/build_gn.patch @@ -7,7 +7,7 @@ These are variables we add to the root BUILDCONFIG so that they're available everywhere, without having to import("//electron/.../flags.gni"). diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index c9a3ce41465b38594c5eba3f152e4f127859ebb2..011c3c76c362d137d5eda90b4f5fcd6f6388ad15 100644 +index 132226f5ff9127881cd46df8fbe5a8327d854aec..a8379f00996368eabdf8a3f58d072ea819e9572b 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -123,6 +123,9 @@ if (current_os == "") { diff --git a/patches/chromium/build_libc_as_static_library.patch b/patches/chromium/build_libc_as_static_library.patch index 46ce377117..d9c514fac7 100644 --- a/patches/chromium/build_libc_as_static_library.patch +++ b/patches/chromium/build_libc_as_static_library.patch @@ -7,7 +7,7 @@ Build libc++ as static library to compile and pass nan tests diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn -index 7ed6671c98d81022672c394bdb92b93cc6b9e119..149814a9e75c38d1c1736e7a0f9481c31e220997 100644 +index 23afc35f9fe7caadf7ffbc4c87d044a0b0a5e6d1..36461703003c482e3183fe7864e574e1e2cc47c1 100644 --- a/buildtools/third_party/libc++/BUILD.gn +++ b/buildtools/third_party/libc++/BUILD.gn @@ -45,7 +45,11 @@ config("winver") { diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index 070f45cd7a..611d804821 100644 --- a/patches/chromium/can_create_window.patch +++ b/patches/chromium/can_create_window.patch @@ -9,10 +9,10 @@ potentially prevent a window from being created. TODO(loc): this patch is currently broken. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index 4babd9f35aa9b7bb4cc23b190671d2adc509942e..9f530a1a768d27070f10fc40c6af51f56f42f0ca 100644 +index 26d669854194d0dcdc5aced69db86ce7bd8c210f..f45bde8012a8078f0b636059d1c7f92c72cd325f 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -9123,6 +9123,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -9130,6 +9130,7 @@ void RenderFrameHostImpl::CreateNewWindow( last_committed_origin_, params->window_container_type, params->target_url, params->referrer.To(), params->frame_name, params->disposition, *params->features, @@ -21,10 +21,10 @@ index 4babd9f35aa9b7bb4cc23b190671d2adc509942e..9f530a1a768d27070f10fc40c6af51f5 &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index f25b2cc6c138a4e201b6ec9f74f9cb5734195f24..c67be0c23f8b8d6f49ee82e1617c0f3cfee5c9ab 100644 +index c3f8ee3b8a448bab29741c66dc354d4b8a7fa2b3..2a7ef7a03efea98b65ad9d986b7427974f874f1c 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4781,6 +4781,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4888,6 +4888,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( SetPartitionedPopinOpenerOnNewWindowIfNeeded(new_contents_impl, params, opener); @@ -37,7 +37,7 @@ index f25b2cc6c138a4e201b6ec9f74f9cb5734195f24..c67be0c23f8b8d6f49ee82e1617c0f3c // If the new frame has a name, make sure any SiteInstances that can find // this named frame have proxies for it. Must be called after // SetSessionStorageNamespace, since this calls CreateRenderView, which uses -@@ -4822,12 +4828,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4929,12 +4935,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -66,7 +66,7 @@ index 8e571dc1371cf2aa7c8354f0b4e492e0d030b485..c878169e7838849cbc23df2ed94ca65d // Operation result when the renderer asks the browser to create a new window. diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc -index 225e8ebcd6ffc5396268c002c53307b81680be09..981c5a6919201e7c0557330833d6756aea08c8d6 100644 +index 24e7e7012a5b0ad397e9fe69f058c0b22c61e665..288512073e93c730f9d44457219230ca63aa080c 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc @@ -774,6 +774,8 @@ bool ContentBrowserClient::CanCreateWindow( @@ -79,10 +79,10 @@ index 225e8ebcd6ffc5396268c002c53307b81680be09..981c5a6919201e7c0557330833d6756a bool opener_suppressed, bool* no_javascript_access) { diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index a521f0fc8b3acc45e93996997a26e05771b56a03..47efdce8d0aacf331d7b54ca787dc0afd1595029 100644 +index c7091089d0ec87c13f6d24fbd9040e17094e2d22..927057884f708de195245e6335886e5f0a87134c 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -196,6 +196,7 @@ class NetworkService; +@@ -195,6 +195,7 @@ class NetworkService; class TrustedURLLoaderHeaderClient; } // namespace mojom struct ResourceRequest; @@ -90,7 +90,7 @@ index a521f0fc8b3acc45e93996997a26e05771b56a03..47efdce8d0aacf331d7b54ca787dc0af } // namespace network namespace sandbox { -@@ -1339,6 +1340,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1337,6 +1338,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -148,10 +148,10 @@ index 19dff7ea3f62e5095ee03335978dac5d58cc1465..cbec82fe1fbc43c188ac9c0cf318ee49 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 0cbe72d5fb0d564243e596e5b6eea8cb9f181fc1..6e8b3fbcc9c553a725bbd8e5a710be6be239a88b 100644 +index 100661b0376899e4cf41dde2f7187ab6749decec..fc56ff48a7b15653fcf5a035a72fe60d1c55e33a 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -6848,6 +6848,10 @@ WebView* RenderFrameImpl::CreateNewWindow( +@@ -6850,6 +6850,10 @@ WebView* RenderFrameImpl::CreateNewWindow( request.HasUserGesture(), GetWebFrame()->IsAdFrame(), GetWebFrame()->IsAdScriptInStack()); @@ -210,10 +210,10 @@ index c576ace24e81cc877aa2595d40e0a13a7af9f6a2..210fb97d44c19c29af424cc7b9cb3169 } // namespace blink diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc -index de0c2fab54859901352196a2e8de48d4b49e5056..ff6abde24c6bc863f721902bb90f47288ff4b543 100644 +index 23be94989c8d85a729419ec8ede710e0675e730f..857e01c1bec4a4b7082d1ff92b9e546440f8939f 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc -@@ -2237,6 +2237,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, +@@ -2238,6 +2238,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, WebWindowFeatures window_features = GetWindowFeaturesFromString(features, entered_window); diff --git a/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch b/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch index 450ab0d047..d72cfef0f4 100644 --- a/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch +++ b/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch @@ -34,10 +34,10 @@ index 1e2c5bb35cc314d44dba85a9bafc5e55bf2b5f14..d110d0a2f005888c4450262fc1887cbf Widget* GetWidget(); const Widget* GetWidget() const; diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 6b5ed4cec3847ace96b8c1f028b789154b9cad7f..24854c7fbfefd11dabf899817f068d69f574e290 100644 +index b5d55aaa700e48542fb82eed1ac7bd69c3949d86..4e4a10ac149d980e6e28b474adc68ef101519ffc 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3140,15 +3140,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3122,15 +3122,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, SetMsgHandled(FALSE); // We must let Windows handle the caption buttons if it's drawing them, or // they won't work. diff --git a/patches/chromium/chore_defer_usb_service_getdevices_request_until_usb_service_is.patch b/patches/chromium/chore_defer_usb_service_getdevices_request_until_usb_service_is.patch index 33419567d1..139062032e 100644 --- a/patches/chromium/chore_defer_usb_service_getdevices_request_until_usb_service_is.patch +++ b/patches/chromium/chore_defer_usb_service_getdevices_request_until_usb_service_is.patch @@ -9,7 +9,7 @@ devices is available. This should no longer be necessary if/when https://crbug.com/1096743 is completed. diff --git a/services/device/usb/usb_service_impl.cc b/services/device/usb/usb_service_impl.cc -index f638ad390c4f05bec450d3acaae7697871233a8b..d50bdbf488c0b046a70d174e891807ebbb2be27b 100644 +index 3a4a37b798dd816edc79f4812ab9e7cfea562163..5c9b951ec06f72af37f676f9ad24b4f862d71551 100644 --- a/services/device/usb/usb_service_impl.cc +++ b/services/device/usb/usb_service_impl.cc @@ -203,7 +203,7 @@ void UsbServiceImpl::GetDevices(GetDevicesCallback callback) { diff --git a/patches/chromium/chore_partial_revert_of.patch b/patches/chromium/chore_partial_revert_of.patch index 24d1cbec58..834526fd0f 100644 --- a/patches/chromium/chore_partial_revert_of.patch +++ b/patches/chromium/chore_partial_revert_of.patch @@ -14,10 +14,10 @@ track down the source of this problem & figure out if we can fix it by changing something in Electron. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index c1e2bf39aa70776b7e3b26ac78c82995cd376c58..c26d53d7555cbdaae5c167aabf49135afb667259 100644 +index b1d6040688ab7eba8e81f753ec7138e9f0bf0e65..21ebab86a27c0719f086e03ac767f9ac9e9e7cd3 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4707,9 +4707,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4814,9 +4814,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( bool renderer_started_hidden = params.disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB; diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index 216a50c647..9c1b17fd5f 100644 --- a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch +++ b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -80,10 +80,10 @@ index b078a4a06c7b3f767e2e01f0bef2ba440f729620..0459568581a3073333ae6afabd3680f2 content::WebContents* source, const content::OpenURLParams& params, diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index e87612be406274364fd125e7e89e803aa21702d8..0964949aaaec52cbc4db124e345db458df57c040 100644 +index 979ed55d272c9f6e6b6498b01fc4c9b07b93ffe3..3f47784a7b10c2874fb691657dcb9b2c3c12cedb 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -2110,12 +2110,11 @@ bool Browser::IsWebContentsCreationOverridden( +@@ -2118,12 +2118,11 @@ bool Browser::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -99,10 +99,10 @@ index e87612be406274364fd125e7e89e803aa21702d8..0964949aaaec52cbc4db124e345db458 WebContents* Browser::CreateCustomWebContents( diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h -index 86ea151056ca1e565f2c636aeb23fdff269e8e9a..244cabf50f63d061cba99cfefc2cf992e365b433 100644 +index 7b1c8c4c103611dad82e791f47ee97864ce309d4..8ce16d833262f6dde156c6e5038072f2d4c07661 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h -@@ -970,8 +970,7 @@ class Browser : public TabStripModelObserver, +@@ -977,8 +977,7 @@ class Browser : public TabStripModelObserver, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -218,10 +218,10 @@ index c6838c83ef971b88769b1f3fba8095025ae25464..2da6a4e08340e72ba7de5d03444c2f17 content::WebContents* AddNewContents( content::WebContents* source, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 76d396192337ad3b3046c6eb80c14a7d4a54ac8c..cc2e4302ad121d658bb43af1014b6af42a62d47a 100644 +index e252f8e62e92f2a4b8baa6901f3d6c4d3600075c..e438e56c0f5d636ddba9c7c25086c2e80de3263f 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4676,8 +4676,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4783,8 +4783,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, @@ -260,21 +260,21 @@ index cbec82fe1fbc43c188ac9c0cf318ee49aa83c503..9daed06017f4a586e34f1e47dc85b9e6 // Allow delegate to creates a custom WebContents when // WebContents::CreateNewWindow() is called. This function is only called diff --git a/extensions/browser/guest_view/app_view/app_view_guest.cc b/extensions/browser/guest_view/app_view/app_view_guest.cc -index 7168904a792aedeea0249a1bc38718da06a43c04..f69143c9554f74709edbb5ac80c50083860e8856 100644 +index b02090784eee44027fa50d29dfdb045fe01be65e..3a54dc7f8541aa65c29252163f9bae8f1ca9f180 100644 --- a/extensions/browser/guest_view/app_view/app_view_guest.cc +++ b/extensions/browser/guest_view/app_view/app_view_guest.cc -@@ -142,8 +142,7 @@ bool AppViewGuest::IsWebContentsCreationOverridden( +@@ -145,8 +145,7 @@ bool AppViewGuest::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, - const std::string& frame_name, - const GURL& target_url) { + const content::mojom::CreateNewWindowParams& params) { - return true; - } + CHECK(!base::FeatureList::IsEnabled(features::kGuestViewMPArch)); + return true; diff --git a/extensions/browser/guest_view/app_view/app_view_guest.h b/extensions/browser/guest_view/app_view/app_view_guest.h -index cb4241744b7c8ee4803de5ff5ccdefcae61cb02f..390ff1e3840f245b302aad460fc00cb4ea3e68b2 100644 +index 82b2161b6fd04c34ad7423729e24bd6385b2ec3d..edb83f9d135b7dc9d6ba6bb7716cc24ea6d9123f 100644 --- a/extensions/browser/guest_view/app_view/app_view_guest.h +++ b/extensions/browser/guest_view/app_view/app_view_guest.h @@ -10,6 +10,7 @@ @@ -296,21 +296,21 @@ index cb4241744b7c8ee4803de5ff5ccdefcae61cb02f..390ff1e3840f245b302aad460fc00cb4 content::RenderFrameHost* opener, content::SiteInstance* source_site_instance, diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc -index 0eb1b7b778c139971601a14cef729be6fdf5c247..3491662f5eb6131e6d4a6cd525e6ba951ac91e00 100644 +index 960327ffe666f0dbb95f128e6356f9dd95b2379d..57a9ee4890cae70dc2cee45028994634a1b74abc 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc -@@ -221,8 +221,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden( +@@ -240,8 +240,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, - const std::string& frame_name, - const GURL& target_url) { + const content::mojom::CreateNewWindowParams& params) { + CHECK(!base::FeatureList::IsEnabled(features::kGuestViewMPArch)); + // This method handles opening links from within the guest. Since this guest - // view is used for displaying embedded extension options, we want any - // external links to be opened in a new tab, not in a new guest view so we diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h -index 2ee922084c82edb7e49ec1c894b517b88f56f54d..9c12c8e9bab2ac59b16cb4a638e099cafc4cb36f 100644 +index 29646283d0219f637ec243474d26d831be48c12a..0f5a88970946015647e9d0b6e0da1bd81a1402ba 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.h +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h @@ -66,8 +66,7 @@ class ExtensionOptionsGuest @@ -324,21 +324,21 @@ index 2ee922084c82edb7e49ec1c894b517b88f56f54d..9c12c8e9bab2ac59b16cb4a638e099ca content::RenderFrameHost* opener, content::SiteInstance* source_site_instance, diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index 6c8040666b5203f9d2cd1f87cb730680483942c3..5a48581859f36a2c2a3925d44fcae0b07096bae4 100644 +index 6ce54fc40f122fb13a4464817a1b5f1d095d060a..427eaa324d0d7485caa42d63c12ce8bb0e6b64f7 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -@@ -389,8 +389,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden( +@@ -418,8 +418,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, - const std::string& frame_name, - const GURL& target_url) { + const content::mojom::CreateNewWindowParams& params) { - return true; - } + CHECK(!base::FeatureList::IsEnabled(features::kGuestViewMPArch)); + return true; diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index f0b71aba6dfb4682ce2e5b4c834b2526dcacb75c..d4b1857ca468ff97914d91d0c31298b73577547f 100644 +index dd0a81a7f358611a05ae45b6c57e9dfc98642894..81e799bb2ce8baab8deb779d97c5481fa7a78948 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h @@ -177,8 +177,7 @@ class MimeHandlerViewGuest diff --git a/patches/chromium/chore_remove_reference_to_chrome_browser_themes.patch b/patches/chromium/chore_remove_reference_to_chrome_browser_themes.patch index a4972189d3..7f3eeaafc3 100644 --- a/patches/chromium/chore_remove_reference_to_chrome_browser_themes.patch +++ b/patches/chromium/chore_remove_reference_to_chrome_browser_themes.patch @@ -11,10 +11,10 @@ not need this dependency. refs https://chromium-review.googlesource.com/c/chromium/src/+/5573603 diff --git a/chrome/browser/ui/color/BUILD.gn b/chrome/browser/ui/color/BUILD.gn -index 02d3457d65c4edf2cdbb3c37d90813b496f7945b..ce9e3a87ad650ad99808dea6e292f340fb58aa36 100644 +index 198f02d4b5a16e266a502994aec0d7e4a9a5ab25..7afb323d4c18dacd2f82a8f89774596957fabd08 100644 --- a/chrome/browser/ui/color/BUILD.gn +++ b/chrome/browser/ui/color/BUILD.gn -@@ -87,9 +87,6 @@ source_set("mixers") { +@@ -85,9 +85,6 @@ source_set("mixers") { ] } diff --git a/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch b/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch index aa57f2c3f0..de50236395 100644 --- a/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch +++ b/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch @@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`. diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc -index 4f0cdcab844bd91655f9e257aadbe0d1e0fae648..13a37644535aa97e059b652ef7e0c689fc8c8d8f 100644 +index 48a08ba375645c01858de8e9b449f8d36668b078..fbb16847b12c880ffd6e70ea6b3ed2f169fda29a 100644 --- a/content/app/content_main_runner_impl.cc +++ b/content/app/content_main_runner_impl.cc @@ -279,8 +279,13 @@ void AsanProcessInfoCB(const char*, bool*) { @@ -40,7 +40,7 @@ index 4f0cdcab844bd91655f9e257aadbe0d1e0fae648..13a37644535aa97e059b652ef7e0c689 #endif // V8_USE_EXTERNAL_STARTUP_DATA } -@@ -991,7 +997,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) { +@@ -990,7 +996,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) { return TerminateForFatalInitializationError(); #endif // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE) @@ -95,10 +95,10 @@ index f482ce44b4339e0cf2a57a6a4f9db4d1be5fa178..49604d211b4d406fd59e7da3c4a648dd friend class ContentClientCreator; friend class ContentClientInitializer; diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index 4805f361cafb7854bd9b4f1c29a15417c88665e4..eb4382c022eb02ee6d73a2712c1b92a66940d593 100644 +index 48fd400ee03bde4019e4f8425c32a25d5e6eea8e..0f84f487917d6c43699c18375200e888d9fc7d13 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc -@@ -662,8 +662,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out, +@@ -665,8 +665,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out, #if defined(V8_USE_EXTERNAL_STARTUP_DATA) @@ -108,7 +108,7 @@ index 4805f361cafb7854bd9b4f1c29a15417c88665e4..eb4382c022eb02ee6d73a2712c1b92a6 if (g_mapped_snapshot) { // TODO(crbug.com/40558459): Confirm not loading different type of snapshot // files in a process. -@@ -672,10 +671,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) { +@@ -675,10 +674,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) { base::MemoryMappedFile::Region file_region; base::File file = diff --git a/patches/chromium/disable_elf_crel_on_linux_arm.patch b/patches/chromium/disable_elf_crel_on_linux_arm.patch new file mode 100644 index 0000000000..b0f79fb1db --- /dev/null +++ b/patches/chromium/disable_elf_crel_on_linux_arm.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: John Kleinschmidt +Date: Tue, 29 Oct 2024 16:12:28 -0400 +Subject: disable ELF CREL on Linux Arm + +https://chromium-review.googlesource.com/c/chromium/src/+/5938657 +enabled ELF CREL, but this causes a Segmentation fault in GetAccessFlags +in page_allocator_internals_posix.cc when running on, so disable +ELF CREL on Linux Arm + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 5d29e8f419048989f1d902d7dbd5e38e94b93251..c3c56ffac051bea5df7702b9adc2641d0d34fcdd 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -618,7 +618,7 @@ config("compiler") { + + # Enable ELF CREL (see crbug.com/357878242) for all platforms that use ELF + # (excluding toolchains that use an older version of LLVM). +- if (is_linux && !llvm_android_mainline && ++ if (is_linux && !llvm_android_mainline && current_cpu != "arm" && + default_toolchain != "//build/toolchain/cros:target") { + cflags += [ "-Wa,--crel,--allow-experimental-crel" ] + } diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index a219a123f9..9015c6d804 100644 --- a/patches/chromium/disable_hidden.patch +++ b/patches/chromium/disable_hidden.patch @@ -6,7 +6,7 @@ Subject: disable_hidden.patch Electron uses this to disable background throttling for hidden windows. diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 0f818deb682df60f33b89a34ca0eedef020e3a75..9fe8ce99d4b5fe83bf66c37d7acec4d4e670f8c2 100644 +index 66ed04ce55f36ec5c0d469860d8998dec26fa943..fe40b67aa7a158855eea6f03c13d02b614c384de 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -790,6 +790,10 @@ void RenderWidgetHostImpl::WasHidden() { @@ -21,10 +21,10 @@ index 0f818deb682df60f33b89a34ca0eedef020e3a75..9fe8ce99d4b5fe83bf66c37d7acec4d4 // Prompts should remain open and functional across tab switches. if (!delegate_->IsWaitingForPointerLockPrompt(this)) { diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h -index 39f00090f4ab24ee3a8bd3a8f0e26b3f5156454b..b306f1b435a38ef8e3aaa1172fc6bdb90b20f1a4 100644 +index 01b87c84b32c01b93f04a9b8f477564915b1e8d0..8e08570ab381cbbf70d6729f8f13059bd953a9c2 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h -@@ -1019,6 +1019,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -1023,6 +1023,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl // Requests a commit and forced redraw in the renderer compositor. void ForceRedrawForTesting(); @@ -35,10 +35,10 @@ index 39f00090f4ab24ee3a8bd3a8f0e26b3f5156454b..b306f1b435a38ef8e3aaa1172fc6bdb9 // |routing_id| must not be MSG_ROUTING_NONE. // If this object outlives |delegate|, DetachDelegate() must be called when diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc -index ac44bba7a596eed995b2e66f72c5f54ba73d3dd3..dff505e44145b630c03715bf4c2e5ff8a264602e 100644 +index ca5b911a9ca807255ae5bec77abad3fe73399336..86778acd91c50902d9e07da9e94eaecc6626509f 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -649,7 +649,7 @@ void RenderWidgetHostViewAura::HideImpl() { +@@ -650,7 +650,7 @@ void RenderWidgetHostViewAura::HideImpl() { CHECK(visibility_ == Visibility::HIDDEN || visibility_ == Visibility::OCCLUDED); diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index 409f7112e5..00d3842f54 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -19,10 +19,10 @@ index 6cd2eace306cb6b3b8d39d968f898c6468d00eea..e2146f0a06fb70d16c48fe6e06d0615c excluded_margin); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 8e0e565f4a8a1e39070a9225bcfc277e3eb0ba60..fc0c3a59dc308d675cc3997231df2c9b9ad02e83 100644 +index e2f1433822c391372e81819cc2b6cb8b39e807e3..ae0b5f7d9a324afdbc7c2811b06d44371bb24d06 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -967,8 +967,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, +@@ -949,8 +949,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, void HWNDMessageHandler::SetAspectRatio(float aspect_ratio, const gfx::Size& excluded_margin) { diff --git a/patches/chromium/expose_setuseragent_on_networkcontext.patch b/patches/chromium/expose_setuseragent_on_networkcontext.patch index 471c86bc37..23b1a14de4 100644 --- a/patches/chromium/expose_setuseragent_on_networkcontext.patch +++ b/patches/chromium/expose_setuseragent_on_networkcontext.patch @@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4 } // namespace net diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index 0b78b88754394cbbd5ffcc5694b2fdbd862ff6a8..9ea1e303fa40b03479f83a1fe7f4cb734fde7923 100644 +index f997ff511bb9467a53a2c42b700eb58b5d7d3091..c38f269aecadba37701e274860b86143bf685a31 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1764,6 +1764,13 @@ void NetworkContext::SetNetworkConditions( +@@ -1773,6 +1773,13 @@ void NetworkContext::SetNetworkConditions( std::move(network_conditions)); } @@ -51,7 +51,7 @@ index 0b78b88754394cbbd5ffcc5694b2fdbd862ff6a8..9ea1e303fa40b03479f83a1fe7f4cb73 // This may only be called on NetworkContexts created with the constructor // that calls MakeURLRequestContext(). diff --git a/services/network/network_context.h b/services/network/network_context.h -index 345fa438ad2afea7946117b8bac7bb6f08669b28..c191762087c5c4e777f8ff9fb6f4cf89171626e8 100644 +index 884a1da963ac6e05dd47ec6b0dcd595f2a7e44c0..0ee32cf3361e461f6175db6fd694785abbe2bc21 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -316,6 +316,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext diff --git a/patches/chromium/extend_apply_webpreferences.patch b/patches/chromium/extend_apply_webpreferences.patch index d4f68f3256..d4060668b3 100644 --- a/patches/chromium/extend_apply_webpreferences.patch +++ b/patches/chromium/extend_apply_webpreferences.patch @@ -12,7 +12,7 @@ Ideally we could add an embedder observer pattern here but that can be done in future work. diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc -index 734c055e1828d790f2abb80243bc10fa1f4d6e5e..0aa8550641a1e914bf4b6e377267888db8aac796 100644 +index fcf0fde51cf30a3797a7627a9170f8534700d59b..3618f606380342da71e973e178ec28d7abc3e9f1 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -169,6 +169,7 @@ @@ -23,7 +23,7 @@ index 734c055e1828d790f2abb80243bc10fa1f4d6e5e..0aa8550641a1e914bf4b6e377267888d #include "third_party/blink/renderer/platform/graphics/image.h" #include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h" #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h" -@@ -1845,6 +1846,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -1849,6 +1850,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, #if BUILDFLAG(IS_MAC) web_view_impl->SetMaximumLegibleScale( prefs.default_maximum_page_scale_factor); diff --git a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch index 38da8c0b48..8e7350ecf8 100644 --- a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch +++ b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch @@ -178,7 +178,7 @@ index 72cdfe2c4a0258dbd575f536ca42fa1d53f44988..092f60adb1080bea16ac24c53d57539d if (!WriteToSocket(socket.fd(), to_send.data(), to_send.length())) { // Try to kill the other process, because it might have been dead. diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc -index 27216805188c77aa45b478e66b04a2d45f92fba6..9646e314af0de3d4a7ccf1c54a339b703be125c2 100644 +index d91f58ebe3a024bc41ed72121c49172f68e0d862..b63fccf1d11ba199e3fd3f019e348ad7c8bff215 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -81,10 +81,12 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) { @@ -268,16 +268,16 @@ index 27216805188c77aa45b478e66b04a2d45f92fba6..9646e314af0de3d4a7ccf1c54a339b70 return PROCESS_NONE; } -- switch (chrome::AttemptToNotifyRunningChrome(remote_window_)) { -+ switch (chrome::AttemptToNotifyRunningChrome(remote_window_, additional_data_)) { - case chrome::NOTIFY_SUCCESS: +- switch (AttemptToNotifyRunningChrome(remote_window_)) { ++ switch (AttemptToNotifyRunningChrome(remote_window_, additional_data_)) { + case NotifyChromeResult::NOTIFY_SUCCESS: return PROCESS_NOTIFIED; - case chrome::NOTIFY_FAILED: + case NotifyChromeResult::NOTIFY_FAILED: diff --git a/chrome/browser/win/chrome_process_finder.cc b/chrome/browser/win/chrome_process_finder.cc -index f572b9db19cc1341cf0493d7486bb484121e7384..5b053e160d4653cd6de7eabc37e3b4a264a6c2c7 100644 +index 019ac7e93e009a713ce56ee8bcacf467b4fe769d..c3a7d3c5d2d413a2dfede341b1c8de661bc3d381 100644 --- a/chrome/browser/win/chrome_process_finder.cc +++ b/chrome/browser/win/chrome_process_finder.cc -@@ -41,7 +41,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) { +@@ -39,7 +39,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) { return base::win::MessageWindow::FindWindow(user_data_dir.value()); } @@ -288,7 +288,7 @@ index f572b9db19cc1341cf0493d7486bb484121e7384..5b053e160d4653cd6de7eabc37e3b4a2 TRACE_EVENT0("startup", "AttemptToNotifyRunningChrome"); DCHECK(remote_window); -@@ -70,12 +72,29 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) { +@@ -68,12 +70,29 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) { new_command_line.AppendSwitchNative(switches::kSourceShortcut, si.lpTitle); // Send the command line to the remote chrome window. @@ -320,7 +320,7 @@ index f572b9db19cc1341cf0493d7486bb484121e7384..5b053e160d4653cd6de7eabc37e3b4a2 // window (otherwise it will just flash in the taskbar). ::AllowSetForegroundWindow(process_id); diff --git a/chrome/browser/win/chrome_process_finder.h b/chrome/browser/win/chrome_process_finder.h -index ddea93de709db5967a353bb73d433737c6aac40c..43c6896923032ffa16a0df4efd48a42f869c15d7 100644 +index 91e5e623840b9912bd05d024c12e3eb3f1ba2f53..4c8591c3938b6540c698f40d89ee64eea1bec418 100644 --- a/chrome/browser/win/chrome_process_finder.h +++ b/chrome/browser/win/chrome_process_finder.h @@ -7,6 +7,7 @@ @@ -331,7 +331,7 @@ index ddea93de709db5967a353bb73d433737c6aac40c..43c6896923032ffa16a0df4efd48a42f #include "base/time/time.h" namespace base { -@@ -27,7 +28,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir); +@@ -25,7 +26,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir); // Attempts to send the current command line to an already running instance of // Chrome via a WM_COPYDATA message. // Returns true if a running Chrome is found and successfully notified. diff --git a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch index d7f4e0d3ac..10c5088758 100644 --- a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch +++ b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch @@ -13,10 +13,10 @@ uses internally for things like menus and devtools. We can remove this patch once it has in some shape been upstreamed. diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc -index 358225da145e73aedaab16f4dad3199411715c04..9c0a211ae8d5b4238e0dc663d4a3048367a80e34 100644 +index e3e38747994bc18f7df64b5b74cea099a9f42a60..a367530ba886eb50557ce67626db12607469821b 100644 --- a/ui/native_theme/native_theme.cc +++ b/ui/native_theme/native_theme.cc -@@ -211,6 +211,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors, +@@ -213,6 +213,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors, NativeTheme::~NativeTheme() = default; bool NativeTheme::ShouldUseDarkColors() const { @@ -26,10 +26,10 @@ index 358225da145e73aedaab16f4dad3199411715c04..9c0a211ae8d5b4238e0dc663d4a30483 } diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h -index c49860df0c20ca3b34a10a3d522b8b5e6930d46d..f3e6e07037d474c5fdc9078e52096f51ae4bdea6 100644 +index 7a9b0b3488e4105c76f944574640778e648f7bef..e5a660a6cf9b87017f93b5f92291012ca4065e61 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h -@@ -445,6 +445,23 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -446,6 +446,23 @@ class NATIVE_THEME_EXPORT NativeTheme { scoped_refptr custom_theme, bool use_custom_frame = true) const; @@ -53,7 +53,7 @@ index c49860df0c20ca3b34a10a3d522b8b5e6930d46d..f3e6e07037d474c5fdc9078e52096f51 // Returns a shared instance of the native theme that should be used for web // rendering. Do not use it in a normal application context (i.e. browser). // The returned object should not be deleted by the caller. This function is -@@ -689,6 +706,7 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -690,6 +707,7 @@ class NATIVE_THEME_EXPORT NativeTheme { PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight; PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference; std::optional caret_blink_interval_; @@ -62,10 +62,10 @@ index c49860df0c20ca3b34a10a3d522b8b5e6930d46d..f3e6e07037d474c5fdc9078e52096f51 // Obtaining the PrefersAlwaysShowScrollbar system setting can be expensive, // so it is cached in this boolean. diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index c1523bbdbf16e1df1bf158b7b053dce09116f2fc..06831ec767f6ba81e76f52322fc2d81a45c2c275 100644 +index 1b098cbb291fe904f34d59ce5aaab7a0e48b28ea..9d27e7b3dc503a3f25d71f0342a3fd4f17a42ea0 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -682,6 +682,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -678,6 +678,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { // ...unless --force-dark-mode was specified in which case caveat emptor. if (InForcedColorsMode() && !IsForcedDarkMode()) return false; diff --git a/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch b/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch index 456f0d7e47..7e5aada071 100644 --- a/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch +++ b/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch @@ -13,7 +13,7 @@ other protocols to register their streaming behavior. MultibufferDataSource::Ass then refers to the list so that it can correctly determine the data source's settings. diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc -index fefae60e6d53cd18368e27c2c76ef936e5d9fb5b..534b57c20c9fbfbd90234787ac16a67ff18474e7 100644 +index 14b6e02f10cd3c9e666b23507355d42ffffa56f8..4542732d5fe1631d1f4eb519ecf9a0962f8f0565 100644 --- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc +++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc @@ -13,8 +13,10 @@ @@ -52,9 +52,9 @@ index fefae60e6d53cd18368e27c2c76ef936e5d9fb5b..534b57c20c9fbfbd90234787ac16a67f bool MultiBufferDataSource::AssumeFullyBuffered() const { DCHECK(url_data_); -- return !url_data_->url().SchemeIsHTTPOrHTTPS(); +- return !url_data_->url().ProtocolIsInHTTPFamily(); + -+ const std::string scheme = url_data_->url().scheme(); ++ const std::string scheme = url_data_->url().Protocol().Ascii(); + for (const std::string& streaming_scheme : *GetStreamingSchemes()) { + if (base::EqualsCaseInsensitiveASCII(scheme, streaming_scheme)) { + return false; diff --git a/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch b/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch index 63f8f27dd1..7211ffe100 100644 --- a/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch +++ b/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch @@ -14,10 +14,10 @@ It also: This may be partially upstreamed to Chromium in the future. diff --git a/ui/gtk/select_file_dialog_linux_gtk.cc b/ui/gtk/select_file_dialog_linux_gtk.cc -index e10245b4f36f324510a2dfd785ffaa2ceaad48d6..befb5666134d5f299b228e3d654fa2b0d39c9299 100644 +index b83f0177a2adb0a19be49684f865941e6708f626..f313c766ddc2b79f082e70138dd566a846f0d923 100644 --- a/ui/gtk/select_file_dialog_linux_gtk.cc +++ b/ui/gtk/select_file_dialog_linux_gtk.cc -@@ -408,9 +408,11 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateFileOpenHelper( +@@ -407,9 +407,11 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateFileOpenHelper( const std::string& title, const base::FilePath& default_path, gfx::NativeWindow parent) { @@ -30,7 +30,7 @@ index e10245b4f36f324510a2dfd785ffaa2ceaad48d6..befb5666134d5f299b228e3d654fa2b0 SetGtkTransientForAura(dialog, parent); AddFilters(GTK_FILE_CHOOSER(dialog)); -@@ -426,6 +428,7 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateFileOpenHelper( +@@ -425,6 +427,7 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateFileOpenHelper( GtkFileChooserSetCurrentFolder(GTK_FILE_CHOOSER(dialog), *last_opened_path()); } @@ -38,7 +38,7 @@ index e10245b4f36f324510a2dfd785ffaa2ceaad48d6..befb5666134d5f299b228e3d654fa2b0 return dialog; } -@@ -441,11 +444,15 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateSelectFolderDialog( +@@ -440,11 +443,15 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateSelectFolderDialog( ? l10n_util::GetStringUTF8(IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE) : l10n_util::GetStringUTF8(IDS_SELECT_FOLDER_DIALOG_TITLE); } @@ -59,7 +59,7 @@ index e10245b4f36f324510a2dfd785ffaa2ceaad48d6..befb5666134d5f299b228e3d654fa2b0 GtkWidget* dialog = GtkFileChooserDialogNew( title_string.c_str(), nullptr, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, -@@ -467,7 +474,8 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateSelectFolderDialog( +@@ -466,7 +473,8 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateSelectFolderDialog( gtk_file_filter_add_mime_type(only_folders, "inode/directory"); gtk_file_filter_add_mime_type(only_folders, "text/directory"); gtk_file_chooser_add_filter(chooser, only_folders); @@ -69,7 +69,7 @@ index e10245b4f36f324510a2dfd785ffaa2ceaad48d6..befb5666134d5f299b228e3d654fa2b0 return dialog; } -@@ -504,10 +512,11 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateSaveAsDialog( +@@ -503,10 +511,11 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateSaveAsDialog( std::string title_string = !title.empty() ? title : l10n_util::GetStringUTF8(IDS_SAVE_AS_DIALOG_TITLE); @@ -83,7 +83,7 @@ index e10245b4f36f324510a2dfd785ffaa2ceaad48d6..befb5666134d5f299b228e3d654fa2b0 GTK_RESPONSE_ACCEPT); SetGtkTransientForAura(dialog, parent); -@@ -533,9 +542,10 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateSaveAsDialog( +@@ -532,9 +541,10 @@ GtkWidget* SelectFileDialogLinuxGtk::CreateSaveAsDialog( gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); // Overwrite confirmation is always enabled in GTK4. if (!GtkCheckVersion(4)) { @@ -186,7 +186,7 @@ index 61683d0eddb04c494ca5e650e7d556b44968ec49..5492456a9138b250e97a5479838bb443 } // namespace ui diff --git a/ui/shell_dialogs/select_file_dialog_linux_kde.cc b/ui/shell_dialogs/select_file_dialog_linux_kde.cc -index 58985ce62dc569256bad5e94de9c0d125fc470d0..33436784b691c860d58f8b4dfcc6718e38a4da47 100644 +index 64a79ebe2e2d21d5a6b4a98042d1cdb7b6edad52..16f2ae01a8d33e6341ed52638e963c340455ebf8 100644 --- a/ui/shell_dialogs/select_file_dialog_linux_kde.cc +++ b/ui/shell_dialogs/select_file_dialog_linux_kde.cc @@ -468,7 +468,7 @@ void SelectFileDialogLinuxKde::CreateSelectFolderDialog( @@ -199,7 +199,7 @@ index 58985ce62dc569256bad5e94de9c0d125fc470d0..33436784b691c860d58f8b4dfcc6718e &SelectFileDialogLinuxKde::OnSelectSingleFolderDialogResponse, this, parent)); diff --git a/ui/shell_dialogs/select_file_dialog_linux_portal.cc b/ui/shell_dialogs/select_file_dialog_linux_portal.cc -index 2658b98695703b994319b85a4e033dd3d8e639d9..4a829931097d657f35636649cb743b264925a359 100644 +index 143f5fe1028e154192767599a1e68b45301a894d..d612e1614a313db0dcf7dc592fd6fa74c89e70e1 100644 --- a/ui/shell_dialogs/select_file_dialog_linux_portal.cc +++ b/ui/shell_dialogs/select_file_dialog_linux_portal.cc @@ -40,7 +40,9 @@ namespace { @@ -222,7 +222,7 @@ index 2658b98695703b994319b85a4e033dd3d8e639d9..4a829931097d657f35636649cb743b26 if (owning_window) { if (auto* root = owning_window->GetRootWindow()) { -@@ -455,7 +459,9 @@ void SelectFileDialogLinuxPortal::DialogInfo::AppendOptions( +@@ -471,7 +475,9 @@ void SelectFileDialogLinuxPortal::DialogInfo::AppendOptions( response_handle_token); if (type == SelectFileDialog::Type::SELECT_UPLOAD_FOLDER) { @@ -233,7 +233,7 @@ index 2658b98695703b994319b85a4e033dd3d8e639d9..4a829931097d657f35636649cb743b26 l10n_util::GetStringUTF8( IDS_SELECT_UPLOAD_FOLDER_DIALOG_UPLOAD_BUTTON)); } -@@ -464,6 +470,8 @@ void SelectFileDialogLinuxPortal::DialogInfo::AppendOptions( +@@ -480,6 +486,8 @@ void SelectFileDialogLinuxPortal::DialogInfo::AppendOptions( type == SelectFileDialog::Type::SELECT_UPLOAD_FOLDER || type == SelectFileDialog::Type::SELECT_EXISTING_FOLDER) { AppendBoolOption(&options_writer, kFileChooserOptionDirectory, true); diff --git a/patches/chromium/feat_allow_code_cache_in_custom_schemes.patch b/patches/chromium/feat_allow_code_cache_in_custom_schemes.patch index d8e7826a37..9aa756d35f 100644 --- a/patches/chromium/feat_allow_code_cache_in_custom_schemes.patch +++ b/patches/chromium/feat_allow_code_cache_in_custom_schemes.patch @@ -259,7 +259,7 @@ index 61c8b54bc5a9ea59c90e8627ab01745e0c328382..f9521b7aac19bf3994517906b85fc928 + } // namespace content diff --git a/content/browser/renderer_host/code_cache_host_impl.cc b/content/browser/renderer_host/code_cache_host_impl.cc -index 15e731756530e684b583f25a3f2bdf4af3653d54..f68a97b3ebf1d2151fc19950d41b15915a334e9f 100644 +index 588dfcafab5a073401b20a39a3d945b94d162d30..68be867a26f4f8ea84106d33bc658acf1fac11d5 100644 --- a/content/browser/renderer_host/code_cache_host_impl.cc +++ b/content/browser/renderer_host/code_cache_host_impl.cc @@ -6,6 +6,7 @@ @@ -369,7 +369,7 @@ index 15e731756530e684b583f25a3f2bdf4af3653d54..f68a97b3ebf1d2151fc19950d41b1591 } if (operation == CodeCacheHostImpl::Operation::kWrite) { -@@ -427,6 +452,7 @@ std::optional CodeCacheHostImpl::GetSecondaryKeyForCodeCache( +@@ -433,6 +458,7 @@ std::optional CodeCacheHostImpl::GetSecondaryKeyForCodeCache( process_lock.matches_scheme(url::kHttpsScheme) || process_lock.matches_scheme(content::kChromeUIScheme) || process_lock.matches_scheme(content::kChromeUIUntrustedScheme) || diff --git a/patches/chromium/feat_configure_launch_options_for_service_process.patch b/patches/chromium/feat_configure_launch_options_for_service_process.patch index d82b931304..e95d385632 100644 --- a/patches/chromium/feat_configure_launch_options_for_service_process.patch +++ b/patches/chromium/feat_configure_launch_options_for_service_process.patch @@ -187,7 +187,7 @@ index bdd5bec301f5fcff2d3e3d7994ecbc4eae46da36..f6082bada22c5f4e70af60ea6f555b0f host->GetChildProcess()->BindServiceInterface(std::move(receiver)); } diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc -index 2fc9fabe67dc4d8c209247e46b57d27ec1a0fb90..ce73ed7f7070ee276511da674599364a468a2c8f 100644 +index 605117f78bb9ad2f8f2b04ca398c78a88f5b8243..d49b7f0c0026bb1159f92a93db32adee4b4883ca 100644 --- a/content/browser/utility_process_host.cc +++ b/content/browser/utility_process_host.cc @@ -181,11 +181,13 @@ const ChildProcessData& UtilityProcessHost::GetData() { @@ -237,7 +237,7 @@ index 2fc9fabe67dc4d8c209247e46b57d27ec1a0fb90..ce73ed7f7070ee276511da674599364a mojom::ChildProcess* UtilityProcessHost::GetChildProcess() { return static_cast(process_->GetHost()) ->child_process(); -@@ -440,9 +466,26 @@ bool UtilityProcessHost::StartProcess() { +@@ -437,9 +463,26 @@ bool UtilityProcessHost::StartProcess() { #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH) || // BUILDFLAG(IS_MAC) @@ -706,7 +706,7 @@ index b67f4f87d588386409a90cd49e8338272c6e0d51..c34a80ec8db1b868a7f387ea4a11d71d #if BUILDFLAG(IS_MAC) // Whether or not to disclaim TCC responsibility for the process, defaults to diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc -index b550651a8a98132104d38df083717e1cb58567e4..52b9eddefcc6a2240babcac824058cd853d3058f 100644 +index 5f5857379ad34ccd1fb46564859bcef2d2a25d5e..6a39285e344d90b73199e73e48afaddbec3de628 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc @@ -619,11 +619,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() { @@ -782,7 +782,7 @@ index b550651a8a98132104d38df083717e1cb58567e4..52b9eddefcc6a2240babcac824058cd8 DWORD last_error = GetLastError(); std::move(result_callback).Run(base::Process(), last_error, result); diff --git a/sandbox/policy/win/sandbox_win.h b/sandbox/policy/win/sandbox_win.h -index ede8bb552b2602fb06a6317399eb910e24a54216..c86744af9de2c366951d659851aaa9cac74b96de 100644 +index 8fb74a2eefba49f95e4947ef9fd081ab8decebd4..3eed3d348132d5992c27bd8082a267fb42d4e431 100644 --- a/sandbox/policy/win/sandbox_win.h +++ b/sandbox/policy/win/sandbox_win.h @@ -92,7 +92,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin { diff --git a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch index e2a11873ec..e21df7963d 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -90,7 +90,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217 private: const HWND hwnd_; diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index 964dc5c3aa8440fd3076f2198b2c89e9b8b82816..cbfdf25e7f4881fb9b6b3c7425702ea0b22e51af 100644 +index dddf398085d2902b4b1e6e00cb90ccecc238a672..559b9964718a29558b19b0183fc2b7265522ba7e 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn @@ -172,6 +172,8 @@ viz_component("service") { @@ -117,7 +117,7 @@ index 7fbb05e606fc26364c674c6330b8a5eb9c016fb3..a190a42c2127011ab54aae937a3cab36 virtual gpu::SharedImageManager* GetSharedImageManager() = 0; virtual gpu::SyncPointManager* GetSyncPointManager() = 0; diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc -index 87722045daafa87f7111df943217ceaa8518e55c..badf8c3dc5fb768388a19814d8428a46d3c5648b 100644 +index 4be4660c007ee5cd9da9947dc61d2497931d0ddb..f382cef64946576c85588ef4d3b334a2ec9e61bd 100644 --- a/components/viz/service/display_embedder/output_surface_provider_impl.cc +++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc @@ -25,6 +25,7 @@ @@ -155,7 +155,7 @@ index 87722045daafa87f7111df943217ceaa8518e55c..badf8c3dc5fb768388a19814d8428a46 } else { DCHECK(gpu_dependency); -@@ -143,10 +146,22 @@ std::unique_ptr OutputSurfaceProviderImpl::CreateOutputSurface( +@@ -142,10 +145,22 @@ std::unique_ptr OutputSurfaceProviderImpl::CreateOutputSurface( std::unique_ptr OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( gpu::SurfaceHandle surface_handle, diff --git a/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch b/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch index afdde36e35..15d250127d 100644 --- a/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch +++ b/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch @@ -76,10 +76,10 @@ index f6082bada22c5f4e70af60ea6f555b0f363919c5..228f947edbe04bce242df62080052d9c void ServiceProcessHost::RemoveObserver(Observer* observer) { GetServiceProcessTracker().RemoveObserver(observer); diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc -index ce73ed7f7070ee276511da674599364a468a2c8f..3af02ceeddc8eb5c585fb04baa4bb20574a2df1b 100644 +index d49b7f0c0026bb1159f92a93db32adee4b4883ca..f3ae57d624da367cfc18e60a35737c1d2207b010 100644 --- a/content/browser/utility_process_host.cc +++ b/content/browser/utility_process_host.cc -@@ -523,7 +523,7 @@ void UtilityProcessHost::OnProcessCrashed(int exit_code) { +@@ -520,7 +520,7 @@ void UtilityProcessHost::OnProcessCrashed(int exit_code) { // Take ownership of |client_| so the destructor doesn't notify it of // termination. auto client = std::move(client_); diff --git a/patches/chromium/feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch b/patches/chromium/feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch index fd16ec1cba..d9fc38071c 100644 --- a/patches/chromium/feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch +++ b/patches/chromium/feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch @@ -28,7 +28,7 @@ index 23b29fe25bc463ff1d36aa502a27c4222595e7c5..c1ac6172c4cee72f64f42ca64d2db9c0 // Returns the http referrer of original request which initited this load. diff --git a/third_party/blink/renderer/core/loader/document_loader.h b/third_party/blink/renderer/core/loader/document_loader.h -index aa2e582b43a0ca9cad9c1e62c5887ff3f699b86a..1b514b8d881a8feee2426dd0557b3354c63f4417 100644 +index 0f7739eb9fffb85f4e8f51c24715680c5eb991d3..2fc081c117ecfeceecc3acae5208ba3d33be6859 100644 --- a/third_party/blink/renderer/core/loader/document_loader.h +++ b/third_party/blink/renderer/core/loader/document_loader.h @@ -324,7 +324,7 @@ class CORE_EXPORT DocumentLoader : public GarbageCollected, diff --git a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch index c4f3a72e93..b5531872a0 100644 --- a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch +++ b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch @@ -17,7 +17,7 @@ headers, moving forward we should find a way in upstream to provide access to these headers for loader clients created on the browser process. diff --git a/services/network/public/cpp/resource_request.cc b/services/network/public/cpp/resource_request.cc -index 28bf295032c89dc7831d341cef95d11c53ade3b3..9f82e5202f2fe275d738dcadf41c535ad9f8df94 100644 +index 8e3e37301879f70de0430adb81258df2e4cd5e46..90fcfad3fa7b431e6be257c886963e7fabca4d7b 100644 --- a/services/network/public/cpp/resource_request.cc +++ b/services/network/public/cpp/resource_request.cc @@ -155,6 +155,7 @@ ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=( @@ -49,10 +49,10 @@ index 79851e979be2dbba27690e1e7807afcb252d3d23..5b766862d8c9e08ce55f328eaf9314a5 mojo::PendingRemote trust_token_observer; mojo::PendingRemote diff --git a/services/network/public/cpp/url_request_mojom_traits.cc b/services/network/public/cpp/url_request_mojom_traits.cc -index 1f18c9cbe892c24cde8d1430afa882f2d5d9879d..9817380cf1169f9c778f236a316b1928b501c68a 100644 +index 8079532618a360aba8f6e1396b87a8b927c839dd..7a6c6a8be3b5b7b4f4a35e9493aeb5da07639e06 100644 --- a/services/network/public/cpp/url_request_mojom_traits.cc +++ b/services/network/public/cpp/url_request_mojom_traits.cc -@@ -96,6 +96,7 @@ bool StructTraitsallow_cookies_from_browser = data.allow_cookies_from_browser(); out->include_request_cookies_with_response = data.include_request_cookies_with_response(); @@ -90,7 +90,7 @@ index 7c006ab576a03d14549f3a0c7b3fb35cf21fee0a..5cd81ab4de26bf9f174a5571d3c41fd4 // a cookie. If this is set to non-null, the observer passed to // URLLoaderFactory will be ignored. diff --git a/services/network/public/mojom/url_response_head.mojom b/services/network/public/mojom/url_response_head.mojom -index 3450c15835d8b792f37764f6edc4a4560be435ef..b1034aa141d6121f8e1524fb34a28a040a280420 100644 +index a123ea0b396815063c4261110ee39e611b6e9eed..968256ba1df386589fda1b97b0e043585c4aa951 100644 --- a/services/network/public/mojom/url_response_head.mojom +++ b/services/network/public/mojom/url_response_head.mojom @@ -13,6 +13,7 @@ import "services/network/public/mojom/attribution.mojom"; @@ -112,10 +112,10 @@ index 3450c15835d8b792f37764f6edc4a4560be435ef..b1034aa141d6121f8e1524fb34a28a04 string mime_type; diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc -index 9e9b917e3f2aa9a56d4db931211828a913ed7f40..05d82fa5dd20acf84d33ca92bddedb9c6132ac36 100644 +index ba6ebceb0b515b4cb1aa5df503d10ede4658a2a1..038c16640ff7aaaeb463e6a9b7fae95d56866e79 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc -@@ -598,6 +598,9 @@ URLLoader::URLLoader( +@@ -597,6 +597,9 @@ URLLoader::URLLoader( mojo::SimpleWatcher::ArmingPolicy::MANUAL, base::SequencedTaskRunner::GetCurrentDefault()), per_factory_orb_state_(context.GetMutableOrbState()), @@ -125,7 +125,7 @@ index 9e9b917e3f2aa9a56d4db931211828a913ed7f40..05d82fa5dd20acf84d33ca92bddedb9c devtools_request_id_(request.devtools_request_id), request_mode_(request.mode), request_credentials_mode_(request.credentials_mode), -@@ -869,7 +872,7 @@ void URLLoader::ConfigureRequest( +@@ -868,7 +871,7 @@ void URLLoader::ConfigureRequest( &URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this))); } diff --git a/patches/chromium/fix_activate_background_material_on_windows.patch b/patches/chromium/fix_activate_background_material_on_windows.patch index 086e0aa48e..da5ecc5faf 100644 --- a/patches/chromium/fix_activate_background_material_on_windows.patch +++ b/patches/chromium/fix_activate_background_material_on_windows.patch @@ -14,10 +14,10 @@ This patch likely can't be upstreamed as-is, as Chromium doesn't have this use case in mind currently. diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index d0d7155c9130e4139c59e993520aa82162a0cc5d..94f3bd5c73d3474164e4bab4ec74743d86a43fce 100644 +index 3bc598c8a1809f55750764018402dd04dd58f255..3d72ea4ad293f1c7f64003f1ddb2cf2efe0705d4 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -914,13 +914,13 @@ void HWNDMessageHandler::FrameTypeChanged() { +@@ -896,13 +896,13 @@ void HWNDMessageHandler::FrameTypeChanged() { void HWNDMessageHandler::PaintAsActiveChanged() { if (!delegate_->HasNonClientView() || !delegate_->CanActivate() || @@ -33,7 +33,7 @@ index d0d7155c9130e4139c59e993520aa82162a0cc5d..94f3bd5c73d3474164e4bab4ec74743d } void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon, -@@ -2269,17 +2269,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message, +@@ -2251,17 +2251,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message, if (IsVisible()) delegate_->SchedulePaint(); diff --git a/patches/chromium/fix_aspect_ratio_with_max_size.patch b/patches/chromium/fix_aspect_ratio_with_max_size.patch index fb549422b5..92ba1e668f 100644 --- a/patches/chromium/fix_aspect_ratio_with_max_size.patch +++ b/patches/chromium/fix_aspect_ratio_with_max_size.patch @@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the BrowserWindow. diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index fc0c3a59dc308d675cc3997231df2c9b9ad02e83..6b5ed4cec3847ace96b8c1f028b789154b9cad7f 100644 +index ae0b5f7d9a324afdbc7c2811b06d44371bb24d06..b5d55aaa700e48542fb82eed1ac7bd69c3949d86 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3694,14 +3694,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, +@@ -3676,14 +3676,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, delegate_->GetMinMaxSize(&min_window_size, &max_window_size); min_window_size = delegate_->DIPToScreenSize(min_window_size); max_window_size = delegate_->DIPToScreenSize(max_window_size); diff --git a/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch b/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch index 4cfa890a2a..6172770601 100644 --- a/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch +++ b/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch @@ -23,10 +23,10 @@ Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397. Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266. diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc -index 53bba48293111e74daba50dde617fb78f1bcc7ee..67083fb13db2020f432ec488a784bcfb9570d737 100644 +index df82cb2cb0038dd6466b73b4bd5d9ed9ec8ca061..e8d302b37677a14f44035769c41068b4a2443972 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -10788,6 +10788,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() { +@@ -10798,6 +10798,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() { "blob"); } @@ -40,7 +40,7 @@ index 53bba48293111e74daba50dde617fb78f1bcc7ee..67083fb13db2020f432ec488a784bcfb // origin of |common_params.url| and/or |common_params.initiator_origin|. url::Origin resolved_origin = url::Origin::Resolve( diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc -index ca0f254f2d38c238851ae0daf50b49b10922c186..c5063f9b0b428b8ece8816a812e6616e207504b0 100644 +index 0c065aef4715b680d0bf4f8df7a252e594663ade..806ce382283eb01ef5b37052da56c53b51440b07 100644 --- a/third_party/blink/renderer/core/loader/document_loader.cc +++ b/third_party/blink/renderer/core/loader/document_loader.cc @@ -2264,6 +2264,10 @@ Frame* DocumentLoader::CalculateOwnerFrame() { diff --git a/patches/chromium/fix_crash_when_saving_edited_pdf_files.patch b/patches/chromium/fix_crash_when_saving_edited_pdf_files.patch index db7f95b857..d4c6bcb835 100644 --- a/patches/chromium/fix_crash_when_saving_edited_pdf_files.patch +++ b/patches/chromium/fix_crash_when_saving_edited_pdf_files.patch @@ -13,10 +13,10 @@ This patch can be removed should we choose to support chrome.fileSystem or support it enough to fix the crash. diff --git a/chrome/browser/resources/pdf/pdf_viewer.ts b/chrome/browser/resources/pdf/pdf_viewer.ts -index 020e31e04887008cba6ed04407124c034b9565a2..8a8a7eb411dc6946254d0d92e043a22bdd2053f9 100644 +index 4f83c769386ab3f8b9e62ecf82964a3b85b06625..c86ac99a1ad70eddb34cdfa65e2e3fab546c4c83 100644 --- a/chrome/browser/resources/pdf/pdf_viewer.ts +++ b/chrome/browser/resources/pdf/pdf_viewer.ts -@@ -1020,28 +1020,27 @@ export class PdfViewerElement extends PdfViewerBaseElement { +@@ -1051,28 +1051,27 @@ export class PdfViewerElement extends PdfViewerBaseElement { dataArray = [result.dataToSave]; } @@ -65,7 +65,7 @@ index 020e31e04887008cba6ed04407124c034b9565a2..8a8a7eb411dc6946254d0d92e043a22b } /** -@@ -1169,36 +1168,33 @@ export class PdfViewerElement extends PdfViewerBaseElement { +@@ -1256,36 +1255,33 @@ export class PdfViewerElement extends PdfViewerBaseElement { fileName = fileName + '.pdf'; } @@ -128,7 +128,7 @@ index 020e31e04887008cba6ed04407124c034b9565a2..8a8a7eb411dc6946254d0d92e043a22b // // Ink2 doesn't need to exit annotation mode after save. -@@ -1308,6 +1304,9 @@ declare global { +@@ -1421,6 +1417,9 @@ declare global { interface HTMLElementTagNameMap { 'pdf-viewer': PdfViewerElement; } diff --git a/patches/chromium/fix_disabling_background_throttling_in_compositor.patch b/patches/chromium/fix_disabling_background_throttling_in_compositor.patch index 88fe88e7ab..e6cd4a1c5b 100644 --- a/patches/chromium/fix_disabling_background_throttling_in_compositor.patch +++ b/patches/chromium/fix_disabling_background_throttling_in_compositor.patch @@ -12,7 +12,7 @@ invisible state of the `viz::DisplayScheduler` owned by the `ui::Compositor`. diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc -index 15908ea0f5a8f84d1381678291a818a26c5f5bda..3552cebebd6425e4152f4b0bf63d3fe0ea5fbda6 100644 +index 99657563e117d243af1466dd1d4ad736da85f1b9..13bf3608ab9b8f6753a9474b2ce4c0a8eda60d90 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -344,7 +344,8 @@ void Compositor::SetLayerTreeFrameSink( diff --git a/patches/chromium/fix_don_t_use_forward_declaration_header.patch b/patches/chromium/fix_don_t_use_forward_declaration_header.patch new file mode 100644 index 0000000000..ac123c529d --- /dev/null +++ b/patches/chromium/fix_don_t_use_forward_declaration_header.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Sanders +Date: Wed, 30 Oct 2024 19:14:19 -0700 +Subject: fix: don't use forward declaration header + +Fails to build from source unless the full header is included. Being upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/5981701. + +Refs: https://chromium-review.googlesource.com/c/chromium/src/+/5868889 + +diff --git a/content/browser/shared_storage/shared_storage_saved_query_data.h b/content/browser/shared_storage/shared_storage_saved_query_data.h +index 206c720fcb797eb36e13183044e13d4e2159b48f..3f37b06492305e279eb46886ddfa6f9a170eaf6e 100644 +--- a/content/browser/shared_storage/shared_storage_saved_query_data.h ++++ b/content/browser/shared_storage/shared_storage_saved_query_data.h +@@ -9,7 +9,7 @@ + + #include + +-#include "base/functional/callback_forward.h" ++#include "base/functional/callback.h" + #include "content/common/content_export.h" + + namespace content { diff --git a/patches/chromium/fix_getcursorscreenpoint_wrongly_returns_0_0.patch b/patches/chromium/fix_getcursorscreenpoint_wrongly_returns_0_0.patch index 32b00fed33..380e2a6f48 100644 --- a/patches/chromium/fix_getcursorscreenpoint_wrongly_returns_0_0.patch +++ b/patches/chromium/fix_getcursorscreenpoint_wrongly_returns_0_0.patch @@ -10,10 +10,10 @@ This patch should be backported to e29, upstreamed to Chromium, and then removed if it lands upstream. diff --git a/ui/events/x/events_x_utils.cc b/ui/events/x/events_x_utils.cc -index 18a0865f85add58588168a29962b35802fab28da..b584517c21285efed01ea4211b606ff768829993 100644 +index f917bd5fda5c1c2102239ebfe3456114e2fae05e..02094a778440505214401930e0b3f005dea1240f 100644 --- a/ui/events/x/events_x_utils.cc +++ b/ui/events/x/events_x_utils.cc -@@ -594,6 +594,9 @@ gfx::Point EventLocationFromXEvent(const x11::Event& xev) { +@@ -592,6 +592,9 @@ gfx::Point EventLocationFromXEvent(const x11::Event& xev) { gfx::Point EventSystemLocationFromXEvent(const x11::Event& xev) { if (auto* crossing = xev.As()) return gfx::Point(crossing->root_x, crossing->root_y); diff --git a/patches/chromium/fix_move_autopipsettingshelper_behind_branding_buildflag.patch b/patches/chromium/fix_move_autopipsettingshelper_behind_branding_buildflag.patch index 4b2e2229d2..282bb1781c 100644 --- a/patches/chromium/fix_move_autopipsettingshelper_behind_branding_buildflag.patch +++ b/patches/chromium/fix_move_autopipsettingshelper_behind_branding_buildflag.patch @@ -75,10 +75,10 @@ index 50f1b8711f7e9bd0aa31ba29f7e7be45eed2647c..869f36e70c48e80a0606d156f33fe05c PictureInPictureOcclusionTracker* diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc -index cb9e61a104f4cbf89d268502ce653aef96c94392..f9e9dcb19362e58eeffe2e9ef1105c6e88bd3118 100644 +index 6e250c07fd096db26807389698d74e993d3de50b..ed5032ea6bbcb278f2032bf37ae32b72edcd07bf 100644 --- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc -@@ -357,11 +357,13 @@ std::unique_ptr VideoOverlayWindowViews::Create( +@@ -364,11 +364,13 @@ std::unique_ptr VideoOverlayWindowViews::Create( #endif // BUILDFLAG(IS_WIN) diff --git a/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch b/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch index fca067f3b8..c271c47ce0 100644 --- a/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch +++ b/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch @@ -9,10 +9,10 @@ focus node change via TextInputManager. chromium-bug: https://crbug.com/1369605 diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc -index 233a352c5c2cb5ce66fc67989a0d93a3d08523c6..95d607a5231a2c5f41ff5961e6bc3e8fe059d2f1 100644 +index d2454381351253e76c48d651ac09cecc9b9d219b..c8cb26dba6d166b8bf6aa0894002b8da4d5bcf1c 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -3064,6 +3064,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged( +@@ -3121,6 +3121,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged( } } @@ -26,10 +26,10 @@ index 233a352c5c2cb5ce66fc67989a0d93a3d08523c6..95d607a5231a2c5f41ff5961e6bc3e8f RenderWidgetHostViewAura* popup_child_host_view) { popup_child_host_view_ = popup_child_host_view; diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h -index 1d513861a831d0a4249209b234026c99ddca0b1b..58425f47285db368e3966ab96347d3c56327253e 100644 +index 74e38cd40248181b2ffd71a51cf3714e6b2b0692..90d9922dacc8b74d36ffbc19e1fd483dde768af7 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h -@@ -642,6 +642,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura +@@ -650,6 +650,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura RenderWidgetHostViewBase* updated_view) override; void OnTextSelectionChanged(TextInputManager* text_input_mangager, RenderWidgetHostViewBase* updated_view) override; @@ -87,10 +87,10 @@ index 51522e60d6dc14f1113cc438558b6b393c3fe73a..153ed02f493a83ef9ca354cc18736f93 // The view with active text input state, i.e., a focused element. // It will be nullptr if no such view exists. Note that the active view diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 5ee493c16d2ff59438c2e233f7e30d796711ee06..c1e2bf39aa70776b7e3b26ac78c82995cd376c58 100644 +index 5f0411754e6bcdf323f55c89c959b5f1e2028f42..b1d6040688ab7eba8e81f753ec7138e9f0bf0e65 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -9235,7 +9235,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( +@@ -9362,7 +9362,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( "WebContentsImpl::OnFocusedElementChangedInFrame", "render_frame_host", frame); RenderWidgetHostViewBase* root_view = diff --git a/patches/chromium/fix_properly_honor_printing_page_ranges.patch b/patches/chromium/fix_properly_honor_printing_page_ranges.patch index 71a04360fc..6551c976c9 100644 --- a/patches/chromium/fix_properly_honor_printing_page_ranges.patch +++ b/patches/chromium/fix_properly_honor_printing_page_ranges.patch @@ -100,7 +100,7 @@ index c6a080107949c435565d6e57646f36fd5e3b912d..e37331436cf5d4bca41bb39a288d395e } else { // No need to bother, we don't know how many pages are available. diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc -index 1a2c8f974e3d38478b6fdea41ec3c7e668e141db..0e560956b03855647f8e90bee585200764db4b46 100644 +index b04cb0b9a9fd25e638c8e5cfac08ddf5dbd1a67e..393815e33b8c700baa349482867fc7f1425ff09f 100644 --- a/ui/gtk/printing/print_dialog_gtk.cc +++ b/ui/gtk/printing/print_dialog_gtk.cc @@ -247,6 +247,24 @@ void PrintDialogGtk::UpdateSettings( diff --git a/patches/chromium/fix_remove_caption-removing_style_call.patch b/patches/chromium/fix_remove_caption-removing_style_call.patch index 12e5443039..4f6b02614d 100644 --- a/patches/chromium/fix_remove_caption-removing_style_call.patch +++ b/patches/chromium/fix_remove_caption-removing_style_call.patch @@ -18,10 +18,10 @@ or resizing, but Electron does not seem to run into that issue for opaque frameless windows even with that block commented out. diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 24854c7fbfefd11dabf899817f068d69f574e290..d0d7155c9130e4139c59e993520aa82162a0cc5d 100644 +index 4e4a10ac149d980e6e28b474adc68ef101519ffc..3bc598c8a1809f55750764018402dd04dd58f255 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -1742,7 +1742,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { +@@ -1724,7 +1724,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0); diff --git a/patches/chromium/fix_restore_original_resize_performance_on_macos.patch b/patches/chromium/fix_restore_original_resize_performance_on_macos.patch index e8eec52752..f7f8e1e32c 100644 --- a/patches/chromium/fix_restore_original_resize_performance_on_macos.patch +++ b/patches/chromium/fix_restore_original_resize_performance_on_macos.patch @@ -11,7 +11,7 @@ This patch should be upstreamed as a conditional revert of the logic in desktop vs mobile runtimes. i.e. restore the old logic only on desktop platforms diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 1ca77c290c177826b090f636f73667c5a0094c1a..e89a6985b85c0c6b26800689e470a9c538d89e2a 100644 +index e79d117c7ab46478ac8e3fc219036417d411f877..d5f9c09622be0a490459b2723f0ed5693527ae00 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -2049,9 +2049,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() { diff --git a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch index d3f640b4bd..088262f8de 100644 --- a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch +++ b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch @@ -8,10 +8,10 @@ v8::Value instead of base::Value. Refs https://bugs.chromium.org/p/chromium/issues/detail?id=1323953 diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc -index 424b73ed6ccda8a29ddfb17e7c1ed2dbbe222711..2391a8e29a9501b7f2461867991819bb7afcaa07 100644 +index 78b7f442e9ce0776b806c352f5ff8f38b4f87bf4..ed96d2d7f0aed6a0c87d2371bccd96c0d4983e02 100644 --- a/extensions/renderer/script_injection.cc +++ b/extensions/renderer/script_injection.cc -@@ -318,6 +318,7 @@ void ScriptInjection::InjectJs(std::set* executing_scripts, +@@ -317,6 +317,7 @@ void ScriptInjection::InjectJs(std::set* executing_scripts, blink::mojom::LoadEventBlockingOption::kBlock, base::BindOnce(&ScriptInjection::OnJsInjectionCompleted, weak_ptr_factory_.GetWeakPtr()), @@ -20,10 +20,10 @@ index 424b73ed6ccda8a29ddfb17e7c1ed2dbbe222711..2391a8e29a9501b7f2461867991819bb injector_->ExpectsResults(), injector_->ShouldWaitForPromise()); } diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h -index 585c16f09a4abc555690944b6694bbae1a3d6a75..cbcad3c67171619b72735cf3adb704c5a40bf426 100644 +index fba018e836f6e898c991a682ca034c9383818c41..5256839ee525ee6b133cddc2e6abf761172b594b 100644 --- a/third_party/blink/public/web/web_local_frame.h +++ b/third_party/blink/public/web/web_local_frame.h -@@ -450,6 +450,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame { +@@ -455,6 +455,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame { mojom::EvaluationTiming, mojom::LoadEventBlockingOption, WebScriptExecutionCallback, @@ -85,7 +85,7 @@ index 0614c5e043fd0b88397863e02fd23feee2c19016..8549807e503c70c4d080b726e89972b7 void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() { diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h -index acbb40738b38a5c029ca89473927b53ad9a43e16..d9fa5bb2cfff5a08d884358c4b4e4ffbac80e7ea 100644 +index 13d1bea90341efbf51c476d3eacae49c8b960537..f508e3e9df98c167740b0574ef554bd17f41447f 100644 --- a/third_party/blink/renderer/core/frame/local_frame.h +++ b/third_party/blink/renderer/core/frame/local_frame.h @@ -824,6 +824,7 @@ class CORE_EXPORT LocalFrame final @@ -97,10 +97,10 @@ index acbb40738b38a5c029ca89473927b53ad9a43e16..d9fa5bb2cfff5a08d884358c4b4e4ffb mojom::blink::WantResultOption, mojom::blink::PromiseResultOption); diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc -index e169f07a251ae3d00058e5831b104cff2b1d412c..a85f0ae8a0536efa5f6d4c56d65d414a7be8ec40 100644 +index 1a45b33d4282ee85de73090c85579bfcb0f7ba6c..339a13afff642992f4ce894d341b861e22a9cbda 100644 --- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc +++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc -@@ -968,6 +968,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld( +@@ -964,6 +964,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld( std::move(callback).Run(value ? std::move(*value) : base::Value()); }, std::move(callback)), @@ -109,10 +109,10 @@ index e169f07a251ae3d00058e5831b104cff2b1d412c..a85f0ae8a0536efa5f6d4c56d65d414a wants_result ? mojom::blink::WantResultOption::kWantResultDateAndRegExpAllowed diff --git a/third_party/blink/renderer/core/frame/pausable_script_executor.cc b/third_party/blink/renderer/core/frame/pausable_script_executor.cc -index 0a1dc01ef4f989ebed466fd66a7a87fb46584cbb..20a596c0fffd076abdf8284ec2f433bc8cdd079b 100644 +index 53f0ae7d2a3df5b89900dcbfa89d2b4225859966..6231edeb3540827c5552bf934cd3905bebdae164 100644 --- a/third_party/blink/renderer/core/frame/pausable_script_executor.cc +++ b/third_party/blink/renderer/core/frame/pausable_script_executor.cc -@@ -255,7 +255,7 @@ void PausableScriptExecutor::CreateAndRun( +@@ -246,7 +246,7 @@ void PausableScriptExecutor::CreateAndRun( script_state, mojom::blink::UserActivationOption::kDoNotActivate, mojom::blink::LoadEventBlockingOption::kDoNotBlock, want_result_option, mojom::blink::PromiseResultOption::kDoNotWait, @@ -121,7 +121,7 @@ index 0a1dc01ef4f989ebed466fd66a7a87fb46584cbb..20a596c0fffd076abdf8284ec2f433bc MakeGarbageCollected( script_state->GetIsolate(), function, receiver, argc, argv)); executor->Run(); -@@ -270,10 +270,11 @@ void PausableScriptExecutor::CreateAndRun( +@@ -261,10 +261,11 @@ void PausableScriptExecutor::CreateAndRun( mojom::blink::LoadEventBlockingOption blocking_option, mojom::blink::WantResultOption want_result_option, mojom::blink::PromiseResultOption promise_result_option, @@ -135,7 +135,7 @@ index 0a1dc01ef4f989ebed466fd66a7a87fb46584cbb..20a596c0fffd076abdf8284ec2f433bc MakeGarbageCollected(std::move(sources), execute_script_policy)); switch (evaluation_timing) { -@@ -295,6 +296,14 @@ void PausableScriptExecutor::ContextDestroyed() { +@@ -286,6 +287,14 @@ void PausableScriptExecutor::ContextDestroyed() { ScriptState::Scope script_scope(script_state_); std::move(callback_).Run({}, {}); } @@ -150,7 +150,7 @@ index 0a1dc01ef4f989ebed466fd66a7a87fb46584cbb..20a596c0fffd076abdf8284ec2f433bc Dispose(); } -@@ -305,10 +314,12 @@ PausableScriptExecutor::PausableScriptExecutor( +@@ -296,10 +305,12 @@ PausableScriptExecutor::PausableScriptExecutor( mojom::blink::WantResultOption want_result_option, mojom::blink::PromiseResultOption promise_result_option, WebScriptExecutionCallback callback, @@ -163,7 +163,7 @@ index 0a1dc01ef4f989ebed466fd66a7a87fb46584cbb..20a596c0fffd076abdf8284ec2f433bc user_activation_option_(user_activation_option), blocking_option_(blocking_option), want_result_option_(want_result_option), -@@ -432,6 +443,9 @@ void PausableScriptExecutor::HandleResults( +@@ -423,6 +434,9 @@ void PausableScriptExecutor::HandleResults( std::move(callback_).Run(std::move(value), start_time_); } @@ -204,7 +204,7 @@ index fa65331f40b90d812b71a489fd560e9359152d2b..390714d631dc88ef92d59ef9618a5706 const mojom::blink::UserActivationOption user_activation_option_; const mojom::blink::LoadEventBlockingOption blocking_option_; diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc -index 9c95dcc932a7744ea43f84fcf558efc14a3096d9..8dddf3b038a99fb52746985526d328707a94b58d 100644 +index a0497dc0fbf3b44cb9f1104373f49ea526816927..fe812de1a0925fa7a51684dd1a4f8429c0f2e059 100644 --- a/third_party/blink/renderer/core/frame/web_frame_test.cc +++ b/third_party/blink/renderer/core/frame/web_frame_test.cc @@ -291,6 +291,7 @@ void ExecuteScriptsInMainWorld( @@ -216,7 +216,7 @@ index 9c95dcc932a7744ea43f84fcf558efc14a3096d9..8dddf3b038a99fb52746985526d32870 mojom::blink::WantResultOption::kWantResult, wait_for_promise); } diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc -index 9622c7de8d00e4a68502a09433ede099d5768eba..fe2622ab079105373ade745b2fc96f3275d60d7b 100644 +index e9c770458b0d238d295fc0b67b62966261fb6b0c..73350ecebd9bbcd33f7bdaa9ac43569659d48f77 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc @@ -1098,14 +1098,15 @@ void WebLocalFrameImpl::RequestExecuteScript( @@ -238,7 +238,7 @@ index 9622c7de8d00e4a68502a09433ede099d5768eba..fe2622ab079105373ade745b2fc96f32 bool WebLocalFrameImpl::IsInspectorConnected() { diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h -index 8084ef0dde77ba46a6f6f7b7f00b04f56de77ec9..9073bd49093a42a7448783e3cfb876a27048c447 100644 +index dd114ccec84b96ac5d1c1152521534e02d9d4ecc..566d58c86a6e1ff48267514b884e12f6bed7c308 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h @@ -196,6 +196,7 @@ class CORE_EXPORT WebLocalFrameImpl final diff --git a/patches/chromium/fix_select_the_first_menu_item_when_opened_via_keyboard.patch b/patches/chromium/fix_select_the_first_menu_item_when_opened_via_keyboard.patch index 97f1efb217..07c03e80ba 100644 --- a/patches/chromium/fix_select_the_first_menu_item_when_opened_via_keyboard.patch +++ b/patches/chromium/fix_select_the_first_menu_item_when_opened_via_keyboard.patch @@ -6,7 +6,7 @@ Subject: fix: select the first menu item when opened via keyboard This fixes an accessibility issue where the root view is 'focused' to the screen reader instead of the first menu item as with all other native menus. This patch will be upstreamed. diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc -index 901a933aa92a0857b5cbdce63f9788662e8a7d87..ec4d8122d519c763da40f5abeaa27f891a02953d 100644 +index 7d8efccc7370f9f0451673f0bd8f4ac8d0e2ae6c..4e4845c72c065e82261ece35a69df23b4f6f55e4 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc @@ -579,6 +579,7 @@ void MenuController::Run(Widget* parent, @@ -21,7 +21,7 @@ index 901a933aa92a0857b5cbdce63f9788662e8a7d87..ec4d8122d519c763da40f5abeaa27f89 // Set the selection, which opens the initial menu. SetSelection(root, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY); -+ if (source_type == ui::MENU_SOURCE_KEYBOARD && context_menu && root->HasSubmenu()) { ++ if (source_type == ui::mojom::MenuSourceType::kKeyboard && context_menu && root->HasSubmenu()) { + // For context menus opened via the keyboard we select the first item by default + // to match accessibility expectations + MenuItemView* first_item = FindInitialSelectableMenuItem(root, INCREMENT_SELECTION_DOWN); @@ -58,7 +58,7 @@ index 901a933aa92a0857b5cbdce63f9788662e8a7d87..ec4d8122d519c763da40f5abeaa27f89 item->GetSubmenu()->GetWidget()->SetNativeWindowProperty( diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h -index e516d8035db49893de0c7b62b7bc755f1c96cece..102b45f09ad7ffcd082e8e2369e19cf611bd6568 100644 +index cf53b35efa3d63125d7cc81668dbabaa27166d34..e356db0c36920c132c34412c3a040b569f9d05cb 100644 --- a/ui/views/controls/menu/menu_controller.h +++ b/ui/views/controls/menu/menu_controller.h @@ -138,6 +138,7 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate, diff --git a/patches/chromium/fix_software_compositing_infinite_loop.patch b/patches/chromium/fix_software_compositing_infinite_loop.patch index b411639835..95c7814041 100644 --- a/patches/chromium/fix_software_compositing_infinite_loop.patch +++ b/patches/chromium/fix_software_compositing_infinite_loop.patch @@ -10,10 +10,10 @@ process CompositingModeFallbackToSoftware IPC to disable GPU compositing. https://issues.chromium.org/345275130 diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc -index 9497ab591864295231db47fdc526e59935e6aa31..635fa41649db41800f99da2683cc955b2e1e935f 100644 +index a8cfc2d7a769c3dc61a3140bb3742d940ea0f82d..e3b6ce1586b51739886fa00aff3d84ae9575e777 100644 --- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc +++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc -@@ -374,9 +374,13 @@ void LayerTreeView::DidFailToInitializeLayerTreeFrameSink() { +@@ -382,9 +382,13 @@ void LayerTreeView::DidFailToInitializeLayerTreeFrameSink() { // unable to be killed after Chrome is closed. // https://issues.chromium.org/336164423 if (!Platform::Current()->IsGpuRemoteDisconnected()) { diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 1e70aa5fe1..352b143369 100644 --- a/patches/chromium/frame_host_manager.patch +++ b/patches/chromium/frame_host_manager.patch @@ -6,10 +6,10 @@ Subject: frame_host_manager.patch Allows embedder to intercept site instances created by chromium. diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc -index cc0f32c6f27a32a41290bdc23447f809770482aa..e51f29ec59a86950c2fb74292ecb4db669719478 100644 +index 3db738d584f3daaa3fd6f97577160fd8a1435df8..7f2cff13a1d1c386a15c5a23c6564ff234748fb2 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -4515,6 +4515,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -4520,6 +4520,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } @@ -20,10 +20,10 @@ index cc0f32c6f27a32a41290bdc23447f809770482aa..e51f29ec59a86950c2fb74292ecb4db6 } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index 47efdce8d0aacf331d7b54ca787dc0afd1595029..c1a6d33d248255eb2b6f391062816f6a3fd38590 100644 +index 927057884f708de195245e6335886e5f0a87134c..0d52ef9f34ac6d105038e4a67c11fdc52b36bb3a 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -337,6 +337,11 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -335,6 +335,11 @@ class CONTENT_EXPORT ContentBrowserClient { virtual ~ContentBrowserClient() = default; diff --git a/patches/chromium/gin_enable_disable_v8_platform.patch b/patches/chromium/gin_enable_disable_v8_platform.patch index b63fd6fd74..5411abddfd 100644 --- a/patches/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/chromium/gin_enable_disable_v8_platform.patch @@ -38,10 +38,10 @@ index 7053a5619c6ff6bced75572d7a3336f532b8bb81..89bbc161b99846c1f9e9585e98dd9056 // Returns whether `Initialize` has already been invoked in the process. // Initialization is a one-way operation (i.e., this method cannot return diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index a428a78a790c2256817a2851edf58414d7b85553..4805f361cafb7854bd9b4f1c29a15417c88665e4 100644 +index 9d6642ee2eb238e733c84d09ffc241137b869a1b..48fd400ee03bde4019e4f8425c32a25d5e6eea8e 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc -@@ -550,7 +550,8 @@ void SetFlags(IsolateHolder::ScriptMode mode, +@@ -553,7 +553,8 @@ void SetFlags(IsolateHolder::ScriptMode mode, // static void V8Initializer::Initialize(IsolateHolder::ScriptMode mode, const std::string& js_command_line_flags, @@ -51,7 +51,7 @@ index a428a78a790c2256817a2851edf58414d7b85553..4805f361cafb7854bd9b4f1c29a15417 static bool v8_is_initialized = false; if (v8_is_initialized) return; -@@ -560,7 +561,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode, +@@ -563,7 +564,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode, // See https://crbug.com/v8/11043 SetFlags(mode, js_command_line_flags); diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index bcf982a7e0..849a8085c7 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/patches/chromium/gritsettings_resource_ids.patch @@ -6,18 +6,18 @@ Subject: gritsettings_resource_ids.patch Add electron resources file to the list of resource ids generation. diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec -index 38cf9d8fd803f47c57d5491648cb6ae445c1c380..935f197f0a47e4786c017e9fdef16b7c597d8fae 100644 +index 2373c6bb0cc1b47ae59b89652b1fa8177fad4c2e..10798092738ce28906d8c5851104808174d43fdf 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec -@@ -1373,6 +1373,11 @@ - "includes": [10060], - }, - +@@ -1385,6 +1385,11 @@ + "<(SHARED_INTERMEDIATE_DIR)/third_party/blink/public/strings/permission_element_generated_strings.grd": { + "META": {"sizes": {"messages": [2000],}}, + "messages": [10080], ++ }, ++ + "electron/electron_resources.grd": { + "messages": [31750], + "includes": [31950], -+ }, -+ - # END "everything else" section. - # Everything but chrome/, components/, content/, and ios/ + } + # END "everything else" section. diff --git a/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch b/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch index f15822c086..8bb3754f57 100644 --- a/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch +++ b/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch @@ -11,7 +11,7 @@ If removing this patch causes no sync failures, it's safe to delete :+1: Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903 diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py -index a07f3fff802db2eb1fcc496ab33e76d24ef1dbab..a157fc3ae1f637d3fc4b2748e0e65b251d8164a6 100755 +index a719eda33d96c7d1d66c97b707b16a8d4a6b1d95..cbf908c6fb58e61821df3d8e18b035e127b737a8 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py @@ -304,6 +304,8 @@ def GetDefaultHostOs(): diff --git a/patches/chromium/load_v8_snapshot_in_browser_process.patch b/patches/chromium/load_v8_snapshot_in_browser_process.patch index e39366e6f2..188e53a863 100644 --- a/patches/chromium/load_v8_snapshot_in_browser_process.patch +++ b/patches/chromium/load_v8_snapshot_in_browser_process.patch @@ -9,7 +9,7 @@ but due to the nature of electron, we need to load the v8 snapshot in the browser process. diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc -index 8fdd8d02e6496d4889d8d6ed5703554e63b7991e..4f0cdcab844bd91655f9e257aadbe0d1e0fae648 100644 +index 840c14bae7ed8cb819b4c5eeccd6beccbf95a764..48a08ba375645c01858de8e9b449f8d36668b078 100644 --- a/content/app/content_main_runner_impl.cc +++ b/content/app/content_main_runner_impl.cc @@ -300,11 +300,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) { diff --git a/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch b/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch index bd64f1773d..5561b03207 100644 --- a/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch +++ b/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch @@ -35,7 +35,7 @@ system font by checking if it's kCTFontPriorityAttribute is set to system priority. diff --git a/base/BUILD.gn b/base/BUILD.gn -index de197a0826f550f39c2438b5bcd53e7f1d463f1b..71d826841792ba99f1d2afca152332e7ff65ee1a 100644 +index 0eb84c31ebbda5e7e842cd0f0df5ff2a15048178..c2fa88ac47c846ad94494660453891b0e38b33e3 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -1040,6 +1040,7 @@ component("base") { @@ -250,7 +250,7 @@ index e9f4e5131238b9fb5f1b4b3e90a0cb84a7fc15b4..8b5f4cae3123ac5480ad73f0c873fca0 } // namespace diff --git a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm -index f9dae777fd2d6ba4f9fe647e6507dea4005d7e25..acef8dfa59981ef58bdfa14108eedfebfdc60334 100644 +index 1db1e7fc1d86bbca432a4226a24a312cf0b989f8..c4192c16299d291df259902ef8497a65776e3189 100644 --- a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm +++ b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm @@ -8,7 +8,9 @@ @@ -263,7 +263,7 @@ index f9dae777fd2d6ba4f9fe647e6507dea4005d7e25..acef8dfa59981ef58bdfa14108eedfeb @interface NSWindow (PrivateBrowserNativeWidgetAPI) + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle; @end -@@ -100,10 +102,13 @@ - (void)maybeShowTrafficLights { +@@ -95,10 +97,13 @@ - (void)maybeShowTrafficLights { @end @@ -277,7 +277,7 @@ index f9dae777fd2d6ba4f9fe647e6507dea4005d7e25..acef8dfa59981ef58bdfa14108eedfeb + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { // - NSThemeFrame and its subclasses will be nil if it's missing at runtime. if ([BrowserWindowFrame class]) -@@ -150,6 +155,8 @@ - (BOOL)_usesCustomDrawing { +@@ -145,6 +150,8 @@ - (BOOL)_usesCustomDrawing { return NO; } @@ -286,7 +286,7 @@ index f9dae777fd2d6ba4f9fe647e6507dea4005d7e25..acef8dfa59981ef58bdfa14108eedfeb // Handle "Move focus to the window toolbar" configured in System Preferences -> // Keyboard -> Shortcuts -> Keyboard. Usually Ctrl+F5. The argument (|unknown|) // tends to just be nil. -@@ -160,8 +167,8 @@ - (void)_handleFocusToolbarHotKey:(id)unknown { +@@ -155,8 +162,8 @@ - (void)_handleFocusToolbarHotKey:(id)unknown { } - (void)setAlwaysShowTrafficLights:(BOOL)alwaysShow { @@ -453,10 +453,10 @@ index f71ea08f64ab5cd36f6bd1e2d3d2908d4de80ba6..4b3450b3bd44a35964bd935453861101 // Beware: This view was briefly removed (in favor of a bare CALayer) in // https://crrev.com/c/1236675. The ordering of unassociated layers relative diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index d1a60edcb29d5d2484badf6cb2853871c1e7bcec..964dc5c3aa8440fd3076f2198b2c89e9b8b82816 100644 +index 4687c5e66f2176cc408b474e4d1e67f7dbf51669..dddf398085d2902b4b1e6e00cb90ccecc238a672 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn -@@ -376,6 +376,7 @@ viz_component("service") { +@@ -378,6 +378,7 @@ viz_component("service") { "frame_sinks/external_begin_frame_source_mac.h", ] } @@ -464,7 +464,7 @@ index d1a60edcb29d5d2484badf6cb2853871c1e7bcec..964dc5c3aa8440fd3076f2198b2c89e9 } if (is_android || use_ozone) { -@@ -656,6 +657,7 @@ viz_source_set("unit_tests") { +@@ -660,6 +661,7 @@ viz_source_set("unit_tests") { "display_embedder/software_output_device_mac_unittest.mm", ] frameworks = [ "IOSurface.framework" ] @@ -558,7 +558,7 @@ index 13c3fe06c417a2565e6af4552930a56c44a01fb3..ef67191f5d010451cde2b084d6165c7d return kAttributes; } diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index cb085a13580106f0218285dc5ad51912d60735d2..f51437492310908f582d3d68cf460c1f8892436c 100644 +index 44579cb75f6757ff72279f0e5d8b7115322fa131..5b18a160870a0294a6eda807570ad847be546bf4 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -323,6 +323,7 @@ source_set("browser") { @@ -677,10 +677,10 @@ index 34fb29866785ef07c6dca4cfc85966df1c479b5f..e305d25a8f2a34ac90f4d503a9c74dcc /////////////////////////////////////////////////////////////////////////////// diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn -index 357c5a754f6b3f2992646dda4955aa5b53e0b84f..faf49fec0f54dfb258945e59bc7ee3d15a8a21e7 100644 +index f1a3573055d86e68e7089b06ea1bb3f97e36df27..e5b0194d583e0a0eb2441514abb65816f595dedc 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn -@@ -284,6 +284,7 @@ source_set("common") { +@@ -286,6 +286,7 @@ source_set("common") { "//ui/shell_dialogs", "//url", "//url/ipc:url_ipc", @@ -771,10 +771,10 @@ index a1068589ad844518038ee7bc15a3de9bc5cba525..1ff781c49f086ec8015c7d3c44567dbe } // namespace content diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index f5130062e82601932c346b348cfbbddc218fcca0..8c0998257db56d02ceeab8543cc74fa1018f053b 100644 +index e9f8c56f5eaf281f62bf3841c2b000e90c07f4b2..85445aa251d92aff789d4a6d2f3c145e70816c9e 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn -@@ -640,6 +640,7 @@ static_library("test_support") { +@@ -643,6 +643,7 @@ static_library("test_support") { "//url", "//url/mojom:url_mojom_gurl", "//v8", @@ -782,7 +782,7 @@ index f5130062e82601932c346b348cfbbddc218fcca0..8c0998257db56d02ceeab8543cc74fa1 ] data_deps = [ -@@ -1109,6 +1110,7 @@ static_library("browsertest_support") { +@@ -1112,6 +1113,7 @@ static_library("browsertest_support") { } configs += [ "//v8:external_startup_data" ] @@ -790,7 +790,7 @@ index f5130062e82601932c346b348cfbbddc218fcca0..8c0998257db56d02ceeab8543cc74fa1 } mojom("content_test_mojo_bindings") { -@@ -1931,6 +1933,7 @@ test("content_browsertests") { +@@ -1936,6 +1938,7 @@ test("content_browsertests") { "//ui/shell_dialogs", "//ui/snapshot", "//ui/webui:test_support", @@ -798,7 +798,7 @@ index f5130062e82601932c346b348cfbbddc218fcca0..8c0998257db56d02ceeab8543cc74fa1 ] if (!(is_chromeos_ash && target_cpu == "arm64" && current_cpu == "arm")) { -@@ -3206,6 +3209,7 @@ test("content_unittests") { +@@ -3214,6 +3217,7 @@ test("content_unittests") { "//ui/latency:test_support", "//ui/shell_dialogs:shell_dialogs", "//ui/webui:test_support", @@ -819,7 +819,7 @@ index 99e612f705c5dff041454802033564085718260a..aa37555d9a9c0fda19d0096d035c245e # TODO(crbug.com/40139469): Blink test plugin must be migrated from PPAPI. diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn -index 82d4f2bf563f6bf489b1f257efb249ba4ec9a7f3..7ae5132961a01175d0d28004e5fc2e9cfb924bdd 100644 +index 094318e67239ea34ccfe42949f417dece377673a..ba645e2aad56ac007eb6f41cf84cb1e05e4a6a1a 100644 --- a/device/bluetooth/BUILD.gn +++ b/device/bluetooth/BUILD.gn @@ -258,6 +258,7 @@ component("bluetooth") { @@ -1371,10 +1371,10 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..9921ccb10d3455600eddd85f77f10228 } // namespace sandbox diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn -index c73b33c834353abcf2f209d5a2ee79f76e701e7d..f6a507adee7ff387f131eb14b27ee01e51a20714 100644 +index 2041934dd6c8f5bb77c286871ff79c1fb56922a5..c6b5bb81023dd7b61b8d429e7cb46f4d37c4d9e1 100644 --- a/third_party/blink/renderer/core/BUILD.gn +++ b/third_party/blink/renderer/core/BUILD.gn -@@ -404,6 +404,7 @@ component("core") { +@@ -408,6 +408,7 @@ component("core") { "//ui/gfx/geometry", "//ui/gfx/geometry:geometry_skia", "//ui/strings", @@ -1612,11 +1612,11 @@ index c8171f0527fe5194f0ea73b57c4444d4c630fbc4..c2ac4da580e3e7f749a0a4de1e859af6 // Accessible object if (AXElementWrapper::IsValidElement(value)) { diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index d7541d80aab34a06348359fbcdb41c7d45579b6a..b72f3f34cbe5059940025c2dd89dfa89960436d1 100644 +index d6e2f90269e179f02a5ff972cca6963e86c3e211..c88e9d2f83f427c2763a307a21b81359245086d6 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn -@@ -380,6 +380,13 @@ component("base") { - sources += [ "resource/resource_bundle_lacros.cc" ] +@@ -358,6 +358,13 @@ component("base") { + ] } + if (is_mas_build) { @@ -1629,7 +1629,7 @@ index d7541d80aab34a06348359fbcdb41c7d45579b6a..b72f3f34cbe5059940025c2dd89dfa89 if (is_ios) { sources += [ "device_form_factor_ios.mm", -@@ -530,6 +537,12 @@ component("base") { +@@ -508,6 +515,12 @@ component("base") { "//url", ] @@ -1837,7 +1837,7 @@ index fe3f85073e31de487a08e57d7f9b07aa4eccf8f3..cf5b07203c8bd559a404600cc98cc8ec // enough. return PlatformFontMac::SystemFontType::kGeneral; diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn -index b0032a1d1d23acb43b702295ac7a5e3445610fbe..a1568062e4657f787fb28d04d1ffecc9d77d1376 100644 +index 02473f891423617ae9b386d8d8628a4c418ebb2a..8dc033eb0d8cf11cc1d63f050da599454c391b7a 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn @@ -723,6 +723,8 @@ component("views") { @@ -1849,7 +1849,7 @@ index b0032a1d1d23acb43b702295ac7a5e3445610fbe..a1568062e4657f787fb28d04d1ffecc9 } if (is_win) { -@@ -1157,6 +1159,8 @@ source_set("test_support") { +@@ -1153,6 +1155,8 @@ source_set("test_support") { "//ui/base/mojom:ui_base_types", ] diff --git a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch index aa79dac94a..455214ca6e 100644 --- a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch +++ b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch @@ -7,10 +7,10 @@ This adds a callback from the network service that's used to implement session.setCertificateVerifyCallback. diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index a9af5589e17c4480bfe553f76769ed50a63d596f..0b78b88754394cbbd5ffcc5694b2fdbd862ff6a8 100644 +index 7e0ee54f435893560515cb8380a5396dc1292d50..f997ff511bb9467a53a2c42b700eb58b5d7d3091 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -157,6 +157,11 @@ +@@ -158,6 +158,11 @@ #include "services/network/web_transport.h" #include "url/gurl.h" @@ -22,7 +22,7 @@ index a9af5589e17c4480bfe553f76769ed50a63d596f..0b78b88754394cbbd5ffcc5694b2fdbd #if BUILDFLAG(IS_CT_SUPPORTED) // gn check does not account for BUILDFLAG(). So, for iOS builds, it will // complain about a missing dependency on the target exposing this header. Add a -@@ -598,6 +603,99 @@ void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) { +@@ -599,6 +604,99 @@ void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) { } // namespace @@ -122,7 +122,7 @@ index a9af5589e17c4480bfe553f76769ed50a63d596f..0b78b88754394cbbd5ffcc5694b2fdbd constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess; NetworkContext::NetworkContextHttpAuthPreferences:: -@@ -979,6 +1077,13 @@ void NetworkContext::SetClient( +@@ -988,6 +1086,13 @@ void NetworkContext::SetClient( client_.Bind(std::move(client)); } @@ -136,7 +136,7 @@ index a9af5589e17c4480bfe553f76769ed50a63d596f..0b78b88754394cbbd5ffcc5694b2fdbd void NetworkContext::CreateURLLoaderFactory( mojo::PendingReceiver receiver, mojom::URLLoaderFactoryParamsPtr params) { -@@ -2529,6 +2634,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2538,6 +2643,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( std::move(cert_verifier)); cert_verifier = std::move(cert_verifier_with_trust_anchors); #endif // BUILDFLAG(IS_CHROMEOS) @@ -147,7 +147,7 @@ index a9af5589e17c4480bfe553f76769ed50a63d596f..0b78b88754394cbbd5ffcc5694b2fdbd builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( diff --git a/services/network/network_context.h b/services/network/network_context.h -index 3ab2d4f27dc258bbb82aa2c929a5ee717a933bd8..345fa438ad2afea7946117b8bac7bb6f08669b28 100644 +index d9c63e9ff7f3afb320b1d88f69cc1105f0a59bad..884a1da963ac6e05dd47ec6b0dcd595f2a7e44c0 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -114,6 +114,7 @@ class URLMatcher; @@ -167,7 +167,7 @@ index 3ab2d4f27dc258bbb82aa2c929a5ee717a933bd8..345fa438ad2afea7946117b8bac7bb6f void ResetURLLoaderFactories() override; void GetViaObliviousHttp( mojom::ObliviousHttpRequestPtr request, -@@ -925,6 +928,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -930,6 +933,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext std::vector dismount_closures_; #endif // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED) diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index 08190d7a64..eaff40e2ea 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -133,10 +133,10 @@ index 05d3a12dd84c7005d46cc73b312f97ef418d96f5..4765de982802541b3efc7211d106acc7 const GURL& document_url, const WeakDocumentPtr& weak_document_ptr, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 244fa3b44eab8ee51da79d2375e7ae3cadf3ad9b..f25a3e94ae2040cd266f8947babd172ee9036ac8 100644 +index 876218eee48cc47f8144a084bc865914de8777f5..fcbb078120cef8f6fdd93de84101a215932fb5fd 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2110,7 +2110,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -2107,7 +2107,7 @@ void RenderProcessHostImpl::CreateNotificationService( case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker: case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: { storage_partition_impl_->GetPlatformNotificationContext()->CreateService( @@ -145,7 +145,7 @@ index 244fa3b44eab8ee51da79d2375e7ae3cadf3ad9b..f25a3e94ae2040cd266f8947babd172e creator_type, std::move(receiver)); break; } -@@ -2118,7 +2118,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -2115,7 +2115,7 @@ void RenderProcessHostImpl::CreateNotificationService( CHECK(rfh); storage_partition_impl_->GetPlatformNotificationContext()->CreateService( diff --git a/patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch b/patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch index 910bb1dd37..7644b7e424 100644 --- a/patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch +++ b/patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch @@ -10,10 +10,10 @@ an about:blank check to this area. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5403876 diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index b03f7c5517681454caf3a0abf527088f63cfea94..61a6856c84c808b4b01c5f3643e7745f21aff357 100644 +index 58bbbabec878172b80c87d4da7d577f2e6fc6fb9..9636327e0d47277e94b9944eddb66904923edcf9 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -784,8 +784,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch( +@@ -785,8 +785,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch( // TODO(crbug.com/40092527): Consider adding a separate boolean that // tracks this instead of piggybacking `origin_calculation_debug_info`. if (renderer_side_origin.opaque() && diff --git a/patches/chromium/picture-in-picture.patch b/patches/chromium/picture-in-picture.patch index 94b3efceab..731ebb7d53 100644 --- a/patches/chromium/picture-in-picture.patch +++ b/patches/chromium/picture-in-picture.patch @@ -39,7 +39,7 @@ index d236578cefc347e772305ac7ec54b9734e4aa20b..6bb89cea3b6b91ec8ea351ed60c4e405 ui::ImageModel::FromVectorIcon(*icon, kColorPipWindowForeground, kCloseButtonIconSize)); diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc -index 68b5bc575c6c1458d2c3351407f73a8a26f13cb2..cb9e61a104f4cbf89d268502ce653aef96c94392 100644 +index 4f0dbb3bbd7537ab4c33e3cd4cf2858a4422ab9f..6e250c07fd096db26807389698d74e993d3de50b 100644 --- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc @@ -17,9 +17,11 @@ @@ -54,7 +54,7 @@ index 68b5bc575c6c1458d2c3351407f73a8a26f13cb2..cb9e61a104f4cbf89d268502ce653aef #include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/browser/ui/views/overlay/back_to_tab_button.h" #include "chrome/browser/ui/views/overlay/back_to_tab_label_button.h" -@@ -62,7 +64,7 @@ +@@ -63,7 +65,7 @@ #include "ui/aura/window.h" #endif @@ -63,7 +63,7 @@ index 68b5bc575c6c1458d2c3351407f73a8a26f13cb2..cb9e61a104f4cbf89d268502ce653aef #include "chrome/browser/shell_integration_win.h" #include "content/public/browser/render_widget_host_view.h" #include "ui/aura/window.h" -@@ -322,7 +324,7 @@ std::unique_ptr VideoOverlayWindowViews::Create( +@@ -329,7 +331,7 @@ std::unique_ptr VideoOverlayWindowViews::Create( overlay_window->Init(std::move(params)); overlay_window->OnRootViewReady(); diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index 749e4088bb..3d2d17d8fb 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -653,10 +653,10 @@ index 3c2fdc9f9a6c60efc4b0afacbfb83eef55917791..8fd9aff538fa03da6c171927c316d4f6 PrintingFailed(int32 cookie, PrintFailureReason reason); diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc -index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee0997074dd1e 100644 +index 423cea4420bc868baad6260fb7c6b33430eaaf95..2b105dc1fb2a7b06fe717df9edf897446aca606c 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc -@@ -51,6 +51,7 @@ +@@ -52,6 +52,7 @@ #include "printing/mojom/print.mojom.h" #include "printing/page_number.h" #include "printing/print_job_constants.h" @@ -664,7 +664,7 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 #include "printing/units.h" #include "services/metrics/public/cpp/ukm_source_id.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" -@@ -1225,14 +1226,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1227,14 +1228,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { } print_in_progress_ = true; @@ -681,7 +681,7 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 if (!weak_this) { return; } -@@ -1263,12 +1264,14 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( +@@ -1265,12 +1266,14 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( receivers_.Add(this, std::move(receiver)); } @@ -699,7 +699,7 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr()); if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) { return; -@@ -1285,9 +1288,10 @@ void PrintRenderFrameHelper::PrintRequestedPagesInternal( +@@ -1287,9 +1290,10 @@ void PrintRenderFrameHelper::PrintRequestedPagesInternal( is_loading_ = frame->WillPrintSoon(); if (is_loading_) { @@ -713,7 +713,7 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 SetupOnStopLoadingTimeout(); return; } -@@ -1297,7 +1301,7 @@ void PrintRenderFrameHelper::PrintRequestedPagesInternal( +@@ -1299,7 +1303,7 @@ void PrintRenderFrameHelper::PrintRequestedPagesInternal( // plugin node and print that instead. auto plugin = delegate_->GetPdfElement(frame); @@ -722,7 +722,7 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 if (render_frame_gone_) { return; -@@ -1454,6 +1458,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { +@@ -1456,6 +1460,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; @@ -731,7 +731,7 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 print_preview_context_.OnPrintPreview(); #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -2046,17 +2052,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2063,17 +2069,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -754,7 +754,7 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 DidFinishPrinting(PrintingResult::kFailPrintInit); return; } -@@ -2077,8 +2085,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2094,8 +2102,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, print_pages_params_->params->print_scaling_option; auto self = weak_ptr_factory_.GetWeakPtr(); @@ -771,7 +771,7 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 // Check if `this` is still valid. if (!self) return; -@@ -2339,29 +2354,37 @@ void PrintRenderFrameHelper::IPCProcessed() { +@@ -2360,29 +2375,37 @@ void PrintRenderFrameHelper::IPCProcessed() { } bool PrintRenderFrameHelper::InitPrintSettings(blink::WebLocalFrame* frame, @@ -817,10 +817,10 @@ index e61e108ceefc53f1727102438a0f1b17d4cbbab6..95792ed1398b574faf5f1c24962ee099 } diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h -index 9c91fdf50b38ad437279eaada4359a7a95911d07..8eed4887949d0c30f067d86aaa971ee5aaecd2ca 100644 +index b8c803184f267d87696c4e72c3d993ff3b69d95b..7278dfae56305cc8669fc2240563450f96bb6f52 100644 --- a/components/printing/renderer/print_render_frame_helper.h +++ b/components/printing/renderer/print_render_frame_helper.h -@@ -251,7 +251,7 @@ class PrintRenderFrameHelper +@@ -259,7 +259,7 @@ class PrintRenderFrameHelper mojo::PendingAssociatedReceiver receiver); // printing::mojom::PrintRenderFrame: @@ -829,7 +829,7 @@ index 9c91fdf50b38ad437279eaada4359a7a95911d07..8eed4887949d0c30f067d86aaa971ee5 void PrintWithParams(mojom::PrintPagesParamsPtr params, PrintWithParamsCallback callback) override; #if BUILDFLAG(ENABLE_PRINT_PREVIEW) -@@ -318,7 +318,8 @@ class PrintRenderFrameHelper +@@ -326,7 +326,8 @@ class PrintRenderFrameHelper // WARNING: |this| may be gone after this method returns. void Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -839,7 +839,7 @@ index 9c91fdf50b38ad437279eaada4359a7a95911d07..8eed4887949d0c30f067d86aaa971ee5 // Notification when printing is done - signal tear-down/free resources. void DidFinishPrinting(PrintingResult result); -@@ -328,7 +329,8 @@ class PrintRenderFrameHelper +@@ -336,7 +337,8 @@ class PrintRenderFrameHelper // Initialize print page settings with default settings. // Used only for native printing workflow. bool InitPrintSettings(blink::WebLocalFrame* frame, @@ -849,7 +849,7 @@ index 9c91fdf50b38ad437279eaada4359a7a95911d07..8eed4887949d0c30f067d86aaa971ee5 // Calculate number of pages in source document. uint32_t CalculateNumberOfPages(blink::WebLocalFrame* frame, -@@ -625,7 +627,8 @@ class PrintRenderFrameHelper +@@ -634,7 +636,8 @@ class PrintRenderFrameHelper }; void SetupOnStopLoadingTimeout(); @@ -860,10 +860,10 @@ index 9c91fdf50b38ad437279eaada4359a7a95911d07..8eed4887949d0c30f067d86aaa971ee5 ScriptingThrottler scripting_throttler_; diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index f51437492310908f582d3d68cf460c1f8892436c..dbff945f9e54a5c947c23efff4d11d57d07b8a4e 100644 +index 5b18a160870a0294a6eda807570ad847be546bf4..eedbfda88da7bf68bb86e8a2c6953aa4273b030b 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn -@@ -3001,8 +3001,9 @@ source_set("browser") { +@@ -3011,8 +3011,9 @@ source_set("browser") { "//ppapi/shared_impl", ] diff --git a/patches/chromium/process_singleton.patch b/patches/chromium/process_singleton.patch index e446abb82f..8fc56d8c5e 100644 --- a/patches/chromium/process_singleton.patch +++ b/patches/chromium/process_singleton.patch @@ -165,7 +165,7 @@ index 80b0c47637a6726e1e43113d84187910911271b4..72cdfe2c4a0258dbd575f536ca42fa1d int dir_mode = 0; CHECK(base::GetPosixFilePermissions(socket_dir_.GetPath(), &dir_mode) && diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc -index 3138eaa2c1e8ed806d81445149d4f88f54d19254..27216805188c77aa45b478e66b04a2d45f92fba6 100644 +index 68ca956bdd251f1fadccbd2f4e336918141cadf1..d91f58ebe3a024bc41ed72121c49172f68e0d862 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -29,7 +29,9 @@ @@ -218,7 +218,7 @@ index 3138eaa2c1e8ed806d81445149d4f88f54d19254..27216805188c77aa45b478e66b04a2d4 - static const wchar_t kMutexName[] = L"Local\\ChromeProcessSingletonStartup!"; + std::wstring mutexName = base::UTF8ToWide("Local\\" + program_name_ + "ProcessSingletonStartup"); - remote_window_ = chrome::FindRunningChromeWindow(user_data_dir_); + remote_window_ = FindRunningChromeWindow(user_data_dir_); if (!remote_window_ && !EscapeVirtualization(user_data_dir_)) { @@ -390,7 +401,7 @@ bool ProcessSingleton::Create() { // access. As documented, it's clearer to NOT request ownership on creation diff --git a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch index 55f540f5fd..f0bb355868 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -30,7 +30,7 @@ index dea7ba2237cea261fe0b526753e1a9c4e355e484..9e3bf5eca5e9ad99112069a28b7fb8c1 // RenderWidgetHost on the primary main frame, and false otherwise. virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*); diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 9fe8ce99d4b5fe83bf66c37d7acec4d4e670f8c2..1ca77c290c177826b090f636f73667c5a0094c1a 100644 +index fe40b67aa7a158855eea6f03c13d02b614c384de..e79d117c7ab46478ac8e3fc219036417d411f877 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -1983,6 +1983,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) { @@ -44,10 +44,10 @@ index 9fe8ce99d4b5fe83bf66c37d7acec4d4e670f8c2..1ca77c290c177826b090f636f73667c5 void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index c67be0c23f8b8d6f49ee82e1617c0f3cfee5c9ab..76d396192337ad3b3046c6eb80c14a7d4a54ac8c 100644 +index 2a7ef7a03efea98b65ad9d986b7427974f874f1c..e252f8e62e92f2a4b8baa6901f3d6c4d3600075c 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -5493,6 +5493,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -5600,6 +5600,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -60,10 +60,10 @@ index c67be0c23f8b8d6f49ee82e1617c0f3cfee5c9ab..76d396192337ad3b3046c6eb80c14a7d RenderWidgetHostImpl* render_widget_host) { return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost(); diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h -index b17c393dd5d622130fa0bea0e74ebfc3a68b4cb3..be8fa9d6b4b72bab11b68a10fc55225cdf4f52aa 100644 +index 87d55b2c37754f95119f5de775d72713bd30b70b..669677b9d23a9246c69b52442d31e6f48b960489 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h -@@ -1122,6 +1122,7 @@ class CONTENT_EXPORT WebContentsImpl +@@ -1120,6 +1120,7 @@ class CONTENT_EXPORT WebContentsImpl void SendScreenRects() override; void SendActiveState(bool active) override; TextInputManager* GetTextInputManager() override; @@ -72,10 +72,10 @@ index b17c393dd5d622130fa0bea0e74ebfc3a68b4cb3..be8fa9d6b4b72bab11b68a10fc55225c RenderWidgetHostImpl* render_widget_host) override; bool IsShowingContextMenuOnPage() const override; diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h -index 58e3918a83b1adbd37b8cffc98fd667b71c53442..43362728bacd4cd7a28c0e792351082a82e0ab0d 100644 +index aedd14552cc6f5c9d8e7f832df70af5010102462..3688231f2f6f1349b46fa97b600e5b0b7353c8f2 100644 --- a/content/public/browser/web_contents_observer.h +++ b/content/public/browser/web_contents_observer.h -@@ -36,6 +36,7 @@ +@@ -37,6 +37,7 @@ #include "third_party/blink/public/mojom/media/capture_handle_config.mojom-forward.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/accessibility/ax_location_and_scroll_updates.h" @@ -83,7 +83,7 @@ index 58e3918a83b1adbd37b8cffc98fd667b71c53442..43362728bacd4cd7a28c0e792351082a #include "ui/base/page_transition_types.h" #include "ui/base/window_open_disposition.h" -@@ -628,6 +629,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { +@@ -617,6 +618,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { // Invoked when the primary main frame changes size. virtual void PrimaryMainFrameWasResized(bool width_changed) {} diff --git a/patches/chromium/refactor_expose_file_system_access_blocklist.patch b/patches/chromium/refactor_expose_file_system_access_blocklist.patch index 7eed3b16ef..163fe35062 100644 --- a/patches/chromium/refactor_expose_file_system_access_blocklist.patch +++ b/patches/chromium/refactor_expose_file_system_access_blocklist.patch @@ -8,10 +8,10 @@ it in Electron and prevent drift from Chrome's blocklist. We should look for a w to upstream this change to Chrome. diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc -index 83c679ab4b6a7eb128402406441e503a951b1c79..3cfa97bea3eeadf01ff5bc090a9f59e61e932309 100644 +index 31104e81161f2110fe18275b065c32fc1e823764..42de7fff737beada8f5b54463c2854f9caa15511 100644 --- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc +++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc -@@ -46,7 +46,6 @@ +@@ -47,7 +47,6 @@ #include "chrome/browser/ui/file_system_access/file_system_access_dangerous_file_dialog.h" #include "chrome/browser/ui/file_system_access/file_system_access_dialogs.h" #include "chrome/browser/ui/file_system_access/file_system_access_restricted_directory_dialog.h" @@ -19,7 +19,7 @@ index 83c679ab4b6a7eb128402406441e503a951b1c79..3cfa97bea3eeadf01ff5bc090a9f59e6 #include "chrome/grit/generated_resources.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" -@@ -250,126 +249,10 @@ bool MaybeIsLocalUNCPath(const base::FilePath& path) { +@@ -251,128 +250,10 @@ bool MaybeIsLocalUNCPath(const base::FilePath& path) { } #endif @@ -97,6 +97,8 @@ index 83c679ab4b6a7eb128402406441e503a951b1c79..3cfa97bea3eeadf01ff5bc090a9f59e6 -#if BUILDFLAG(IS_MAC) - // Similar Mac specific blocks. - {base::DIR_APP_DATA, nullptr, kBlockAllChildren}, +- // Block access to the current bundle directory. +- {chrome::DIR_OUTER_BUNDLE, nullptr, kBlockAllChildren}, - // Block access to the user's Applications directory. - {base::DIR_HOME, FILE_PATH_LITERAL("Applications"), kBlockAllChildren}, - // Block access to the root Applications directory. @@ -151,13 +153,13 @@ index 83c679ab4b6a7eb128402406441e503a951b1c79..3cfa97bea3eeadf01ff5bc090a9f59e6 // Describes a rule for blocking a directory, which can be constructed // dynamically (based on state) or statically (from kBlockedPaths). diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h -index b28cc5b1227060ae7cb889a0689ceb55fc52a8f8..dd2f36727d547f26406ea8e0bc8c276cac2b163c 100644 +index 68a712cb272224d7a75ff3f512e45ed82eab5a86..d46119d9a7a32c9dc0c4844da73c63b42af9f7a8 100644 --- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h +++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h -@@ -18,7 +18,7 @@ - #include "base/types/expected.h" - #include "chrome/browser/file_system_access/file_system_access_features.h" +@@ -21,7 +21,7 @@ #include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h" + #include "chrome/browser/permissions/one_time_permissions_tracker.h" + #include "chrome/browser/permissions/one_time_permissions_tracker_observer.h" -#include "components/enterprise/buildflags/buildflags.h" +#include "chrome/common/chrome_paths.h" #include "components/permissions/features.h" @@ -172,7 +174,7 @@ index b28cc5b1227060ae7cb889a0689ceb55fc52a8f8..dd2f36727d547f26406ea8e0bc8c276c #include "components/enterprise/common/files_scan_data.h" #endif -@@ -337,6 +337,127 @@ class ChromeFileSystemAccessPermissionContext +@@ -340,6 +340,129 @@ class ChromeFileSystemAccessPermissionContext // KeyedService: void Shutdown() override; @@ -250,6 +252,8 @@ index b28cc5b1227060ae7cb889a0689ceb55fc52a8f8..dd2f36727d547f26406ea8e0bc8c276c + #if BUILDFLAG(IS_MAC) + // Similar Mac specific blocks. + {base::DIR_APP_DATA, nullptr, kBlockAllChildren}, ++ // Block access to the current bundle directory. ++ {chrome::DIR_OUTER_BUNDLE, nullptr, kBlockAllChildren}, + // Block access to the user's Applications directory. + {base::DIR_HOME, FILE_PATH_LITERAL("Applications"), kBlockAllChildren}, + // Block access to the root Applications directory. @@ -300,7 +304,7 @@ index b28cc5b1227060ae7cb889a0689ceb55fc52a8f8..dd2f36727d547f26406ea8e0bc8c276c protected: SEQUENCE_CHECKER(sequence_checker_); -@@ -356,7 +477,7 @@ class ChromeFileSystemAccessPermissionContext +@@ -359,7 +482,7 @@ class ChromeFileSystemAccessPermissionContext void PermissionGrantDestroyed(PermissionGrantImpl* grant); diff --git a/patches/chromium/refactor_expose_hostimportmoduledynamically_and.patch b/patches/chromium/refactor_expose_hostimportmoduledynamically_and.patch index 2f4bdf57bc..4e66dca97d 100644 --- a/patches/chromium/refactor_expose_hostimportmoduledynamically_and.patch +++ b/patches/chromium/refactor_expose_hostimportmoduledynamically_and.patch @@ -7,10 +7,10 @@ Subject: refactor: expose HostImportModuleDynamically and This is so that Electron can blend Blink's and Node's implementations of these isolate handlers. diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc -index c3f7b26c1613abbc5cc8378d175db2ef5187b2b4..f5e61f6201bc3721a2ceb14ec09b625f2db939aa 100644 +index 550a216177b7be1bb1f90fbc8714ef1f9bc2f298..34c40b1089695a557ec405409156b51a389e3edf 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc -@@ -649,7 +649,9 @@ bool WasmJSPromiseIntegrationEnabledCallback(v8::Local context) { +@@ -648,7 +648,9 @@ bool WasmJSPromiseIntegrationEnabledCallback(v8::Local context) { execution_context); } @@ -21,7 +21,7 @@ index c3f7b26c1613abbc5cc8378d175db2ef5187b2b4..f5e61f6201bc3721a2ceb14ec09b625f v8::Local context, v8::Local v8_host_defined_options, v8::Local v8_referrer_resource_url, -@@ -727,7 +729,7 @@ v8::MaybeLocal HostImportModuleDynamically( +@@ -726,7 +728,7 @@ v8::MaybeLocal HostImportModuleDynamically( } // https://html.spec.whatwg.org/C/#hostgetimportmetaproperties @@ -30,7 +30,7 @@ index c3f7b26c1613abbc5cc8378d175db2ef5187b2b4..f5e61f6201bc3721a2ceb14ec09b625f v8::Local module, v8::Local meta) { v8::Isolate* isolate = context->GetIsolate(); -@@ -770,9 +772,6 @@ std::ostream& operator<<(std::ostream& os, const PrintV8OOM& oom_details) { +@@ -769,9 +771,6 @@ std::ostream& operator<<(std::ostream& os, const PrintV8OOM& oom_details) { return os; } @@ -40,7 +40,7 @@ index c3f7b26c1613abbc5cc8378d175db2ef5187b2b4..f5e61f6201bc3721a2ceb14ec09b625f void V8Initializer::InitializeV8Common(v8::Isolate* isolate) { // Set up garbage collection before setting up anything else as V8 may trigger // GCs during Blink setup. -@@ -792,9 +791,9 @@ void V8Initializer::InitializeV8Common(v8::Isolate* isolate) { +@@ -791,9 +790,9 @@ void V8Initializer::InitializeV8Common(v8::Isolate* isolate) { isolate->SetWasmJSPIEnabledCallback(WasmJSPromiseIntegrationEnabledCallback); isolate->SetSharedArrayBufferConstructorEnabledCallback( SharedArrayBufferConstructorEnabledCallback); diff --git a/patches/chromium/render_widget_host_view_base.patch b/patches/chromium/render_widget_host_view_base.patch index bfaebb7e2c..7bfe9c31bd 100644 --- a/patches/chromium/render_widget_host_view_base.patch +++ b/patches/chromium/render_widget_host_view_base.patch @@ -6,7 +6,7 @@ Subject: render_widget_host_view_base.patch ... something to do with OSR? and maybe as well? terrifying. diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc -index 72c5c119911a627c69e19d72a8bdbc91c770afc1..a5338c058fc25ce763804965030e211224111fc2 100644 +index a09e0fd3993923fb21b9a13c0abfdb5789509f1e..ff12932ea58019a08a5791cdd4f6439ac6b4d0b6 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc @@ -638,6 +638,13 @@ void RenderWidgetHostViewBase::OnFrameTokenChangedForView( diff --git a/patches/chromium/resource_file_conflict.patch b/patches/chromium/resource_file_conflict.patch index 810545228d..0eeef4e87e 100644 --- a/patches/chromium/resource_file_conflict.patch +++ b/patches/chromium/resource_file_conflict.patch @@ -52,10 +52,10 @@ Some alternatives to this patch: None of these options seems like a substantial maintainability win over this patch to me (@nornagon). diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index e2d2446670d358346b5c7399596625087627d5e4..f40c70d840845fdb6171ab6ba4cdcf92dbfd9965 100644 +index c785db2fe2a24d33db6499da7806defbdec78a7e..9580623c57cb02f7e924742c6cb1638676881115 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -1560,7 +1560,7 @@ if (is_chrome_branded && !is_android) { +@@ -1557,7 +1557,7 @@ if (is_chrome_branded && !is_android) { } } @@ -64,7 +64,7 @@ index e2d2446670d358346b5c7399596625087627d5e4..f40c70d840845fdb6171ab6ba4cdcf92 chrome_paks("packed_resources") { if (is_mac) { output_dir = "$root_gen_dir/repack" -@@ -1599,6 +1599,12 @@ if (!is_android) { +@@ -1596,6 +1596,12 @@ if (!is_android) { } } diff --git a/patches/chromium/revert_mojo_force_blink_headers_to_only_be_included_in_blink.patch b/patches/chromium/revert_mojo_force_blink_headers_to_only_be_included_in_blink.patch new file mode 100644 index 0000000000..89bfdebbdb --- /dev/null +++ b/patches/chromium/revert_mojo_force_blink_headers_to_only_be_included_in_blink.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Sanders +Date: Wed, 30 Oct 2024 23:28:24 -0700 +Subject: Revert "[mojo] Force blink headers to only be included in blink" + +This reverts commit 83b7fc2ecb7341531fdd346a905618f6fab06d12. + +Revert this change until we determine the best way to land it in Electron. + +Refs: https://chromium-review.googlesource.com/c/chromium/src/+/5962696 + +diff --git a/mojo/public/cpp/bindings/tests/BUILD.gn b/mojo/public/cpp/bindings/tests/BUILD.gn +index 3395ffb932df565798b91229fe1fecf94f07ee86..763053a2a2b80a5d335c3459f4f2dfa55e363d82 100644 +--- a/mojo/public/cpp/bindings/tests/BUILD.gn ++++ b/mojo/public/cpp/bindings/tests/BUILD.gn +@@ -110,7 +110,6 @@ source_set("tests") { + ":struct_with_traits_impl", + "//mojo/public/interfaces/bindings/tests:test_interfaces_blink", + ] +- defines = [ "BLINK_MOJO_IMPL=1" ] + } + } + +@@ -132,8 +131,6 @@ if (use_blink) { + "wtf_types_unittest.cc", + ] + +- defines = [ "BLINK_MOJO_IMPL=1" ] +- + deps = [ + "//base/test:test_support", + "//mojo/public/cpp/bindings", +diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl +index da123a97ef4f13258600cd9af461dc20dea0b2aa..9a86c5b47d3254cb6b5af5d609fa9eaaed0befd7 100644 +--- a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl ++++ b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl +@@ -81,12 +81,6 @@ + #include "{{export_header}}" + {%- endif %} + +-{%- if for_blink %} +-#if !BLINK_MOJO_IMPL && !INSIDE_BLINK +-#error "File must only be imported inside blink" +-#endif +-{%- endif %} +- + {% if enable_kythe_annotations -%} + #ifdef KYTHE_IS_RUNNING + #pragma kythe_inline_metadata "Metadata comment" +diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni +index aee1a53dfd6d1115192eaf1cd25160d546c44175..25361499581908170285e68241efeb668fe35350 100644 +--- a/mojo/public/tools/bindings/mojom.gni ++++ b/mojo/public/tools/bindings/mojom.gni +@@ -1366,9 +1366,6 @@ template("mojom") { + "base/component_export.h", + ] + } +- if (defined(variant) && variant == "blink") { +- export_defines += [ "BLINK_MOJO_IMPL=1" ] +- } + + generator_cpp_output_suffixes = [] + variant_dash_suffix = "" diff --git a/patches/chromium/scroll_bounce_flag.patch b/patches/chromium/scroll_bounce_flag.patch index 0057d7d988..4d6a94851f 100644 --- a/patches/chromium/scroll_bounce_flag.patch +++ b/patches/chromium/scroll_bounce_flag.patch @@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch Patch to make scrollBounce option work. diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc -index 15e28effa2cbfe7662a466d9a4664818d343e3d8..d71cbbe887ba0cc2fb3e9595edef1bb68857c2d4 100644 +index e82ddca5469308ec02c9b1e5565dddc42946c0fe..7a49f91be6d20c3e19b084fface4bc015d3ca0b9 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1277,7 +1277,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { +@@ -1276,7 +1276,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { } bool RenderThreadImpl::IsElasticOverscrollEnabled() { diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index cc7b3e9702..5965343e8d 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,7 +22,7 @@ However, the patch would need to be reviewed by the security team, as it does touch a security-sensitive class. diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index f25a3e94ae2040cd266f8947babd172ee9036ac8..7d3d2d917440efef069a81861aaeebd9e382f884 100644 +index fcbb078120cef8f6fdd93de84101a215932fb5fd..8dd0fc3c23bf82a4557e7cdf074851f8eec660ea 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1755,6 +1755,10 @@ bool RenderProcessHostImpl::Init() { diff --git a/patches/chromium/ui_add_missing_shortcut_text_for_vkey_command_on_linux.patch b/patches/chromium/ui_add_missing_shortcut_text_for_vkey_command_on_linux.patch deleted file mode 100644 index 6643e78ca5..0000000000 --- a/patches/chromium/ui_add_missing_shortcut_text_for_vkey_command_on_linux.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: deepak1556 -Date: Tue, 22 Oct 2024 00:27:27 +0900 -Subject: Add missing shortcut text for VKEY_COMMAND on linux - -Backports https://chromium-review.googlesource.com/c/chromium/src/+/5947724 - -diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc -index 32a3fc0843656eaa87b85dd63ac1ade6d83b6e5b..ed1ff076b1db6b77d0684bae1931714bf575ebe8 100644 ---- a/ui/base/accelerators/accelerator.cc -+++ b/ui/base/accelerators/accelerator.cc -@@ -419,6 +419,8 @@ std::u16string Accelerator::ApplyLongFormModifiers( - result = ApplyModifierToAcceleratorString(result, IDS_APP_SEARCH_KEY); - #elif BUILDFLAG(IS_WIN) - result = ApplyModifierToAcceleratorString(result, IDS_APP_WINDOWS_KEY); -+#elif BUILDFLAG(IS_LINUX) -+ result = ApplyModifierToAcceleratorString(result, IDS_APP_SUPER_KEY); - #else - NOTREACHED(); - #endif -diff --git a/ui/base/accelerators/accelerator_unittest.cc b/ui/base/accelerators/accelerator_unittest.cc -index 3b29229c02b0dac7197d3e4bf6014733e0f9669a..cfd9396184e16237cbf49c693af0bd80f8a2ee16 100644 ---- a/ui/base/accelerators/accelerator_unittest.cc -+++ b/ui/base/accelerators/accelerator_unittest.cc -@@ -58,6 +58,9 @@ TEST(AcceleratorTest, MAYBE_GetShortcutText) { - {VKEY_OEM_COMMA, EF_CONTROL_DOWN, u"Ctrl+Comma", u"⌃,"}, - #if BUILDFLAG(IS_MAC) - {VKEY_T, EF_COMMAND_DOWN | EF_CONTROL_DOWN, nullptr, u"⌃⌘T"}, -+#endif -+#if BUILDFLAG(IS_LINUX) -+ {VKEY_T, EF_COMMAND_DOWN | EF_CONTROL_DOWN, u"Super+Ctrl+T", nullptr}, - #endif - }; - -diff --git a/ui/strings/ui_strings.grd b/ui/strings/ui_strings.grd -index bf64f8fbc6d8f6700b40aa0d798dadc67ecc5db6..9307df9b60bcc7bd2a44bb98bc0720901cd8f4a0 100644 ---- a/ui/strings/ui_strings.grd -+++ b/ui/strings/ui_strings.grd -@@ -767,6 +767,11 @@ need to be translated for each locale.--> - Win - - -+ -+ -+ Super -+ -+ - - - Meta diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index ee28bdc91e..27be0052fe 100644 --- a/patches/chromium/web_contents.patch +++ b/patches/chromium/web_contents.patch @@ -9,10 +9,10 @@ is needed for OSR. Originally landed in https://github.com/electron/libchromiumcontent/pull/226. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index cc2e4302ad121d658bb43af1014b6af42a62d47a..2585728e652de91cbc9839cb1500e04f87635866 100644 +index e438e56c0f5d636ddba9c7c25086c2e80de3263f..4f5861f52faf12a2be31637f729284f87fad241b 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3651,6 +3651,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3755,6 +3755,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, params.main_frame_name, GetOpener(), primary_main_frame_policy, base::UnguessableToken::Create()); @@ -26,7 +26,7 @@ index cc2e4302ad121d658bb43af1014b6af42a62d47a..2585728e652de91cbc9839cb1500e04f std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3661,6 +3668,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3765,6 +3772,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } @@ -35,11 +35,11 @@ index cc2e4302ad121d658bb43af1014b6af42a62d47a..2585728e652de91cbc9839cb1500e04f CHECK(view_.get()); diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index 09099f8ba7b051d89bc43da5b8ae96222d9b0f7f..3cebb9b8fc035550523beac742cb27ce404a9e89 100644 +index a0a13547fe05410525ff122ba08600997c2e2bc8..b1b0be781a7b480dff896d9e34e41048908d61df 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h -@@ -110,10 +110,13 @@ class BrowserContext; - class BrowserPluginGuestDelegate; +@@ -111,10 +111,13 @@ class BrowserPluginGuestDelegate; + class GuestPageHolder; class RenderFrameHost; class RenderViewHost; +class RenderViewHostDelegateView; @@ -52,7 +52,7 @@ index 09099f8ba7b051d89bc43da5b8ae96222d9b0f7f..3cebb9b8fc035550523beac742cb27ce class WebUI; struct DropData; struct MHTMLGenerationParams; -@@ -259,6 +262,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData { +@@ -275,6 +278,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData { network::mojom::WebSandboxFlags starting_sandbox_flags = network::mojom::WebSandboxFlags::kNone; diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index 1e67d0b584..badf1b0162 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -15,10 +15,10 @@ Note that we also need to manually update embedder's `api::WebContents::IsFullscreenForTabOrPending` value. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index 9f530a1a768d27070f10fc40c6af51f56f42f0ca..b03f7c5517681454caf3a0abf527088f63cfea94 100644 +index f45bde8012a8078f0b636059d1c7f92c72cd325f..58bbbabec878172b80c87d4da7d577f2e6fc6fb9 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -8238,6 +8238,17 @@ void RenderFrameHostImpl::EnterFullscreen( +@@ -8245,6 +8245,17 @@ void RenderFrameHostImpl::EnterFullscreen( } } @@ -37,10 +37,10 @@ index 9f530a1a768d27070f10fc40c6af51f56f42f0ca..b03f7c5517681454caf3a0abf527088f if (had_fullscreen_token && !GetView()->HasFocus()) GetView()->Focus(); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 2585728e652de91cbc9839cb1500e04f87635866..5ee493c16d2ff59438c2e233f7e30d796711ee06 100644 +index 4f5861f52faf12a2be31637f729284f87fad241b..5f0411754e6bcdf323f55c89c959b5f1e2028f42 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3907,21 +3907,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent( +@@ -4011,21 +4011,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent( const input::NativeWebKeyboardEvent& event) { OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"), "WebContentsImpl::PreHandleKeyboardEvent"); @@ -78,7 +78,7 @@ index 2585728e652de91cbc9839cb1500e04f87635866..5ee493c16d2ff59438c2e233f7e30d79 } bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) { -@@ -4080,7 +4084,7 @@ void WebContentsImpl::EnterFullscreenMode( +@@ -4184,7 +4188,7 @@ void WebContentsImpl::EnterFullscreenMode( OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode"); DCHECK(CanEnterFullscreenMode(requesting_frame)); DCHECK(requesting_frame->IsActive()); diff --git a/patches/chromium/worker_context_will_destroy.patch b/patches/chromium/worker_context_will_destroy.patch index fe55226044..64c1ba772c 100644 --- a/patches/chromium/worker_context_will_destroy.patch +++ b/patches/chromium/worker_context_will_destroy.patch @@ -10,7 +10,7 @@ An attempt to upstream this was made, but rejected: https://chromium-review.googlesource.com/c/chromium/src/+/1954347 diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h -index 784e0a5166d6bece3f6a251e7cab1192e576af22..efd8ef49f1f2b6ecd6c3638b56e40c4e418f3493 100644 +index c5b71cede2f440bebe3b808bae3e61c50e5c8a22..8edb29fba20bbc16366a12196ea1055d60576f1b 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -414,6 +414,11 @@ class CONTENT_EXPORT ContentRendererClient { diff --git a/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch b/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch index 21a85623e5..492eeec061 100644 --- a/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch +++ b/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch @@ -19,7 +19,7 @@ that clearly establishes the worker script is ready for evaluation with the scop initialized. diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h -index efd8ef49f1f2b6ecd6c3638b56e40c4e418f3493..9d8a1947e371d085486c1c4e27edfb03f04a6334 100644 +index 8edb29fba20bbc16366a12196ea1055d60576f1b..bd0844c3301e8ecca29852756d6c52607d834610 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -414,6 +414,11 @@ class CONTENT_EXPORT ContentRendererClient { @@ -78,7 +78,7 @@ index 9f90e46f989c6def8e92f61e179e938f8a0ec29c..5d1abdae16d41f443fa346f8042e3f3e virtual bool AllowScriptExtensionForServiceWorker( const WebSecurityOrigin& script_origin) { diff --git a/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc b/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc -index 2ae0fef28566f19627de0424dae4e8b292e0b096..b8f6aa88e4511981ca0c923196e478614cf808a2 100644 +index 0ed1c87e5573a041eed9fa30a7b49001cf565a86..8986877f95680b7d6864ba5d9f2d73f7667b8918 100644 --- a/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc +++ b/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc @@ -302,6 +302,7 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() { diff --git a/patches/config.json b/patches/config.json index 8cf28d8d2b..8d297c0fd3 100644 --- a/patches/config.json +++ b/patches/config.json @@ -11,5 +11,6 @@ { "patch_dir": "src/electron/patches/Mantle", "repo": "src/third_party/squirrel.mac/vendor/Mantle" }, { "patch_dir": "src/electron/patches/ReactiveObjC", "repo": "src/third_party/squirrel.mac/vendor/ReactiveObjC" }, { "patch_dir": "src/electron/patches/webrtc", "repo": "src/third_party/webrtc" }, - { "patch_dir": "src/electron/patches/reclient-configs", "repo": "src/third_party/engflow-reclient-configs" } + { "patch_dir": "src/electron/patches/reclient-configs", "repo": "src/third_party/engflow-reclient-configs" }, + { "patch_dir": "src/electron/patches/sqlite", "repo": "src/third_party/sqlite/src" } ] diff --git a/patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch b/patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch index b7fd012a53..7c1fa8c265 100644 --- a/patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch +++ b/patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch @@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer patching legacy devtools code. diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts -index 978092dea5d6c1a62807f2454c359ff9780d4d92..53d57818eb7dc41d02a3d004716ed114ac3bc526 100644 +index 833e2d339699018a6baceeca85439fa9611be300..6b726a61b4746fa255d3082ebf0f4ca9502e1cb2 100644 --- a/front_end/entrypoints/main/MainImpl.ts +++ b/front_end/entrypoints/main/MainImpl.ts -@@ -767,6 +767,8 @@ export class MainImpl { +@@ -777,6 +777,8 @@ export class MainImpl { globalThis.Main = globalThis.Main || {}; // @ts-ignore Exported for Tests.js globalThis.Main.Main = MainImpl; diff --git a/patches/node/.patches b/patches/node/.patches index abdfda54fa..1394c2d7bc 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -21,37 +21,24 @@ enable_crashpad_linux_node_processes.patch fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch chore_expose_importmoduledynamically_and.patch test_formally_mark_some_tests_as_flaky.patch -fix_adapt_debugger_tests_for_upstream_v8_changes.patch -chore_remove_--no-harmony-atomics_related_code.patch -fix_account_for_createexternalizablestring_v8_global.patch fix_do_not_resolve_electron_entrypoints.patch ci_ensure_node_tests_set_electron_run_as_node.patch fix_assert_module_in_the_renderer_process.patch -fix_add_trusted_space_and_trusted_lo_space_to_the_v8_heap.patch -win_process_avoid_assert_after_spawning_store_app_4152.patch -chore_remove_use_of_deprecated_kmaxlength.patch -src_update_default_v8_platform_to_override_functions_with_location.patch fix_capture_embedder_exceptions_before_entering_v8.patch -spec_add_iterator_to_global_intrinsics.patch test_make_test-node-output-v8-warning_generic.patch -test_match_wpt_streams_transferable_transform-stream-members_any_js.patch fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch -deprecate_vector_v8_local_in_v8.patch fix_remove_deprecated_errno_constants.patch build_enable_perfetto.patch fix_add_source_location_for_v8_task_runner.patch -cherry-pick_src_remove_calls_to_recently_deprecated_v8_apis.patch -src_do_not_use_deprecated_v8_api.patch -src_use_new_v8_api_to_define_stream_accessor.patch src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch test_update_v8-stats_test_for_v8_12_6.patch src_do_not_use_soon-to-be-deprecated_v8_api.patch -fix_add_property_query_interceptors.patch src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch -src_use_supported_api_to_get_stalled_tla_messages.patch build_don_t_redefine_win32_lean_and_mean.patch build_compile_with_c_20_support.patch add_v8_taskpirority_to_foreground_task_runner_signature.patch cli_remove_deprecated_v8_flag.patch build_restore_clang_as_default_compiler_on_macos.patch -esm_drop_support_for_import_assertions.patch +fix_-wextra-semi_errors_in_nghttp2_helper_h.patch +fix_remove_harmony-import-assertions_from_node_cc.patch +win_almost_fix_race_detecting_esrch_in_uv_kill.patch diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 1cb0332f0c..1fc6f58658 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -10,1268 +10,58 @@ however those files were cherry-picked from main branch and do not really in 20/21. We have to wait until 22 is released to be able to build with upstream GN files. -diff --git a/BUILD.gn b/BUILD.gn -index 1ed186b597eece7c34cb69c8e1e20870555a040d..e36168f0a051ca2fa2fc024aadcf5375b860105e 100644 ---- a/BUILD.gn -+++ b/BUILD.gn -@@ -1,14 +1,406 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+import("//v8/gni/v8.gni") -+import("//electron/js2c_toolchain.gni") -+import("electron_node.gni") +diff --git a/deps/ncrypto/ncrypto.h b/deps/ncrypto/ncrypto.h +index 60bfce3ea8999e8e145aaf8cd14f0fdf21ed9c54..661c996889d0a89c1c38658a0933fcf5e3cdc1b9 100644 +--- a/deps/ncrypto/ncrypto.h ++++ b/deps/ncrypto/ncrypto.h +@@ -400,17 +400,21 @@ public: + UNABLE_TO_CHECK_GENERATOR = DH_UNABLE_TO_CHECK_GENERATOR, + NOT_SUITABLE_GENERATOR = DH_NOT_SUITABLE_GENERATOR, + Q_NOT_PRIME = DH_CHECK_Q_NOT_PRIME, ++#ifndef OPENSSL_IS_BORINGSSL + INVALID_Q = DH_CHECK_INVALID_Q_VALUE, + INVALID_J = DH_CHECK_INVALID_J_VALUE, ++#endif + CHECK_FAILED = 512, + }; + CheckResult check(); --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+declare_args() { -+ # Enable the V8 inspector protocol for use with node. -+ node_enable_inspector = true - --import("unofficial.gni") -+ # Build node with SSL support. -+ # The variable is called "openssl" for parity with node's GYP build. -+ node_use_openssl = true - --node_gn_build("node") { -+ # Use the specified path to system CA (PEM format) in addition to -+ # the BoringSSL supplied CA store or compiled-in Mozilla CA copy. -+ node_openssl_system_ca_path = "" -+ -+ # Initialize v8 platform during node.js startup. -+ # NB. this must be turned off in Electron, because Electron initializes the -+ # v8 platform itself. -+ node_use_v8_platform = false -+ -+ # Build with DTrace support. -+ node_use_dtrace = false -+ -+ # Build with ETW support. -+ node_use_etw = false -+ -+ # Build JavaScript in lib/ with DCHECK macros. -+ node_debug_lib = false -+ -+ # Custom build tag. -+ node_tag = "" -+ -+ # V8 options to pass, see `node --v8-options` for examples -+ node_v8_options = "" -+ -+ # Provide a custom URL prefix for the `process.release` properties -+ # `sourceUrl` and `headersUrl`. When compiling a release build, this will -+ # default to https://nodejs.org/download/release/') -+ node_release_urlbase = "" -+ -+ # Allows downstream packagers (eg. Linux distributions) to build Electron against system shared libraries. -+ use_system_cares = false -+ use_system_nghttp2 = false -+ use_system_llhttp = false -+ use_system_histogram = false -+} -+ -+if (is_linux) { -+ import("//build/config/linux/pkg_config.gni") -+ if (use_system_cares) { -+ pkg_config("cares") { -+ packages = [ "libcares" ] -+ } -+ } -+ if (use_system_nghttp2) { -+ pkg_config("nghttp2") { -+ packages = [ "libnghttp2" ] -+ } -+ } -+} -+ -+assert(!node_use_dtrace, "node_use_dtrace not supported in GN") -+assert(!node_use_etw, "node_use_etw not supported in GN") -+ -+assert(!node_enable_inspector || node_use_openssl, -+ "node_enable_inspector requires node_use_openssl") -+ -+config("node_internals") { -+ defines = [ "NODE_WANT_INTERNALS=1" ] -+} -+ -+node_files = read_file("filenames.json", "json") -+library_files = node_files.library_files -+fs_files = node_files.fs_files -+original_fs_files = [] -+foreach(file, fs_files) { -+ original_fs_files += [string_replace(string_replace(string_replace(file, "internal/fs/", "internal/original-fs/"), "lib/fs.js", "lib/original-fs.js"), "lib/fs/", "lib/original-fs/")] -+} -+ -+copy("node_js2c_inputs") { -+ sources = library_files -+ outputs = [ -+ "$target_gen_dir/js2c_inputs/{{source_target_relative}}", -+ ] -+} -+ -+action("node_js2c_original_fs") { -+ script = "//electron/script/node/generate_original_fs.py" -+ inputs = fs_files -+ outputs = [] -+ foreach(file, fs_files + original_fs_files) { -+ outputs += ["$target_gen_dir/js2c_inputs/$file"] -+ } -+ -+ args = [rebase_path("$target_gen_dir/js2c_inputs")] + fs_files -+} -+ -+action("node_js2c_exec") { -+ deps = [ -+ "//electron:generate_config_gypi", -+ ":node_js2c_original_fs", -+ ":node_js2c_inputs", -+ ":node_js2c($electron_js2c_toolchain)" -+ ] -+ config_gypi = [ "$root_gen_dir/config.gypi" ] -+ inputs = library_files + get_target_outputs(":node_js2c_original_fs") + config_gypi -+ outputs = [ -+ "$target_gen_dir/node_javascript.cc", -+ ] -+ -+ script = "//electron/build/run-in-dir.py" -+ out_dir = get_label_info(":anything($electron_js2c_toolchain)", "root_out_dir") -+ args = [ rebase_path("$target_gen_dir/js2c_inputs"), rebase_path("$out_dir/node_js2c") ] + -+ rebase_path(outputs) + library_files + fs_files + original_fs_files + rebase_path(config_gypi) -+} -+ -+config("node_features") { -+ defines = [] -+ if (node_enable_inspector) { -+ defines += [ "HAVE_INSPECTOR=1" ] -+ } else { -+ defines += [ "HAVE_INSPECTOR=0" ] -+ } -+ if (node_use_openssl) { -+ defines += [ "HAVE_OPENSSL=1" ] -+ } else { -+ defines += [ "HAVE_OPENSSL=0" ] -+ } -+ if (v8_enable_i18n_support) { -+ defines += [ "NODE_HAVE_I18N_SUPPORT=1" ] -+ } else { -+ defines += [ "NODE_HAVE_I18N_SUPPORT=0" ] -+ } -+ if (node_use_v8_platform) { -+ defines += [ "NODE_USE_V8_PLATFORM=1" ] -+ } else { -+ defines += [ "NODE_USE_V8_PLATFORM=0" ] -+ } -+} -+ -+config("node_lib_config") { -+ include_dirs = [ "src" ] -+ -+ cflags = [ -+ "-Wno-shadow", -+ # FIXME(deepak1556): include paths should be corrected, -+ # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702 -+ "-Wno-microsoft-include", -+ ] -+ -+ configs = [ ":node_features" ] -+ -+ if (is_debug) { -+ defines = [ "DEBUG" ] -+ } -+} -+ -+config("node_internal_config") { -+ visibility = [ -+ ":*", -+ "src/inspector:*", -+ ] -+ defines = [ -+ "NODE_WANT_INTERNALS=1", -+ "NODE_IMPLEMENTATION", -+ ] -+ if (node_module_version != "") { -+ defines += [ "NODE_EMBEDDER_MODULE_VERSION=" + node_module_version ] -+ } -+ if (is_component_build) { -+ defines += [ -+ "NODE_SHARED_MODE", + enum class CheckPublicKeyResult { + NONE, ++ #ifndef OPENSSL_IS_BORINGSSL + TOO_SMALL = DH_R_CHECK_PUBKEY_TOO_SMALL, + TOO_LARGE = DH_R_CHECK_PUBKEY_TOO_LARGE, + INVALID = DH_R_CHECK_PUBKEY_INVALID, ++ #endif + CHECK_FAILED = 512, + }; + // Check to see if the given public key is suitable for this DH instance. +diff --git a/deps/sqlite/unofficial.gni b/deps/sqlite/unofficial.gni +index ebb3ffcd6d42b4c16b6865a91ccf4428cffe864b..00225afa1fb4205f1e02d9f185aeb97d642b3fd9 100644 +--- a/deps/sqlite/unofficial.gni ++++ b/deps/sqlite/unofficial.gni +@@ -18,8 +18,14 @@ template("sqlite_gn_build") { + forward_variables_from(invoker, "*") + public_configs = [ ":sqlite_config" ] + sources = gypi_values.sqlite_sources ++ cflags_c = [ ++ "-Wno-implicit-fallthrough", ++ "-Wno-unreachable-code-break", ++ "-Wno-unreachable-code-return", ++ "-Wno-unreachable-code", + ] -+ } -+ -+ if (target_cpu == "x86") { -+ node_arch = "ia32" -+ } else { -+ node_arch = target_cpu -+ } -+ defines += [ "NODE_ARCH=\"$node_arch\"" ] -+ -+ if (target_os == "win") { -+ node_platform = "win32" -+ } else if (target_os == "mac") { -+ node_platform = "darwin" -+ } else { -+ node_platform = target_os -+ } -+ defines += [ "NODE_PLATFORM=\"$node_platform\"" ] -+ -+ if (is_win) { -+ defines += [ -+ "NOMINMAX", -+ "_UNICODE=1", -+ ] -+ } else { -+ defines += [ "__POSIX__" ] -+ } -+ -+ if (node_tag != "") { -+ defines += [ "NODE_TAG=\"$node_tag\"" ] -+ } -+ if (node_v8_options != "") { -+ defines += [ "NODE_V8_OPTIONS=\"$node_v8_options\"" ] -+ } -+ if (node_release_urlbase != "") { -+ defines += [ "NODE_RELEASE_URLBASE=\"$node_release_urlbase\"" ] -+ } -+ -+ if (node_use_openssl) { -+ defines += [ -+ "NODE_OPENSSL_SYSTEM_CERT_PATH=\"$node_openssl_system_ca_path\"", -+ "EVP_CTRL_CCM_SET_TAG=EVP_CTRL_GCM_SET_TAG", -+ ] -+ } -+} -+ -+executable("overlapped-checker") { -+ sources = [] -+ if (is_win) { -+ sources += [ "test/overlapped-checker/main_win.c" ] -+ } else { -+ sources += [ "test/overlapped-checker/main_unix.c" ] -+ } -+} -+ -+if (current_toolchain == electron_js2c_toolchain) { -+ executable("node_js2c") { -+ defines = [] -+ sources = [ -+ "tools/js2c.cc", -+ "tools/executable_wrapper.h", -+ "src/embedded_data.cc", -+ "src/embedded_data.h", -+ ] -+ include_dirs = [ "tools", "src" ] -+ deps = [ -+ "deps/simdutf($electron_js2c_toolchain)", -+ "deps/uv($electron_js2c_toolchain)", -+ "//v8" -+ ] -+ -+ if (!is_win) { -+ defines += [ "NODE_JS2C_USE_STRING_LITERALS" ] -+ } -+ if (is_debug) { -+ cflags_cc = [ "-g", "-O0" ] -+ defines += [ "DEBUG" ] -+ } -+ } -+} -+ -+component("node_lib") { -+ deps = [ -+ ":node_js2c_exec", -+ "deps/googletest:gtest", -+ "deps/ada", -+ "deps/base64", -+ "deps/simdutf", -+ "deps/uvwasi", -+ "//third_party/zlib", -+ "//third_party/brotli:dec", -+ "//third_party/brotli:enc", -+ "//v8:v8_libplatform", -+ ] -+ if (use_system_cares) { -+ configs += [ ":cares" ] -+ } else { -+ deps += [ "deps/cares" ] -+ } -+ if (use_system_nghttp2) { -+ configs += [ ":nghttp2" ] -+ } else { -+ deps += [ "deps/nghttp2" ] -+ } -+ public_deps = [ -+ "deps/uv", -+ "//electron:electron_js2c", -+ "//v8", -+ ] -+ configs += [ ":node_internal_config" ] -+ public_configs = [ ":node_lib_config" ] -+ include_dirs = [ -+ "src", -+ "deps/postject" -+ ] -+ libs = [] -+ if (use_system_llhttp) { -+ libs += [ "llhttp" ] -+ } else { -+ deps += [ "deps/llhttp" ] -+ } -+ if (use_system_histogram) { -+ libs += [ "hdr_histogram" ] -+ include_dirs += [ "/usr/include/hdr" ] -+ } else { -+ deps += [ "deps/histogram" ] -+ } -+ frameworks = [] -+ cflags_cc = [ -+ "-Wno-deprecated-declarations", -+ "-Wno-implicit-fallthrough", -+ "-Wno-return-type", -+ "-Wno-sometimes-uninitialized", -+ "-Wno-string-plus-int", -+ "-Wno-unused-function", -+ "-Wno-unused-label", -+ "-Wno-unused-private-field", -+ "-Wno-unused-variable", -+ ] -+ -+ if (v8_enable_i18n_support) { -+ deps += [ "//third_party/icu" ] -+ } -+ -+ sources = node_files.node_sources -+ sources += [ -+ "$root_gen_dir/electron_natives.cc", -+ "$target_gen_dir/node_javascript.cc", -+ "src/node_snapshot_stub.cc", -+ ] -+ -+ if (is_win) { -+ libs += [ "psapi.lib" ] -+ } -+ if (is_mac) { -+ frameworks += [ "CoreFoundation.framework" ] -+ } -+ -+ if (node_enable_inspector) { -+ sources += [ -+ "src/inspector_agent.cc", -+ "src/inspector_agent.h", -+ "src/inspector_io.cc", -+ "src/inspector_io.h", -+ "src/inspector_js_api.cc", -+ "src/inspector_profiler.cc", -+ "src/inspector_socket.cc", -+ "src/inspector_socket.h", -+ "src/inspector_socket_server.cc", -+ "src/inspector_socket_server.h", -+ ] -+ deps += [ "src/inspector" ] -+ } -+ -+ if (node_use_openssl) { -+ deps += [ "//third_party/boringssl" ] -+ sources += [ -+ "src/crypto/crypto_aes.cc", -+ "src/crypto/crypto_aes.h", -+ "src/crypto/crypto_bio.cc", -+ "src/crypto/crypto_bio.h", -+ "src/crypto/crypto_cipher.cc", -+ "src/crypto/crypto_cipher.h", -+ "src/crypto/crypto_clienthello-inl.h", -+ "src/crypto/crypto_clienthello.cc", -+ "src/crypto/crypto_clienthello.h", -+ "src/crypto/crypto_common.cc", -+ "src/crypto/crypto_common.h", -+ "src/crypto/crypto_context.cc", -+ "src/crypto/crypto_context.h", -+ "src/crypto/crypto_dh.cc", -+ "src/crypto/crypto_dh.h", -+ "src/crypto/crypto_dsa.cc", -+ "src/crypto/crypto_dsa.h", -+ "src/crypto/crypto_ec.cc", -+ "src/crypto/crypto_ec.h", -+ "src/crypto/crypto_groups.h", -+ "src/crypto/crypto_hash.cc", -+ "src/crypto/crypto_hash.h", -+ "src/crypto/crypto_hkdf.cc", -+ "src/crypto/crypto_hkdf.h", -+ "src/crypto/crypto_hmac.cc", -+ "src/crypto/crypto_hmac.h", -+ "src/crypto/crypto_keygen.cc", -+ "src/crypto/crypto_keygen.h", -+ "src/crypto/crypto_keys.cc", -+ "src/crypto/crypto_keys.h", -+ "src/crypto/crypto_pbkdf2.cc", -+ "src/crypto/crypto_pbkdf2.h", -+ "src/crypto/crypto_random.cc", -+ "src/crypto/crypto_random.h", -+ "src/crypto/crypto_rsa.cc", -+ "src/crypto/crypto_rsa.h", -+ "src/crypto/crypto_scrypt.cc", -+ "src/crypto/crypto_scrypt.h", -+ "src/crypto/crypto_sig.cc", -+ "src/crypto/crypto_sig.h", -+ "src/crypto/crypto_spkac.cc", -+ "src/crypto/crypto_spkac.h", -+ "src/crypto/crypto_timing.cc", -+ "src/crypto/crypto_timing.h", -+ "src/crypto/crypto_tls.cc", -+ "src/crypto/crypto_tls.h", -+ "src/crypto/crypto_util.cc", -+ "src/crypto/crypto_util.h", -+ "src/crypto/crypto_x509.cc", -+ "src/crypto/crypto_x509.h", -+ "src/node_crypto.cc", -+ "src/node_crypto.h", -+ ] -+ cflags_cc += [ "-Wno-sign-compare" ] -+ } - } -diff --git a/deps/ada/BUILD.gn b/deps/ada/BUILD.gn -index e92ac3a3beac143dced2efb05304ed8ba832b067..1ce69e9deba1a9b191e8d95f4c82e0ec1f7b50ca 100644 ---- a/deps/ada/BUILD.gn -+++ b/deps/ada/BUILD.gn -@@ -1,14 +1,12 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+import("//v8/gni/v8.gni") - --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+config("ada_config") { -+ include_dirs = [ "." ] -+} - --import("unofficial.gni") -+static_library("ada") { -+ include_dirs = [ "." ] -+ sources = [ "ada.cpp" ] - --ada_gn_build("ada") { -+ public_configs = [ ":ada_config" ] - } -diff --git a/deps/base64/unofficial.gni b/deps/base64/unofficial.gni -index 0e69d7383762f6b81c5b57698aa9d121d5a9c401..35bbeb37acc7ccb14b4b8a644ec3d4c76ca5c61c 100644 ---- a/deps/base64/unofficial.gni -+++ b/deps/base64/unofficial.gni -@@ -12,6 +12,10 @@ template("base64_gn_build") { - } - } - -+ # FIXME(zcbenz): ASM on win/x86 compiles perfectly in upstream Node, figure -+ # out why it does not work in Electron's build configs. -+ support_x86_asm = current_cpu == "x64" || (current_cpu == "x86" && !is_win) -+ - config("base64_internal_config") { - include_dirs = [ "base64/lib" ] - if (is_component_build) { -@@ -19,7 +23,7 @@ template("base64_gn_build") { - } else { - defines = [] - } -- if (current_cpu == "x86" || current_cpu == "x64") { -+ if (support_x86_asm) { - defines += [ - "HAVE_SSSE3=1", - "HAVE_SSE41=1", -@@ -69,7 +73,7 @@ template("base64_gn_build") { - source_set("base64_ssse3") { - configs += [ ":base64_internal_config" ] - sources = [ "base64/lib/arch/ssse3/codec.c" ] -- if (current_cpu == "x86" || current_cpu == "x64") { -+ if (support_x86_asm) { - if (is_clang || !is_win) { - cflags_c = [ "-mssse3" ] - } -@@ -79,7 +83,7 @@ template("base64_gn_build") { - source_set("base64_sse41") { - configs += [ ":base64_internal_config" ] - sources = [ "base64/lib/arch/sse41/codec.c" ] -- if (current_cpu == "x86" || current_cpu == "x64") { -+ if (support_x86_asm) { - if (is_clang || !is_win) { - cflags_c = [ "-msse4.1" ] - } -@@ -89,7 +93,7 @@ template("base64_gn_build") { - source_set("base64_sse42") { - configs += [ ":base64_internal_config" ] - sources = [ "base64/lib/arch/sse42/codec.c" ] -- if (current_cpu == "x86" || current_cpu == "x64") { -+ if (support_x86_asm) { - if (is_clang || !is_win) { - cflags_c = [ "-msse4.2" ] - } -@@ -99,7 +103,7 @@ template("base64_gn_build") { - source_set("base64_avx") { - configs += [ ":base64_internal_config" ] - sources = [ "base64/lib/arch/avx/codec.c" ] -- if (current_cpu == "x86" || current_cpu == "x64") { -+ if (support_x86_asm) { - if (is_clang || !is_win) { - cflags_c = [ "-mavx" ] - } else if (is_win) { -@@ -111,7 +115,7 @@ template("base64_gn_build") { - source_set("base64_avx2") { - configs += [ ":base64_internal_config" ] - sources = [ "base64/lib/arch/avx2/codec.c" ] -- if (current_cpu == "x86" || current_cpu == "x64") { -+ if (support_x86_asm) { - if (is_clang || !is_win) { - cflags_c = [ "-mavx2" ] - } else if (is_win) { -@@ -123,7 +127,7 @@ template("base64_gn_build") { - source_set("base64_avx512") { - configs += [ ":base64_internal_config" ] - sources = [ "base64/lib/arch/avx512/codec.c" ] -- if (current_cpu == "x86" || current_cpu == "x64") { -+ if (support_x86_asm) { - if (is_clang || !is_win) { - cflags_c = [ - "-mavx512vl", -diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn -index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..7f4885631a85a25692e8969991951be02e5d73f1 100644 ---- a/deps/cares/BUILD.gn -+++ b/deps/cares/BUILD.gn -@@ -1,14 +1,175 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+config("cares_config") { -+ include_dirs = [ "include", "src/lib" ] -+} -+static_library("cares") { -+ defines = [ "CARES_STATICLIB" ] -+ include_dirs = [ "include" ] -+ public_configs = [ ":cares_config" ] -+ -+ libs = [] -+ cflags_c = [ -+ "-Wno-logical-not-parentheses", -+ "-Wno-implicit-fallthrough", -+ "-Wno-sign-compare", -+ ] -+ -+ sources = [ -+ "include/ares.h", -+ "include/ares_dns.h", -+ "include/ares_dns_record.h", -+ "include/ares_nameser.h", -+ "include/ares_version.h", -+ "src/lib/ares__addrinfo2hostent.c", -+ "src/lib/ares__addrinfo_localhost.c", -+ "src/lib/ares__close_sockets.c", -+ "src/lib/ares__hosts_file.c", -+ "src/lib/ares__parse_into_addrinfo.c", -+ "src/lib/ares__socket.c", -+ "src/lib/ares__sortaddrinfo.c", -+ "src/lib/ares_android.c", -+ "src/lib/ares_android.h", -+ "src/lib/ares_cancel.c", -+ "src/lib/ares_cookie.c", -+ "src/lib/ares_data.c", -+ "src/lib/ares_data.h", -+ "src/lib/ares_destroy.c", -+ "src/lib/ares_free_hostent.c", -+ "src/lib/ares_free_string.c", -+ "src/lib/ares_freeaddrinfo.c", -+ "src/lib/ares_getaddrinfo.c", -+ "src/lib/ares_getenv.c", -+ "src/lib/ares_getenv.h", -+ "src/lib/ares_gethostbyaddr.c", -+ "src/lib/ares_gethostbyname.c", -+ "src/lib/ares_getnameinfo.c", -+ "src/lib/ares_inet_net_pton.h", -+ "src/lib/ares_init.c", -+ "src/lib/ares_ipv6.h", -+ "src/lib/ares_library_init.c", -+ "src/lib/ares_metrics.c", -+ "src/lib/ares_options.c", -+ "src/lib/ares_platform.c", -+ "src/lib/ares_platform.h", -+ "src/lib/ares_private.h", -+ "src/lib/ares_process.c", -+ "src/lib/ares_qcache.c", -+ "src/lib/ares_query.c", -+ "src/lib/ares_search.c", -+ "src/lib/ares_send.c", -+ "src/lib/ares_setup.h", -+ "src/lib/ares_strerror.c", -+ "src/lib/ares_sysconfig.c", -+ "src/lib/ares_sysconfig_files.c", -+ "src/lib/ares_timeout.c", -+ "src/lib/ares_update_servers.c", -+ "src/lib/ares_version.c", -+ "src/lib/dsa/ares__array.c", -+ "src/lib/dsa/ares__array.h", -+ "src/lib/dsa/ares__htable.c", -+ "src/lib/dsa/ares__htable.h", -+ "src/lib/dsa/ares__htable_asvp.c", -+ "src/lib/dsa/ares__htable_asvp.h", -+ "src/lib/dsa/ares__htable_strvp.c", -+ "src/lib/dsa/ares__htable_strvp.h", -+ "src/lib/dsa/ares__htable_szvp.c", -+ "src/lib/dsa/ares__htable_szvp.h", -+ "src/lib/dsa/ares__htable_vpvp.c", -+ "src/lib/dsa/ares__htable_vpvp.h", -+ "src/lib/dsa/ares__llist.c", -+ "src/lib/dsa/ares__llist.h", -+ "src/lib/dsa/ares__slist.c", -+ "src/lib/dsa/ares__slist.h", -+ "src/lib/event/ares_event.h", -+ "src/lib/event/ares_event_configchg.c", -+ "src/lib/event/ares_event_epoll.c", -+ "src/lib/event/ares_event_kqueue.c", -+ "src/lib/event/ares_event_poll.c", -+ "src/lib/event/ares_event_select.c", -+ "src/lib/event/ares_event_thread.c", -+ "src/lib/event/ares_event_wake_pipe.c", -+ "src/lib/event/ares_event_win32.c", -+ "src/lib/event/ares_event_win32.h", -+ "src/lib/inet_net_pton.c", -+ "src/lib/inet_ntop.c", -+ "src/lib/legacy/ares_create_query.c", -+ "src/lib/legacy/ares_expand_name.c", -+ "src/lib/legacy/ares_expand_string.c", -+ "src/lib/legacy/ares_fds.c", -+ "src/lib/legacy/ares_getsock.c", -+ "src/lib/legacy/ares_parse_a_reply.c", -+ "src/lib/legacy/ares_parse_aaaa_reply.c", -+ "src/lib/legacy/ares_parse_caa_reply.c", -+ "src/lib/legacy/ares_parse_mx_reply.c", -+ "src/lib/legacy/ares_parse_naptr_reply.c", -+ "src/lib/legacy/ares_parse_ns_reply.c", -+ "src/lib/legacy/ares_parse_ptr_reply.c", -+ "src/lib/legacy/ares_parse_soa_reply.c", -+ "src/lib/legacy/ares_parse_srv_reply.c", -+ "src/lib/legacy/ares_parse_txt_reply.c", -+ "src/lib/legacy/ares_parse_uri_reply.c", -+ "src/lib/record/ares_dns_mapping.c", -+ "src/lib/record/ares_dns_multistring.c", -+ "src/lib/record/ares_dns_multistring.h", -+ "src/lib/record/ares_dns_name.c", -+ "src/lib/record/ares_dns_parse.c", -+ "src/lib/record/ares_dns_private.h", -+ "src/lib/record/ares_dns_record.c", -+ "src/lib/record/ares_dns_write.c", -+ "src/lib/str/ares__buf.c", -+ "src/lib/str/ares__buf.h", -+ "src/lib/str/ares_str.c", -+ "src/lib/str/ares_str.h", -+ "src/lib/str/ares_strcasecmp.c", -+ "src/lib/str/ares_strcasecmp.h", -+ "src/lib/str/ares_strsplit.c", -+ "src/lib/str/ares_strsplit.h", -+ "src/lib/util/ares__iface_ips.c", -+ "src/lib/util/ares__iface_ips.h", -+ "src/lib/util/ares__threads.c", -+ "src/lib/util/ares__threads.h", -+ "src/lib/util/ares__timeval.c", -+ "src/lib/util/ares_math.c", -+ "src/lib/util/ares_rand.c", -+ "src/tools/ares_getopt.c", -+ "src/tools/ares_getopt.h", -+ ] -+ -+ if (!is_win) { -+ defines += [ -+ "_DARWIN_USE_64_BIT_INODE=1", -+ "_LARGEFILE_SOURCE", -+ "_FILE_OFFSET_BITS=64", -+ "_GNU_SOURCE", -+ ] -+ } - --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+ if (is_win) { -+ defines += [ "CARES_PULL_WS2TCPIP_H=1" ] -+ include_dirs += [ "config/win32" ] -+ sources += [ -+ "src/lib/ares_sysconfig_win.c", -+ "src/lib/config-win32.h", -+ "src/lib/windows_port.c", -+ ] -+ libs += [ -+ "ws2_32.lib", -+ "iphlpapi.lib", -+ ] -+ } else { -+ defines += [ "HAVE_CONFIG_H" ] -+ } - --import("unofficial.gni") -+ if (is_linux) { -+ include_dirs += [ "config/linux" ] -+ sources += [ "config/linux/ares_config.h" ] -+ } - --cares_gn_build("cares") { -+ if (is_mac) { -+ include_dirs += [ "config/darwin" ] -+ sources += [ -+ "config/darwin/ares_config.h", -+ "src/lib/ares_sysconfig_mac.c", -+ "src/lib/thirdparty/apple/dnsinfo.h", -+ ] -+ } - } -diff --git a/deps/googletest/BUILD.gn b/deps/googletest/BUILD.gn -index de13f3f653b5d53610f4611001c10dce332293c2..0daf8c006cef89e76d7eccec3e924bd2718021c9 100644 ---- a/deps/googletest/BUILD.gn -+++ b/deps/googletest/BUILD.gn -@@ -1,14 +1,64 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+config("gtest_config") { -+ include_dirs = [ "include" ] -+ defines = [ "UNIT_TEST" ] -+} -+ -+static_library("gtest") { -+ include_dirs = [ -+ "include", -+ "." # src -+ ] -+ -+ public_configs = [ ":gtest_config" ] - --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+ cflags_cc = [ -+ "-Wno-c++98-compat-extra-semi", -+ "-Wno-unused-const-variable", -+ "-Wno-unreachable-code-return", -+ ] - --import("unofficial.gni") -+ defines = [ -+ "GTEST_HAS_POSIX_RE=0", -+ "GTEST_LANG_CXX11=1", -+ ] -+ -+ sources = [ -+ "include/gtest/gtest_pred_impl.h", -+ "include/gtest/gtest_prod.h", -+ "include/gtest/gtest-death-test.h", -+ "include/gtest/gtest-matchers.h", -+ "include/gtest/gtest-message.h", -+ "include/gtest/gtest-param-test.h", -+ "include/gtest/gtest-printers.h", -+ "include/gtest/gtest-spi.h", -+ "include/gtest/gtest-test-part.h", -+ "include/gtest/gtest-typed-test.h", -+ "include/gtest/gtest.h", -+ "include/gtest/internal/gtest-death-test-internal.h", -+ "include/gtest/internal/gtest-filepath.h", -+ "include/gtest/internal/gtest-internal.h", -+ "include/gtest/internal/gtest-param-util.h", -+ "include/gtest/internal/gtest-port-arch.h", -+ "include/gtest/internal/gtest-port.h", -+ "include/gtest/internal/gtest-string.h", -+ "include/gtest/internal/gtest-type-util.h", -+ "include/gtest/internal/custom/gtest-port.h", -+ "include/gtest/internal/custom/gtest-printers.h", -+ "include/gtest/internal/custom/gtest.h", -+ "src/gtest-all.cc", -+ "src/gtest-death-test.cc", -+ "src/gtest-filepath.cc", -+ "src/gtest-internal-inl.h", -+ "src/gtest-matchers.cc", -+ "src/gtest-port.cc", -+ "src/gtest-printers.cc", -+ "src/gtest-test-part.cc", -+ "src/gtest-typed-test.cc", -+ "src/gtest.cc", -+ ] -+} - --googletest_gn_build("googletest") { -+static_library("gtest_main") { -+ deps = [ ":gtest" ] -+ sources = [ "src/gtest_main.cc" ] - } -diff --git a/deps/histogram/BUILD.gn b/deps/histogram/BUILD.gn -index e2f3ee37137a6b7d45cbe79f8b9ba7f693ffc4d3..85467b372f01cf602af45fa2f0d599acabfc2310 100644 ---- a/deps/histogram/BUILD.gn -+++ b/deps/histogram/BUILD.gn -@@ -1,14 +1,19 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+config("histogram_config") { -+ include_dirs = [ "include" ] - --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+ cflags = [ -+ "-Wno-implicit-function-declaration", -+ "-Wno-incompatible-pointer-types", -+ "-Wno-unused-function", -+ "-Wno-atomic-alignment", -+ ] -+} - --import("unofficial.gni") -+static_library("histogram") { -+ public_configs = [ ":histogram_config" ] - --histogram_gn_build("histogram") { -+ sources = [ -+ "src/hdr_histogram.c", -+ "src/hdr_histogram.h", -+ ] - } -diff --git a/deps/llhttp/BUILD.gn b/deps/llhttp/BUILD.gn -index 64a2a4799d5530276f46aa1faa63ece063390ada..fb000f8ee7647c375bc190d1729d67bb7770d109 100644 ---- a/deps/llhttp/BUILD.gn -+++ b/deps/llhttp/BUILD.gn -@@ -1,14 +1,15 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -- --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -- --import("unofficial.gni") -+config("llhttp_config") { -+ include_dirs = [ "include" ] -+ cflags = [ "-Wno-unreachable-code" ] -+} - --llhttp_gn_build("llhttp") { -+static_library("llhttp") { -+ include_dirs = [ "include" ] -+ public_configs = [ ":llhttp_config" ] -+ cflags_c = [ "-Wno-implicit-fallthrough" ] -+ sources = [ -+ "src/api.c", -+ "src/http.c", -+ "src/llhttp.c", -+ ] - } -diff --git a/deps/nghttp2/BUILD.gn b/deps/nghttp2/BUILD.gn -index 274352b0e2449f8db49d9a49c6b92a69f97e8363..f04c7ca24af6cdbe8d739bcd55172110963888e9 100644 ---- a/deps/nghttp2/BUILD.gn -+++ b/deps/nghttp2/BUILD.gn -@@ -1,14 +1,51 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -- --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+config("nghttp2_config") { -+ defines = [ "NGHTTP2_STATICLIB" ] -+ include_dirs = [ "lib/includes" ] -+} -+static_library("nghttp2") { -+ public_configs = [ ":nghttp2_config" ] -+ defines = [ -+ "_U_", -+ "BUILDING_NGHTTP2", -+ "NGHTTP2_STATICLIB", -+ "HAVE_CONFIG_H", -+ ] -+ include_dirs = [ "lib/includes" ] - --import("unofficial.gni") -+ cflags_c = [ -+ "-Wno-implicit-function-declaration", -+ "-Wno-implicit-fallthrough", -+ "-Wno-string-plus-int", -+ "-Wno-unreachable-code-return", -+ "-Wno-unused-but-set-variable", -+ ] - --nghttp2_gn_build("nghttp2") { -+ sources = [ -+ "lib/nghttp2_buf.c", -+ "lib/nghttp2_callbacks.c", -+ "lib/nghttp2_debug.c", -+ "lib/nghttp2_extpri.c", -+ "lib/nghttp2_frame.c", -+ "lib/nghttp2_hd.c", -+ "lib/nghttp2_hd_huffman.c", -+ "lib/nghttp2_hd_huffman_data.c", -+ "lib/nghttp2_helper.c", -+ "lib/nghttp2_http.c", -+ "lib/nghttp2_map.c", -+ "lib/nghttp2_mem.c", -+ "lib/nghttp2_alpn.c", -+ "lib/nghttp2_option.c", -+ "lib/nghttp2_outbound_item.c", -+ "lib/nghttp2_pq.c", -+ "lib/nghttp2_priority_spec.c", -+ "lib/nghttp2_queue.c", -+ "lib/nghttp2_ratelim.c", -+ "lib/nghttp2_rcbuf.c", -+ "lib/nghttp2_session.c", -+ "lib/nghttp2_stream.c", -+ "lib/nghttp2_submit.c", -+ "lib/nghttp2_time.c", -+ "lib/nghttp2_version.c", -+ "lib/sfparse.c", -+ ] - } -diff --git a/deps/simdjson/BUILD.gn b/deps/simdjson/BUILD.gn -index d0580ccf354d2000fb0075fd3bb4579f93477927..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 ---- a/deps/simdjson/BUILD.gn -+++ b/deps/simdjson/BUILD.gn -@@ -1,14 +0,0 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -- --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -- --import("unofficial.gni") -- --simdjson_gn_build("simdjson") { --} -diff --git a/deps/simdutf/BUILD.gn b/deps/simdutf/BUILD.gn -index 119d49456911e99944294bd00b3f182a8f0e35b5..ce38c3633a228306622a7237067393d25332c59c 100644 ---- a/deps/simdutf/BUILD.gn -+++ b/deps/simdutf/BUILD.gn -@@ -1,14 +1,21 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+config("simdutf_config") { -+ include_dirs = [ "." ] -+} - --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+static_library("simdutf") { -+ include_dirs = [ "." ] -+ sources = [ -+ "simdutf.cpp", -+ ] - --import("unofficial.gni") -+ public_configs = [ ":simdutf_config" ] - --simdutf_gn_build("simdutf") { -+ cflags_cc = [ -+ "-Wno-ambiguous-reversed-operator", -+ "-Wno-c++98-compat-extra-semi", -+ "-Wno-unreachable-code", -+ "-Wno-unreachable-code-break", -+ "-Wno-unused-const-variable", -+ "-Wno-unused-function", -+ ] - } -diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn -index 8e6ac27048b5965e20f35c7a63e469beb6fa5970..7518168141db7958550c7f5dc1ed17ccdbbe4a60 100644 ---- a/deps/uv/BUILD.gn -+++ b/deps/uv/BUILD.gn -@@ -1,14 +1,194 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+config("libuv_config") { -+ include_dirs = [ "include" ] - --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+ defines = [] - --import("unofficial.gni") -+ if (is_linux) { -+ defines += [ "_POSIX_C_SOURCE=200112" ] -+ } -+ if (!is_win) { -+ defines += [ -+ "_LARGEFILE_SOURCE", -+ "_FILE_OFFSET_BITS=64", -+ ] -+ } -+ if (is_mac) { -+ defines += [ "_DARWIN_USE_64_BIT_INODE=1" ] -+ } -+} -+ -+static_library("uv") { -+ include_dirs = [ -+ "include", -+ "src", -+ ] -+ -+ public_configs = [ ":libuv_config" ] -+ -+ ldflags = [] -+ -+ defines = [] -+ -+ # This only has an effect on Windows, where it will cause libuv's symbols to be exported in node.lib -+ defines += [ "BUILDING_UV_SHARED=1" ] -+ -+ cflags_c = [ -+ "-Wno-incompatible-pointer-types", -+ "-Wno-bitwise-op-parentheses", -+ "-Wno-implicit-fallthrough", -+ "-Wno-implicit-function-declaration", -+ "-Wno-missing-braces", -+ "-Wno-sign-compare", -+ "-Wno-sometimes-uninitialized", -+ "-Wno-string-conversion", -+ "-Wno-switch", -+ "-Wno-unused-function", -+ "-Wno-unused-result", -+ "-Wno-unused-variable", -+ "-Wno-unreachable-code", -+ "-Wno-unreachable-code-return", -+ "-Wno-unused-but-set-variable", -+ "-Wno-shadow", -+ ] -+ -+ libs = [] -+ -+ sources = [ -+ "include/uv.h", -+ "include/uv/tree.h", -+ "include/uv/errno.h", -+ "include/uv/threadpool.h", -+ "include/uv/version.h", -+ "src/fs-poll.c", -+ "src/heap-inl.h", -+ "src/idna.c", -+ "src/idna.h", -+ "src/inet.c", -+ "src/queue.h", -+ "src/random.c", -+ "src/strscpy.c", -+ "src/strscpy.h", -+ "src/strtok.c", -+ "src/strtok.h", -+ "src/thread-common.c", -+ "src/threadpool.c", -+ "src/timer.c", -+ "src/uv-data-getter-setters.c", -+ "src/uv-common.c", -+ "src/uv-common.h", -+ "src/version.c", -+ ] -+ -+ if (is_win) { -+ defines += [ "_GNU_SOURCE" ] -+ sources += [ -+ "include/uv/win.h", -+ "src/win/async.c", -+ "src/win/atomicops-inl.h", -+ "src/win/core.c", -+ "src/win/detect-wakeup.c", -+ "src/win/dl.c", -+ "src/win/error.c", -+ "src/win/fs.c", -+ "src/win/fs-event.c", -+ "src/win/getaddrinfo.c", -+ "src/win/getnameinfo.c", -+ "src/win/handle.c", -+ "src/win/handle-inl.h", -+ "src/win/internal.h", -+ "src/win/loop-watcher.c", -+ "src/win/pipe.c", -+ "src/win/thread.c", -+ "src/win/poll.c", -+ "src/win/process.c", -+ "src/win/process-stdio.c", -+ "src/win/req-inl.h", -+ "src/win/signal.c", -+ "src/win/snprintf.c", -+ "src/win/stream.c", -+ "src/win/stream-inl.h", -+ "src/win/tcp.c", -+ "src/win/tty.c", -+ "src/win/udp.c", -+ "src/win/util.c", -+ "src/win/winapi.c", -+ "src/win/winapi.h", -+ "src/win/winsock.c", -+ "src/win/winsock.h", -+ ] - --uv_gn_build("uv") { -+ libs += [ -+ "advapi32.lib", -+ "iphlpapi.lib", -+ "psapi.lib", -+ "shell32.lib", -+ "user32.lib", -+ "userenv.lib", -+ "ws2_32.lib", -+ ] -+ } else { -+ sources += [ -+ "include/uv/unix.h", -+ "include/uv/linux.h", -+ "include/uv/sunos.h", -+ "include/uv/darwin.h", -+ "include/uv/bsd.h", -+ "include/uv/aix.h", -+ "src/unix/async.c", -+ "src/unix/core.c", -+ "src/unix/dl.c", -+ "src/unix/fs.c", -+ "src/unix/getaddrinfo.c", -+ "src/unix/getnameinfo.c", -+ "src/unix/internal.h", -+ "src/unix/loop.c", -+ "src/unix/loop-watcher.c", -+ "src/unix/pipe.c", -+ "src/unix/poll.c", -+ "src/unix/process.c", -+ "src/unix/random-devurandom.c", -+ "src/unix/signal.c", -+ "src/unix/stream.c", -+ "src/unix/tcp.c", -+ "src/unix/thread.c", -+ "src/unix/tty.c", -+ "src/unix/udp.c", -+ ] -+ libs += [ "m" ] -+ ldflags += [ "-pthread" ] -+ } -+ if (is_mac || is_linux) { -+ sources += [ "src/unix/proctitle.c" ] -+ } -+ if (is_mac) { -+ sources += [ -+ "src/unix/darwin-proctitle.c", -+ "src/unix/darwin.c", -+ "src/unix/fsevents.c", -+ "src/unix/random-getentropy.c", -+ ] -+ defines += [ -+ "_DARWIN_USE_64_BIT_INODE=1", -+ "_DARWIN_UNLIMITED_SELECT=1", -+ ] -+ } -+ if (is_linux) { -+ defines += [ "_GNU_SOURCE" ] -+ sources += [ -+ "src/unix/linux.c", -+ "src/unix/procfs-exepath.c", -+ "src/unix/random-getrandom.c", -+ "src/unix/random-sysctl-linux.c", -+ ] -+ libs += [ -+ "dl", -+ "rt", -+ ] -+ } -+ if (is_mac) { # is_bsd -+ sources += [ -+ "src/unix/bsd-ifaddrs.c", -+ "src/unix/kqueue.c", -+ ] -+ } - } -diff --git a/deps/uvwasi/BUILD.gn b/deps/uvwasi/BUILD.gn -index 4f8fb081df805a786e523e5f0ffbb0096fdeca99..d9fcf8dc972b1caa2b7a130b1144c685316035cd 100644 ---- a/deps/uvwasi/BUILD.gn -+++ b/deps/uvwasi/BUILD.gn -@@ -1,14 +1,39 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+config("uvwasi_config") { -+ include_dirs = [ "include" ] -+} -+ -+static_library("uvwasi") { -+ include_dirs = [ -+ "include", -+ "src", -+ ] -+ -+ defines = [] -+ if (is_linux) { -+ defines += [ -+ "_GNU_SOURCE", -+ "_POSIX_C_SOURCE=200112" -+ ] -+ } -+ -+ deps = [ "../../deps/uv" ] - --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+ public_configs = [ ":uvwasi_config" ] - --import("unofficial.gni") -+ cflags_c = [] -+ if (!is_win) { -+ cflags_c += [ "-fvisibility=hidden" ] -+ } - --uvwasi_gn_build("uvwasi") { -+ sources = [ -+ "src/clocks.c", -+ "src/fd_table.c", -+ "src/path_resolver.c", -+ "src/poll_oneoff.c", -+ "src/sync_helpers.c", -+ "src/uv_mapping.c", -+ "src/uvwasi.c", -+ "src/wasi_rights.c", -+ "src/wasi_serdes.c" -+ ] - } -diff --git a/electron_node.gni b/electron_node.gni -new file mode 100644 -index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1c4349223 ---- /dev/null -+++ b/electron_node.gni -@@ -0,0 +1,4 @@ -+declare_args() { -+ # Allows embedders to override the NODE_MODULE_VERSION define -+ node_module_version = "" -+} + if (is_win) { +- cflags_c = [ ++ cflags_c += [ + "-Wno-sign-compare", + "-Wno-unused-but-set-variable", + "-Wno-unused-function", diff --git a/filenames.json b/filenames.json new file mode 100644 -index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a607bb12f +index 0000000000000000000000000000000000000000..5af3886d8d3d74d31249a4d79030a8373b8dad52 --- /dev/null +++ b/filenames.json -@@ -0,0 +1,741 @@ +@@ -0,0 +1,756 @@ +// This file is automatically generated by generate_gn_filenames_json.py +// DO NOT EDIT +{ @@ -1279,6 +69,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/fs/cp/cp-sync.js", + "lib/internal/fs/cp/cp.js", + "lib/internal/fs/dir.js", ++ "lib/internal/fs/glob.js", + "lib/internal/fs/promises.js", + "lib/internal/fs/read/context.js", + "lib/internal/fs/recursive_watch.js", @@ -1481,7 +272,10 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/assert/assertion_error.js", + "lib/internal/assert/calltracker.js", + "lib/internal/assert/utils.js", ++ "lib/internal/async_context_frame.js", + "lib/internal/async_hooks.js", ++ "lib/internal/async_local_storage/async_context_frame.js", ++ "lib/internal/async_local_storage/async_hooks.js", + "lib/internal/blob.js", + "lib/internal/blocklist.js", + "lib/internal/bootstrap/node.js", @@ -1527,6 +321,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/crypto/webcrypto.js", + "lib/internal/crypto/webidl.js", + "lib/internal/crypto/x509.js", ++ "lib/internal/data_url.js", + "lib/internal/debugger/inspect.js", + "lib/internal/debugger/inspect_client.js", + "lib/internal/debugger/inspect_repl.js", @@ -1582,7 +377,6 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/modules/esm/loader.js", + "lib/internal/modules/esm/module_job.js", + "lib/internal/modules/esm/module_map.js", -+ "lib/internal/modules/esm/package_config.js", + "lib/internal/modules/esm/resolve.js", + "lib/internal/modules/esm/shared_constants.js", + "lib/internal/modules/esm/translators.js", @@ -1607,13 +401,11 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/perf/timerify.js", + "lib/internal/perf/usertiming.js", + "lib/internal/perf/utils.js", -+ "lib/internal/policy/manifest.js", -+ "lib/internal/policy/sri.js", + "lib/internal/priority_queue.js", + "lib/internal/process/execution.js", ++ "lib/internal/process/finalization.js", + "lib/internal/process/per_thread.js", + "lib/internal/process/permission.js", -+ "lib/internal/process/policy.js", + "lib/internal/process/pre_execution.js", + "lib/internal/process/promises.js", + "lib/internal/process/report.js", @@ -1637,6 +429,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/source_map/prepare_stack_trace.js", + "lib/internal/source_map/source_map.js", + "lib/internal/source_map/source_map_cache.js", ++ "lib/internal/source_map/source_map_cache_map.js", + "lib/internal/stream_base_commons.js", + "lib/internal/streams/add-abort-signal.js", + "lib/internal/streams/compose.js", @@ -1671,6 +464,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/test_runner/reporter/utils.js", + "lib/internal/test_runner/reporter/v8-serializer.js", + "lib/internal/test_runner/runner.js", ++ "lib/internal/test_runner/snapshot.js", + "lib/internal/test_runner/test.js", + "lib/internal/test_runner/tests_stream.js", + "lib/internal/test_runner/utils.js", @@ -1684,10 +478,8 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/util/colors.js", + "lib/internal/util/comparisons.js", + "lib/internal/util/debuglog.js", -+ "lib/internal/util/embedding.js", + "lib/internal/util/inspect.js", + "lib/internal/util/inspector.js", -+ "lib/internal/util/iterable_weak_map.js", + "lib/internal/util/parse_args/parse_args.js", + "lib/internal/util/parse_args/utils.js", + "lib/internal/util/types.js", @@ -1701,6 +493,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/watch_mode/files_watcher.js", + "lib/internal/watchdog.js", + "lib/internal/webidl.js", ++ "lib/internal/webstorage.js", + "lib/internal/webstreams/adapters.js", + "lib/internal/webstreams/compression.js", + "lib/internal/webstreams/encoding.js", @@ -1713,6 +506,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/internal/worker.js", + "lib/internal/worker/io.js", + "lib/internal/worker/js_transferable.js", ++ "lib/internal/worker/messaging.js", + "lib/module.js", + "lib/net.js", + "lib/os.js", @@ -1727,6 +521,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "lib/readline/promises.js", + "lib/repl.js", + "lib/sea.js", ++ "lib/sqlite.js", + "lib/stream.js", + "lib/stream/consumers.js", + "lib/stream/promises.js", @@ -1775,10 +570,12 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/api/exceptions.cc", + "src/api/hooks.cc", + "src/api/utils.cc", ++ "src/async_context_frame.cc", + "src/async_wrap.cc", + "src/base_object.cc", + "src/cares_wrap.cc", + "src/cleanup_queue.cc", ++ "src/compile_cache.cc", + "src/connect_wrap.cc", + "src/connection_wrap.cc", + "src/dataqueue/queue.cc", @@ -1812,6 +609,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/node_constants.cc", + "src/node_contextify.cc", + "src/node_credentials.cc", ++ "src/node_debug.cc", + "src/node_dir.cc", + "src/node_dotenv.cc", + "src/node_env_var.cc", @@ -1824,6 +622,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/node_main_instance.cc", + "src/node_messaging.cc", + "src/node_metadata.cc", ++ "src/node_modules.cc", + "src/node_options.cc", + "src/node_os.cc", + "src/node_perf.cc", @@ -1841,9 +640,11 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/node_shadow_realm.cc", + "src/node_snapshotable.cc", + "src/node_sockaddr.cc", ++ "src/node_sqlite.cc", + "src/node_stat_watcher.cc", + "src/node_symbols.cc", + "src/node_task_queue.cc", ++ "src/node_task_runner.cc", + "src/node_trace_events.cc", + "src/node_types.cc", + "src/node_url.cc", @@ -1852,6 +653,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/node_wasi.cc", + "src/node_wasm_web_api.cc", + "src/node_watchdog.cc", ++ "src/node_webstorage.cc", + "src/node_worker.cc", + "src/node_zlib.cc", + "src/path.cc", @@ -1886,19 +688,19 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/aliased_buffer-inl.h", + "src/aliased_struct.h", + "src/aliased_struct-inl.h", ++ "src/async_context_frame.h", + "src/async_wrap.h", + "src/async_wrap-inl.h", + "src/base_object.h", + "src/base_object-inl.h", + "src/base_object_types.h", -+ "src/base64.h", -+ "src/base64-inl.h", + "src/blob_serializer_deserializer.h", + "src/blob_serializer_deserializer-inl.h", + "src/callback_queue.h", + "src/callback_queue-inl.h", + "src/cleanup_queue.h", + "src/cleanup_queue-inl.h", ++ "src/compile_cache.h", + "src/connect_wrap.h", + "src/connection_wrap.h", + "src/dataqueue/queue.h", @@ -1929,6 +731,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/node_constants.h", + "src/node_context_data.h", + "src/node_contextify.h", ++ "src/node_debug.h", + "src/node_dir.h", + "src/node_dotenv.h", + "src/node_errors.h", @@ -1948,6 +751,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/node_messaging.h", + "src/node_metadata.h", + "src/node_mutex.h", ++ "src/node_modules.h", + "src/node_object_wrap.h", + "src/node_options.h", + "src/node_options-inl.h", @@ -1967,6 +771,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/node_snapshot_builder.h", + "src/node_sockaddr.h", + "src/node_sockaddr-inl.h", ++ "src/node_sqlite.h", + "src/node_stat_watcher.h", + "src/node_union_bytes.h", + "src/node_url.h", @@ -1975,6 +780,7 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/node_v8_platform-inl.h", + "src/node_wasi.h", + "src/node_watchdog.h", ++ "src/node_webstorage.h", + "src/node_worker.h", + "src/path.h", + "src/permission/child_process_permission.h", @@ -1994,7 +800,6 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "src/string_bytes.h", + "src/string_decoder.h", + "src/string_decoder-inl.h", -+ "src/string_search.h", + "src/tcp_wrap.h", + "src/timers.h", + "src/tracing/agent.h", @@ -2013,234 +818,46 @@ index 0000000000000000000000000000000000000000..889a487e24721a8ecfef91f5a655892a + "deps/postject/postject-api.h" + ] +} -diff --git a/src/inspector/BUILD.gn b/src/inspector/BUILD.gn -index 909fd14345fcd988c381e640280f4b33f2e0c351..3b430a666a7d5cb52ec41f8d828284625f916701 100644 ---- a/src/inspector/BUILD.gn -+++ b/src/inspector/BUILD.gn -@@ -1,14 +1,208 @@ --############################################################################## --# # --# DO NOT EDIT THIS FILE! # --# # --############################################################################## -+import("//v8/gni/v8.gni") +diff --git a/node.gni b/node.gni +index 9dca810decebd75aab427e306b3cc37c80fb55c9..32709b860ccb12d8d1e75342a65dda0b86129b21 100644 +--- a/node.gni ++++ b/node.gni +@@ -5,10 +5,10 @@ + # Embedder options. + declare_args() { + # The location of Node.js in source code tree. +- node_path = "//node" ++ node_path = "//third_party/electron_node" --# This file is used by GN for building, which is NOT the build system used for --# building official binaries. --# Please modify the gyp files if you are making changes to build system. -+inspector_protocol_dir = "../../tools/inspector_protocol" + # The location of V8, use the one from node's deps by default. +- node_v8_path = "$node_path/deps/v8" ++ node_v8_path = "//v8" --import("unofficial.gni") -+_protocol_generated = [ -+ "protocol/Forward.h", -+ "protocol/Protocol.cpp", -+ "protocol/Protocol.h", -+ "protocol/NodeWorker.cpp", -+ "protocol/NodeWorker.h", -+ "protocol/NodeTracing.cpp", -+ "protocol/NodeTracing.h", -+ "protocol/NodeRuntime.cpp", -+ "protocol/NodeRuntime.h", -+ "protocol/Network.cpp", -+ "protocol/Network.h", -+] + # The NODE_MODULE_VERSION defined in node_version.h. + node_module_version = exec_script("$node_path/tools/getmoduleversion.py", [], "value") +@@ -38,7 +38,7 @@ declare_args() { + node_openssl_system_ca_path = "" --inspector_gn_build("inspector") { -+# These are from node_protocol_config.json -+# These convoluted path hacks are to work around the fact that node.js is very -+# confused about what paths are in its includes, without changing node at all. -+# Hopefully, keying everything in this file off the paths that are in -+# node_protocol_config.json will mean that the paths stay in sync. -+inspector_protocol_package = "src/node/inspector/protocol" -+inspector_protocol_output = "node/inspector/protocol" -+ -+config("inspector_config") { -+ include_dirs = [ -+ "$target_gen_dir", -+ "$target_gen_dir/src", -+ ] -+ -+ configs = [ "../..:node_features" ] -+} -+ -+source_set("inspector") { -+ sources = [ -+ "main_thread_interface.cc", -+ "main_thread_interface.h", -+ "node_string.cc", -+ "node_string.h", -+ "runtime_agent.cc", -+ "runtime_agent.h", -+ "tracing_agent.cc", -+ "tracing_agent.h", -+ "worker_agent.cc", -+ "worker_agent.h", -+ "network_inspector.cc", -+ "network_inspector.h", -+ "network_agent.cc", -+ "network_agent.h", -+ "worker_inspector.cc", -+ "worker_inspector.h", -+ ] -+ sources += rebase_path(_protocol_generated, -+ ".", -+ "$target_gen_dir/$inspector_protocol_package/..") -+ include_dirs = [ -+ "//v8/include", -+ "..", -+ ] -+ deps = [ -+ ":protocol_generated_sources", -+ ":v8_inspector_compress_protocol_json", -+ "../../deps/uv", -+ "../../deps/simdutf", -+ "//third_party/icu:icuuc", -+ ] -+ configs += [ -+ "../..:node_internal_config", -+ "../..:node_lib_config", -+ ] -+ public_configs = [ ":inspector_config" ] -+} -+ -+# This based on the template from //v8/../inspector_protocol.gni -+action("protocol_generated_sources") { -+ # This is to ensure that the output directory exists--the code generator -+ # doesn't create it. -+ write_file("$target_gen_dir/$inspector_protocol_package/.dummy", "") -+ script = "$inspector_protocol_dir/code_generator.py" -+ -+ inputs = [ -+ "$target_gen_dir/node_protocol_config.json", -+ "$target_gen_dir/src/node_protocol.json", -+ "$inspector_protocol_dir/lib/base_string_adapter_cc.template", -+ "$inspector_protocol_dir/lib/base_string_adapter_h.template", -+ "$inspector_protocol_dir/lib/Allocator_h.template", -+ "$inspector_protocol_dir/lib/DispatcherBase_cpp.template", -+ "$inspector_protocol_dir/lib/DispatcherBase_h.template", -+ "$inspector_protocol_dir/lib/ErrorSupport_cpp.template", -+ "$inspector_protocol_dir/lib/ErrorSupport_h.template", -+ "$inspector_protocol_dir/lib/Forward_h.template", -+ "$inspector_protocol_dir/lib/FrontendChannel_h.template", -+ "$inspector_protocol_dir/lib/Maybe_h.template", -+ "$inspector_protocol_dir/lib/Object_cpp.template", -+ "$inspector_protocol_dir/lib/Object_h.template", -+ "$inspector_protocol_dir/lib/Parser_cpp.template", -+ "$inspector_protocol_dir/lib/Parser_h.template", -+ "$inspector_protocol_dir/lib/Protocol_cpp.template", -+ "$inspector_protocol_dir/lib/ValueConversions_h.template", -+ "$inspector_protocol_dir/lib/Values_cpp.template", -+ "$inspector_protocol_dir/lib/Values_h.template", -+ "$inspector_protocol_dir/templates/Exported_h.template", -+ "$inspector_protocol_dir/templates/Imported_h.template", -+ "$inspector_protocol_dir/templates/TypeBuilder_cpp.template", -+ "$inspector_protocol_dir/templates/TypeBuilder_h.template", -+ ] -+ -+ deps = [ -+ ":node_protocol_config", -+ ":node_protocol_json", -+ ] -+ -+ args = [ -+ "--jinja_dir", -+ rebase_path("//third_party/", root_build_dir), # jinja is in chromium's third_party -+ "--output_base", -+ rebase_path("$target_gen_dir/src", root_build_dir), -+ "--config", -+ rebase_path("$target_gen_dir/node_protocol_config.json", root_build_dir), -+ ] -+ -+ outputs = -+ get_path_info(rebase_path(rebase_path(_protocol_generated, -+ ".", -+ "$inspector_protocol_output/.."), -+ ".", -+ "$target_gen_dir/src"), -+ "abspath") -+} -+ -+template("generate_protocol_json") { -+ copy_target_name = target_name + "_copy" -+ copy(copy_target_name) { -+ sources = invoker.sources -+ outputs = [ -+ "$target_gen_dir/{{source_file_part}}", -+ ] -+ } -+ copied_pdl = get_target_outputs(":$copy_target_name") -+ action(target_name) { -+ deps = [ -+ ":$copy_target_name", -+ ] -+ sources = copied_pdl -+ outputs = invoker.outputs -+ script = "$inspector_protocol_dir/convert_protocol_to_json.py" -+ args = rebase_path(sources + outputs, root_build_dir) -+ } -+} -+ -+copy("node_protocol_config") { -+ sources = [ -+ "node_protocol_config.json", -+ ] -+ outputs = [ -+ "$target_gen_dir/{{source_file_part}}", -+ ] -+} -+ -+generate_protocol_json("node_protocol_json") { -+ sources = [ -+ "node_protocol.pdl", -+ ] -+ outputs = [ -+ "$target_gen_dir/src/node_protocol.json", -+ ] -+} -+ -+generate_protocol_json("v8_protocol_json") { -+ sources = [ -+ "//v8/include/js_protocol.pdl", -+ ] -+ outputs = [ -+ "$target_gen_dir/js_protocol.json", -+ ] -+} -+ -+action("concatenate_protocols") { -+ deps = [ -+ ":node_protocol_json", -+ ":v8_protocol_json", -+ ] -+ inputs = [ -+ "$target_gen_dir/js_protocol.json", -+ "$target_gen_dir/src/node_protocol.json", -+ ] -+ outputs = [ -+ "$target_gen_dir/concatenated_protocol.json", -+ ] -+ script = "//v8/third_party/inspector_protocol/concatenate_protocols.py" -+ args = rebase_path(inputs + outputs, root_build_dir) -+} -+ -+action("v8_inspector_compress_protocol_json") { -+ deps = [ -+ ":concatenate_protocols", -+ ] -+ inputs = [ -+ "$target_gen_dir/concatenated_protocol.json", -+ ] -+ outputs = [ -+ "$target_gen_dir/v8_inspector_protocol_json.h", -+ ] -+ script = "../../tools/compress_json.py" -+ args = rebase_path(inputs + outputs, root_build_dir) + # Initialize v8 platform during node.js startup. +- node_use_v8_platform = true ++ node_use_v8_platform = false + + # Custom build tag. + node_tag = "" +@@ -58,7 +58,7 @@ declare_args() { + # TODO(zcbenz): There are few broken things for now: + # 1. cross-os compilation is not supported. + # 2. node_mksnapshot crashes when cross-compiling for x64 from arm64. +- node_use_node_snapshot = (host_os == target_os) && !(host_cpu == "arm64" && target_cpu == "x64") ++ node_use_node_snapshot = false } + + assert(!node_enable_inspector || node_use_openssl, diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 706ea4f5cb90525c8ea56f794320a733c45a193f..c7ae7759595bfc7fdc31dab174a7514ddd8345e7 100644 +index 2bc7155f7c075e5a22ece7159a64a1c9ba3d8ac9..48d29a0d05538cd1d992f3f086d826e78d0d8882 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc -@@ -773,6 +773,7 @@ void BuiltinLoader::RegisterExternalReferences( +@@ -775,6 +775,7 @@ void BuiltinLoader::RegisterExternalReferences( registry->Register(GetNatives); RegisterExternalReferencesForInternalizedBuiltinCode(registry); @@ -2261,12 +878,25 @@ index 1cb85b9058d06555382e565dc32192a9fa48ed9f..cec9be01abd107e8612f70daf19b4834 // Handles compilation and caching of built-in JavaScript modules and // bootstrap scripts, whose source are bundled into the binary as static data. +diff --git a/tools/generate_config_gypi.py b/tools/generate_config_gypi.py +index 45b3ac5006140fb55aad0e6b78084b753a947a76..8667857107e4f2481fd98032d4333b086fb7b479 100755 +--- a/tools/generate_config_gypi.py ++++ b/tools/generate_config_gypi.py +@@ -21,7 +21,7 @@ import getnapibuildversion + GN_RE = re.compile(r'(\w+)\s+=\s+(.*?)$', re.MULTILINE) + + if sys.platform == 'win32': +- GN = 'gn.exe' ++ GN = 'gn.bat' + else: + GN = 'gn' + diff --git a/tools/generate_gn_filenames_json.py b/tools/generate_gn_filenames_json.py new file mode 100755 -index 0000000000000000000000000000000000000000..37c16859003e61636fe2f1a4040b1e904c472d0b +index 0000000000000000000000000000000000000000..54b761d91734aead50aeeba8c91a1262531df713 --- /dev/null +++ b/tools/generate_gn_filenames_json.py -@@ -0,0 +1,117 @@ +@@ -0,0 +1,118 @@ +#!/usr/bin/env python3 +import json +import os @@ -2318,6 +948,7 @@ index 0000000000000000000000000000000000000000..37c16859003e61636fe2f1a4040b1e90 + '<@(deps_files)', + '<@(node_sources)', + 'common.gypi', ++ 'common_node.gypi', + '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc', + } + @@ -2385,27 +1016,10 @@ index 0000000000000000000000000000000000000000..37c16859003e61636fe2f1a4040b1e90 + f.write(json.dumps(out, sort_keys=True, indent=2, separators=(',', ': '))) + f.write('\n') diff --git a/tools/install.py b/tools/install.py -index b132c7bf26c02886a7ab341a1973bf449744ba0f..757e3e60a7be01fac55c5fbb010dbbae00b1bfca 100755 +index bf54249b66c0d4e179deaae5a9fd55568e694fe0..57b51b03d237fba4b25aa69a663c88e9541b6cb5 100755 --- a/tools/install.py +++ b/tools/install.py -@@ -264,6 +264,7 @@ def headers(options, action): - 'include/v8-forward.h', - 'include/v8-function-callback.h', - 'include/v8-function.h', -+ 'include/v8-handle-base.h', - 'include/v8-initialization.h', - 'include/v8-internal.h', - 'include/v8-isolate.h', -@@ -284,6 +285,8 @@ def headers(options, action): - 'include/v8-promise.h', - 'include/v8-proxy.h', - 'include/v8-regexp.h', -+ "include/v8-sandbox.h", -+ "include/v8-source-location.h", - 'include/v8-script.h', - 'include/v8-snapshot.h', - 'include/v8-statistics.h', -@@ -390,7 +393,7 @@ def parse_options(args): +@@ -392,7 +392,7 @@ def parse_options(args): parser.add_argument('--build-dir', help='the location of built binaries', default='out/Release') parser.add_argument('--v8-dir', help='the location of V8', @@ -2417,7 +1031,7 @@ index b132c7bf26c02886a7ab341a1973bf449744ba0f..757e3e60a7be01fac55c5fbb010dbbae diff --git a/tools/js2c.cc b/tools/js2c.cc old mode 100644 new mode 100755 -index e0f3d8844718ab8a6478c40ff713c1fd6bcff95a..c73a5b666dbaf555c749d836c20a7ae19a840847 +index a536b5dcd857275d3b02e361bd7d37a939f6b573..b2d5678d58a79774d5aeedc15ac5d5fd786f64bb --- a/tools/js2c.cc +++ b/tools/js2c.cc @@ -30,6 +30,7 @@ namespace js2c { @@ -2552,7 +1166,7 @@ index e0f3d8844718ab8a6478c40ff713c1fd6bcff95a..c73a5b666dbaf555c749d836c20a7ae1 // Should have exactly 3 types: `.js`, `.mjs` and `.gypi`. assert(file_map.size() == 3); auto gypi_it = file_map.find(".gypi"); -@@ -932,6 +989,7 @@ int Main(int argc, char* argv[]) { +@@ -939,6 +996,7 @@ int Main(int argc, char* argv[]) { std::sort(mjs_it->second.begin(), mjs_it->second.end()); return JS2C(js_it->second, mjs_it->second, gypi_it->second[0], output); @@ -2560,10 +1174,171 @@ index e0f3d8844718ab8a6478c40ff713c1fd6bcff95a..c73a5b666dbaf555c749d836c20a7ae1 } } // namespace js2c } // namespace node -@@ -940,4 +998,4 @@ NODE_MAIN(int argc, node::argv_type raw_argv[]) { - char** argv; - node::FixupMain(argc, raw_argv, &argv); - return node::js2c::Main(argc, argv); --} -+} -\ No newline at end of file +diff --git a/tools/search_files.py b/tools/search_files.py +index 65d0e1be42f0a85418491ebb548278cf431aa6a0..d4a31342f1c6107b029394c6e1d00a1d1e877e03 100755 +--- a/tools/search_files.py ++++ b/tools/search_files.py +@@ -14,6 +14,7 @@ if __name__ == '__main__': + try: + files = SearchFiles(*sys.argv[2:]) + files = [ os.path.relpath(x, sys.argv[1]) for x in files ] ++ files = [os.path.normpath(x).replace(os.sep, '/') for x in files] + print('\n'.join(files)) + except Exception as e: + print(str(e)) +diff --git a/unofficial.gni b/unofficial.gni +index c3b311e4a7f5444b07d4d7028d4621806959804e..de6ff5548ca5282199b7d85c11941c1fa351a9d9 100644 +--- a/unofficial.gni ++++ b/unofficial.gni +@@ -139,6 +139,7 @@ template("node_gn_build") { + public_deps = [ + "deps/ada", + "deps/uv", ++ "//electron:electron_js2c", + "deps/simdjson", + "$node_v8_path", + ] +@@ -150,7 +151,6 @@ template("node_gn_build") { + "deps/llhttp", + "deps/nbytes", + "deps/nghttp2", +- "deps/ngtcp2", + "deps/postject", + "deps/simdutf", + "deps/sqlite", +@@ -159,7 +159,11 @@ template("node_gn_build") { + "$node_v8_path:v8_libplatform", + ] + ++ cflags_cc = [ "-Wno-unguarded-availability-new" ] ++ + sources = [ ++ "src/node_snapshot_stub.cc", ++ "$root_gen_dir/electron_natives.cc", + "$target_gen_dir/node_javascript.cc", + ] + gypi_values.node_sources + +@@ -178,8 +182,10 @@ template("node_gn_build") { + deps += [ "//third_party/icu" ] + } + if (node_use_openssl) { +- deps += [ "deps/ncrypto" ] +- public_deps += [ "deps/openssl" ] ++ deps += [ ++ "deps/ncrypto", ++ "//third_party/boringssl" ++ ] + sources += gypi_values.node_crypto_sources + } + if (node_enable_inspector) { +@@ -276,6 +282,7 @@ template("node_gn_build") { + } + + executable("node_js2c") { ++ defines = [] + deps = [ + "deps/simdutf", + "deps/uv", +@@ -286,26 +293,75 @@ template("node_gn_build") { + "src/embedded_data.cc", + "src/embedded_data.h", + ] +- include_dirs = [ "src" ] ++ include_dirs = [ "src", "tools" ] ++ ++ if (!is_win) { ++ defines += [ "NODE_JS2C_USE_STRING_LITERALS" ] ++ } ++ } ++ ++ node_deps_files = gypi_values.deps_files + node_builtin_shareable_builtins ++ node_library_files = exec_script("./tools/search_files.py", ++ [ rebase_path(".", root_build_dir), ++ rebase_path("lib", root_build_dir), ++ "js" ], ++ "list lines") ++ ++ fs_files = [ ++ "lib/internal/fs/cp/cp-sync.js", ++ "lib/internal/fs/cp/cp.js", ++ "lib/internal/fs/dir.js", ++ "lib/internal/fs/glob.js", ++ "lib/internal/fs/promises.js", ++ "lib/internal/fs/read/context.js", ++ "lib/internal/fs/recursive_watch.js", ++ "lib/internal/fs/rimraf.js", ++ "lib/internal/fs/streams.js", ++ "lib/internal/fs/sync_write_stream.js", ++ "lib/internal/fs/utils.js", ++ "lib/internal/fs/watchers.js", ++ "lib/fs.js", ++ "lib/fs/promises.js" ++ ] ++ ++ original_fs_files = [] ++ foreach(file, fs_files) { ++ original_fs_files += [string_replace(string_replace(string_replace(file, "internal/fs/", "internal/original-fs/"), "lib/fs.js", "lib/original-fs.js"), "lib/fs/", "lib/original-fs/")] ++ } ++ ++ copy("node_js2c_inputs") { ++ sources = node_deps_files + node_library_files ++ outputs = [ ++ "$target_gen_dir/js2c_inputs/{{source_target_relative}}", ++ ] ++ } ++ ++ action("node_js2c_original_fs") { ++ script = "//electron/script/node/generate_original_fs.py" ++ inputs = fs_files ++ deps = [ ":node_js2c_inputs" ] ++ ++ outputs = [] ++ foreach(file, original_fs_files) { ++ outputs += ["$target_gen_dir/js2c_inputs/$file"] ++ } ++ ++ args = [rebase_path("$target_gen_dir/js2c_inputs")] + fs_files + } + + action("run_node_js2c") { +- script = "$node_v8_path/tools/run.py" ++ script = "//electron/build/run-in-dir.py" + deps = [ ++ ":node_js2c_original_fs", + ":node_js2c($host_toolchain)", + ":generate_config_gypi", + ] + +- node_deps_files = gypi_values.deps_files + node_builtin_shareable_builtins +- node_library_files = exec_script("./tools/search_files.py", +- [ rebase_path(".", root_build_dir), +- rebase_path("lib", root_build_dir), +- "js" ], +- "list lines") +- ++ config_gypi = [ "$target_gen_dir/config.gypi" ] + inputs = node_library_files + + node_deps_files + +- [ "$target_gen_dir/config.gypi" ] ++ get_target_outputs(":node_js2c_original_fs") + ++ config_gypi + outputs = [ "$target_gen_dir/node_javascript.cc" ] + + # Get the path to node_js2c executable of the host toolchain. +@@ -319,11 +375,11 @@ template("node_gn_build") { + get_label_info(":node_js2c($host_toolchain)", "name") + + host_executable_suffix + +- args = [ rebase_path(node_js2c_path), +- rebase_path("$target_gen_dir/node_javascript.cc"), +- "--root", rebase_path("."), +- "lib", rebase_path("$target_gen_dir/config.gypi") ] + +- node_deps_files ++ args = [ rebase_path("$target_gen_dir/js2c_inputs"), ++ rebase_path(node_js2c_path), ++ rebase_path("$target_gen_dir/node_javascript.cc")] + ++ rebase_path(config_gypi) + node_deps_files + ++ original_fs_files + node_library_files + } + + executable("node_cctest") { diff --git a/patches/node/build_compile_with_c_20_support.patch b/patches/node/build_compile_with_c_20_support.patch index bef0bb28e9..c83de137e2 100644 --- a/patches/node/build_compile_with_c_20_support.patch +++ b/patches/node/build_compile_with_c_20_support.patch @@ -10,28 +10,19 @@ V8 requires C++20 support as of https://chromium-review.googlesource.com/c/v8/v8 This can be removed when Electron upgrades to a version of Node.js containing the required V8 version. diff --git a/common.gypi b/common.gypi -index bdf1a1f33f3ea09d933757c7fee87c563cc833ab..2eb62610db2f0ebf68fa9a55ffba98291ecfe451 100644 +index 74616453e2e047acbb9e25f2f93ebeab06011669..bce15fc4a8b3f2fa0b5a588e6a2b28d2b8b6ac45 100644 --- a/common.gypi +++ b/common.gypi -@@ -305,7 +305,7 @@ - 'VCCLCompilerTool': { - 'AdditionalOptions': [ - '/Zc:__cplusplus', -- '-std:c++17' -+ '-std:c++20' +@@ -518,7 +518,7 @@ + '-fno-rtti', + '-fno-exceptions', + '-fno-strict-aliasing', +- '-std=gnu++17', ++ '-std=gnu++20', ], - 'BufferSecurityCheck': 'true', - 'DebugInformationFormat': 1, # /Z7 embed info in .obj files -@@ -487,7 +487,7 @@ - }], - [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', { - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], -- 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ], -+ 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++20' ], 'defines': [ '__STDC_FORMAT_MACROS' ], 'ldflags': [ '-rdynamic' ], - 'target_conditions': [ -@@ -658,7 +658,7 @@ +@@ -688,7 +688,7 @@ ['clang==1', { 'xcode_settings': { 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', diff --git a/patches/node/build_enable_perfetto.patch b/patches/node/build_enable_perfetto.patch index 2d8e77f07f..0bfc4367eb 100644 --- a/patches/node/build_enable_perfetto.patch +++ b/patches/node/build_enable_perfetto.patch @@ -12,6 +12,19 @@ adding associated guards there should be relatively small. We should upstream this as it will eventually impact Node.js as well. +diff --git a/filenames.json b/filenames.json +index 5af3886d8d3d74d31249a4d79030a8373b8dad52..8ab04d0b1b58454c6ea21f33870f9557f3a57b56 100644 +--- a/filenames.json ++++ b/filenames.json +@@ -739,8 +739,6 @@ + "src/tcp_wrap.h", + "src/timers.h", + "src/tracing/agent.h", +- "src/tracing/node_trace_buffer.h", +- "src/tracing/node_trace_writer.h", + "src/tracing/trace_event.h", + "src/tracing/trace_event_common.h", + "src/tracing/traced_value.h", diff --git a/lib/internal/constants.js b/lib/internal/constants.js index 8d7204f6cb48f783adc4d1c1eb2de0c83b7fffe2..a154559a56bf383d3c26af523c9bb07b564ef600 100644 --- a/lib/internal/constants.js @@ -63,11 +76,62 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327 } module.exports = { +diff --git a/node.gyp b/node.gyp +index 11474953b186c7b3ec2edb0539f34572e6c551b7..eeaaef8a06cdc2d17e89f9c719f9922e6e04ce92 100644 +--- a/node.gyp ++++ b/node.gyp +@@ -174,7 +174,6 @@ + 'src/timers.cc', + 'src/timer_wrap.cc', + 'src/tracing/agent.cc', +- 'src/tracing/node_trace_buffer.cc', + 'src/tracing/node_trace_writer.cc', + 'src/tracing/trace_event.cc', + 'src/tracing/traced_value.cc', +@@ -302,7 +301,6 @@ + 'src/tcp_wrap.h', + 'src/timers.h', + 'src/tracing/agent.h', +- 'src/tracing/node_trace_buffer.h', + 'src/tracing/node_trace_writer.h', + 'src/tracing/trace_event.h', + 'src/tracing/trace_event_common.h', +diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc +index e7b6d3b3ea63bdc80e569f56209e958b4fcde328..b52d5b1c7293539315626cd67f794cce4cfd1760 100644 +--- a/src/inspector/tracing_agent.cc ++++ b/src/inspector/tracing_agent.cc +@@ -84,14 +84,14 @@ class InspectorTraceWriter : public node::tracing::AsyncTraceWriter { + explicit InspectorTraceWriter(int frontend_object_id, + std::shared_ptr main_thread) + : frontend_object_id_(frontend_object_id), main_thread_(main_thread) {} +- ++#ifndef V8_USE_PERFETTO + void AppendTraceEvent( + v8::platform::tracing::TraceObject* trace_event) override { + if (!json_writer_) + json_writer_.reset(TraceWriter::CreateJSONTraceWriter(stream_, "value")); + json_writer_->AppendTraceEvent(trace_event); + } +- ++#endif + void Flush(bool) override { + if (!json_writer_) + return; diff --git a/src/tracing/agent.cc b/src/tracing/agent.cc -index 7ce59674356f9743438350949be42fa7ead2afbe..c5fedc3be86a77730c57321b9c73cc8e94a001d7 100644 +index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187177fc3bd 100644 --- a/src/tracing/agent.cc +++ b/src/tracing/agent.cc -@@ -50,7 +50,9 @@ using v8::platform::tracing::TraceWriter; +@@ -2,7 +2,9 @@ + + #include + #include "trace_event.h" ++#ifndef V8_USE_PERFETTO + #include "tracing/node_trace_buffer.h" ++#endif + #include "debug_utils-inl.h" + #include "env-inl.h" + +@@ -50,7 +52,9 @@ using v8::platform::tracing::TraceWriter; using std::string; Agent::Agent() : tracing_controller_(new TracingController()) { @@ -77,7 +141,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..c5fedc3be86a77730c57321b9c73cc8e CHECK_EQ(uv_loop_init(&tracing_loop_), 0); CHECK_EQ(uv_async_init(&tracing_loop_, -@@ -86,10 +88,14 @@ Agent::~Agent() { +@@ -86,10 +90,14 @@ Agent::~Agent() { void Agent::Start() { if (started_) return; @@ -93,7 +157,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..c5fedc3be86a77730c57321b9c73cc8e // This thread should be created *after* async handles are created // (within NodeTraceWriter and NodeTraceBuffer constructors). -@@ -143,8 +149,10 @@ void Agent::StopTracing() { +@@ -143,8 +151,10 @@ void Agent::StopTracing() { return; // Perform final Flush on TraceBuffer. We don't want the tracing controller // to flush the buffer again on destruction of the V8::Platform. @@ -105,7 +169,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..c5fedc3be86a77730c57321b9c73cc8e started_ = false; // Thread should finish when the tracing loop is stopped. -@@ -202,6 +210,7 @@ std::string Agent::GetEnabledCategories() const { +@@ -202,6 +212,7 @@ std::string Agent::GetEnabledCategories() const { return categories; } @@ -113,7 +177,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..c5fedc3be86a77730c57321b9c73cc8e void Agent::AppendTraceEvent(TraceObject* trace_event) { for (const auto& id_writer : writers_) id_writer.second->AppendTraceEvent(trace_event); -@@ -211,18 +220,21 @@ void Agent::AddMetadataEvent(std::unique_ptr event) { +@@ -211,18 +222,21 @@ void Agent::AddMetadataEvent(std::unique_ptr event) { Mutex::ScopedLock lock(metadata_events_mutex_); metadata_events_.push_back(std::move(event)); } @@ -136,7 +200,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..c5fedc3be86a77730c57321b9c73cc8e void TracingController::AddMetadataEvent( const unsigned char* category_group_enabled, const char* name, -@@ -246,6 +258,6 @@ void TracingController::AddMetadataEvent( +@@ -246,6 +260,6 @@ void TracingController::AddMetadataEvent( if (node_agent != nullptr) node_agent->AddMetadataEvent(std::move(trace_event)); } @@ -198,26 +262,20 @@ index b542a849fe8da7e8bbbcca7067b73dc32b18d6d3..059ce6f6ea17199ead09c6c13bcc680f }; void AgentWriterHandle::reset() { -diff --git a/src/tracing/node_trace_buffer.cc b/src/tracing/node_trace_buffer.cc -index e187a1d78c81972b69cd4e03f7079cdb727956ad..3256c6326a08c6cafd83f1e49e3350193e813b51 100644 ---- a/src/tracing/node_trace_buffer.cc -+++ b/src/tracing/node_trace_buffer.cc -@@ -55,6 +55,7 @@ TraceObject* InternalTraceBuffer::GetEventByHandle(uint64_t handle) { - } - - void InternalTraceBuffer::Flush(bool blocking) { +diff --git a/src/tracing/node_trace_buffer.h b/src/tracing/node_trace_buffer.h +index 18e4f43efaae3a60b924e697918867e604513194..7cbaf01235750138c680c8ec2ed5d206d638f8b6 100644 +--- a/src/tracing/node_trace_buffer.h ++++ b/src/tracing/node_trace_buffer.h +@@ -42,7 +42,9 @@ class InternalTraceBuffer { + bool flushing_; + size_t max_chunks_; + Agent* agent_; +#ifndef V8_USE_PERFETTO - { - Mutex::ScopedLock scoped_lock(mutex_); - if (total_chunks_ > 0) { -@@ -75,6 +76,7 @@ void InternalTraceBuffer::Flush(bool blocking) { - flushing_ = false; - } - } + std::vector> chunks_; +#endif - agent_->Flush(blocking); - } - + size_t total_chunks_ = 0; + uint32_t current_chunk_seq_ = 1; + uint32_t id_; diff --git a/src/tracing/node_trace_writer.cc b/src/tracing/node_trace_writer.cc index 8f053efe93324b9acbb4e85f7b974b4f7712e200..e331ed5567caa39ade90ce28cea69f1d10533812 100644 --- a/src/tracing/node_trace_writer.cc diff --git a/patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch b/patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch index ae020d1bb1..4001cf3cb6 100644 --- a/patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch +++ b/patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch @@ -7,7 +7,7 @@ Subject: build: ensure native module compilation fails if not using a new This should not be upstreamed, it is a quality-of-life patch for downstream module builders. diff --git a/common.gypi b/common.gypi -index 697b8bba6a55358924d6986f2eb347a99ff73889..bdf1a1f33f3ea09d933757c7fee87c563cc833ab 100644 +index 229cb96c1385c597138719f2b01f78bd54ad44ab..74616453e2e047acbb9e25f2f93ebeab06011669 100644 --- a/common.gypi +++ b/common.gypi @@ -86,6 +86,8 @@ @@ -19,7 +19,7 @@ index 697b8bba6a55358924d6986f2eb347a99ff73889..bdf1a1f33f3ea09d933757c7fee87c56 ##### end V8 defaults ##### # When building native modules using 'npm install' with the system npm, -@@ -285,6 +287,7 @@ +@@ -291,6 +293,7 @@ # Defines these mostly for node-gyp to pickup. 'defines': [ '_GLIBCXX_USE_CXX11_ABI=1', @@ -27,7 +27,7 @@ index 697b8bba6a55358924d6986f2eb347a99ff73889..bdf1a1f33f3ea09d933757c7fee87c56 ], # Forcibly disable -Werror. We support a wide range of compilers, it's -@@ -414,6 +417,11 @@ +@@ -437,6 +440,11 @@ }], ], }], @@ -40,19 +40,19 @@ index 697b8bba6a55358924d6986f2eb347a99ff73889..bdf1a1f33f3ea09d933757c7fee87c56 # list in v8/BUILD.gn. ['v8_enable_v8_checks == 1', { diff --git a/configure.py b/configure.py -index a6f66c41f75bffcfaf75d4415c694300b7624136..7ca0762fe3590fef7b88ba684de44d99aaecace4 100755 +index d03db1970fd7a1629a7a7719a5ff267402ab4a66..ce055fb5dfc84c75c486b99f01fea6b9531ff54b 100755 --- a/configure.py +++ b/configure.py -@@ -1585,6 +1585,7 @@ def configure_library(lib, output, pkgname=None): +@@ -1634,6 +1634,7 @@ def configure_library(lib, output, pkgname=None): + def configure_v8(o, configs): + set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0) - - def configure_v8(o): + o['variables']['using_electron_config_gypi'] = 1 o['variables']['v8_enable_webassembly'] = 0 if options.v8_lite_mode else 1 o['variables']['v8_enable_javascript_promise_hooks'] = 1 o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0 diff --git a/src/node.h b/src/node.h -index 4f2eb9d0aab88b70c86339e750799080e980d7da..df3fb3372d6357b5d77b4f683e309b8483998128 100644 +index 0fec9477fd0f2a3c2aa68284131c510b0da0e025..c16204ad2a4787eeffe61eedda254d3a5509df8c 100644 --- a/src/node.h +++ b/src/node.h @@ -22,6 +22,12 @@ diff --git a/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch b/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch index 6c5aa02753..aaba7297e7 100644 --- a/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch +++ b/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch @@ -34,10 +34,10 @@ index f5ecc15159f457cd0b8069c0427b7c758c916c4e..c9ce67391f321989b0af48159b4da3ab let kResistStopPropagation; diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index c7ae7759595bfc7fdc31dab174a7514ddd8345e7..4bf80aa6cc6385dc376fd0a3538efc27fe5bd0a2 100644 +index 48d29a0d05538cd1d992f3f086d826e78d0d8882..8987234c2d08449242b5fd037ed314b725bc42a5 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc -@@ -35,6 +35,7 @@ using v8::Value; +@@ -34,6 +34,7 @@ using v8::Value; BuiltinLoader::BuiltinLoader() : config_(GetConfig()), code_cache_(std::make_shared()) { LoadJavaScriptSource(); diff --git a/patches/node/build_restore_clang_as_default_compiler_on_macos.patch b/patches/node/build_restore_clang_as_default_compiler_on_macos.patch index 0423182e8b..5cee2b1aef 100644 --- a/patches/node/build_restore_clang_as_default_compiler_on_macos.patch +++ b/patches/node/build_restore_clang_as_default_compiler_on_macos.patch @@ -11,7 +11,7 @@ node-gyp will use the result of `process.config` that reflects the environment in which the binary got built. diff --git a/common.gypi b/common.gypi -index 2eb62610db2f0ebf68fa9a55ffba98291ecfe451..3ec08ee144b586d05c4e49c2251416734cbc02c5 100644 +index bce15fc4a8b3f2fa0b5a588e6a2b28d2b8b6ac45..289ab5d282e93c795eafb5fb992c3bbc4790a687 100644 --- a/common.gypi +++ b/common.gypi @@ -125,6 +125,7 @@ diff --git a/patches/node/cherry-pick_src_remove_calls_to_recently_deprecated_v8_apis.patch b/patches/node/cherry-pick_src_remove_calls_to_recently_deprecated_v8_apis.patch deleted file mode 100644 index 2d33d6a273..0000000000 --- a/patches/node/cherry-pick_src_remove_calls_to_recently_deprecated_v8_apis.patch +++ /dev/null @@ -1,182 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Adam Klein -Date: Wed, 15 May 2024 09:16:00 +0200 -Subject: cherry-pick: src: remove calls to recently deprecated V8 APIs - -Node.js Commit: a6d54f179d997497a95c18456bef6bc3ee15e2c4 -Node.js PR: https://github.com/nodejs/node/pull/52996 -V8 API Removal CL: https://chromium-review.googlesource.com/c/v8/v8/+/5539888 - -This patch is slightly modified from the original commit in order to -resolve conflicts due to the base commit difference between the Node.js -PR and the current upgrade roll. - -This patch is expected to be deleted once we catch up with a Node.js -upgrade that includes the original Node.js commit above. - -diff --git a/src/module_wrap.cc b/src/module_wrap.cc -index ff658ec88e5161cd66536ee6e95dba675b16eccc..9bbb8ab908d8d992abb43254860d51f57f56387b 100644 ---- a/src/module_wrap.cc -+++ b/src/module_wrap.cc -@@ -202,8 +202,7 @@ void ModuleWrap::New(const FunctionCallbackInfo& args) { - } - - Local source_text = args[2].As(); -- ScriptOrigin origin(isolate, -- url, -+ ScriptOrigin origin(url, - line_offset, - column_offset, - true, // is cross origin -@@ -464,7 +463,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo& args) { - - ShouldNotAbortOnUncaughtScope no_abort_scope(realm->env()); - TryCatchScope try_catch(realm->env()); -- Isolate::SafeForTerminationScope safe_for_termination(isolate); - - bool timed_out = false; - bool received_signal = false; -diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 4bf80aa6cc6385dc376fd0a3538efc27fe5bd0a2..3e37aa8b0c9696cceb3f3cfab9721f38c74a2fba 100644 ---- a/src/node_builtins.cc -+++ b/src/node_builtins.cc -@@ -267,7 +267,7 @@ MaybeLocal BuiltinLoader::LookupAndCompileInternal( - std::string filename_s = std::string("node:") + id; - Local filename = - OneByteString(isolate, filename_s.c_str(), filename_s.size()); -- ScriptOrigin origin(isolate, filename, 0, 0, true); -+ ScriptOrigin origin(filename, 0, 0, true); - - BuiltinCodeCacheData cached_data{}; - { -diff --git a/src/node_contextify.cc b/src/node_contextify.cc -index 6456d87d4202c013aafe071adbac06852b3ae2c1..28ba7dbe66a44a43c39e3d75edf0be9513bcf732 100644 ---- a/src/node_contextify.cc -+++ b/src/node_contextify.cc -@@ -877,16 +877,15 @@ void ContextifyScript::New(const FunctionCallbackInfo& args) { - host_defined_options->Set( - isolate, loader::HostDefinedOptions::kID, id_symbol); - -- ScriptOrigin origin(isolate, -- filename, -- line_offset, // line offset -- column_offset, // column offset -- true, // is cross origin -- -1, // script id -- Local(), // source map URL -- false, // is opaque (?) -- false, // is WASM -- false, // is ES Module -+ ScriptOrigin origin(filename, -+ line_offset, // line offset -+ column_offset, // column offset -+ true, // is cross origin -+ -1, // script id -+ Local(), // source map URL -+ false, // is opaque (?) -+ false, // is WASM -+ false, // is ES Module - host_defined_options); - ScriptCompiler::Source source(code, origin, cached_data); - ScriptCompiler::CompileOptions compile_options = -@@ -998,7 +997,7 @@ MaybeLocal CompileFunction(Local context, - Local filename, - Local content, - std::vector>* parameters) { -- ScriptOrigin script_origin(context->GetIsolate(), filename, 0, 0, true); -+ ScriptOrigin script_origin(filename, 0, 0, true); - ScriptCompiler::Source script_source(content, script_origin); - - return ScriptCompiler::CompileFunction(context, -@@ -1108,7 +1107,6 @@ bool ContextifyScript::EvalMachine(Local context, - } - - TryCatchScope try_catch(env); -- Isolate::SafeForTerminationScope safe_for_termination(env->isolate()); - ContextifyScript* wrapped_script; - ASSIGN_OR_RETURN_UNWRAP(&wrapped_script, args.This(), false); - Local unbound_script = -@@ -1286,8 +1284,7 @@ void ContextifyContext::CompileFunction( - Local host_defined_options = - GetHostDefinedOptions(isolate, id_symbol); - ScriptCompiler::Source source = -- GetCommonJSSourceInstance(isolate, -- code, -+ GetCommonJSSourceInstance(code, - filename, - line_offset, - column_offset, -@@ -1342,15 +1339,13 @@ void ContextifyContext::CompileFunction( - } - - ScriptCompiler::Source ContextifyContext::GetCommonJSSourceInstance( -- Isolate* isolate, - Local code, - Local filename, - int line_offset, - int column_offset, - Local host_defined_options, - ScriptCompiler::CachedData* cached_data) { -- ScriptOrigin origin(isolate, -- filename, -+ ScriptOrigin origin(filename, - line_offset, // line offset - column_offset, // column offset - true, // is cross origin -@@ -1528,7 +1523,7 @@ void ContextifyContext::ContainsModuleSyntax( - Local host_defined_options = - GetHostDefinedOptions(isolate, id_symbol); - ScriptCompiler::Source source = GetCommonJSSourceInstance( -- isolate, code, filename, 0, 0, host_defined_options, nullptr); -+ code, filename, 0, 0, host_defined_options, nullptr); - ScriptCompiler::CompileOptions options = GetCompileOptions(source); - - std::vector> params = GetCJSParameters(env->isolate_data()); -@@ -1576,7 +1571,7 @@ void ContextifyContext::ContainsModuleSyntax( - code, - String::NewFromUtf8(isolate, "})();").ToLocalChecked()); - ScriptCompiler::Source wrapped_source = GetCommonJSSourceInstance( -- isolate, code, filename, 0, 0, host_defined_options, nullptr); -+ code, filename, 0, 0, host_defined_options, nullptr); - std::ignore = ScriptCompiler::CompileFunction( - context, - &wrapped_source, -@@ -1629,8 +1624,7 @@ static void CompileFunctionForCJSLoader( - - Local symbol = env->vm_dynamic_import_default_internal(); - Local hdo = GetHostDefinedOptions(isolate, symbol); -- ScriptOrigin origin(isolate, -- filename, -+ ScriptOrigin origin(filename, - 0, // line offset - 0, // column offset - true, // is cross origin -diff --git a/src/node_contextify.h b/src/node_contextify.h -index 517e3f44d324900222e1da961a4cd60bbb4a85f9..10715c7eb07715cc11e49734bd54747dad95f6a4 100644 ---- a/src/node_contextify.h -+++ b/src/node_contextify.h -@@ -99,7 +99,6 @@ class ContextifyContext : public BaseObject { - v8::Local id_symbol, - const errors::TryCatchScope& try_catch); - static v8::ScriptCompiler::Source GetCommonJSSourceInstance( -- v8::Isolate* isolate, - v8::Local code, - v8::Local filename, - int line_offset, -diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc -index 64e38c83006a004ebc3519a5e9f8b04263244514..14e82cc80ff73084fb43b2ef07febfd2667a0abc 100644 ---- a/test/cctest/test_environment.cc -+++ b/test/cctest/test_environment.cc -@@ -620,12 +620,9 @@ TEST_F(EnvironmentTest, SetImmediateMicrotasks) { - - #ifndef _WIN32 // No SIGINT on Windows. - TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) { -- // We need to go through the whole setup dance here because we want to -- // set only_terminate_in_safe_scope. - // Allocate and initialize Isolate. - v8::Isolate::CreateParams create_params; - create_params.array_buffer_allocator = allocator.get(); -- create_params.only_terminate_in_safe_scope = true; - v8::Isolate* isolate = v8::Isolate::Allocate(); - CHECK_NOT_NULL(isolate); - platform->RegisterIsolate(isolate, ¤t_loop); diff --git a/patches/node/chore_add_context_to_context_aware_module_prevention.patch b/patches/node/chore_add_context_to_context_aware_module_prevention.patch index b0119bd437..c74109225a 100644 --- a/patches/node/chore_add_context_to_context_aware_module_prevention.patch +++ b/patches/node/chore_add_context_to_context_aware_module_prevention.patch @@ -8,7 +8,7 @@ modules from being used in the renderer process. This should be upstreamed as a customizable error message. diff --git a/src/node_binding.cc b/src/node_binding.cc -index 4e750be66452de47040e3a46555c062dfccf7807..5e1caeee18e447cc76b980df712521cf8b60e8da 100644 +index b5c0a93d83ab4d4f6792d0eb648e7198de874bcf..0fd01987c29b06b91944d18266ba67994c1fac45 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc @@ -4,6 +4,7 @@ @@ -19,7 +19,7 @@ index 4e750be66452de47040e3a46555c062dfccf7807..5e1caeee18e447cc76b980df712521cf #include "util.h" #include -@@ -483,7 +484,12 @@ void DLOpen(const FunctionCallbackInfo& args) { +@@ -495,7 +496,12 @@ void DLOpen(const FunctionCallbackInfo& args) { if (mp->nm_context_register_func == nullptr) { if (env->force_context_aware()) { dlib->Close(); diff --git a/patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch b/patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch index db246d414e..23e2ee6694 100644 --- a/patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch +++ b/patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch @@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form of this. diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 364469160af5e348f8890417de16a63c0d1dca67..75d5f58fe02fa8cfa7716ffaf761d567ab403a2c 100644 +index d49941881e6cfd8647a6d44a57e0daaf1c874702..f696fb263b356a76b87cd4b6c4b1a0fd60a84afd 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -1441,6 +1441,13 @@ Module.prototype._compile = function(content, filename, loadAsESM = false) { +@@ -1518,6 +1518,13 @@ Module.prototype._compile = function(content, filename, format) { if (getOptionValue('--inspect-brk') && process._eval == null) { if (!resolvedArgv) { // We enter the repl if we're not given a filename argument. @@ -26,10 +26,10 @@ index 364469160af5e348f8890417de16a63c0d1dca67..75d5f58fe02fa8cfa7716ffaf761d567 try { resolvedArgv = Module._resolveFilename(process.argv[1], null, false); diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js -index ea7afd52fab1cf3fde1674be1429a00562b714c0..02cfc8b3328fedb6306abf6c738bea772c674458 100644 +index cb96fd1bc4fcdce750ce241ee5f47f2ae39cfdc6..c46b270109697f7cc1683f8f9f463575e5040216 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -247,12 +247,14 @@ function patchProcessObject(expandArgv1) { +@@ -243,12 +243,14 @@ function patchProcessObject(expandArgv1) { if (expandArgv1 && process.argv[1] && !StringPrototypeStartsWith(process.argv[1], '-')) { // Expand process.argv[1] into a full path. diff --git a/patches/node/chore_expose_importmoduledynamically_and.patch b/patches/node/chore_expose_importmoduledynamically_and.patch index 18583f403a..53d3d0a6e0 100644 --- a/patches/node/chore_expose_importmoduledynamically_and.patch +++ b/patches/node/chore_expose_importmoduledynamically_and.patch @@ -11,7 +11,7 @@ its own blended handler between Node and Blink. Not upstreamable. diff --git a/lib/internal/modules/esm/utils.js b/lib/internal/modules/esm/utils.js -index 150816057129c147c13ce044474f341581679f34..dd8627653265e22f55e67ec4a47641b20fba6c9d 100644 +index d393d4336a0c1e681e4f6b4e5c7cf2bcc5fc287e..807cb5172e0c2178b6c20e81f8175141d3a0284f 100644 --- a/lib/internal/modules/esm/utils.js +++ b/lib/internal/modules/esm/utils.js @@ -30,7 +30,7 @@ const { @@ -40,10 +40,10 @@ index 150816057129c147c13ce044474f341581679f34..dd8627653265e22f55e67ec4a47641b2 /** diff --git a/src/module_wrap.cc b/src/module_wrap.cc -index eea74bed4bb8a980f99a9a1404c9a2df203ca09c..e862b51293135995c527c32aa3c3579780d7831c 100644 +index 48b61e8b7600701c4992a98ff802614ce915faee..4e9835e502a8d078a448aa4253f37de0f49f4854 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc -@@ -752,7 +752,7 @@ MaybeLocal ModuleWrap::ResolveModuleCallback( +@@ -813,7 +813,7 @@ MaybeLocal ModuleWrap::ResolveModuleCallback( return module->module_.Get(isolate); } @@ -52,7 +52,7 @@ index eea74bed4bb8a980f99a9a1404c9a2df203ca09c..e862b51293135995c527c32aa3c35797 Local context, Local host_defined_options, Local resource_name, -@@ -817,12 +817,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback( +@@ -878,12 +878,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback( Realm* realm = Realm::GetCurrent(args); HandleScope handle_scope(isolate); @@ -68,7 +68,7 @@ index eea74bed4bb8a980f99a9a1404c9a2df203ca09c..e862b51293135995c527c32aa3c35797 } void ModuleWrap::HostInitializeImportMetaObjectCallback( -@@ -864,13 +865,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback( +@@ -925,13 +926,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback( Realm* realm = Realm::GetCurrent(args); Isolate* isolate = realm->isolate(); @@ -87,18 +87,18 @@ index eea74bed4bb8a980f99a9a1404c9a2df203ca09c..e862b51293135995c527c32aa3c35797 MaybeLocal ModuleWrap::SyntheticModuleEvaluationStepsCallback( diff --git a/src/module_wrap.h b/src/module_wrap.h -index 45a338b38e01c824f69ea59ee286130c67e9eddf..99bb079df11696fc3ba5e6bcca7e7a42818fe3d1 100644 +index 83b5793013cbc453cf92c0a006fc7be3c06ad276..90353954bc497cb4ae413dc134850f8abb4efc7c 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h -@@ -7,6 +7,7 @@ - #include +@@ -8,6 +8,7 @@ + #include #include #include "base_object.h" +#include "node.h" + #include "v8-script.h" namespace node { - -@@ -31,7 +32,14 @@ enum HostDefinedOptions : int { +@@ -33,7 +34,14 @@ enum HostDefinedOptions : int { kLength = 9, }; @@ -114,20 +114,20 @@ index 45a338b38e01c824f69ea59ee286130c67e9eddf..99bb079df11696fc3ba5e6bcca7e7a42 public: enum InternalFields { kModuleSlot = BaseObject::kInternalFieldCount, -@@ -68,6 +76,8 @@ class ModuleWrap : public BaseObject { - return true; - } +@@ -91,6 +99,8 @@ class ModuleWrap : public BaseObject { + static void CreateRequiredModuleFacade( + const v8::FunctionCallbackInfo& args); + static ModuleWrap* GetFromModule(node::Environment*, v8::Local); + private: ModuleWrap(Realm* realm, v8::Local object, -@@ -110,7 +120,6 @@ class ModuleWrap : public BaseObject { +@@ -129,7 +139,6 @@ class ModuleWrap : public BaseObject { v8::Local specifier, v8::Local import_attributes, v8::Local referrer); - static ModuleWrap* GetFromModule(node::Environment*, v8::Local); v8::Global module_; - std::unordered_map> resolve_cache_; + std::unordered_map> resolve_cache_; diff --git a/patches/node/chore_remove_--no-harmony-atomics_related_code.patch b/patches/node/chore_remove_--no-harmony-atomics_related_code.patch deleted file mode 100644 index cc52a3017c..0000000000 --- a/patches/node/chore_remove_--no-harmony-atomics_related_code.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Wed, 19 Apr 2023 14:13:23 +0200 -Subject: chore: remove --no-harmony-atomics related code - -This was removed in https://chromium-review.googlesource.com/c/v8/v8/+/4416459. - -This patch can be removed when Node.js upgrades to a version of V8 containing -the above CL. - -diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml -index 74e867ace6207751a96b4da03802b50b620dbd7b..53ceabeb58f56ebd27e60fd49c362d26e361e6d8 100644 ---- a/lib/.eslintrc.yaml -+++ b/lib/.eslintrc.yaml -@@ -30,10 +30,6 @@ rules: - message: Use `const { AbortController } = require('internal/abort_controller');` instead of the global. - - name: AbortSignal - message: Use `const { AbortSignal } = require('internal/abort_controller');` instead of the global. -- # Atomics is not available in primordials because it can be -- # disabled with --no-harmony-atomics CLI flag. -- - name: Atomics -- message: Use `const { Atomics } = globalThis;` instead of the global. - - name: Blob - message: Use `const { Blob } = require('buffer');` instead of the global. - - name: BroadcastChannel -diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js -index 30f7a5f79e50fdeb4e1775a0e56dafa4c6908898..f7250985277c4127425ef36dff566c1fe06603e2 100644 ---- a/lib/internal/main/worker_thread.js -+++ b/lib/internal/main/worker_thread.js -@@ -112,7 +112,7 @@ port.on('message', (message) => { - - require('internal/worker').assignEnvironmentData(environmentData); - -- if (SharedArrayBuffer !== undefined && Atomics !== undefined) { -+ if (SharedArrayBuffer !== undefined) { - // The counter is only passed to the workers created by the main thread, - // not to workers created by other workers. - let cachedCwd = ''; -diff --git a/lib/internal/worker.js b/lib/internal/worker.js -index 401bc43550ea7f19847dfd588e3fba0507243905..560f69c6c2de2bd976bcd62cd7ac9c770b838446 100644 ---- a/lib/internal/worker.js -+++ b/lib/internal/worker.js -@@ -101,8 +101,7 @@ let cwdCounter; - const environmentData = new SafeMap(); - - // SharedArrayBuffers can be disabled with --no-harmony-sharedarraybuffer. --// Atomics can be disabled with --no-harmony-atomics. --if (isMainThread && SharedArrayBuffer !== undefined && Atomics !== undefined) { -+if (isMainThread && SharedArrayBuffer !== undefined) { - cwdCounter = new Uint32Array(new SharedArrayBuffer(4)); - const originalChdir = process.chdir; - process.chdir = function(path) { diff --git a/patches/node/chore_remove_use_of_deprecated_kmaxlength.patch b/patches/node/chore_remove_use_of_deprecated_kmaxlength.patch deleted file mode 100644 index ded4d1f30d..0000000000 --- a/patches/node/chore_remove_use_of_deprecated_kmaxlength.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Charles Kerr -Date: Tue, 17 Oct 2023 10:58:41 -0500 -Subject: chore: remove use of deprecated kMaxLength - -https://chromium-review.googlesource.com/c/v8/v8/+/4935412 - -This patch can be removed when upstream moves to kMaxByteLength - -diff --git a/src/node_buffer.h b/src/node_buffer.h -index 606a6f5caa3b11b6d2a9068ed2fd65800530a5eb..080dcce21da05ccea398d8a856deb397b1ac8b07 100644 ---- a/src/node_buffer.h -+++ b/src/node_buffer.h -@@ -29,7 +29,7 @@ namespace node { - - namespace Buffer { - --static const size_t kMaxLength = v8::TypedArray::kMaxLength; -+static const size_t kMaxLength = v8::TypedArray::kMaxByteLength; - - typedef void (*FreeCallback)(char* data, void* hint); - -diff --git a/src/node_errors.h b/src/node_errors.h -index 1662491bac44311421eeb7ee35bb47c025162abf..a62b18e832986ee38d93b412b36020a2c22255a9 100644 ---- a/src/node_errors.h -+++ b/src/node_errors.h -@@ -230,7 +230,7 @@ inline v8::Local ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) { - char message[128]; - snprintf(message, sizeof(message), - "Cannot create a Buffer larger than 0x%zx bytes", -- v8::TypedArray::kMaxLength); -+ v8::TypedArray::kMaxByteLength); - return ERR_BUFFER_TOO_LARGE(isolate, message); - } - diff --git a/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch b/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch index 05a70dd710..ef4d76a3e8 100644 --- a/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch +++ b/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch @@ -7,53 +7,6 @@ Some node tests / test fixtures spawn other tests that clobber env, which causes the `ELECTRON_RUN_AS_NODE` variable to be lost. This patch re-injects it. -diff --git a/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot b/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot -index d7f1aa2f72007f6f70b6b66b81913f39e5678d2f..e091b1575954f5dc82a05a5d200ee028e053f616 100644 ---- a/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot -+++ b/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot -@@ -6,5 +6,5 @@ - at * - at * - at * --(Use `node --trace-warnings ...` to show where the warning was created) -+(Use `* --trace-warnings ...` to show where the warning was created) - (node:*) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https:*nodejs.org*api*cli.html#cli_unhandled_rejections_mode). (rejection id: 1) -diff --git a/test/fixtures/errors/throw_error_with_getter_throw.snapshot b/test/fixtures/errors/throw_error_with_getter_throw.snapshot -index 30bbb336a22aaffbd63333f297eb598a8f501d75..1786f96f19856cdc43e0e86c8271a845e337359f 100644 ---- a/test/fixtures/errors/throw_error_with_getter_throw.snapshot -+++ b/test/fixtures/errors/throw_error_with_getter_throw.snapshot -@@ -3,6 +3,6 @@ - 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) - - Node.js * -diff --git a/test/fixtures/errors/throw_null.snapshot b/test/fixtures/errors/throw_null.snapshot -index 88494ec6832205b30e7ae159708112a45494834c..1a1191ca9ced90936b764c32c1c334cce114b46e 100644 ---- a/test/fixtures/errors/throw_null.snapshot -+++ b/test/fixtures/errors/throw_null.snapshot -@@ -3,6 +3,6 @@ - throw null; - ^ - null --(Use `node --trace-uncaught ...` to show where the exception was thrown) -+(Use `* --trace-uncaught ...` to show where the exception was thrown) - - Node.js * -diff --git a/test/fixtures/errors/throw_undefined.snapshot b/test/fixtures/errors/throw_undefined.snapshot -index baae7384453373f3a005b4f85abb702a4c165f98..b6b6060b17839f3452aa915c12bd5174b7585414 100644 ---- a/test/fixtures/errors/throw_undefined.snapshot -+++ b/test/fixtures/errors/throw_undefined.snapshot -@@ -3,6 +3,6 @@ - throw undefined; - ^ - undefined --(Use `node --trace-uncaught ...` to show where the exception was thrown) -+(Use `* --trace-uncaught ...` to show where the exception was thrown) - - Node.js * diff --git a/test/fixtures/test-runner/output/arbitrary-output-colored.js b/test/fixtures/test-runner/output/arbitrary-output-colored.js index af23e674cb361ed81dafa22670d5633559cd1144..1dd59990cb7cdba8aecf4f499ee6b92e7cd41b30 100644 --- a/test/fixtures/test-runner/output/arbitrary-output-colored.js @@ -67,32 +20,3 @@ index af23e674cb361ed81dafa22670d5633559cd1144..1dd59990cb7cdba8aecf4f499ee6b92e + await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 }}), 'exit'); + await once(spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 } }), 'exit'); })().then(common.mustCall()); -diff --git a/test/parallel/test-node-output-errors.mjs b/test/parallel/test-node-output-errors.mjs -index 84f20a77dda367fe1ada8d616c7b6813d39efd43..9bebb256776c5be155a8de07abbe4284bc8dad8a 100644 ---- a/test/parallel/test-node-output-errors.mjs -+++ b/test/parallel/test-node-output-errors.mjs -@@ -3,6 +3,7 @@ import * as fixtures from '../common/fixtures.mjs'; - import * as snapshot from '../common/assertSnapshot.js'; - import * as os from 'node:os'; - import { describe, it } from 'node:test'; -+import { basename } from 'node:path'; - import { pathToFileURL } from 'node:url'; - - const skipForceColors = -@@ -20,13 +21,15 @@ function replaceForceColorsStackTrace(str) { - - describe('errors output', { concurrency: true }, () => { - function normalize(str) { -+ const baseName = basename(process.argv0 || 'node', '.exe'); - return str.replaceAll(snapshot.replaceWindowsPaths(process.cwd()), '') - .replaceAll(pathToFileURL(process.cwd()).pathname, '') - .replaceAll('//', '*') - .replaceAll(/\/(\w)/g, '*$1') - .replaceAll('*test*', '*') - .replaceAll('*fixtures*errors*', '*') -- .replaceAll('file:**', 'file:*/'); -+ .replaceAll('file:**', 'file:*/') -+ .replaceAll(`${baseName} --`, '* --'); - } - - function normalizeNoNumbers(str) { diff --git a/patches/node/cli_remove_deprecated_v8_flag.patch b/patches/node/cli_remove_deprecated_v8_flag.patch index 0a4e8eb25b..8a9772f144 100644 --- a/patches/node/cli_remove_deprecated_v8_flag.patch +++ b/patches/node/cli_remove_deprecated_v8_flag.patch @@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso Reviewed-By: Yagiz Nizipli diff --git a/doc/api/cli.md b/doc/api/cli.md -index ed0a43306e87962cf0e756d9e059ec5c08ad674b..7ada2802b2590e78fa5b9847935866b743cf94ed 100644 +index 0cfed4a4a91a3d3fb5aee6c9a4db3405ba836565..61d980a12fcf7c799e726e1462c65ce478a8ed0c 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md -@@ -2868,7 +2868,6 @@ V8 options that are allowed are: +@@ -3151,7 +3151,6 @@ V8 options that are allowed are: * `--disallow-code-generation-from-strings` * `--enable-etw-stack-walking` * `--expose-gc` @@ -30,10 +30,10 @@ index ed0a43306e87962cf0e756d9e059ec5c08ad674b..7ada2802b2590e78fa5b9847935866b7 * `--jitless` * `--max-old-space-size` diff --git a/src/node_options.cc b/src/node_options.cc -index 4e3c82e9528b04fd1a0cc99d30fb885e4b224bc9..38e173f72b446aa2db07f676b6ece26247bbf56b 100644 +index 4b3f7751db2871c8ce76b197a84a2417097030ea..21e53e1053fe2e4194d91b27a726d3a1306b1683 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -866,11 +866,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( +@@ -922,11 +922,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( "disallow eval and friends", V8Option{}, kAllowedInEnvvar); @@ -46,7 +46,7 @@ index 4e3c82e9528b04fd1a0cc99d30fb885e4b224bc9..38e173f72b446aa2db07f676b6ece262 "disable runtime allocation of executable memory", V8Option{}, diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js -index 8d614e607177cdd922fef65a85a2ccdcf54116c0..146df3a21a0551e910c46248d2fd97dde8896164 100644 +index e898a81af09ca6852ddc866310e5b8e0dc82971b..22d5a342df5d55f065383a6ebe1aebe59dc0f8d2 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -70,7 +70,6 @@ if (common.hasCrypto) { diff --git a/patches/node/deprecate_vector_v8_local_in_v8.patch b/patches/node/deprecate_vector_v8_local_in_v8.patch deleted file mode 100644 index 7462efb97f..0000000000 --- a/patches/node/deprecate_vector_v8_local_in_v8.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Sun, 10 Mar 2024 16:59:30 +0100 -Subject: Deprecate vector in v8 - -Adapts for changes in https://chromium-review.googlesource.com/c/v8/v8/+/4866222. - -This patch can be removed when Electron upgrades to a version of Node.js that -contains the above CL. - -diff --git a/src/module_wrap.cc b/src/module_wrap.cc -index e862b51293135995c527c32aa3c3579780d7831c..ff658ec88e5161cd66536ee6e95dba675b16eccc 100644 ---- a/src/module_wrap.cc -+++ b/src/module_wrap.cc -@@ -186,7 +186,9 @@ void ModuleWrap::New(const FunctionCallbackInfo& args) { - export_names[i] = export_name_val.As(); - } - -- module = Module::CreateSyntheticModule(isolate, url, export_names, -+ -+ module = Module::CreateSyntheticModule(isolate, url, -+ v8::MemorySpan>(export_names.begin(), export_names.end()), - SyntheticModuleEvaluationStepsCallback); - } else { - ScriptCompiler::CachedData* cached_data = nullptr; diff --git a/patches/node/enable_crashpad_linux_node_processes.patch b/patches/node/enable_crashpad_linux_node_processes.patch index 931c066507..6f403b6ac8 100644 --- a/patches/node/enable_crashpad_linux_node_processes.patch +++ b/patches/node/enable_crashpad_linux_node_processes.patch @@ -8,7 +8,7 @@ to child processes spawned with `ELECTRON_RUN_AS_NODE` which is used by the crashpad client to connect with the handler process. diff --git a/lib/child_process.js b/lib/child_process.js -index 48870b35ad0f3411f2d509b12d92a9e0d20046f9..e7ef454d2d71207ae7b2788a437b82bf7732716e 100644 +index 580a441a803bdd0b57871c0cdd8af576f11609b1..755712d24219de7ffe491957d941df7c8cf7baad 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -61,6 +61,7 @@ let debug = require('internal/util/debuglog').debuglog( @@ -19,7 +19,7 @@ index 48870b35ad0f3411f2d509b12d92a9e0d20046f9..e7ef454d2d71207ae7b2788a437b82bf const { AbortError, -@@ -154,7 +155,6 @@ function fork(modulePath, args = [], options) { +@@ -153,7 +154,6 @@ function fork(modulePath, args = [], options) { ArrayPrototypeSplice(execArgv, index - 1, 2); } } @@ -27,7 +27,7 @@ index 48870b35ad0f3411f2d509b12d92a9e0d20046f9..e7ef454d2d71207ae7b2788a437b82bf args = [...execArgv, modulePath, ...args]; if (typeof options.stdio === 'string') { -@@ -618,6 +618,22 @@ function normalizeSpawnArguments(file, args, options) { +@@ -617,6 +617,22 @@ function normalizeSpawnArguments(file, args, options) { 'options.windowsVerbatimArguments'); } @@ -50,7 +50,7 @@ index 48870b35ad0f3411f2d509b12d92a9e0d20046f9..e7ef454d2d71207ae7b2788a437b82bf if (options.shell) { validateArgumentNullCheck(options.shell, 'options.shell'); const command = ArrayPrototypeJoin([file, ...args], ' '); -@@ -651,7 +667,6 @@ function normalizeSpawnArguments(file, args, options) { +@@ -650,7 +666,6 @@ function normalizeSpawnArguments(file, args, options) { ArrayPrototypeUnshift(args, file); } diff --git a/patches/node/esm_drop_support_for_import_assertions.patch b/patches/node/esm_drop_support_for_import_assertions.patch deleted file mode 100644 index ff45e7c990..0000000000 --- a/patches/node/esm_drop_support_for_import_assertions.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= -Date: Fri, 19 Apr 2024 02:01:24 +0200 -Subject: esm: drop support for import assertions - -This patch removes support for the `assert` keyword -for import attributes. It was an old variant of the -proposal that was only shipped in V8 and no other -engine, and that has then been replaced by the `with` -keyword. - -Chrome is planning to remove support for `assert` -in version 126, which will be released in June. - -Node.js already supports the `with` keyword for -import attributes, and this patch does not change that. - -PR-URL: https://github.com/nodejs/node/pull/52104 -Reviewed-By: Matteo Collina -Reviewed-By: Joyee Cheung -Reviewed-By: Yagiz Nizipli -Reviewed-By: Ethan Arrowood -Reviewed-By: Geoffrey Booth -(cherry picked from commit 25c79f333104d1feb0d84794d5bcdb4227177c9b) - -esm: remove --no-import-harmony-assertions - -It is off by default now. - -PR-URL: https://github.com/nodejs/node/pull/54890 -Reviewed-By: Luigi Pinca -Reviewed-By: Yagiz Nizipli -Reviewed-By: Antoine du Hamel -Reviewed-By: James M Snell -(cherry picked from commit 8fd90938f923ef2a04bb3ebb08b89568fe6fd4ee) - -diff --git a/src/node.cc b/src/node.cc -index 9f6f8e53abd7e447d88c187c447431a0d96cd150..4415f18ecbd84c1f41e0febbf2446fb636242d58 100644 ---- a/src/node.cc -+++ b/src/node.cc -@@ -778,12 +778,6 @@ static ExitCode ProcessGlobalArgsInternal(std::vector* args, - return ExitCode::kInvalidCommandLineArgument2; - } - -- // TODO(aduh95): remove this when the harmony-import-assertions flag -- // is removed in V8. -- if (std::find(v8_args.begin(), v8_args.end(), -- "--no-harmony-import-assertions") == v8_args.end()) { -- v8_args.emplace_back("--harmony-import-assertions"); -- } - // TODO(aduh95): remove this when the harmony-import-attributes flag - // is removed in V8. - if (std::find(v8_args.begin(), diff --git a/patches/node/expose_get_builtin_module_function.patch b/patches/node/expose_get_builtin_module_function.patch index 4a9b451241..39d3c031d4 100644 --- a/patches/node/expose_get_builtin_module_function.patch +++ b/patches/node/expose_get_builtin_module_function.patch @@ -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 6b0297d8984ccb34b8d0019fedd1307d48cf49f8..4e750be66452de47040e3a46555c062dfccf7807 100644 +index c2ef9b36d5b2967c798c123b6cbbd099b15c2791..b5c0a93d83ab4d4f6792d0eb648e7198de874bcf 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc -@@ -641,6 +641,10 @@ void GetInternalBinding(const FunctionCallbackInfo& args) { +@@ -653,6 +653,10 @@ void GetInternalBinding(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(exports); } @@ -24,10 +24,10 @@ index 6b0297d8984ccb34b8d0019fedd1307d48cf49f8..4e750be66452de47040e3a46555c062d Environment* env = Environment::GetCurrent(args); diff --git a/src/node_binding.h b/src/node_binding.h -index 7256bf2bbcf73214a25e61156305cc212b6f2451..d129981ad8588376eeee61155964062f624695d6 100644 +index eb1364cb01a2bea52bce768056e73b0f3a86ae35..d421a2773403e7b22fcca2fcf8275ef2d9654c55 100644 --- a/src/node_binding.h +++ b/src/node_binding.h -@@ -137,6 +137,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo& args); +@@ -146,6 +146,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo& args); void GetLinkedBinding(const v8::FunctionCallbackInfo& args); void DLOpen(const v8::FunctionCallbackInfo& args); diff --git a/patches/node/feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch b/patches/node/feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch index a1b2774b5c..68284309f8 100644 --- a/patches/node/feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch +++ b/patches/node/feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch @@ -26,7 +26,7 @@ index 0f5ddfb3ca21b7e5b38d0a4ce4b9e77387597199..ba815202fb157aa82859ec0518523cf6 .. c:function:: int uv_loop_close(uv_loop_t* loop) diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h -index 02397dd0fdd43d51f86c0dde9a62046702f12bdb..3375600023e39ddacf62cc17deb4f206db942084 100644 +index a62b3fa69b1087847f37c7093954e19a07959b74..7f48b7daa87d1a5b14bc6f641b60f21263fa5ec3 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -260,7 +260,8 @@ typedef struct uv_metrics_s uv_metrics_t; @@ -101,10 +101,10 @@ index 0ff2669e30a628dbb2df9e28ba14b38cf14114e5..117190ef26338944b78dbed7380c631d static int uv__async_start(uv_loop_t* loop) { int pipefd[2]; diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c -index 25c5181f370e94983e8a5f797f02f7a8dc207e00..f4d9059796d2c65339a5d48ecb273b09d9364d21 100644 +index 965e7f775250cf9899266bc3aaf62eda69367264..45b3dec662b093a61af356e431416530b35343d2 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c -@@ -926,6 +926,9 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { +@@ -927,6 +927,9 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { loop->watchers[w->fd] = w; loop->nfds++; } @@ -114,7 +114,7 @@ index 25c5181f370e94983e8a5f797f02f7a8dc207e00..f4d9059796d2c65339a5d48ecb273b09 } -@@ -957,6 +960,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) { +@@ -958,6 +961,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) { } else if (uv__queue_empty(&w->watcher_queue)) uv__queue_insert_tail(&loop->watcher_queue, &w->watcher_queue); @@ -124,7 +124,7 @@ index 25c5181f370e94983e8a5f797f02f7a8dc207e00..f4d9059796d2c65339a5d48ecb273b09 } -@@ -973,6 +979,9 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) { +@@ -974,6 +980,9 @@ 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 (uv__queue_empty(&w->pending_queue)) uv__queue_insert_tail(&loop->pending_queue, &w->pending_queue); @@ -241,7 +241,7 @@ index e9885a0f1ff3890a8d957c8793e22b01cedc0e97..ae3d09878253fe7169ad7b74b3faea02 return -1; } diff --git a/deps/uv/test/test-embed.c b/deps/uv/test/test-embed.c -index bbe56e176db17a502d7f3864ba529212f553590a..b0da9d1cddc69428e9fb3379d1338cf893ab93d2 100644 +index 6e9917239aa5626dd56fffd6eb2469d3e63224bf..b0da9d1cddc69428e9fb3379d1338cf893ab93d2 100644 --- a/deps/uv/test/test-embed.c +++ b/deps/uv/test/test-embed.c @@ -25,54 +25,184 @@ @@ -278,7 +278,7 @@ index bbe56e176db17a502d7f3864ba529212f553590a..b0da9d1cddc69428e9fb3379d1338cf8 -static void thread_main(void* arg) { - ASSERT_LE(0, uv_barrier_wait(&barrier)); - uv_sleep(250); -- ASSERT_EQ(0, uv_async_send(&async)); +- ASSERT_OK(uv_async_send(&async)); -} +static uv_timer_t main_timer; +static int main_timer_called; @@ -333,9 +333,9 @@ index bbe56e176db17a502d7f3864ba529212f553590a..b0da9d1cddc69428e9fb3379d1338cf8 - uv_loop_t* loop; - - loop = uv_default_loop(); -- ASSERT_EQ(0, uv_async_init(loop, &async, async_cb)); -- ASSERT_EQ(0, uv_barrier_init(&barrier, 2)); -- ASSERT_EQ(0, uv_thread_create(&thread, thread_main, NULL)); +- ASSERT_OK(uv_async_init(loop, &async, async_cb)); +- ASSERT_OK(uv_barrier_init(&barrier, 2)); +- ASSERT_OK(uv_thread_create(&thread, thread_main, NULL)); - ASSERT_LE(0, uv_barrier_wait(&barrier)); - - while (uv_loop_alive(loop)) { @@ -457,7 +457,7 @@ index bbe56e176db17a502d7f3864ba529212f553590a..b0da9d1cddc69428e9fb3379d1338cf8 + uv_timer_init(&external_loop, &external_timer); + uv_timer_start(&external_timer, external_timer_cb, 100, 0); -- ASSERT_EQ(0, uv_thread_join(&thread)); +- ASSERT_OK(uv_thread_join(&thread)); - uv_barrier_destroy(&barrier); + run_loop(); + ASSERT_EQ(main_timer_called, 1); @@ -465,10 +465,10 @@ index bbe56e176db17a502d7f3864ba529212f553590a..b0da9d1cddc69428e9fb3379d1338cf8 MAKE_VALGRIND_HAPPY(loop); return 0; diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h -index 78ff9c2d1621676feab5d357609970cdf1ba5864..204160f324ad1a80c9b042e62c4bedcb745666ba 100644 +index d30f02faa8515ca3a995490d53f2e85fda11c6a2..a392f5e3d701b0d973db2bbc6553977ce55a8775 100644 --- a/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h -@@ -273,6 +273,7 @@ TEST_DECLARE (process_priority) +@@ -276,6 +276,7 @@ TEST_DECLARE (process_priority) TEST_DECLARE (has_ref) TEST_DECLARE (active) TEST_DECLARE (embed) @@ -476,7 +476,7 @@ index 78ff9c2d1621676feab5d357609970cdf1ba5864..204160f324ad1a80c9b042e62c4bedcb TEST_DECLARE (async) TEST_DECLARE (async_null_cb) TEST_DECLARE (eintr_handling) -@@ -894,6 +895,7 @@ TASK_LIST_START +@@ -906,6 +907,7 @@ TASK_LIST_START TEST_ENTRY (active) TEST_ENTRY (embed) diff --git a/patches/node/fix_-wextra-semi_errors_in_nghttp2_helper_h.patch b/patches/node/fix_-wextra-semi_errors_in_nghttp2_helper_h.patch new file mode 100644 index 0000000000..238db21385 --- /dev/null +++ b/patches/node/fix_-wextra-semi_errors_in_nghttp2_helper_h.patch @@ -0,0 +1,60 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Wed, 16 Oct 2024 16:09:37 +0200 +Subject: fix: -Wextra-semi errors in nghttp2_helper.h + +Introduced in https://github.com/nodejs/node/pull/52966 + +Upstreamed in https://github.com/nghttp2/nghttp2/pull/2258 + +diff --git a/deps/nghttp2/lib/nghttp2_helper.h b/deps/nghttp2/lib/nghttp2_helper.h +index 89b0d4f535db795cd1df582475c02b2f4d1ac98f..f5de6290dab0e17ae3aff10230dd8ad7414f9631 100644 +--- a/deps/nghttp2/lib/nghttp2_helper.h ++++ b/deps/nghttp2/lib/nghttp2_helper.h +@@ -38,28 +38,28 @@ + #define nghttp2_max_def(SUFFIX, T) \ + static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; } + +-nghttp2_max_def(int8, int8_t); +-nghttp2_max_def(int16, int16_t); +-nghttp2_max_def(int32, int32_t); +-nghttp2_max_def(int64, int64_t); +-nghttp2_max_def(uint8, uint8_t); +-nghttp2_max_def(uint16, uint16_t); +-nghttp2_max_def(uint32, uint32_t); +-nghttp2_max_def(uint64, uint64_t); +-nghttp2_max_def(size, size_t); ++nghttp2_max_def(int8, int8_t) ++nghttp2_max_def(int16, int16_t) ++nghttp2_max_def(int32, int32_t) ++nghttp2_max_def(int64, int64_t) ++nghttp2_max_def(uint8, uint8_t) ++nghttp2_max_def(uint16, uint16_t) ++nghttp2_max_def(uint32, uint32_t) ++nghttp2_max_def(uint64, uint64_t) ++nghttp2_max_def(size, size_t) + + #define nghttp2_min_def(SUFFIX, T) \ + static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; } + +-nghttp2_min_def(int8, int8_t); +-nghttp2_min_def(int16, int16_t); +-nghttp2_min_def(int32, int32_t); +-nghttp2_min_def(int64, int64_t); +-nghttp2_min_def(uint8, uint8_t); +-nghttp2_min_def(uint16, uint16_t); +-nghttp2_min_def(uint32, uint32_t); +-nghttp2_min_def(uint64, uint64_t); +-nghttp2_min_def(size, size_t); ++nghttp2_min_def(int8, int8_t) ++nghttp2_min_def(int16, int16_t) ++nghttp2_min_def(int32, int32_t) ++nghttp2_min_def(int64, int64_t) ++nghttp2_min_def(uint8, uint8_t) ++nghttp2_min_def(uint16, uint16_t) ++nghttp2_min_def(uint32, uint32_t) ++nghttp2_min_def(uint64, uint64_t) ++nghttp2_min_def(size, size_t) + + #define lstreq(A, B, N) ((sizeof((A)) - 1) == (N) && memcmp((A), (B), (N)) == 0) + diff --git a/patches/node/fix_account_for_createexternalizablestring_v8_global.patch b/patches/node/fix_account_for_createexternalizablestring_v8_global.patch deleted file mode 100644 index d0dc5f5e72..0000000000 --- a/patches/node/fix_account_for_createexternalizablestring_v8_global.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Tue, 23 May 2023 18:21:17 +0200 -Subject: fix: account for createExternalizableString V8 global - -Introduced in https://chromium-review.googlesource.com/c/v8/v8/+/4531903. - -This patch can be removed when Node.js upgrades to a version of V8 with the above -CL - they'll need to make the same change. - -diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js -index 59b83f531cf0a60f960d0096aea70854f45bd629..9dcc35987a4757ea090e81c7de38a6af5bc3182f 100644 ---- a/test/parallel/test-fs-write.js -+++ b/test/parallel/test-fs-write.js -@@ -38,7 +38,7 @@ const constants = fs.constants; - const { externalizeString, isOneByteString } = global; - - // Account for extra globals exposed by --expose_externalize_string. --common.allowGlobals(externalizeString, isOneByteString, global.x); -+common.allowGlobals(createExternalizableString, externalizeString, isOneByteString, global.x); - - { - const expected = 'ümlaut sechzig'; // Must be a unique string. diff --git a/patches/node/fix_adapt_debugger_tests_for_upstream_v8_changes.patch b/patches/node/fix_adapt_debugger_tests_for_upstream_v8_changes.patch deleted file mode 100644 index 978b11d75f..0000000000 --- a/patches/node/fix_adapt_debugger_tests_for_upstream_v8_changes.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Wed, 29 Mar 2023 09:55:47 +0200 -Subject: fix: adapt debugger tests for upstream v8 changes - -Updates debugger tests to conform to changes in https://chromium-review.googlesource.com/c/v8/v8/+/4290476 - -This can be removed when Node.js updates to at least V8 11.4. - -diff --git a/test/common/debugger.js b/test/common/debugger.js -index 4aff5b9a0f74d99f8f605b68631f820e282091ab..d5d77fc7c648ddb45225f04c6cf23f9816b2186d 100644 ---- a/test/common/debugger.js -+++ b/test/common/debugger.js -@@ -4,7 +4,7 @@ const spawn = require('child_process').spawn; - - const BREAK_MESSAGE = new RegExp('(?:' + [ - 'assert', 'break', 'break on start', 'debugCommand', -- 'exception', 'other', 'promiseRejection', -+ 'exception', 'other', 'promiseRejection', 'step', - ].join('|') + ') in', 'i'); - - let TIMEOUT = common.platformTimeout(5000); -@@ -121,13 +121,13 @@ function startCLI(args, flags = [], spawnOpts = {}) { - get breakInfo() { - const output = this.output; - const breakMatch = -- output.match(/break (?:on start )?in ([^\n]+):(\d+)\n/i); -+ output.match(/(step |break (?:on start )?)in ([^\n]+):(\d+)\n/i); - - if (breakMatch === null) { - throw new Error( - `Could not find breakpoint info in ${JSON.stringify(output)}`); - } -- return { filename: breakMatch[1], line: +breakMatch[2] }; -+ return { filename: breakMatch[2], line: +breakMatch[3] }; - }, - - ctrlC() { -diff --git a/test/parallel/test-debugger-break.js b/test/parallel/test-debugger-break.js -index 65b4355cfe7bc25464626cca6f1c3b0de1dd9a45..8e3a290321a2e70304859eb57a2056c3a70af0f6 100644 ---- a/test/parallel/test-debugger-break.js -+++ b/test/parallel/test-debugger-break.js -@@ -27,7 +27,7 @@ const cli = startCLI(['--port=0', script]); - - await cli.stepCommand('n'); - assert.ok( -- cli.output.includes(`break in ${script}:2`), -+ cli.output.includes(`step in ${script}:2`), - 'pauses in next line of the script'); - assert.match( - cli.output, -@@ -36,7 +36,7 @@ const cli = startCLI(['--port=0', script]); - - await cli.stepCommand('next'); - assert.ok( -- cli.output.includes(`break in ${script}:3`), -+ cli.output.includes(`step in ${script}:3`), - 'pauses in next line of the script'); - assert.match( - cli.output, -@@ -89,7 +89,7 @@ const cli = startCLI(['--port=0', script]); - await cli.stepCommand(''); - assert.match( - cli.output, -- /break in node:timers/, -+ /step in node:timers/, - 'entered timers.js'); - - await cli.stepCommand('cont'); -diff --git a/test/parallel/test-debugger-run-after-quit-restart.js b/test/parallel/test-debugger-run-after-quit-restart.js -index 2c56f7227aed69d781392ce2f3f40e489e3501f2..0e1048699206dcc77696974e097e97de6b217811 100644 ---- a/test/parallel/test-debugger-run-after-quit-restart.js -+++ b/test/parallel/test-debugger-run-after-quit-restart.js -@@ -25,7 +25,7 @@ const path = require('path'); - .then(() => cli.stepCommand('n')) - .then(() => { - assert.ok( -- cli.output.includes(`break in ${script}:2`), -+ cli.output.includes(`step in ${script}:2`), - 'steps to the 2nd line' - ); - }) diff --git a/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch b/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch index 0c0aebff56..d7cf142afa 100644 --- a/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch +++ b/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch @@ -7,7 +7,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 1ece4f5e494533ea0fa25e0d35143fe424dbf70b..697b8bba6a55358924d6986f2eb347a99ff73889 100644 +index a97e77860e151f5126515d65ef99b34aa7301f76..229cb96c1385c597138719f2b01f78bd54ad44ab 100644 --- a/common.gypi +++ b/common.gypi @@ -88,6 +88,23 @@ diff --git a/patches/node/fix_add_property_query_interceptors.patch b/patches/node/fix_add_property_query_interceptors.patch deleted file mode 100644 index b0c4211c1c..0000000000 --- a/patches/node/fix_add_property_query_interceptors.patch +++ /dev/null @@ -1,574 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: VerteDinde -Date: Mon, 24 Jun 2024 21:48:40 -0700 -Subject: fix: add property query interceptors - -This commit cherry-picks an upstream interceptor API change -from node-v8/canary to accomodate V8's upstream changes to old -interceptor APIs. - -Node PR: https://github.com/nodejs/node-v8/commit/d1f18b0bf16efbc1e54ba04a54735ce4683cb936 -CL: https://chromium-review.googlesource.com/c/v8/v8/+/5630388 - -This patch can be removed when the node change is incorporated into main. - -diff --git a/src/node_contextify.cc b/src/node_contextify.cc -index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465e11439b8 100644 ---- a/src/node_contextify.cc -+++ b/src/node_contextify.cc -@@ -49,6 +49,7 @@ using v8::FunctionTemplate; - using v8::HandleScope; - using v8::IndexedPropertyHandlerConfiguration; - using v8::Int32; -+using v8::Intercepted; - using v8::Isolate; - using v8::Just; - using v8::Local; -@@ -484,14 +485,15 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) { - } - - // static --void ContextifyContext::PropertyGetterCallback( -- Local property, -- const PropertyCallbackInfo& args) { -+Intercepted ContextifyContext::PropertyGetterCallback( -+ Local property, const PropertyCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args); - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - - Local context = ctx->context(); - Local sandbox = ctx->sandbox(); -@@ -515,18 +517,22 @@ void ContextifyContext::PropertyGetterCallback( - rv = ctx->global_proxy(); - - args.GetReturnValue().Set(rv); -+ return Intercepted::kYes; - } -+ return Intercepted::kNo; - } - - // static --void ContextifyContext::PropertySetterCallback( -+Intercepted ContextifyContext::PropertySetterCallback( - Local property, - Local value, -- const PropertyCallbackInfo& args) { -+ const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - - Local context = ctx->context(); - PropertyAttribute attributes = PropertyAttribute::None; -@@ -544,8 +550,9 @@ void ContextifyContext::PropertySetterCallback( - (static_cast(attributes) & - static_cast(PropertyAttribute::ReadOnly)); - -- if (read_only) -- return; -+ if (read_only) { -+ return Intercepted::kNo; -+ } - - // true for x = 5 - // false for this.x = 5 -@@ -564,11 +571,16 @@ void ContextifyContext::PropertySetterCallback( - - bool is_declared = is_declared_on_global_proxy || is_declared_on_sandbox; - if (!is_declared && args.ShouldThrowOnError() && is_contextual_store && -- !is_function) -- return; -+ !is_function) { -+ return Intercepted::kNo; -+ } - -- if (!is_declared && property->IsSymbol()) return; -- if (ctx->sandbox()->Set(context, property, value).IsNothing()) return; -+ if (!is_declared && property->IsSymbol()) { -+ return Intercepted::kNo; -+ } -+ if (ctx->sandbox()->Set(context, property, value).IsNothing()) { -+ return Intercepted::kNo; -+ } - - Local desc; - if (is_declared_on_sandbox && -@@ -582,19 +594,23 @@ void ContextifyContext::PropertySetterCallback( - // We have to specify the return value for any contextual or get/set - // property - if (desc_obj->HasOwnProperty(context, env->get_string()).FromMaybe(false) || -- desc_obj->HasOwnProperty(context, env->set_string()).FromMaybe(false)) -+ desc_obj->HasOwnProperty(context, env->set_string()).FromMaybe(false)) { - args.GetReturnValue().Set(value); -+ return Intercepted::kYes; -+ } - } -+ return Intercepted::kNo; - } - - // static --void ContextifyContext::PropertyDescriptorCallback( -- Local property, -- const PropertyCallbackInfo& args) { -+Intercepted ContextifyContext::PropertyDescriptorCallback( -+ Local property, const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - - Local context = ctx->context(); - -@@ -604,19 +620,23 @@ void ContextifyContext::PropertyDescriptorCallback( - Local desc; - if (sandbox->GetOwnPropertyDescriptor(context, property).ToLocal(&desc)) { - args.GetReturnValue().Set(desc); -+ return Intercepted::kYes; - } - } -+ return Intercepted::kNo; - } - - // static --void ContextifyContext::PropertyDefinerCallback( -+Intercepted ContextifyContext::PropertyDefinerCallback( - Local property, - const PropertyDescriptor& desc, -- const PropertyCallbackInfo& args) { -+ const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - - Local context = ctx->context(); - Isolate* isolate = context->GetIsolate(); -@@ -635,7 +655,7 @@ void ContextifyContext::PropertyDefinerCallback( - // If the property is set on the global as neither writable nor - // configurable, don't change it on the global or sandbox. - if (is_declared && read_only && dont_delete) { -- return; -+ return Intercepted::kNo; - } - - Local sandbox = ctx->sandbox(); -@@ -658,6 +678,9 @@ void ContextifyContext::PropertyDefinerCallback( - desc.has_set() ? desc.set() : Undefined(isolate).As()); - - define_prop_on_sandbox(&desc_for_sandbox); -+ // TODO(https://github.com/nodejs/node/issues/52634): this should return -+ // kYes to behave according to the expected semantics. -+ return Intercepted::kNo; - } else { - Local value = - desc.has_value() ? desc.value() : Undefined(isolate).As(); -@@ -669,26 +692,32 @@ void ContextifyContext::PropertyDefinerCallback( - PropertyDescriptor desc_for_sandbox(value); - define_prop_on_sandbox(&desc_for_sandbox); - } -+ // TODO(https://github.com/nodejs/node/issues/52634): this should return -+ // kYes to behave according to the expected semantics. -+ return Intercepted::kNo; - } - } - - // static --void ContextifyContext::PropertyDeleterCallback( -- Local property, -- const PropertyCallbackInfo& args) { -+Intercepted ContextifyContext::PropertyDeleterCallback( -+ Local property, const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - - Maybe success = ctx->sandbox()->Delete(ctx->context(), property); - -- if (success.FromMaybe(false)) -- return; -+ if (success.FromMaybe(false)) { -+ return Intercepted::kNo; -+ } - - // Delete failed on the sandbox, intercept and do not delete on - // the global object. - args.GetReturnValue().Set(false); -+ return Intercepted::kYes; - } - - // static -@@ -708,76 +737,84 @@ void ContextifyContext::PropertyEnumeratorCallback( - } - - // static --void ContextifyContext::IndexedPropertyGetterCallback( -- uint32_t index, -- const PropertyCallbackInfo& args) { -+Intercepted ContextifyContext::IndexedPropertyGetterCallback( -+ uint32_t index, const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - -- ContextifyContext::PropertyGetterCallback( -+ return ContextifyContext::PropertyGetterCallback( - Uint32ToName(ctx->context(), index), args); - } - -- --void ContextifyContext::IndexedPropertySetterCallback( -+Intercepted ContextifyContext::IndexedPropertySetterCallback( - uint32_t index, - Local value, -- const PropertyCallbackInfo& args) { -+ const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - -- ContextifyContext::PropertySetterCallback( -+ return ContextifyContext::PropertySetterCallback( - Uint32ToName(ctx->context(), index), value, args); - } - - // static --void ContextifyContext::IndexedPropertyDescriptorCallback( -- uint32_t index, -- const PropertyCallbackInfo& args) { -+Intercepted ContextifyContext::IndexedPropertyDescriptorCallback( -+ uint32_t index, const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - -- ContextifyContext::PropertyDescriptorCallback( -+ return ContextifyContext::PropertyDescriptorCallback( - Uint32ToName(ctx->context(), index), args); - } - - --void ContextifyContext::IndexedPropertyDefinerCallback( -+Intercepted ContextifyContext::IndexedPropertyDefinerCallback( - uint32_t index, - const PropertyDescriptor& desc, -- const PropertyCallbackInfo& args) { -+ const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - -- ContextifyContext::PropertyDefinerCallback( -+ return ContextifyContext::PropertyDefinerCallback( - Uint32ToName(ctx->context(), index), desc, args); - } - - // static --void ContextifyContext::IndexedPropertyDeleterCallback( -- uint32_t index, -- const PropertyCallbackInfo& args) { -+Intercepted ContextifyContext::IndexedPropertyDeleterCallback( -+ uint32_t index, const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -- if (IsStillInitializing(ctx)) return; -+ if (IsStillInitializing(ctx)) { -+ return Intercepted::kNo; -+ } - - Maybe success = ctx->sandbox()->Delete(ctx->context(), index); - -- if (success.FromMaybe(false)) -- return; -+ if (success.FromMaybe(false)) { -+ return Intercepted::kNo; -+ } - - // Delete failed on the sandbox, intercept and do not delete on - // the global object. - args.GetReturnValue().Set(false); -+ return Intercepted::kYes; - } - - void ContextifyScript::CreatePerIsolateProperties( -diff --git a/src/node_contextify.h b/src/node_contextify.h -index 10715c7eb07715cc11e49734bd54747dad95f6a4..49b9fabb399aed962e0d29e784a25ca4e9780a8f 100644 ---- a/src/node_contextify.h -+++ b/src/node_contextify.h -@@ -111,42 +111,39 @@ class ContextifyContext : public BaseObject { - const v8::FunctionCallbackInfo& args); - static void WeakCallback( - const v8::WeakCallbackInfo& data); -- static void PropertyGetterCallback( -+ static v8::Intercepted PropertyGetterCallback( - v8::Local property, - const v8::PropertyCallbackInfo& args); -- static void PropertySetterCallback( -+ static v8::Intercepted PropertySetterCallback( - v8::Local property, - v8::Local value, -- const v8::PropertyCallbackInfo& args); -- static void PropertyDescriptorCallback( -+ const v8::PropertyCallbackInfo& args); -+ static v8::Intercepted PropertyDescriptorCallback( - v8::Local property, - const v8::PropertyCallbackInfo& args); -- static void PropertyDefinerCallback( -+ static v8::Intercepted PropertyDefinerCallback( - v8::Local property, - const v8::PropertyDescriptor& desc, -- const v8::PropertyCallbackInfo& args); -- static void PropertyDeleterCallback( -+ const v8::PropertyCallbackInfo& args); -+ static v8::Intercepted PropertyDeleterCallback( - v8::Local property, - const v8::PropertyCallbackInfo& args); - static void PropertyEnumeratorCallback( - const v8::PropertyCallbackInfo& args); -- static void IndexedPropertyGetterCallback( -- uint32_t index, -- const v8::PropertyCallbackInfo& args); -- static void IndexedPropertySetterCallback( -+ static v8::Intercepted IndexedPropertyGetterCallback( -+ uint32_t index, const v8::PropertyCallbackInfo& args); -+ static v8::Intercepted IndexedPropertySetterCallback( - uint32_t index, - v8::Local value, -- const v8::PropertyCallbackInfo& args); -- static void IndexedPropertyDescriptorCallback( -- uint32_t index, -- const v8::PropertyCallbackInfo& args); -- static void IndexedPropertyDefinerCallback( -+ const v8::PropertyCallbackInfo& args); -+ static v8::Intercepted IndexedPropertyDescriptorCallback( -+ uint32_t index, const v8::PropertyCallbackInfo& args); -+ static v8::Intercepted IndexedPropertyDefinerCallback( - uint32_t index, - const v8::PropertyDescriptor& desc, -- const v8::PropertyCallbackInfo& args); -- static void IndexedPropertyDeleterCallback( -- uint32_t index, -- const v8::PropertyCallbackInfo& args); -+ const v8::PropertyCallbackInfo& args); -+ static v8::Intercepted IndexedPropertyDeleterCallback( -+ uint32_t index, const v8::PropertyCallbackInfo& args); - - v8::Global context_; - std::unique_ptr microtask_queue_; -diff --git a/src/node_env_var.cc b/src/node_env_var.cc -index bce7ae07214ddf970a530db29ed6970e14b7a5ed..85f82180d48d6cfd7738cd7b1e504f23b38153e8 100644 ---- a/src/node_env_var.cc -+++ b/src/node_env_var.cc -@@ -16,6 +16,7 @@ using v8::DontEnum; - using v8::FunctionTemplate; - using v8::HandleScope; - using v8::Integer; -+using v8::Intercepted; - using v8::Isolate; - using v8::Just; - using v8::Local; -@@ -336,24 +337,27 @@ Maybe KVStore::AssignToObject(v8::Isolate* isolate, - return Just(true); - } - --static void EnvGetter(Local property, -- const PropertyCallbackInfo& info) { -+static Intercepted EnvGetter(Local property, -+ const PropertyCallbackInfo& info) { - Environment* env = Environment::GetCurrent(info); - CHECK(env->has_run_bootstrapping_code()); - if (property->IsSymbol()) { -- return info.GetReturnValue().SetUndefined(); -+ info.GetReturnValue().SetUndefined(); -+ return Intercepted::kYes; - } - CHECK(property->IsString()); - MaybeLocal value_string = - env->env_vars()->Get(env->isolate(), property.As()); - if (!value_string.IsEmpty()) { - info.GetReturnValue().Set(value_string.ToLocalChecked()); -+ return Intercepted::kYes; - } -+ return Intercepted::kNo; - } - --static void EnvSetter(Local property, -- Local value, -- const PropertyCallbackInfo& info) { -+static Intercepted EnvSetter(Local property, -+ Local value, -+ const PropertyCallbackInfo& info) { - Environment* env = Environment::GetCurrent(info); - CHECK(env->has_run_bootstrapping_code()); - // calling env->EmitProcessEnvWarning() sets a variable indicating that -@@ -369,35 +373,40 @@ static void EnvSetter(Local property, - "the " - "value to a string before setting process.env with it.", - "DEP0104") -- .IsNothing()) -- return; -+ .IsNothing()) { -+ return Intercepted::kNo; -+ } - } - - Local key; - Local value_string; - if (!property->ToString(env->context()).ToLocal(&key) || - !value->ToString(env->context()).ToLocal(&value_string)) { -- return; -+ return Intercepted::kNo; - } - - env->env_vars()->Set(env->isolate(), key, value_string); - -- // Whether it worked or not, always return value. -- info.GetReturnValue().Set(value); -+ return Intercepted::kYes; - } - --static void EnvQuery(Local property, -- const PropertyCallbackInfo& info) { -+static Intercepted EnvQuery(Local property, -+ const PropertyCallbackInfo& info) { - Environment* env = Environment::GetCurrent(info); - CHECK(env->has_run_bootstrapping_code()); - if (property->IsString()) { - int32_t rc = env->env_vars()->Query(env->isolate(), property.As()); -- if (rc != -1) info.GetReturnValue().Set(rc); -+ if (rc != -1) { -+ // Return attributes for the property. -+ info.GetReturnValue().Set(v8::None); -+ return Intercepted::kYes; -+ } - } -+ return Intercepted::kNo; - } - --static void EnvDeleter(Local property, -- const PropertyCallbackInfo& info) { -+static Intercepted EnvDeleter(Local property, -+ const PropertyCallbackInfo& info) { - Environment* env = Environment::GetCurrent(info); - CHECK(env->has_run_bootstrapping_code()); - if (property->IsString()) { -@@ -407,6 +416,7 @@ static void EnvDeleter(Local property, - // process.env never has non-configurable properties, so always - // return true like the tc39 delete operator. - info.GetReturnValue().Set(true); -+ return Intercepted::kYes; - } - - static void EnvEnumerator(const PropertyCallbackInfo& info) { -@@ -417,9 +427,9 @@ static void EnvEnumerator(const PropertyCallbackInfo& info) { - env->env_vars()->Enumerate(env->isolate())); - } - --static void EnvDefiner(Local property, -- const PropertyDescriptor& desc, -- const PropertyCallbackInfo& info) { -+static Intercepted EnvDefiner(Local property, -+ const PropertyDescriptor& desc, -+ const PropertyCallbackInfo& info) { - Environment* env = Environment::GetCurrent(info); - if (desc.has_value()) { - if (!desc.has_writable() || -@@ -430,6 +440,7 @@ static void EnvDefiner(Local property, - "configurable, writable," - " and enumerable " - "data descriptor"); -+ return Intercepted::kYes; - } else if (!desc.configurable() || - !desc.enumerable() || - !desc.writable()) { -@@ -438,6 +449,7 @@ static void EnvDefiner(Local property, - "configurable, writable," - " and enumerable " - "data descriptor"); -+ return Intercepted::kYes; - } else { - return EnvSetter(property, desc.value(), info); - } -@@ -447,12 +459,14 @@ static void EnvDefiner(Local property, - "'process.env' does not accept an" - " accessor(getter/setter)" - " descriptor"); -+ return Intercepted::kYes; - } else { - THROW_ERR_INVALID_OBJECT_DEFINE_PROPERTY(env, - "'process.env' only accepts a " - "configurable, writable," - " and enumerable " - "data descriptor"); -+ return Intercepted::kYes; - } - } - -diff --git a/src/node_external_reference.h b/src/node_external_reference.h -index c4aba23510872d66b58a1adc88cdd1ee85a86cfe..6d9988810b951771064de523bc20aaf389a9c08a 100644 ---- a/src/node_external_reference.h -+++ b/src/node_external_reference.h -@@ -66,16 +66,17 @@ class ExternalReferenceRegistry { - V(v8::FunctionCallback) \ - V(v8::AccessorNameGetterCallback) \ - V(v8::AccessorNameSetterCallback) \ -- V(v8::GenericNamedPropertyDefinerCallback) \ -- V(v8::GenericNamedPropertyDeleterCallback) \ -- V(v8::GenericNamedPropertyEnumeratorCallback) \ -- V(v8::GenericNamedPropertyQueryCallback) \ -- V(v8::GenericNamedPropertySetterCallback) \ -- V(v8::IndexedPropertySetterCallback) \ -- V(v8::IndexedPropertyDefinerCallback) \ -- V(v8::IndexedPropertyDeleterCallback) \ -- V(v8::IndexedPropertyQueryCallback) \ -- V(v8::IndexedPropertyDescriptorCallback) \ -+ V(v8::NamedPropertyGetterCallback) \ -+ V(v8::NamedPropertyDefinerCallback) \ -+ V(v8::NamedPropertyDeleterCallback) \ -+ V(v8::NamedPropertyEnumeratorCallback) \ -+ V(v8::NamedPropertyQueryCallback) \ -+ V(v8::NamedPropertySetterCallback) \ -+ V(v8::IndexedPropertyGetterCallbackV2) \ -+ V(v8::IndexedPropertySetterCallbackV2) \ -+ V(v8::IndexedPropertyDefinerCallbackV2) \ -+ V(v8::IndexedPropertyDeleterCallbackV2) \ -+ V(v8::IndexedPropertyQueryCallbackV2) \ - V(const v8::String::ExternalStringResourceBase*) - - #define V(ExternalReferenceType) \ diff --git a/patches/node/fix_add_trusted_space_and_trusted_lo_space_to_the_v8_heap.patch b/patches/node/fix_add_trusted_space_and_trusted_lo_space_to_the_v8_heap.patch deleted file mode 100644 index 311a90be6d..0000000000 --- a/patches/node/fix_add_trusted_space_and_trusted_lo_space_to_the_v8_heap.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Tue, 12 Sep 2023 11:08:18 +0200 -Subject: fix: Add TRUSTED_SPACE and TRUSTED_LO_SPACE to the V8 heap - -Added by V8 in https://chromium-review.googlesource.com/c/v8/v8/+/4791643 - -This patch can be removed when Node.js upgrades to a version of V8 that -includes this change. - -diff --git a/test/parallel/test-v8-stats.js b/test/parallel/test-v8-stats.js -index dd774267910aa0920ed077dd5bd5cfed93aab6cb..2366cbf716c11851bb3a759dce5db47d616516dc 100644 ---- a/test/parallel/test-v8-stats.js -+++ b/test/parallel/test-v8-stats.js -@@ -48,6 +48,8 @@ const expectedHeapSpaces = [ - 'read_only_space', - 'shared_large_object_space', - 'shared_space', -+ 'trusted_large_object_space', -+ 'trusted_space' - ]; - const heapSpaceStatistics = v8.getHeapSpaceStatistics(); - const actualHeapSpaceNames = heapSpaceStatistics.map((s) => s.space_name); diff --git a/patches/node/fix_assert_module_in_the_renderer_process.patch b/patches/node/fix_assert_module_in_the_renderer_process.patch index b89325039f..8bceb9a241 100644 --- a/patches/node/fix_assert_module_in_the_renderer_process.patch +++ b/patches/node/fix_assert_module_in_the_renderer_process.patch @@ -44,7 +44,7 @@ index 59b5a16f1309a5e4055bccfdb7a529045ad30402..bfdaf6211466a01b64b7942f7b16c480 let filename = call.getFileName(); const line = call.getLineNumber() - 1; diff --git a/src/api/environment.cc b/src/api/environment.cc -index b9098d102b40adad7fafcc331ac62870617019b9..cb9269a31e073caf86164aa39c0640370ade60fd 100644 +index f59abcb21d64b910d8d42eb23c03109f62558813..1b6613d1de8c89c8271066a652afd1024988362d 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -244,6 +244,9 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) { @@ -58,10 +58,10 @@ index b9098d102b40adad7fafcc331ac62870617019b9..cb9269a31e073caf86164aa39c064037 } diff --git a/src/node_options.cc b/src/node_options.cc -index 818baf611fcab7838a339f3ea137467653e270d0..4e3c82e9528b04fd1a0cc99d30fb885e4b224bc9 100644 +index 29630fcccc3bd9d24ad6aec64bef2fedfc3c4031..4b3f7751db2871c8ce76b197a84a2417097030ea 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -1405,14 +1405,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo& args) { +@@ -1464,14 +1464,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo& args) { } Isolate* isolate = args.GetIsolate(); diff --git a/patches/node/fix_capture_embedder_exceptions_before_entering_v8.patch b/patches/node/fix_capture_embedder_exceptions_before_entering_v8.patch index c2909b32d8..ac22a29a41 100644 --- a/patches/node/fix_capture_embedder_exceptions_before_entering_v8.patch +++ b/patches/node/fix_capture_embedder_exceptions_before_entering_v8.patch @@ -10,7 +10,7 @@ in the nodejs test suite. Need to be followed-up with upstream on the broader change as there maybe other callsites. diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc -index be02d4aaa04685cbd6a9ecfe082e38f179129ab5..277748a30bd97ae816d9ba1f2d73851a29b81010 100644 +index 70db7ddbeab5963f1bdf6cb05ee2763d76011cec..6ffe2a2ad01f33ff68c6646df330ec3ac7781a19 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -148,6 +148,9 @@ void HandleWrap::OnClose(uv_handle_t* handle) { @@ -21,62 +21,5 @@ index be02d4aaa04685cbd6a9ecfe082e38f179129ab5..277748a30bd97ae816d9ba1f2d73851a + return; + if (!wrap->persistent().IsEmpty() && - wrap->object()->Has(env->context(), env->handle_onclose_symbol()) - .FromMaybe(false)) { -diff --git a/src/node_contextify.cc b/src/node_contextify.cc -index 8951cd378a9025f58fada47cf96f686d14639f95..6456d87d4202c013aafe071adbac06852b3ae2c1 100644 ---- a/src/node_contextify.cc -+++ b/src/node_contextify.cc -@@ -487,6 +487,7 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) { - void ContextifyContext::PropertyGetterCallback( - Local property, - const PropertyCallbackInfo& args) { -+ Environment* env = Environment::GetCurrent(args); - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing -@@ -494,6 +495,8 @@ void ContextifyContext::PropertyGetterCallback( - - Local context = ctx->context(); - Local sandbox = ctx->sandbox(); -+ -+ TryCatchScope try_catch(env); - MaybeLocal maybe_rv = - sandbox->GetRealNamedProperty(context, property); - if (maybe_rv.IsEmpty()) { -@@ -503,6 +506,11 @@ void ContextifyContext::PropertyGetterCallback( - - Local rv; - if (maybe_rv.ToLocal(&rv)) { -+ if (try_catch.HasCaught() && -+ !try_catch.HasTerminated()) { -+ try_catch.ReThrow(); -+ } -+ - if (rv == sandbox) - rv = ctx->global_proxy(); - -diff --git a/src/node_messaging.cc b/src/node_messaging.cc -index e7d2bfbafef13f04a73dcbefe7d6e90b37b904d1..31b870c5f003b62b848c00d6032ed98eb829778d 100644 ---- a/src/node_messaging.cc -+++ b/src/node_messaging.cc -@@ -907,7 +907,7 @@ Maybe MessagePort::PostMessage(Environment* env, - const TransferList& transfer_v) { - Isolate* isolate = env->isolate(); - Local obj = object(isolate); -- -+ TryCatchScope try_catch(env); - std::shared_ptr msg = std::make_shared(); - - // Per spec, we need to both check if transfer list has the source port, and -@@ -915,6 +915,10 @@ Maybe MessagePort::PostMessage(Environment* env, - - Maybe serialization_maybe = - msg->Serialize(env, context, message_v, transfer_v, obj); -+ if (try_catch.HasCaught() && -+ !try_catch.HasTerminated()) { -+ try_catch.ReThrow(); -+ } - if (data_ == nullptr) { - return serialization_maybe; - } + wrap->object() + ->Has(env->context(), env->handle_onclose_symbol()) diff --git a/patches/node/fix_crypto_tests_to_run_with_bssl.patch b/patches/node/fix_crypto_tests_to_run_with_bssl.patch index 83b02e0c3f..544e4ef6af 100644 --- a/patches/node/fix_crypto_tests_to_run_with_bssl.patch +++ b/patches/node/fix_crypto_tests_to_run_with_bssl.patch @@ -10,15 +10,50 @@ This should be upstreamed in some form, though it may need to be tweaked before it's acceptable to upstream, as this patch comments out a couple of tests that upstream probably cares about. +diff --git a/test/common/index.js b/test/common/index.js +index 172cdb6b049824539a9850789e0e7c5baf613367..c29abc18191aec78ad8eb810093a9a4ef9e854e4 100644 +--- a/test/common/index.js ++++ b/test/common/index.js +@@ -65,6 +65,8 @@ const opensslVersionNumber = (major = 0, minor = 0, patch = 0) => { + return (major << 28) | (minor << 20) | (patch << 4); + }; + ++const openSSLIsBoringSSL = process.versions.openssl === '0.0.0'; ++ + let OPENSSL_VERSION_NUMBER; + const hasOpenSSL = (major = 0, minor = 0, patch = 0) => { + if (!hasCrypto) return false; +@@ -996,6 +998,7 @@ const common = { + mustNotMutateObjectDeep, + mustSucceed, + nodeProcessAborted, ++ openSSLIsBoringSSL, + PIPE, + parseTestFlags, + platformTimeout, +diff --git a/test/parallel/test-buffer-tostring-range.js b/test/parallel/test-buffer-tostring-range.js +index d033cd204b3200cdd736b581abe027d6e46e4ff3..73fec107a36c3db4af6f492137d0ca174f2d0547 100644 +--- a/test/parallel/test-buffer-tostring-range.js ++++ b/test/parallel/test-buffer-tostring-range.js +@@ -102,7 +102,8 @@ assert.throws(() => { + // Must not throw when start and end are within kMaxLength + // Cannot test on 32bit machine as we are testing the case + // when start and end are above the threshold +-common.skipIf32Bits(); ++if (!common.openSSLIsBoringSSL) { + const threshold = 0xFFFFFFFF; + const largeBuffer = Buffer.alloc(threshold + 20); + largeBuffer.toString('utf8', threshold, threshold + 20); ++} diff --git a/test/parallel/test-crypto-async-sign-verify.js b/test/parallel/test-crypto-async-sign-verify.js -index 4e3c32fdcd23fbe3e74bd5e624b739d224689f33..19d65aae7fa8ec9f9b907733ead17a208ed47909 100644 +index 4e3c32fdcd23fbe3e74bd5e624b739d224689f33..29149838ca76986928c7649a5f60a0f5e22a0705 100644 --- a/test/parallel/test-crypto-async-sign-verify.js +++ b/test/parallel/test-crypto-async-sign-verify.js @@ -88,6 +88,7 @@ test('rsa_public.pem', 'rsa_private.pem', 'sha256', false, // ED25519 test('ed25519_public.pem', 'ed25519_private.pem', undefined, true); // ED448 -+/* ++if (!common.openSSLIsBoringSSL) { test('ed448_public.pem', 'ed448_private.pem', undefined, true); // ECDSA w/ der signature encoding @@ -26,145 +61,10 @@ index 4e3c32fdcd23fbe3e74bd5e624b739d224689f33..19d65aae7fa8ec9f9b907733ead17a20 // DSA w/ ieee-p1363 signature encoding test('dsa_public.pem', 'dsa_private.pem', 'sha256', false, { dsaEncoding: 'ieee-p1363' }); -+*/ ++} // Test Parallel Execution w/ KeyObject is threadsafe in openssl3 { -diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js -index 59dd3b69c4bdf6dbd7b5e4f03df74caac551d459..1e0f9ce4c979683530afdf83ac3dc095acad2eb8 100644 ---- a/test/parallel/test-crypto-authenticated.js -+++ b/test/parallel/test-crypto-authenticated.js -@@ -48,7 +48,9 @@ const errMessages = { - const ciphers = crypto.getCiphers(); - - const expectedWarnings = common.hasFipsCrypto ? -- [] : [ -+ [] : !ciphers.includes('aes-192-ccm') ? [ -+ ['Use Cipheriv for counter mode of aes-192-gcm'], -+ ] : [ - ['Use Cipheriv for counter mode of aes-192-gcm'], - ['Use Cipheriv for counter mode of aes-192-ccm'], - ['Use Cipheriv for counter mode of aes-192-ccm'], -@@ -315,7 +317,9 @@ for (const test of TEST_CASES) { - - // Test that create(De|C)ipher(iv)? throws if the mode is CCM and an invalid - // authentication tag length has been specified. --{ -+if (!ciphers.includes('aes-256-ccm')) { -+ common.printSkipMessage(`unsupported aes-256-ccm test`); -+} else { - for (const authTagLength of [-1, true, false, NaN, 5.5]) { - assert.throws(() => { - crypto.createCipheriv('aes-256-ccm', -@@ -403,6 +407,10 @@ for (const test of TEST_CASES) { - // authentication tag has been specified. - { - for (const mode of ['ccm', 'ocb']) { -+ if (!ciphers.includes(`aes-256-${mode}`)) { -+ common.printSkipMessage(`unsupported aes-256-${mode} test`); -+ continue; -+ } - assert.throws(() => { - crypto.createCipheriv(`aes-256-${mode}`, - 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', -@@ -437,7 +445,9 @@ for (const test of TEST_CASES) { - } - - // Test that setAAD throws if an invalid plaintext length has been specified. --{ -+if (!ciphers.includes('aes-256-ccm')) { -+ common.printSkipMessage(`unsupported aes-256-ccm test`); -+} else { - const cipher = crypto.createCipheriv('aes-256-ccm', - 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', - 'qkuZpJWCewa6S', -@@ -458,7 +468,9 @@ for (const test of TEST_CASES) { - } - - // Test that setAAD and update throw if the plaintext is too long. --{ -+if (!ciphers.includes('aes-256-ccm')) { -+ common.printSkipMessage(`unsupported aes-256-ccm test`); -+} else { - for (const ivLength of [13, 12]) { - const maxMessageSize = (1 << (8 * (15 - ivLength))) - 1; - const key = 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8'; -@@ -489,7 +501,9 @@ for (const test of TEST_CASES) { - - // Test that setAAD throws if the mode is CCM and the plaintext length has not - // been specified. --{ -+if (!ciphers.includes('aes-256-ccm')) { -+ common.printSkipMessage(`unsupported aes-256-ccm test`); -+} else { - assert.throws(() => { - const cipher = crypto.createCipheriv('aes-256-ccm', - 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', -@@ -514,7 +528,9 @@ for (const test of TEST_CASES) { - } - - // Test that final() throws in CCM mode when no authentication tag is provided. --{ -+if (!ciphers.includes('aes-128-ccm')) { -+ common.printSkipMessage(`unsupported aes-256-ccm test`); -+} else { - if (!common.hasFipsCrypto) { - const key = Buffer.from('1ed2233fa2223ef5d7df08546049406c', 'hex'); - const iv = Buffer.from('7305220bca40d4c90e1791e9', 'hex'); -@@ -546,7 +562,9 @@ for (const test of TEST_CASES) { - } - - // Test that an IV length of 11 does not overflow max_message_size_. --{ -+if (!ciphers.includes('aes-128-ccm')) { -+ common.printSkipMessage(`unsupported aes-128-ccm test`); -+} else { - const key = 'x'.repeat(16); - const iv = Buffer.from('112233445566778899aabb', 'hex'); - const options = { authTagLength: 8 }; -@@ -563,6 +581,10 @@ for (const test of TEST_CASES) { - const iv = Buffer.from('0123456789ab', 'utf8'); - - for (const mode of ['gcm', 'ocb']) { -+ if (!ciphers.includes(`aes-128-${mode}`)) { -+ common.printSkipMessage(`unsupported aes-128-${mode} test`); -+ continue; -+ } - for (const authTagLength of mode === 'gcm' ? [undefined, 8] : [8]) { - const cipher = crypto.createCipheriv(`aes-128-${mode}`, key, iv, { - authTagLength -@@ -597,6 +619,10 @@ for (const test of TEST_CASES) { - const opts = { authTagLength: 8 }; - - for (const mode of ['gcm', 'ccm', 'ocb']) { -+ if (!ciphers.includes(`aes-128-${mode}`)) { -+ common.printSkipMessage(`unsupported aes-128-${mode} test`); -+ continue; -+ } - const cipher = crypto.createCipheriv(`aes-128-${mode}`, key, iv, opts); - const ciphertext = Buffer.concat([cipher.update(plain), cipher.final()]); - const tag = cipher.getAuthTag(); -@@ -619,7 +645,9 @@ for (const test of TEST_CASES) { - // Test chacha20-poly1305 rejects invalid IV lengths of 13, 14, 15, and 16 (a - // length of 17 or greater was already rejected). - // - https://www.openssl.org/news/secadv/20190306.txt --{ -+if (!ciphers.includes('chacha20-poly1305')) { -+ common.printSkipMessage(`unsupported chacha20-poly1305 test`); -+} else { - // Valid extracted from TEST_CASES, check that it detects IV tampering. - const valid = { - algo: 'chacha20-poly1305', -@@ -664,6 +692,9 @@ for (const test of TEST_CASES) { - - { - // CCM cipher without data should not crash, see https://github.com/nodejs/node/issues/38035. -+ common.printSkipMessage(`unsupported aes-128-ccm test`); -+ return; -+ - const algo = 'aes-128-ccm'; - const key = Buffer.alloc(16); - const iv = Buffer.alloc(12); diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js index 4a5f1f149fe6c739f7f1d2ee17df6e61a942d621..b3287f428ce6b3fde11d449c601a57ff5e3843f9 100644 --- a/test/parallel/test-crypto-certificate.js @@ -194,115 +94,6 @@ index 4a5f1f149fe6c739f7f1d2ee17df6e61a942d621..b3287f428ce6b3fde11d449c601a57ff } { -diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js -index 35514afbea92562a81c163b1e4d918b4ab609f71..13098e1acf12c309f2ed6f6143a2c2eeb8a2763d 100644 ---- a/test/parallel/test-crypto-cipher-decipher.js -+++ b/test/parallel/test-crypto-cipher-decipher.js -@@ -22,7 +22,7 @@ common.expectWarning({ - function testCipher1(key) { - // Test encryption and decryption - const plaintext = 'Keep this a secret? No! Tell everyone about node.js!'; -- const cipher = crypto.createCipher('aes192', key); -+ const cipher = crypto.createCipher('aes-192-cbc', key); - - // Encrypt plaintext which is in utf8 format - // to a ciphertext which will be in hex -@@ -30,7 +30,7 @@ function testCipher1(key) { - // Only use binary or hex, not base64. - ciph += cipher.final('hex'); - -- const decipher = crypto.createDecipher('aes192', key); -+ const decipher = crypto.createDecipher('aes-192-cbc', key); - let txt = decipher.update(ciph, 'hex', 'utf8'); - txt += decipher.final('utf8'); - -@@ -40,11 +40,11 @@ function testCipher1(key) { - // NB: In real life, it's not guaranteed that you can get all of it - // in a single read() like this. But in this case, we know it's - // quite small, so there's no harm. -- const cStream = crypto.createCipher('aes192', key); -+ const cStream = crypto.createCipher('aes-192-cbc', key); - cStream.end(plaintext); - ciph = cStream.read(); - -- const dStream = crypto.createDecipher('aes192', key); -+ const dStream = crypto.createDecipher('aes-192-cbc', key); - dStream.end(ciph); - txt = dStream.read().toString('utf8'); - -@@ -59,14 +59,14 @@ function testCipher2(key) { - '32|RmVZZkFUVmpRRkp0TmJaUm56ZU9qcnJkaXNNWVNpTTU*|iXmckfRWZBGWWELw' + - 'eCBsThSsfUHLeRe0KCsK8ooHgxie0zOINpXxfZi/oNG7uq9JWFVCk70gfzQH8ZUJ' + - 'jAfaFg**'; -- const cipher = crypto.createCipher('aes256', key); -+ const cipher = crypto.createCipher('aes-256-cbc', key); - - // Encrypt plaintext which is in utf8 format to a ciphertext which will be in - // Base64. - let ciph = cipher.update(plaintext, 'utf8', 'base64'); - ciph += cipher.final('base64'); - -- const decipher = crypto.createDecipher('aes256', key); -+ const decipher = crypto.createDecipher('aes-256-cbc', key); - let txt = decipher.update(ciph, 'base64', 'utf8'); - txt += decipher.final('utf8'); - -@@ -170,7 +170,7 @@ testCipher2(Buffer.from('0123456789abcdef')); - // Regression test for https://github.com/nodejs/node-v0.x-archive/issues/5482: - // string to Cipher#update() should not assert. - { -- const c = crypto.createCipher('aes192', '0123456789abcdef'); -+ const c = crypto.createCipher('aes-192-cbc', '0123456789abcdef'); - c.update('update'); - c.final(); - } -@@ -178,15 +178,15 @@ testCipher2(Buffer.from('0123456789abcdef')); - // https://github.com/nodejs/node-v0.x-archive/issues/5655 regression tests, - // 'utf-8' and 'utf8' are identical. - { -- let c = crypto.createCipher('aes192', '0123456789abcdef'); -+ let c = crypto.createCipher('aes-192-cbc', '0123456789abcdef'); - c.update('update', ''); // Defaults to "utf8". - c.final('utf-8'); // Should not throw. - -- c = crypto.createCipher('aes192', '0123456789abcdef'); -+ c = crypto.createCipher('aes-192-cbc', '0123456789abcdef'); - c.update('update', 'utf8'); - c.final('utf-8'); // Should not throw. - -- c = crypto.createCipher('aes192', '0123456789abcdef'); -+ c = crypto.createCipher('aes-192-cbc', '0123456789abcdef'); - c.update('update', 'utf-8'); - c.final('utf8'); // Should not throw. - } -@@ -195,23 +195,23 @@ testCipher2(Buffer.from('0123456789abcdef')); - { - const key = '0123456789abcdef'; - const plaintext = 'Top secret!!!'; -- const c = crypto.createCipher('aes192', key); -+ const c = crypto.createCipher('aes-192-cbc', key); - let ciph = c.update(plaintext, 'utf16le', 'base64'); - ciph += c.final('base64'); - -- let decipher = crypto.createDecipher('aes192', key); -+ let decipher = crypto.createDecipher('aes-192-cbc', key); - - let txt; - txt = decipher.update(ciph, 'base64', 'ucs2'); - txt += decipher.final('ucs2'); - assert.strictEqual(txt, plaintext); - -- decipher = crypto.createDecipher('aes192', key); -+ decipher = crypto.createDecipher('aes-192-cbc', key); - txt = decipher.update(ciph, 'base64', 'ucs-2'); - txt += decipher.final('ucs-2'); - assert.strictEqual(txt, plaintext); - -- decipher = crypto.createDecipher('aes192', key); -+ decipher = crypto.createDecipher('aes-192-cbc', key); - txt = decipher.update(ciph, 'base64', 'utf-16le'); - txt += decipher.final('utf-16le'); - assert.strictEqual(txt, plaintext); diff --git a/test/parallel/test-crypto-cipheriv-decipheriv.js b/test/parallel/test-crypto-cipheriv-decipheriv.js index 3e3632203af72c54f2795d8de0cf345862a043bb..a066bbb803d41d9d1f26a02e41115b71233988d6 100644 --- a/test/parallel/test-crypto-cipheriv-decipheriv.js @@ -318,21 +109,6 @@ index 3e3632203af72c54f2795d8de0cf345862a043bb..a066bbb803d41d9d1f26a02e41115b71 // Test encryption and decryption with explicit key and iv. // AES Key Wrap test vector comes from RFC3394 const plaintext = Buffer.from('00112233445566778899AABBCCDDEEFF', 'hex'); -diff --git a/test/parallel/test-crypto-classes.js b/test/parallel/test-crypto-classes.js -index dd073274aef765e8f1e403aa2c8baf9694b521cb..fc6339e040debe61ecc61a3eb5b26823b102f1ff 100644 ---- a/test/parallel/test-crypto-classes.js -+++ b/test/parallel/test-crypto-classes.js -@@ -22,8 +22,8 @@ const TEST_CASES = { - }; - - if (!common.hasFipsCrypto) { -- TEST_CASES.Cipher = ['aes192', 'secret']; -- TEST_CASES.Decipher = ['aes192', 'secret']; -+ TEST_CASES.Cipher = ['aes-192-cbc', 'secret']; -+ TEST_CASES.Decipher = ['aes-192-cbc', 'secret']; - TEST_CASES.DiffieHellman = [common.hasOpenSSL3 ? 1024 : 256]; - } - diff --git a/test/parallel/test-crypto-dh-curves.js b/test/parallel/test-crypto-dh-curves.js index 81a469c226c261564dee1e0b06b6571b18a41f1f..58b66045dba4201b7ebedd78b129420ffc316051 100644 --- a/test/parallel/test-crypto-dh-curves.js @@ -381,7 +157,7 @@ index fcf1922bcdba733af6c22f142db4f7b099947757..9f72ae4e41a113e752f40795103c2af5 assert.throws(() => crypto.createDiffieHellman('abcdef', g), ex); assert.throws(() => crypto.createDiffieHellman('abcdef', 'hex', g), ex); diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js -index 8ae0a002fec0944737d2c6ae73fc8956e41beb50..5b37236a6c2f1ec1761d8143c8ea6a7e2a837a7a 100644 +index 9ebe14011eed223994e0901bc22dcc582b4b0739..e78f90eb76380916ce7098fb517c83a954edb053 100644 --- a/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js @@ -55,18 +55,17 @@ const crypto = require('crypto'); @@ -411,13 +187,21 @@ index 8ae0a002fec0944737d2c6ae73fc8956e41beb50..5b37236a6c2f1ec1761d8143c8ea6a7e }; } -@@ -100,10 +99,16 @@ const crypto = require('crypto'); +@@ -93,17 +92,23 @@ const crypto = require('crypto'); + dh3.computeSecret(''); + }, { message: common.hasOpenSSL3 && !hasOpenSSL3WithNewErrorMessage ? + 'Unspecified validation error' : +- 'Supplied key is too small' }); ++ 'Supplied key is invalid' }); + } + } + // Through a fluke of history, g=0 defaults to DH_GENERATOR (2). { const g = 0; - crypto.createDiffieHellman('abcdef', g); + assert.throws(() => crypto.createDiffieHellman('abcdef', g), { -+ code: /INVALID_PARAMETERS/, ++ code: /ERR_CRYPTO_OPERATION_FAILED/, + name: 'Error' + }); crypto.createDiffieHellman('abcdef', 'hex', g); @@ -426,28 +210,28 @@ index 8ae0a002fec0944737d2c6ae73fc8956e41beb50..5b37236a6c2f1ec1761d8143c8ea6a7e { - crypto.createDiffieHellman('abcdef', Buffer.from([2])); // OK + assert.throws(() => crypto.createDiffieHellman('abcdef', Buffer.from([2])), { -+ code: /INVALID_PARAMETERS/, ++ code: /ERR_CRYPTO_OPERATION_FAILED/, + name: 'Error' + }); } diff --git a/test/parallel/test-crypto-getcipherinfo.js b/test/parallel/test-crypto-getcipherinfo.js -index 64b79fc36ccf4d38f763fcd8c1930473c82cefd7..892490fc7dd8da09f8aa10a20bec69385c0fee28 100644 +index 64b79fc36ccf4d38f763fcd8c1930473c82cefd7..1c6717ebd46497384b9b13174b65894ca89e7f2d 100644 --- a/test/parallel/test-crypto-getcipherinfo.js +++ b/test/parallel/test-crypto-getcipherinfo.js @@ -62,9 +62,13 @@ assert(getCipherInfo('aes-128-cbc', { ivLength: 16 })); assert(!getCipherInfo('aes-128-ccm', { ivLength: 1 })); assert(!getCipherInfo('aes-128-ccm', { ivLength: 14 })); -+/* ++if (!common.openSSLIsBoringSSL) { for (let n = 7; n <= 13; n++) assert(getCipherInfo('aes-128-ccm', { ivLength: n })); -+*/ ++} assert(!getCipherInfo('aes-128-ocb', { ivLength: 16 })); -+/* ++if (!common.openSSLIsBoringSSL) { for (let n = 1; n < 16; n++) assert(getCipherInfo('aes-128-ocb', { ivLength: n })); -+*/ ++} \ No newline at end of file diff --git a/test/parallel/test-crypto-hash-stream-pipe.js b/test/parallel/test-crypto-hash-stream-pipe.js index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf218791cd6868 100644 @@ -471,7 +255,7 @@ index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf2187 s.pipe(h).on('data', common.mustCall(function(c) { assert.strictEqual(c, expect); diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js -index af2146982c7a3bf7bd7527f44e4b17a3b605026e..f6b91f675cfea367c608892dee078b565814f2dd 100644 +index 83218c105a4596e0ae0381136f176bb8d759899e..afb3c8c592d2a8e2a053fd44f455af06c592a85e 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -182,6 +182,7 @@ assert.throws( @@ -549,7 +333,7 @@ index 1785f5eef3d202976666081d09850ed744d83446..e88227a215ba4f7fa196f7642ae694a5 }); diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js -index 5f4fafdfffbf726b7cb39c472baa3df25c9794cf..73bb53b0405b20f51b13326cc70e52755c674366 100644 +index 5f4fafdfffbf726b7cb39c472baa3df25c9794cf..d52376da2cddd90adcdf8a9b7dcd03e348d9f2b4 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -28,12 +28,11 @@ const dsaPkcs8KeyPem = fixtures.readKey('dsa_private_pkcs8.pem'); @@ -580,22 +364,25 @@ index 5f4fafdfffbf726b7cb39c472baa3df25c9794cf..73bb53b0405b20f51b13326cc70e5275 if (!process.config.variables.node_shared_openssl) { assert.throws(() => { crypto.privateDecrypt({ -@@ -466,7 +466,7 @@ assert.throws(() => { +@@ -466,10 +466,10 @@ assert.throws(() => { assert.strictEqual(verify2.verify(publicKey, signature, 'hex'), true); } - -+/* // // Test DSA signing and verification // ++if (!common.openSSLIsBoringSSL) { + { + const input = 'I AM THE WALRUS'; + @@ -541,3 +541,4 @@ const input = 'I AM THE WALRUS'; assert.strictEqual(verify.verify(dsaPubPem, signature, 'hex'), true); } -+*/ ++} diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js -index 61bd65fc92678c24baa3c0eb9ffb1ead64ace70b..cb690351696a811210b9d990ee4cde3cfb2a3446 100644 +index 338a19b0e88ad6f08d2f6b6a5d38b9980996ce11..a4ee215575d072450ba66c558ddca88bfb23d85f 100644 --- a/test/parallel/test-crypto-scrypt.js +++ b/test/parallel/test-crypto-scrypt.js @@ -178,7 +178,7 @@ for (const options of bad) { @@ -608,26 +395,19 @@ index 61bd65fc92678c24baa3c0eb9ffb1ead64ace70b..cb690351696a811210b9d990ee4cde3c }; assert.throws(() => crypto.scrypt('pass', 'salt', 1, options, () => {}), diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js -index 9dd586a1a1f9a00d9bb0af5b0532e81e7b96a5ce..1a0d0cfc09fb61d65472723ba54e1d0be69b5c68 100644 +index 9dd586a1a1f9a00d9bb0af5b0532e81e7b96a5ce..a37e6d50914345829c8260a97949cee7d17ab676 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js -@@ -28,6 +28,7 @@ const keySize = 2048; - 'instance when called without `new`'); +@@ -29,7 +29,7 @@ const keySize = 2048; } -+/* // Test handling of exceptional conditions - { +-{ ++if (!common.openSSLIsBoringSSL) { const library = { -@@ -68,6 +69,7 @@ const keySize = 2048; - - delete Object.prototype.opensslErrorStack; - } -+*/ - - assert.throws( - () => crypto.createVerify('SHA256').verify({ -@@ -341,15 +343,17 @@ assert.throws( + configurable: true, + set() { +@@ -341,15 +341,17 @@ assert.throws( padding: crypto.constants.RSA_PKCS1_OAEP_PADDING }); }, common.hasOpenSSL3 ? { @@ -649,7 +429,7 @@ index 9dd586a1a1f9a00d9bb0af5b0532e81e7b96a5ce..1a0d0cfc09fb61d65472723ba54e1d0b }); } -@@ -419,10 +423,12 @@ assert.throws( +@@ -419,10 +421,12 @@ assert.throws( public: fixtures.readKey('ed25519_public.pem', 'ascii'), algo: null, sigLen: 64 }, @@ -662,7 +442,7 @@ index 9dd586a1a1f9a00d9bb0af5b0532e81e7b96a5ce..1a0d0cfc09fb61d65472723ba54e1d0b { private: fixtures.readKey('rsa_private_2048.pem', 'ascii'), public: fixtures.readKey('rsa_public_2048.pem', 'ascii'), algo: 'sha1', -@@ -493,7 +499,7 @@ assert.throws( +@@ -493,7 +497,7 @@ assert.throws( { const data = Buffer.from('Hello world'); @@ -776,10 +556,10 @@ index 89a7521544f7051edc1779138551bbad1972b3fb..91df6acc65d4003999f29f0fa5f63905 } +*/ diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js -index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b65795857da1b 100644 +index 4271121881379b6c6892e89e520345f77e4181df..6c87a1ac687aa37d4ba245d1b6fc746a5f1eeffc 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js -@@ -67,7 +67,7 @@ assert.throws(() => { +@@ -61,7 +61,7 @@ assert.throws(() => { // Throws general Error, so there is no opensslErrorStack property. return err instanceof Error && err.name === 'Error' && @@ -788,7 +568,7 @@ index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b6579 !('opensslErrorStack' in err); }); -@@ -77,7 +77,7 @@ assert.throws(() => { +@@ -71,7 +71,7 @@ assert.throws(() => { // Throws general Error, so there is no opensslErrorStack property. return err instanceof Error && err.name === 'Error' && @@ -797,7 +577,7 @@ index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b6579 !('opensslErrorStack' in err); }); -@@ -87,7 +87,7 @@ assert.throws(() => { +@@ -81,7 +81,7 @@ assert.throws(() => { // Throws general Error, so there is no opensslErrorStack property. return err instanceof Error && err.name === 'Error' && @@ -806,7 +586,7 @@ index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b6579 !('opensslErrorStack' in err); }); -@@ -150,8 +150,6 @@ assert(crypto.getHashes().includes('sha1')); +@@ -144,8 +144,6 @@ assert(crypto.getHashes().includes('sha1')); assert(crypto.getHashes().includes('sha256')); assert(!crypto.getHashes().includes('SHA1')); assert(!crypto.getHashes().includes('SHA256')); @@ -815,16 +595,7 @@ index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b6579 validateList(crypto.getHashes()); // Make sure all of the hashes are supported by OpenSSL for (const algo of crypto.getHashes()) -@@ -188,7 +186,7 @@ const encodingError = { - // hex input that's not a power of two should throw, not assert in C++ land. - ['createCipher', 'createDecipher'].forEach((funcName) => { - assert.throws( -- () => crypto[funcName]('aes192', 'test').update('0', 'hex'), -+ () => crypto[funcName]('aes-192-cbc', 'test').update('0', 'hex'), - (error) => { - assert.ok(!('opensslErrorStack' in error)); - if (common.hasFipsCrypto) { -@@ -219,7 +217,7 @@ assert.throws( +@@ -195,7 +193,7 @@ assert.throws( return true; } ); @@ -833,7 +604,7 @@ index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b6579 assert.throws(() => { const priv = [ '-----BEGIN RSA PRIVATE KEY-----', -@@ -232,6 +230,7 @@ assert.throws(() => { +@@ -208,6 +206,7 @@ assert.throws(() => { ].join('\n'); crypto.createSign('SHA256').update('test').sign(priv); }, (err) => { @@ -841,7 +612,7 @@ index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b6579 if (!common.hasOpenSSL3) assert.ok(!('opensslErrorStack' in err)); assert.throws(() => { throw err; }, common.hasOpenSSL3 ? { -@@ -240,10 +239,10 @@ assert.throws(() => { +@@ -216,10 +215,10 @@ assert.throws(() => { library: 'rsa routines', } : { name: 'Error', @@ -856,7 +627,7 @@ index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b6579 code: 'ERR_OSSL_RSA_DIGEST_TOO_BIG_FOR_RSA_KEY' }); return true; -@@ -276,7 +275,7 @@ if (!common.hasOpenSSL3) { +@@ -252,7 +251,7 @@ if (!common.hasOpenSSL3) { return true; }); } @@ -954,56 +725,62 @@ index b06f2fa2c53ea72f9a66f0d002dd9281d0259a0f..864fffeebfad75d95416fd47efdea7f2 const server = https.createServer(opts, (req, res) => { diff --git a/test/parallel/test-webcrypto-derivebits.js b/test/parallel/test-webcrypto-derivebits.js -index eb09bc24f0cb8244b05987e3a7c1d203360d3a38..da891fffa29d5666d91e4445e54c43e3688b870a 100644 +index eb09bc24f0cb8244b05987e3a7c1d203360d3a38..011990db171faa708c5211f6ab9ae1ac0e0ab90e 100644 --- a/test/parallel/test-webcrypto-derivebits.js +++ b/test/parallel/test-webcrypto-derivebits.js -@@ -101,6 +101,7 @@ const { subtle } = globalThis.crypto; +@@ -101,8 +101,9 @@ const { subtle } = globalThis.crypto; tests.then(common.mustCall()); } -+/* ++ // Test X25519 and X448 bit derivation - { +-{ ++if (!common.openSSLIsBoringSSL) { async function test(name) { + const [alice, bob] = await Promise.all([ + subtle.generateKey({ name }, true, ['deriveBits']), @@ -126,3 +127,4 @@ const { subtle } = globalThis.crypto; test('X25519').then(common.mustCall()); test('X448').then(common.mustCall()); } -+*/ ++ diff --git a/test/parallel/test-webcrypto-derivekey.js b/test/parallel/test-webcrypto-derivekey.js -index 558d37d90d5796b30101d1b512c9df3e7661d0db..c18f9670b10cb84c6902391f20e0ff75729cc960 100644 +index 558d37d90d5796b30101d1b512c9df3e7661d0db..f42bf8f4be0b439dd7e7c8d0f6f8a41e01588870 100644 --- a/test/parallel/test-webcrypto-derivekey.js +++ b/test/parallel/test-webcrypto-derivekey.js -@@ -175,6 +175,7 @@ const { KeyObject } = require('crypto'); - })().then(common.mustCall()); +@@ -176,7 +176,7 @@ const { KeyObject } = require('crypto'); } -+/* // Test X25519 and X448 key derivation - { +-{ ++if (!common.openSSLIsBoringSSL) { async function test(name) { -@@ -209,3 +210,4 @@ const { KeyObject } = require('crypto'); - test('X25519').then(common.mustCall()); - test('X448').then(common.mustCall()); - } -+*/ + const [alice, bob] = await Promise.all([ + subtle.generateKey({ name }, true, ['deriveKey']), diff --git a/test/parallel/test-webcrypto-sign-verify.js b/test/parallel/test-webcrypto-sign-verify.js -index de736102bdcb71a5560c95f7041537f25026aed4..638fdf0d798f3309528c63f0f8598f3df5528339 100644 +index de736102bdcb71a5560c95f7041537f25026aed4..12d7fa39446c196bdf1479dbe74c9ee8ab02f949 100644 --- a/test/parallel/test-webcrypto-sign-verify.js +++ b/test/parallel/test-webcrypto-sign-verify.js -@@ -105,6 +105,7 @@ const { subtle } = globalThis.crypto; +@@ -105,8 +105,9 @@ const { subtle } = globalThis.crypto; test('hello world').then(common.mustCall()); } -+/* ++ // Test Sign/Verify Ed25519 - { +-{ ++if (!common.openSSLIsBoringSSL) { async function test(data) { -@@ -144,3 +145,4 @@ const { subtle } = globalThis.crypto; - - test('hello world').then(common.mustCall()); + const ec = new TextEncoder(); + const { publicKey, privateKey } = await subtle.generateKey({ +@@ -126,7 +127,7 @@ const { subtle } = globalThis.crypto; } -+*/ + + // Test Sign/Verify Ed448 +-{ ++if (!common.openSSLIsBoringSSL) { + async function test(data) { + const ec = new TextEncoder(); + const { publicKey, privateKey } = await subtle.generateKey({ diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js index d1ca571af4be713082d32093bfb8a65f2aef9800..57b8df2ce18df58ff54b2d828af67e3c2e082fe0 100644 --- a/test/parallel/test-webcrypto-wrap-unwrap.js diff --git a/patches/node/fix_do_not_resolve_electron_entrypoints.patch b/patches/node/fix_do_not_resolve_electron_entrypoints.patch index e5177c8297..fba87eb85f 100644 --- a/patches/node/fix_do_not_resolve_electron_entrypoints.patch +++ b/patches/node/fix_do_not_resolve_electron_entrypoints.patch @@ -6,10 +6,10 @@ Subject: fix: do not resolve electron entrypoints This wastes fs cycles and can result in strange behavior if this path actually exists on disk diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js -index 22248b753c14960122f1d6b9bfe6b89fdb8d2010..9d245a04fbcb98dcd1c61e60f7cfe528bd1c8af0 100644 +index 463e76cb1abc0c2fdddba4db2ca2e00f7c591e12..d7bc3c35c77b5bf9ec122b38248d0cf1f4d2a548 100644 --- a/lib/internal/modules/esm/load.js +++ b/lib/internal/modules/esm/load.js -@@ -132,7 +132,7 @@ async function defaultLoad(url, context = kEmptyObject) { +@@ -111,7 +111,7 @@ async function defaultLoad(url, context = kEmptyObject) { source = null; format ??= 'builtin'; } else if (format !== 'commonjs' || defaultType === 'module') { @@ -19,10 +19,10 @@ index 22248b753c14960122f1d6b9bfe6b89fdb8d2010..9d245a04fbcb98dcd1c61e60f7cfe528 context = { __proto__: context, source }; } diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js -index f3dfc69cd2cdec50bc3b3f7cb2d63349812d87dd..b6f2d7194cb75ecc8c47869761c63184707ade40 100644 +index 06b31af80ebbfbf35ec787a94f345775eb512ebf..deca5aa4b8829ba9921440fcb5c285a10e40c8f0 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js -@@ -375,6 +375,9 @@ function cjsPreparseModuleExports(filename, source) { +@@ -354,6 +354,9 @@ function cjsPreparseModuleExports(filename, source) { if (module && module[kModuleExportNames] !== undefined) { return { module, exportNames: module[kModuleExportNames] }; } @@ -33,7 +33,7 @@ index f3dfc69cd2cdec50bc3b3f7cb2d63349812d87dd..b6f2d7194cb75ecc8c47869761c63184 if (!loaded) { module = new CJSModule(filename); diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js -index ca401044c0178c46db9b439b27c440a5d7924c84..dc1a682f0a3cf1ba1095c60bf6a6ca992d6043b3 100644 +index 1e1a1ea46fc6c1b43cad4038ab0d9cdf21d6ba3d..95e2fa5479ea31559fdb5a2e03515f243b231b75 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js @@ -2,6 +2,7 @@ @@ -41,10 +41,10 @@ index ca401044c0178c46db9b439b27c440a5d7924c84..dc1a682f0a3cf1ba1095c60bf6a6ca99 const { StringPrototypeEndsWith, + StringPrototypeStartsWith, + globalThis, } = primordials; - const { containsModuleSyntax } = internalBinding('contextify'); -@@ -22,6 +23,13 @@ const { +@@ -26,6 +27,13 @@ const { * @param {string} main - Entry point path */ function resolveMainPath(main) { @@ -58,7 +58,7 @@ index ca401044c0178c46db9b439b27c440a5d7924c84..dc1a682f0a3cf1ba1095c60bf6a6ca99 const defaultType = getOptionValue('--experimental-default-type'); /** @type {string} */ let mainPath; -@@ -59,6 +67,13 @@ function resolveMainPath(main) { +@@ -63,6 +71,13 @@ function resolveMainPath(main) { * @param {string} mainPath - Absolute path to the main entry point */ function shouldUseESMLoader(mainPath) { diff --git a/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch b/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch index ee7a6cf34a..1f84223398 100644 --- a/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch +++ b/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch @@ -6,22 +6,22 @@ Subject: fix: expose the built-in electron module via the ESM loader This allows usage of `import { app } from 'electron'` and `import('electron')` natively in the browser + non-sandboxed renderer diff --git a/lib/internal/modules/esm/get_format.js b/lib/internal/modules/esm/get_format.js -index 1fe5564545dbc86d7f2968274a25ee1579bcbf28..b876af21a0e97ae06dc344d9f78c8f5c7e403d43 100644 +index a89446df710a941390c15171fea63c551776fc93..912f03bfa96c3aa12bfa6e709746642452568bb7 100644 --- a/lib/internal/modules/esm/get_format.js +++ b/lib/internal/modules/esm/get_format.js -@@ -31,6 +31,7 @@ const protocolHandlers = { - 'http:': getHttpProtocolModuleFormat, - 'https:': getHttpProtocolModuleFormat, +@@ -26,6 +26,7 @@ const protocolHandlers = { + 'data:': getDataProtocolModuleFormat, + 'file:': getFileProtocolModuleFormat, 'node:'() { return 'builtin'; }, + 'electron:'() { return 'electron'; }, }; /** diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js -index 7b77af35a1dfebf6ad45ace521f1a55b5fa18293..ac24cf305bd5995ad13b37ee36f9e1fe3589c5d7 100644 +index 8b157f0f461c7b92c567fffe4d99357dbc09aee7..605e812d515fc467001e4ab88fc15b4af3fd4aa2 100644 --- a/lib/internal/modules/esm/load.js +++ b/lib/internal/modules/esm/load.js -@@ -142,7 +142,7 @@ async function defaultLoad(url, context = kEmptyObject) { +@@ -121,7 +121,7 @@ async function defaultLoad(url, context = kEmptyObject) { // Now that we have the source for the module, run `defaultGetFormat` to detect its format. format = await defaultGetFormat(urlInstance, context); @@ -30,37 +30,35 @@ index 7b77af35a1dfebf6ad45ace521f1a55b5fa18293..ac24cf305bd5995ad13b37ee36f9e1fe // For backward compatibility reasons, we need to discard the source in // order for the CJS loader to re-fetch it. source = null; -@@ -234,6 +234,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) { +@@ -218,12 +218,13 @@ function throwIfUnsupportedURLScheme(parsed) { protocol !== 'file:' && protocol !== 'data:' && protocol !== 'node:' && + protocol !== 'electron:' && ( - !experimentalNetworkImports || - ( -@@ -242,7 +243,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) { - ) + protocol !== 'https:' && + protocol !== 'http:' ) ) { - const schemes = ['file', 'data', 'node']; + const schemes = ['file', 'data', 'node', 'electron']; - if (experimentalNetworkImports) { - ArrayPrototypePush(schemes, 'https', 'http'); - } + throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, schemes); + } + } diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js -index e73a8ad60a13925d6773c32cead8d04ec9d96ee7..52cdb7d5e14a18ed7b1b65e429729cf47dce3f98 100644 +index 1fbbb6773c9479128408fa1f27cf19f1a7786ba6..f05c6f99c0037193c5802024be46a967d6cf47a0 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js -@@ -741,6 +741,8 @@ function packageImportsResolve(name, base, conditions) { - throw importNotDefined(name, packageJSONUrl, base); +@@ -772,6 +772,8 @@ function parsePackageName(specifier, base) { + return { packageName, packageSubpath, isScoped }; } +const electronTypes = ['electron', 'electron/main', 'electron/common', 'electron/renderer']; + /** - * Returns the package type for a given URL. - * @param {URL} url - The URL to get the package type for. -@@ -801,6 +803,11 @@ function packageResolve(specifier, base, conditions) { + * Resolves a package specifier to a URL. + * @param {string} specifier - The package specifier to resolve. +@@ -785,6 +787,11 @@ function packageResolve(specifier, base, conditions) { return new URL('node:' + specifier); } @@ -73,10 +71,10 @@ index e73a8ad60a13925d6773c32cead8d04ec9d96ee7..52cdb7d5e14a18ed7b1b65e429729cf4 parsePackageName(specifier, base); diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js -index 8f4b6b25d8889686d00613fd9821b0aa822a946a..89ca269294ee1afa7f5aeb0ac6b8958f7a8b49d0 100644 +index 8f88214f558c52ef26000fb0e1ef4d391327e84e..d182eedf5e96039e0029d36e51f40b75c6fb2a39 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js -@@ -272,7 +272,7 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) { +@@ -246,7 +246,7 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) { const { exportNames, module } = cjsPreparseModuleExports(filename, source); cjsCache.set(url, module); @@ -85,7 +83,7 @@ index 8f4b6b25d8889686d00613fd9821b0aa822a946a..89ca269294ee1afa7f5aeb0ac6b8958f [...exportNames] : ['default', ...exportNames]; if (isMain) { -@@ -294,8 +294,8 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) { +@@ -268,8 +268,8 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) { ({ exports } = module); } for (const exportName of exportNames) { @@ -96,7 +94,7 @@ index 8f4b6b25d8889686d00613fd9821b0aa822a946a..89ca269294ee1afa7f5aeb0ac6b8958f continue; } // We might trigger a getter -> dont fail. -@@ -329,6 +329,10 @@ translators.set('require-commonjs', (url, source, isMain) => { +@@ -304,6 +304,10 @@ translators.set('require-commonjs', (url, source, isMain) => { return createCJSModuleWrap(url, source); }); @@ -104,14 +102,14 @@ index 8f4b6b25d8889686d00613fd9821b0aa822a946a..89ca269294ee1afa7f5aeb0ac6b8958f + return createCJSModuleWrap('electron', ''); +}); + - // Handle CommonJS modules referenced by `import` statements or expressions, - // or as the initial entry point when the ESM loader handles a CommonJS entry. - translators.set('commonjs', async function commonjsStrategy(url, source, + // Handle CommonJS modules referenced by `require` calls. + // This translator function must be sync, as `require` is sync. + translators.set('require-commonjs-typescript', (url, source, isMain) => { diff --git a/lib/internal/url.js b/lib/internal/url.js -index e6ed5466b8807a52633d8406824058bdc8c2ce13..e055facddf086eb8fb456b865ce006cdb7602b0a 100644 +index 3cb186182947a14407e9d5c4d94ab0554298a658..e35ae9ac316ba2e5b8f562d353b2c5ae978abb63 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js -@@ -1485,6 +1485,8 @@ function fileURLToPath(path, options = kEmptyObject) { +@@ -1495,6 +1495,8 @@ function fileURLToPath(path, options = kEmptyObject) { path = new URL(path); else if (!isURL(path)) throw new ERR_INVALID_ARG_TYPE('path', ['string', 'URL'], path); diff --git a/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch b/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch index cf1dc86655..5f005aef01 100644 --- a/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch +++ b/patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch @@ -7,10 +7,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead This API is used by Electron to create Node's tracing controller. diff --git a/src/api/environment.cc b/src/api/environment.cc -index 46106fa94b3055648e4f01cd28860d427268a253..e0bf37f09dceb93af58990438ab577a9d4b843e8 100644 +index 77c20a4b6b9db414444974f68c5def8788386d2b..5fc1b6f2446d7c786024eb60800e2edab613dcd1 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc -@@ -557,6 +557,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) { +@@ -564,6 +564,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) { return env->platform(); } @@ -22,7 +22,7 @@ index 46106fa94b3055648e4f01cd28860d427268a253..e0bf37f09dceb93af58990438ab577a9 int thread_pool_size, node::tracing::TracingController* tracing_controller) { diff --git a/src/node.h b/src/node.h -index 6373adacb628459a4c9d7237da2587aee318e2d8..4f2eb9d0aab88b70c86339e750799080e980d7da 100644 +index 60598f54114b2424f10706e57d8aa50c4634bcb0..0fec9477fd0f2a3c2aa68284131c510b0da0e025 100644 --- a/src/node.h +++ b/src/node.h @@ -133,6 +133,7 @@ struct SnapshotData; diff --git a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch index 82c13656c6..0ffc9526e8 100644 --- a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch +++ b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch @@ -16,11 +16,125 @@ Upstreams: - https://github.com/nodejs/node/pull/39138 - https://github.com/nodejs/node/pull/39136 +diff --git a/deps/ncrypto/ncrypto.cc b/deps/ncrypto/ncrypto.cc +index eb3533bb4623b152605c3c590f37f086cce5f073..ded231aeaa15af22845704cfcc7d24a44bd88f8e 100644 +--- a/deps/ncrypto/ncrypto.cc ++++ b/deps/ncrypto/ncrypto.cc +@@ -6,13 +6,11 @@ + #include + #include + #include ++#include + #include + #if OPENSSL_VERSION_MAJOR >= 3 + #include + #endif +-#ifdef OPENSSL_IS_BORINGSSL +-#include "dh-primes.h" +-#endif // OPENSSL_IS_BORINGSSL + + namespace ncrypto { + namespace { +@@ -665,7 +663,7 @@ bool SafeX509SubjectAltNamePrint(const BIOPointer& out, X509_EXTENSION* ext) { + + bool ok = true; + +- for (int i = 0; i < sk_GENERAL_NAME_num(names); i++) { ++ for (size_t i = 0; i < sk_GENERAL_NAME_num(names); i++) { + GENERAL_NAME* gen = sk_GENERAL_NAME_value(names, i); + + if (i != 0) +@@ -691,7 +689,7 @@ bool SafeX509InfoAccessPrint(const BIOPointer& out, X509_EXTENSION* ext) { + + bool ok = true; + +- for (int i = 0; i < sk_ACCESS_DESCRIPTION_num(descs); i++) { ++ for (size_t i = 0; i < sk_ACCESS_DESCRIPTION_num(descs); i++) { + ACCESS_DESCRIPTION* desc = sk_ACCESS_DESCRIPTION_value(descs, i); + + if (i != 0) +@@ -1002,7 +1000,11 @@ BIOPointer BIOPointer::NewMem() { + } + + BIOPointer BIOPointer::NewSecMem() { ++#ifdef OPENSSL_IS_BORINGSSL ++ return BIOPointer(BIO_new(BIO_s_mem())); ++#else + return BIOPointer(BIO_new(BIO_s_secmem())); ++#endif + } + + BIOPointer BIOPointer::New(const BIO_METHOD* method) { +@@ -1057,8 +1059,10 @@ BignumPointer DHPointer::FindGroup(const std::string_view name, + FindGroupOption option) { + #define V(n, p) if (EqualNoCase(name, n)) return BignumPointer(p(nullptr)); + if (option != FindGroupOption::NO_SMALL_PRIMES) { ++#ifndef OPENSSL_IS_BORINGSSL + V("modp1", BN_get_rfc2409_prime_768); + V("modp2", BN_get_rfc2409_prime_1024); ++#endif + V("modp5", BN_get_rfc3526_prime_1536); + } + V("modp14", BN_get_rfc3526_prime_2048); +@@ -1130,11 +1134,13 @@ DHPointer::CheckPublicKeyResult DHPointer::checkPublicKey(const BignumPointer& p + int codes = 0; + if (DH_check_pub_key(dh_.get(), pub_key.get(), &codes) != 1) + return DHPointer::CheckPublicKeyResult::CHECK_FAILED; ++#ifndef OPENSSL_IS_BORINGSSL + if (codes & DH_CHECK_PUBKEY_TOO_SMALL) { + return DHPointer::CheckPublicKeyResult::TOO_SMALL; + } else if (codes & DH_CHECK_PUBKEY_TOO_SMALL) { + return DHPointer::CheckPublicKeyResult::TOO_LARGE; +- } else if (codes != 0) { ++#endif ++ if (codes != 0) { + return DHPointer::CheckPublicKeyResult::INVALID; + } + return CheckPublicKeyResult::NONE; +diff --git a/deps/ncrypto/ncrypto.h b/deps/ncrypto/ncrypto.h +index 661c996889d0a89c1c38658a0933fcf5e3cdc1b9..1261d5d99fdf4e17b8dec66660028ce184f1cf89 100644 +--- a/deps/ncrypto/ncrypto.h ++++ b/deps/ncrypto/ncrypto.h +@@ -413,8 +413,8 @@ public: + #ifndef OPENSSL_IS_BORINGSSL + TOO_SMALL = DH_R_CHECK_PUBKEY_TOO_SMALL, + TOO_LARGE = DH_R_CHECK_PUBKEY_TOO_LARGE, +- INVALID = DH_R_CHECK_PUBKEY_INVALID, + #endif ++ INVALID = DH_R_INVALID_PUBKEY, + CHECK_FAILED = 512, + }; + // Check to see if the given public key is suitable for this DH instance. +diff --git a/deps/ncrypto/unofficial.gni b/deps/ncrypto/unofficial.gni +index ea024af73e215b3cad5f08796ac405f419530c86..41061b524eea74330b8d2452635a38c48f21386b 100644 +--- a/deps/ncrypto/unofficial.gni ++++ b/deps/ncrypto/unofficial.gni +@@ -27,6 +27,6 @@ template("ncrypto_gn_build") { + forward_variables_from(invoker, "*") + public_configs = [ ":ncrypto_config" ] + sources = gypi_values.ncrypto_sources +- deps = [ "../openssl" ] ++ deps = [ "$node_crypto_path" ] + } + } +diff --git a/node.gni b/node.gni +index 32709b860ccb12d8d1e75342a65dda0b86129b21..18d58591e3d0f1f3512db00033c3410a65702864 100644 +--- a/node.gni ++++ b/node.gni +@@ -10,6 +10,8 @@ declare_args() { + # The location of V8, use the one from node's deps by default. + node_v8_path = "//v8" + ++ node_crypto_path = "//third_party/boringssl" ++ + # The NODE_MODULE_VERSION defined in node_version.h. + node_module_version = exec_script("$node_path/tools/getmoduleversion.py", [], "value") + diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc -index 4f0637f9511d1b90ae9d33760428dceb772667bd..5aba390c49613816ac359dfe995dc2c0a93f2206 100644 +index fe35a8e0f6bbb7ab515a0343a7ed046c44e86474..43a7abbf237d8d809953e302b83755a3283a1bf4 100644 --- a/src/crypto/crypto_cipher.cc +++ b/src/crypto/crypto_cipher.cc -@@ -1088,7 +1088,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { +@@ -1078,7 +1078,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { if (EVP_PKEY_decrypt_init(ctx.get()) <= 0) { return ThrowCryptoError(env, ERR_get_error()); } @@ -29,19 +143,19 @@ index 4f0637f9511d1b90ae9d33760428dceb772667bd..5aba390c49613816ac359dfe995dc2c0 int rsa_pkcs1_implicit_rejection = EVP_PKEY_CTX_ctrl_str(ctx.get(), "rsa_pkcs1_implicit_rejection", "1"); // From the doc -2 means that the option is not supported. -@@ -1104,6 +1104,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { +@@ -1094,6 +1094,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { "RSA_PKCS1_PADDING is no longer supported for private decryption," - " this can be reverted with --security-revert=CVE-2023-46809"); + " this can be reverted with --security-revert=CVE-2024-PEND"); } +#endif } const EVP_MD* digest = nullptr; diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc -index 85d48dfd2c15c453707bf6eb94e22f89b4f856b2..fe31a9a7f465a03d2de365cef392dfbb7c540156 100644 +index 6a967702b22df0eb8aa10e853fd232794955860d..31058cccc6ffeed6b09aaecda320ee2f15849ec8 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc -@@ -158,7 +158,7 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) { +@@ -134,7 +134,7 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) { const unsigned char* buf; size_t len; size_t rem; @@ -50,7 +164,7 @@ index 85d48dfd2c15c453707bf6eb94e22f89b4f856b2..fe31a9a7f465a03d2de365cef392dfbb if (!SSL_client_hello_get0_ext( ssl.get(), TLSEXT_TYPE_application_layer_protocol_negotiation, -@@ -171,13 +171,15 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) { +@@ -147,13 +147,15 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) { len = (buf[0] << 8) | buf[1]; if (len + 2 != rem) return nullptr; return reinterpret_cast(buf + 3); @@ -67,7 +181,7 @@ index 85d48dfd2c15c453707bf6eb94e22f89b4f856b2..fe31a9a7f465a03d2de365cef392dfbb if (!SSL_client_hello_get0_ext( ssl.get(), TLSEXT_TYPE_server_name, -@@ -199,6 +201,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) { +@@ -175,6 +177,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) { if (len + 2 > rem) return nullptr; return reinterpret_cast(buf + 5); @@ -76,7 +190,25 @@ index 85d48dfd2c15c453707bf6eb94e22f89b4f856b2..fe31a9a7f465a03d2de365cef392dfbb } const char* GetServerName(SSL* ssl) { -@@ -1036,14 +1040,14 @@ MaybeLocal GetClientHelloCiphers( +@@ -282,7 +286,7 @@ StackOfX509 CloneSSLCerts(X509Pointer&& cert, + if (!peer_certs) return StackOfX509(); + if (cert && !sk_X509_push(peer_certs.get(), cert.release())) + return StackOfX509(); +- for (int i = 0; i < sk_X509_num(ssl_certs); i++) { ++ for (size_t i = 0; i < sk_X509_num(ssl_certs); i++) { + X509Pointer cert(X509_dup(sk_X509_value(ssl_certs, i))); + if (!cert || !sk_X509_push(peer_certs.get(), cert.get())) + return StackOfX509(); +@@ -298,7 +302,7 @@ MaybeLocal AddIssuerChainToObject(X509Pointer* cert, + Environment* const env) { + cert->reset(sk_X509_delete(peer_certs.get(), 0)); + for (;;) { +- int i; ++ size_t i; + for (i = 0; i < sk_X509_num(peer_certs.get()); i++) { + ncrypto::X509View ca(sk_X509_value(peer_certs.get(), i)); + if (!cert->view().isIssuedBy(ca)) continue; +@@ -384,14 +388,14 @@ MaybeLocal GetClientHelloCiphers( Environment* env, const SSLPointer& ssl) { EscapableHandleScope scope(env->isolate()); @@ -95,7 +227,7 @@ index 85d48dfd2c15c453707bf6eb94e22f89b4f856b2..fe31a9a7f465a03d2de365cef392dfbb Local obj = Object::New(env->isolate()); if (!Set(env->context(), obj, -@@ -1096,8 +1100,11 @@ MaybeLocal GetEphemeralKey(Environment* env, const SSLPointer& ssl) { +@@ -444,8 +448,11 @@ MaybeLocal GetEphemeralKey(Environment* env, const SSLPointer& ssl) { EscapableHandleScope scope(env->isolate()); Local info = Object::New(env->isolate()); @@ -109,19 +241,19 @@ index 85d48dfd2c15c453707bf6eb94e22f89b4f856b2..fe31a9a7f465a03d2de365cef392dfbb crypto::EVPKeyPointer key(raw_key); diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc -index cef0c877c67643d47da787eddb95ed5a410a941b..1b8af49a48f1a34a92d4f0b502d435f3a4ab5d8e 100644 +index c924a54639e8c22d765dc240dffacfffb200ca0c..287afcc792a0a2b7e19126ee9a48ebe21cc8844e 100644 --- a/src/crypto/crypto_context.cc +++ b/src/crypto/crypto_context.cc -@@ -63,7 +63,7 @@ inline X509_STORE* GetOrCreateRootCertStore() { - // Caller responsible for BIO_free_all-ing the returned object. - BIOPointer LoadBIO(Environment* env, Local v) { - if (v->IsString() || v->IsArrayBufferView()) { -- BIOPointer bio(BIO_new(BIO_s_secmem())); -+ BIOPointer bio(BIO_new(BIO_s_mem())); - if (!bio) return nullptr; - ByteSource bsrc = ByteSource::FromStringOrBuffer(env, v); - if (bsrc.size() > INT_MAX) return nullptr; -@@ -882,10 +882,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { +@@ -94,7 +94,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, + // the CA certificates. + SSL_CTX_clear_extra_chain_certs(ctx); + +- for (int i = 0; i < sk_X509_num(extra_certs); i++) { ++ for (size_t i = 0; i < sk_X509_num(extra_certs); i++) { + X509* ca = sk_X509_value(extra_certs, i); + + // NOTE: Increments reference count on `ca` +@@ -920,11 +920,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { // If the user specified "auto" for dhparams, the JavaScript layer will pass // true to this function instead of the original string. Any other string // value will be interpreted as custom DH parameters below. @@ -130,66 +262,106 @@ index cef0c877c67643d47da787eddb95ed5a410a941b..1b8af49a48f1a34a92d4f0b502d435f3 CHECK(SSL_CTX_set_dh_auto(sc->ctx_.get(), true)); return; } +- +#endif - DHPointer dh; { + BIOPointer bio(LoadBIO(env, args[0])); +@@ -1150,7 +1151,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { + } + + // Add CA certs too +- for (int i = 0; i < sk_X509_num(extra_certs.get()); i++) { ++ for (size_t i = 0; i < sk_X509_num(extra_certs.get()); i++) { + X509* ca = sk_X509_value(extra_certs.get(), i); + + X509_STORE_add_cert(sc->GetCertStoreOwnedByThisSecureContext(), ca); diff --git a/src/crypto/crypto_dh.cc b/src/crypto/crypto_dh.cc -index dac37f52b9687cadfa2d02152241e9a6e4c16ddf..d47cfa4ad8707ed7f0a42e7fe176fec25be64305 100644 +index e5664dfa2bc7e11922fa965f28acdf21470d1147..33ffbbb85d05f5356183e3aa1ca23707c5629b5d 100644 --- a/src/crypto/crypto_dh.cc +++ b/src/crypto/crypto_dh.cc -@@ -154,13 +154,11 @@ bool DiffieHellman::Init(BignumPointer&& bn_p, int g) { - bool DiffieHellman::Init(const char* p, int p_len, int g) { - dh_.reset(DH_new()); - if (p_len <= 0) { -- ERR_put_error(ERR_LIB_BN, BN_F_BN_GENERATE_PRIME_EX, -- BN_R_BITS_TOO_SMALL, __FILE__, __LINE__); -+ OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); - return false; - } - if (g <= 1) { -- ERR_put_error(ERR_LIB_DH, DH_F_DH_BUILTIN_GENPARAMS, -- DH_R_BAD_GENERATOR, __FILE__, __LINE__); -+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); - return false; - } - BignumPointer bn_p( -@@ -176,20 +174,17 @@ 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 (p_len <= 0) { -- ERR_put_error(ERR_LIB_BN, BN_F_BN_GENERATE_PRIME_EX, -- BN_R_BITS_TOO_SMALL, __FILE__, __LINE__); -+ OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); - return false; - } - if (g_len <= 0) { -- ERR_put_error(ERR_LIB_DH, DH_F_DH_BUILTIN_GENPARAMS, -- DH_R_BAD_GENERATOR, __FILE__, __LINE__); -+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); - return false; - } - BignumPointer bn_g( - BN_bin2bn(reinterpret_cast(g), g_len, nullptr)); - if (BN_is_zero(bn_g.get()) || BN_is_one(bn_g.get())) { -- ERR_put_error(ERR_LIB_DH, DH_F_DH_BUILTIN_GENPARAMS, -- DH_R_BAD_GENERATOR, __FILE__, __LINE__); -+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); - return false; - } - BignumPointer bn_p( -@@ -219,8 +214,10 @@ typedef BignumPointer (*StandardizedGroupInstantiator)(); - inline StandardizedGroupInstantiator FindDiffieHellmanGroup(const char* name) { - #define V(n, p) \ - if (StringEqualNoCase(name, n)) return InstantiateStandardizedGroup

+@@ -7,7 +7,9 @@ + #include "memory_tracker-inl.h" + #include "ncrypto.h" + #include "node_errors.h" +#ifndef OPENSSL_IS_BORINGSSL - V("modp1", BN_get_rfc2409_prime_768); - V("modp2", BN_get_rfc2409_prime_1024); + #include "openssl/bnerr.h" +#endif - V("modp5", BN_get_rfc3526_prime_1536); - V("modp14", BN_get_rfc3526_prime_2048); - V("modp15", BN_get_rfc3526_prime_3072); -@@ -565,9 +562,11 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) { + #include "openssl/dh.h" + #include "threadpoolwork-inl.h" + #include "v8.h" +@@ -86,11 +88,7 @@ void New(const FunctionCallbackInfo& args) { + if (args[0]->IsInt32()) { + int32_t bits = args[0].As()->Value(); + if (bits < 2) { +-#if OPENSSL_VERSION_MAJOR >= 3 +- ERR_put_error(ERR_LIB_DH, 0, DH_R_MODULUS_TOO_SMALL, __FILE__, __LINE__); +-#else +- ERR_put_error(ERR_LIB_BN, 0, BN_R_BITS_TOO_SMALL, __FILE__, __LINE__); +-#endif ++ OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); + return ThrowCryptoError(env, ERR_get_error(), "Invalid prime length"); + } + +@@ -103,7 +101,7 @@ void New(const FunctionCallbackInfo& args) { + } + int32_t generator = args[1].As()->Value(); + if (generator < 2) { +- ERR_put_error(ERR_LIB_DH, 0, DH_R_BAD_GENERATOR, __FILE__, __LINE__); ++ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); + return ThrowCryptoError(env, ERR_get_error(), "Invalid generator"); + } + +@@ -132,12 +130,12 @@ void New(const FunctionCallbackInfo& args) { + if (args[1]->IsInt32()) { + int32_t generator = args[1].As()->Value(); + if (generator < 2) { +- ERR_put_error(ERR_LIB_DH, 0, DH_R_BAD_GENERATOR, __FILE__, __LINE__); ++ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); + return ThrowCryptoError(env, ERR_get_error(), "Invalid generator"); + } + bn_g = BignumPointer::New(); + if (!bn_g.setWord(generator)) { +- ERR_put_error(ERR_LIB_DH, 0, DH_R_BAD_GENERATOR, __FILE__, __LINE__); ++ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); + return ThrowCryptoError(env, ERR_get_error(), "Invalid generator"); + } + } else { +@@ -146,11 +144,11 @@ void New(const FunctionCallbackInfo& args) { + return THROW_ERR_OUT_OF_RANGE(env, "generator is too big"); + bn_g = BignumPointer(reinterpret_cast(arg1.data()), arg1.size()); + if (!bn_g) { +- ERR_put_error(ERR_LIB_DH, 0, DH_R_BAD_GENERATOR, __FILE__, __LINE__); ++ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); + return ThrowCryptoError(env, ERR_get_error(), "Invalid generator"); + } + if (bn_g.getWord() < 2) { +- ERR_put_error(ERR_LIB_DH, 0, DH_R_BAD_GENERATOR, __FILE__, __LINE__); ++ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR); + return ThrowCryptoError(env, ERR_get_error(), "Invalid generator"); + } + } +@@ -258,15 +256,17 @@ void ComputeSecret(const FunctionCallbackInfo& args) { + BignumPointer key(key_buf.data(), key_buf.size()); + + switch (dh.checkPublicKey(key)) { +- case DHPointer::CheckPublicKeyResult::INVALID: +- // Fall-through + case DHPointer::CheckPublicKeyResult::CHECK_FAILED: + return THROW_ERR_CRYPTO_INVALID_KEYTYPE(env, + "Unspecified validation error"); ++#ifndef OPENSSL_IS_BORINGSSL + case DHPointer::CheckPublicKeyResult::TOO_SMALL: + return THROW_ERR_CRYPTO_INVALID_KEYLEN(env, "Supplied key is too small"); + case DHPointer::CheckPublicKeyResult::TOO_LARGE: + return THROW_ERR_CRYPTO_INVALID_KEYLEN(env, "Supplied key is too large"); ++#endif ++ case DHPointer::CheckPublicKeyResult::INVALID: ++ return THROW_ERR_CRYPTO_INVALID_KEYTYPE(env, "Supplied key is invalid"); + case DHPointer::CheckPublicKeyResult::NONE: + break; + } +@@ -398,9 +398,11 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) { key_params = EVPKeyPointer(EVP_PKEY_new()); CHECK(key_params); CHECK_EQ(EVP_PKEY_assign_DH(key_params.get(), dh.release()), 1); @@ -202,7 +374,7 @@ index dac37f52b9687cadfa2d02152241e9a6e4c16ddf..d47cfa4ad8707ed7f0a42e7fe176fec2 if (!param_ctx || EVP_PKEY_paramgen_init(param_ctx.get()) <= 0 || EVP_PKEY_CTX_set_dh_paramgen_prime_len( -@@ -581,6 +580,9 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) { +@@ -414,6 +416,9 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) { } key_params = EVPKeyPointer(raw_params); @@ -213,7 +385,7 @@ index dac37f52b9687cadfa2d02152241e9a6e4c16ddf..d47cfa4ad8707ed7f0a42e7fe176fec2 UNREACHABLE(); } diff --git a/src/crypto/crypto_dsa.cc b/src/crypto/crypto_dsa.cc -index 3fa4a415dc911a13afd90dfb31c1ed4ad0fd268f..fa48dffc31342c44a1c1207b9d4c3dc72ed93b60 100644 +index 5d081863cf2dcdcf8c2d09db6060eeb5e78c452f..67523ec1c406e345945e1dde663c784c43a1c624 100644 --- a/src/crypto/crypto_dsa.cc +++ b/src/crypto/crypto_dsa.cc @@ -40,7 +40,7 @@ namespace crypto { @@ -237,18 +409,18 @@ index 3fa4a415dc911a13afd90dfb31c1ed4ad0fd268f..fa48dffc31342c44a1c1207b9d4c3dc7 return EVPKeyCtxPointer(); diff --git a/src/crypto/crypto_keys.cc b/src/crypto/crypto_keys.cc -index 35474c31bfc2e3692b7ca10e4ed7026b9c275dfb..43c42c14f75018d4705f218fe4ed7e5dacb46bb8 100644 +index 8488fc57faaf722174032c5a927d150c76120d60..c51efc92d4818ee7701b4725585fb7e1d2d644ad 100644 --- a/src/crypto/crypto_keys.cc +++ b/src/crypto/crypto_keys.cc -@@ -1239,6 +1239,7 @@ void KeyObjectHandle::GetAsymmetricKeyType( +@@ -1204,6 +1204,7 @@ void KeyObjectHandle::GetAsymmetricKeyType( } bool KeyObjectHandle::CheckEcKeyData() const { +#ifndef OPENSSL_IS_BORINGSSL MarkPopErrorOnReturn mark_pop_error_on_return; - const ManagedEVPPKey& key = data_->GetAsymmetricKey(); -@@ -1257,6 +1258,9 @@ bool KeyObjectHandle::CheckEcKeyData() const { + const auto& key = data_.GetAsymmetricKey(); +@@ -1220,6 +1221,9 @@ bool KeyObjectHandle::CheckEcKeyData() const { #else return EVP_PKEY_public_check(ctx.get()) == 1; #endif @@ -259,43 +431,43 @@ index 35474c31bfc2e3692b7ca10e4ed7026b9c275dfb..43c42c14f75018d4705f218fe4ed7e5d void KeyObjectHandle::CheckEcKeyData(const FunctionCallbackInfo& args) { diff --git a/src/crypto/crypto_random.cc b/src/crypto/crypto_random.cc -index 48154df7dc91ed7c0d65323199bc2f59dfc68135..6431e5c3062890975854780d15ecb84370b81770 100644 +index b59e394d9a7e2c19fdf1f2b0177753ff488da0fa..91218f49da5392c6f769495ee7f9275a47ce09b1 100644 --- a/src/crypto/crypto_random.cc +++ b/src/crypto/crypto_random.cc -@@ -140,7 +140,7 @@ Maybe RandomPrimeTraits::AdditionalConfig( +@@ -134,7 +134,7 @@ Maybe RandomPrimeTraits::AdditionalConfig( params->bits = bits; params->safe = safe; -- params->prime.reset(BN_secure_new()); -+ params->prime.reset(BN_new()); +- params->prime = BignumPointer::NewSecure(); ++ params->prime = BignumPointer::New(); if (!params->prime) { THROW_ERR_CRYPTO_OPERATION_FAILED(env, "could not generate prime"); - return Nothing(); + return Nothing(); diff --git a/src/crypto/crypto_rsa.cc b/src/crypto/crypto_rsa.cc -index 23b2b8c56dec8ac600b8f14b78d9e80b7fa3ed3b..e7a8fe4181542252d9142ea9460cacc5b4acd00d 100644 +index 02e8e24b4054afd4c3ca797c19a78927319a0d9e..d2a931a3f8f9490fe17ef8a82d0204ee2cca409d 100644 --- a/src/crypto/crypto_rsa.cc +++ b/src/crypto/crypto_rsa.cc -@@ -616,10 +616,11 @@ Maybe GetRsaKeyDetail( +@@ -608,10 +608,11 @@ Maybe GetRsaKeyDetail(Environment* env, } if (params->saltLength != nullptr) { - if (ASN1_INTEGER_get_int64(&salt_length, params->saltLength) != 1) { - ThrowCryptoError(env, ERR_get_error(), "ASN1_INTEGER_get_in64 error"); -- return Nothing(); +- return Nothing(); - } + // TODO(codebytere): Upstream a shim to BoringSSL? + // if (ASN1_INTEGER_get_int64(&salt_length, params->saltLength) != 1) { + // ThrowCryptoError(env, ERR_get_error(), "ASN1_INTEGER_get_in64 error"); -+ // return Nothing(); ++ // return Nothing(); + // } } if (target diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc -index 990638ec3993bde40ad3dd40d373d816ebc66a6a..63d971e1fe6b861e29c12f04563701b01fdfb976 100644 +index 793c196f8ce538c66b20611d00e12392ff9e878b..ee81048caab4ccfe26ea9e677782c9c955d162a9 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc -@@ -518,24 +518,15 @@ Maybe Decorate(Environment* env, +@@ -495,24 +495,15 @@ Maybe Decorate(Environment* env, V(BIO) \ V(PKCS7) \ V(X509V3) \ @@ -321,7 +493,7 @@ index 990638ec3993bde40ad3dd40d373d816ebc66a6a..63d971e1fe6b861e29c12f04563701b0 V(USER) \ #define V(name) case ERR_LIB_##name: lib = #name "_"; break; -@@ -716,7 +707,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -654,7 +645,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { CHECK(args[0]->IsUint32()); Environment* env = Environment::GetCurrent(args); uint32_t len = args[0].As()->Value(); @@ -330,7 +502,7 @@ index 990638ec3993bde40ad3dd40d373d816ebc66a6a..63d971e1fe6b861e29c12f04563701b0 if (data == nullptr) { // There's no memory available for the allocation. // Return nothing. -@@ -727,7 +718,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -665,7 +656,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { data, len, [](void* data, size_t len, void* deleter_data) { @@ -339,7 +511,7 @@ index 990638ec3993bde40ad3dd40d373d816ebc66a6a..63d971e1fe6b861e29c12f04563701b0 }, data); Local buffer = ArrayBuffer::New(env->isolate(), store); -@@ -735,10 +726,12 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -673,10 +664,12 @@ void SecureBuffer(const FunctionCallbackInfo& args) { } void SecureHeapUsed(const FunctionCallbackInfo& args) { @@ -353,10 +525,10 @@ index 990638ec3993bde40ad3dd40d373d816ebc66a6a..63d971e1fe6b861e29c12f04563701b0 } // namespace diff --git a/src/env.h b/src/env.h -index 30561ab7a24c734be71ed29d963c11e2ea2c2b22..7cb77fb4f35a60fbda5b868798321ac8b6340bfa 100644 +index fc8dbd615255851cad90e1d8ffe225f5e0c6a718..49ca9c0042ccf22ad1fffa54f05fd443cbc681ba 100644 --- a/src/env.h +++ b/src/env.h -@@ -49,7 +49,7 @@ +@@ -50,7 +50,7 @@ #include "uv.h" #include "v8.h" @@ -365,7 +537,7 @@ index 30561ab7a24c734be71ed29d963c11e2ea2c2b22..7cb77fb4f35a60fbda5b868798321ac8 #include #endif -@@ -1065,7 +1065,7 @@ class Environment : public MemoryRetainer { +@@ -1073,7 +1073,7 @@ class Environment final : public MemoryRetainer { kExitInfoFieldCount }; @@ -375,7 +547,7 @@ index 30561ab7a24c734be71ed29d963c11e2ea2c2b22..7cb77fb4f35a60fbda5b868798321ac8 // We declare another alias here to avoid having to include crypto_util.h using EVPMDPointer = DeleteFnPtr; diff --git a/src/node_metadata.h b/src/node_metadata.h -index cf051585e779e2b03bd7b95fe5008b89cc7f8162..9de49c6828468fdf846dcd4ad445390f14446099 100644 +index c59e65ad1fe3fac23f1fc25ca77e6133d1ccaccd..f2f07434e076e2977755ef7dac7d489aedb760b0 100644 --- a/src/node_metadata.h +++ b/src/node_metadata.h @@ -6,7 +6,7 @@ @@ -388,7 +560,7 @@ index cf051585e779e2b03bd7b95fe5008b89cc7f8162..9de49c6828468fdf846dcd4ad445390f #if NODE_OPENSSL_HAS_QUIC #include diff --git a/src/node_options.cc b/src/node_options.cc -index dba59c5560c22899bd108789360f21fd85dd41bf..818baf611fcab7838a339f3ea137467653e270d0 100644 +index cfc599ec9a6197231c3469d318f02c620cdb03a8..29630fcccc3bd9d24ad6aec64bef2fedfc3c4031 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -6,7 +6,7 @@ @@ -401,7 +573,7 @@ index dba59c5560c22899bd108789360f21fd85dd41bf..818baf611fcab7838a339f3ea1374676 #endif diff --git a/src/node_options.h b/src/node_options.h -index 10c220f66122336215f25b9674acfdfe6df82a8e..e8b2243d24fe95ff31254071133fb646e186c07e 100644 +index 9e656a2815045aa5da7eb267708c03058be9f362..600e0850f01e01024414d42b25605f256200540a 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -11,7 +11,7 @@ @@ -413,3 +585,37 @@ index 10c220f66122336215f25b9674acfdfe6df82a8e..e8b2243d24fe95ff31254071133fb646 #include "openssl/opensslv.h" #endif +diff --git a/unofficial.gni b/unofficial.gni +index de6ff5548ca5282199b7d85c11941c1fa351a9d9..3d8b7957e791ce2fa2a8d0937a87b6010087803d 100644 +--- a/unofficial.gni ++++ b/unofficial.gni +@@ -145,7 +145,6 @@ template("node_gn_build") { + ] + deps = [ + ":run_node_js2c", +- "deps/brotli", + "deps/cares", + "deps/histogram", + "deps/llhttp", +@@ -156,6 +155,8 @@ template("node_gn_build") { + "deps/sqlite", + "deps/uvwasi", + "//third_party/zlib", ++ "//third_party/brotli:dec", ++ "//third_party/brotli:enc", + "$node_v8_path:v8_libplatform", + ] + +@@ -182,10 +183,8 @@ template("node_gn_build") { + deps += [ "//third_party/icu" ] + } + if (node_use_openssl) { +- deps += [ +- "deps/ncrypto", +- "//third_party/boringssl" +- ] ++ deps += [ "deps/ncrypto" ] ++ public_deps += [ "$node_crypto_path" ] + sources += gypi_values.node_crypto_sources + } + if (node_enable_inspector) { diff --git a/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch b/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch index 787043e5cc..bc8e7cea5a 100644 --- a/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch +++ b/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch @@ -6,39 +6,39 @@ Subject: fix: lazyload fs in esm loaders to apply asar patches Changes { foo } from fs to just "fs.foo" so that our patching of fs is applied to esm loaders diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js -index ac24cf305bd5995ad13b37ee36f9e1fe3589c5d7..22248b753c14960122f1d6b9bfe6b89fdb8d2010 100644 +index 605e812d515fc467001e4ab88fc15b4af3fd4aa2..463e76cb1abc0c2fdddba4db2ca2e00f7c591e12 100644 --- a/lib/internal/modules/esm/load.js +++ b/lib/internal/modules/esm/load.js -@@ -10,7 +10,7 @@ const { kEmptyObject } = require('internal/util'); +@@ -8,7 +8,7 @@ const { kEmptyObject } = require('internal/util'); const { defaultGetFormat } = require('internal/modules/esm/get_format'); const { validateAttributes, emitImportAssertionWarning } = require('internal/modules/esm/assert'); const { getOptionValue } = require('internal/options'); -const { readFileSync } = require('fs'); +const fs = require('fs'); - // Do not eagerly grab .manifest, it may be in TDZ - const policy = getOptionValue('--experimental-policy') ? -@@ -42,8 +42,7 @@ async function getSource(url, context) { - let responseURL = href; + const defaultType = + getOptionValue('--experimental-default-type'); +@@ -40,8 +40,7 @@ async function getSource(url, context) { + const responseURL = href; let source; if (protocol === 'file:') { - const { readFile: readFileAsync } = require('internal/fs/promises').exports; - source = await readFileAsync(url); + source = await fs.promises.readFile(url); } else if (protocol === 'data:') { - const match = RegExpPrototypeExec(DATA_URL_PATTERN, url.pathname); - if (!match) { -@@ -82,7 +81,7 @@ function getSourceSync(url, context) { + const result = dataURLProcessor(url); + if (result === 'failure') { +@@ -65,7 +64,7 @@ function getSourceSync(url, context) { const responseURL = href; let source; if (protocol === 'file:') { - source = readFileSync(url); + source = fs.readFileSync(url); } else if (protocol === 'data:') { - const match = RegExpPrototypeExec(DATA_URL_PATTERN, url.pathname); - if (!match) { + const result = dataURLProcessor(url); + if (result === 'failure') { diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js -index 52cdb7d5e14a18ed7b1b65e429729cf47dce3f98..69f73f829706deddc4f328b78af9d58434af647d 100644 +index f05c6f99c0037193c5802024be46a967d6cf47a0..f3dad958b2ec275992554477b9344214c8c1e2c8 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -24,7 +24,7 @@ const { @@ -49,17 +49,8 @@ index 52cdb7d5e14a18ed7b1b65e429729cf47dce3f98..69f73f829706deddc4f328b78af9d584 +const fs = require('fs'); const { getOptionValue } = require('internal/options'); // Do not eagerly grab .manifest, it may be in TDZ - const policy = getOptionValue('--experimental-policy') ? -@@ -251,7 +251,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) { - throw err; - } - -- const stats = internalModuleStat(toNamespacedPath(StringPrototypeEndsWith(path, '/') ? -+ const stats = internalFsBinding.internalModuleStat(toNamespacedPath(StringPrototypeEndsWith(path, '/') ? - StringPrototypeSlice(path, -1) : path)); - - // Check for stats.isDirectory() -@@ -267,7 +267,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) { + const { sep, posix: { relative: relativePosixPath }, resolve } = require('path'); +@@ -259,7 +259,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) { } if (!preserveSymlinks) { @@ -68,20 +59,11 @@ index 52cdb7d5e14a18ed7b1b65e429729cf47dce3f98..69f73f829706deddc4f328b78af9d584 [internalFS.realpathCacheKey]: realpathCache, }); const { search, hash } = resolved; -@@ -826,7 +826,7 @@ function packageResolve(specifier, base, conditions) { - let packageJSONPath = fileURLToPath(packageJSONUrl); - let lastPath; - do { -- const stat = internalModuleStat(toNamespacedPath(StringPrototypeSlice(packageJSONPath, 0, -+ const stat = internalFsBinding.internalModuleStat(toNamespacedPath(StringPrototypeSlice(packageJSONPath, 0, - packageJSONPath.length - 13))); - // Check for !stat.isDirectory() - if (stat !== 1) { diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js -index 89ca269294ee1afa7f5aeb0ac6b8958f7a8b49d0..f3dfc69cd2cdec50bc3b3f7cb2d63349812d87dd 100644 +index d182eedf5e96039e0029d36e51f40b75c6fb2a39..06b31af80ebbfbf35ec787a94f345775eb512ebf 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js -@@ -36,7 +36,7 @@ const { +@@ -34,7 +34,7 @@ const { const { BuiltinModule } = require('internal/bootstrap/realm'); const assert = require('internal/assert'); @@ -90,7 +72,7 @@ index 89ca269294ee1afa7f5aeb0ac6b8958f7a8b49d0..f3dfc69cd2cdec50bc3b3f7cb2d63349 const { dirname, extname, isAbsolute } = require('path'); const { loadBuiltinModule, -@@ -356,7 +356,7 @@ translators.set('commonjs', async function commonjsStrategy(url, source, +@@ -335,7 +335,7 @@ translators.set('commonjs', async function commonjsStrategy(url, source, try { // We still need to read the FS to detect the exports. @@ -99,7 +81,7 @@ index 89ca269294ee1afa7f5aeb0ac6b8958f7a8b49d0..f3dfc69cd2cdec50bc3b3f7cb2d63349 } catch { // Continue regardless of error. } -@@ -424,7 +424,7 @@ function cjsPreparseModuleExports(filename, source) { +@@ -403,7 +403,7 @@ function cjsPreparseModuleExports(filename, source) { isAbsolute(resolved)) { // TODO: this should be calling the `load` hook chain to get the source // (and fallback to reading the FS only if the source is nullish). diff --git a/patches/node/fix_remove_deprecated_errno_constants.patch b/patches/node/fix_remove_deprecated_errno_constants.patch index cf9b4ec08c..e86a1fada5 100644 --- a/patches/node/fix_remove_deprecated_errno_constants.patch +++ b/patches/node/fix_remove_deprecated_errno_constants.patch @@ -10,7 +10,7 @@ This change removes the usage of these constants to fix a compilation failure du See: https://github.com/llvm/llvm-project/pull/80542 diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h -index 3375600023e39ddacf62cc17deb4f206db942084..cc106422dd36aa0564e74dd8a16eec496433d3bd 100644 +index 7f48b7daa87d1a5b14bc6f641b60f21263fa5ec3..0be470c9139a6da19414295a59f1a237cc3a50d7 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -155,7 +155,6 @@ struct uv__queue { @@ -86,10 +86,10 @@ index 149c7c107322919dfeea1dfe89dc223f78b0e979..e4e8dac6b8b5924a7eae83935031e091 NODE_DEFINE_CONSTANT(target, ETIMEDOUT); #endif diff --git a/src/node_errors.cc b/src/node_errors.cc -index 69e474257b0427f894375fbc8a2c031f1b8e0c55..f0e968c0dfa8963404c3b87827b8d11a139051cc 100644 +index 65f95c3157add2afca26a133183b65ccba6e9924..81091d364d32094dc91c7abb0c5fe9963d100a8b 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc -@@ -855,10 +855,6 @@ const char* errno_string(int errorno) { +@@ -857,10 +857,6 @@ const char* errno_string(int errorno) { ERRNO_CASE(ENOBUFS); #endif @@ -100,7 +100,7 @@ index 69e474257b0427f894375fbc8a2c031f1b8e0c55..f0e968c0dfa8963404c3b87827b8d11a #ifdef ENODEV ERRNO_CASE(ENODEV); #endif -@@ -897,14 +893,6 @@ const char* errno_string(int errorno) { +@@ -899,14 +895,6 @@ const char* errno_string(int errorno) { ERRNO_CASE(ENOSPC); #endif @@ -115,7 +115,7 @@ index 69e474257b0427f894375fbc8a2c031f1b8e0c55..f0e968c0dfa8963404c3b87827b8d11a #ifdef ENOSYS ERRNO_CASE(ENOSYS); #endif -@@ -987,10 +975,6 @@ const char* errno_string(int errorno) { +@@ -989,10 +977,6 @@ const char* errno_string(int errorno) { ERRNO_CASE(ESTALE); #endif diff --git a/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch b/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch new file mode 100644 index 0000000000..0e7268f6cf --- /dev/null +++ b/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Fri, 18 Oct 2024 17:01:06 +0200 +Subject: fix: remove harmony-import-assertions from node.cc + +harmony-import-assertions has been removed from V8 as of +https://chromium-review.googlesource.com/c/v8/v8/+/5507047, +so we should remove it from node.cc as well. + +This patch can be removed when we upgrade to a V8 version that +contains the above CL. + +diff --git a/src/node.cc b/src/node.cc +index ccc1085a84b214d241687fa9ebd45b55b2cc60d8..1df8e1f00a0e2ffa63bfd4369240b837ab6a9c50 100644 +--- a/src/node.cc ++++ b/src/node.cc +@@ -804,7 +804,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector* args, + } + // TODO(nicolo-ribaudo): remove this once V8 doesn't enable it by default + // anymore. +- v8_args.emplace_back("--no-harmony-import-assertions"); ++ // v8_args.emplace_back("--no-harmony-import-assertions"); + + auto env_opts = per_process::cli_options->per_isolate->per_env; + if (std::find(v8_args.begin(), v8_args.end(), diff --git a/patches/node/fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch b/patches/node/fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch index 831e237f29..15039649de 100644 --- a/patches/node/fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch +++ b/patches/node/fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch @@ -15,31 +15,27 @@ to recognize asar files. This reverts commit 9cf2e1f55b8446a7cde23699d00a3be73aa0c8f1. diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js -index 69f73f829706deddc4f328b78af9d58434af647d..1d53a2a47423150e822bb917b2725d3a6a794814 100644 +index f3dad958b2ec275992554477b9344214c8c1e2c8..a086217046fd5ed7cfb09cfd2ed62f3987eb1f31 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js -@@ -36,10 +36,9 @@ const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main'); - const experimentalNetworkImports = - getOptionValue('--experimental-network-imports'); +@@ -27,14 +27,13 @@ const { BuiltinModule } = require('internal/bootstrap/realm'); + const fs = require('fs'); + const { getOptionValue } = require('internal/options'); + // Do not eagerly grab .manifest, it may be in TDZ +-const { sep, posix: { relative: relativePosixPath }, resolve } = require('path'); ++const { sep, posix: { relative: relativePosixPath }, toNamespacedPath, resolve } = require('path'); + const preserveSymlinks = getOptionValue('--preserve-symlinks'); + const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main'); const inputTypeFlag = getOptionValue('--input-type'); --const { URL, pathToFileURL, fileURLToPath, isURL } = require('internal/url'); -+const { URL, pathToFileURL, fileURLToPath, isURL, toPathIfFileURL } = require('internal/url'); +-const { URL, pathToFileURL, fileURLToPath, isURL, URLParse } = require('internal/url'); ++const { URL, pathToFileURL, fileURLToPath, isURL, URLParse, toPathIfFileURL } = require('internal/url'); const { getCWDURL, setOwnProperty } = require('internal/util'); const { canParse: URLCanParse } = internalBinding('url'); -const { legacyMainResolve: FSLegacyMainResolve } = internalBinding('fs'); const { ERR_INPUT_TYPE_NOT_ALLOWED, ERR_INVALID_ARG_TYPE, -@@ -59,7 +58,7 @@ const { Module: CJSModule } = require('internal/modules/cjs/loader'); - const { getPackageScopeConfig } = require('internal/modules/esm/package_config'); - const { getConditionsSet } = require('internal/modules/esm/utils'); - const packageJsonReader = require('internal/modules/package_json_reader'); --const { internalModuleStat } = internalBinding('fs'); -+const internalFsBinding = internalBinding('fs'); - - /** - * @typedef {import('internal/modules/esm/package_config.js').PackageConfig} PackageConfig -@@ -162,34 +161,13 @@ function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) { +@@ -154,34 +153,13 @@ function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) { const realpathCache = new SafeMap(); @@ -81,7 +77,7 @@ index 69f73f829706deddc4f328b78af9d58434af647d..1d53a2a47423150e822bb917b2725d3a /** * Legacy CommonJS main resolution: -@@ -204,22 +182,44 @@ const legacyMainResolveExtensionsIndexes = { +@@ -196,22 +174,44 @@ const legacyMainResolveExtensionsIndexes = { * @returns {URL} */ function legacyMainResolve(packageJSONUrl, packageConfig, base) { @@ -142,10 +138,10 @@ index 69f73f829706deddc4f328b78af9d58434af647d..1d53a2a47423150e822bb917b2725d3a const encodedSepRegEx = /%2F|%5C/i; diff --git a/src/node_file.cc b/src/node_file.cc -index 73ad5a1a2c092d7f8dac84585fb9b13e76e84e13..039f693de14bec248f93262ad70f2736c24827e3 100644 +index 0bb70eb0fcd42ddf4d5e585065cf1ad8e74faab3..b565beae625d970ba92ab667a145d8897d4e8a6e 100644 --- a/src/node_file.cc +++ b/src/node_file.cc -@@ -19,14 +19,11 @@ +@@ -19,14 +19,12 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "node_file.h" // NOLINT(build/include_inline) @@ -153,14 +149,14 @@ index 73ad5a1a2c092d7f8dac84585fb9b13e76e84e13..039f693de14bec248f93262ad70f2736 #include "aliased_buffer-inl.h" #include "memory_tracker-inl.h" #include "node_buffer.h" --#include "node_errors.h" + #include "node_errors.h" #include "node_external_reference.h" #include "node_file-inl.h" -#include "node_metadata.h" #include "node_process-inl.h" #include "node_stat_watcher.h" #include "node_url.h" -@@ -3127,135 +3124,6 @@ constexpr std::array legacy_main_extensions = { +@@ -3208,146 +3206,6 @@ constexpr std::array legacy_main_extensions = { } // namespace @@ -202,14 +198,20 @@ index 73ad5a1a2c092d7f8dac84585fb9b13e76e84e13..039f693de14bec248f93262ad70f2736 - return; - } - -- node::url::FromNamespacedPath(&initial_file_path.value()); +- FromNamespacedPath(&initial_file_path.value()); - - package_initial_file = *initial_file_path; - - for (int i = 0; i < legacy_main_extensions_with_main_end; i++) { - file_path = *initial_file_path + std::string(legacy_main_extensions[i]); +- // TODO(anonrig): Remove this when ToNamespacedPath supports std::string +- Local local_file_path = +- Buffer::Copy(env->isolate(), file_path.c_str(), file_path.size()) +- .ToLocalChecked(); +- BufferValue buff_file_path(isolate, local_file_path); +- ToNamespacedPath(env, &buff_file_path); - -- switch (FilePathIsFile(env, file_path)) { +- switch (FilePathIsFile(env, buff_file_path.ToString())) { - case BindingData::FilePathIsFileReturnType::kIsFile: - return args.GetReturnValue().Set(i); - case BindingData::FilePathIsFileReturnType::kIsNotFile: @@ -239,14 +241,20 @@ index 73ad5a1a2c092d7f8dac84585fb9b13e76e84e13..039f693de14bec248f93262ad70f2736 - return; - } - -- node::url::FromNamespacedPath(&initial_file_path.value()); +- FromNamespacedPath(&initial_file_path.value()); - - for (int i = legacy_main_extensions_with_main_end; - i < legacy_main_extensions_package_fallback_end; - i++) { - file_path = *initial_file_path + std::string(legacy_main_extensions[i]); +- // TODO(anonrig): Remove this when ToNamespacedPath supports std::string +- Local local_file_path = +- Buffer::Copy(env->isolate(), file_path.c_str(), file_path.size()) +- .ToLocalChecked(); +- BufferValue buff_file_path(isolate, local_file_path); +- ToNamespacedPath(env, &buff_file_path); - -- switch (FilePathIsFile(env, file_path)) { +- switch (FilePathIsFile(env, buff_file_path.ToString())) { - case BindingData::FilePathIsFileReturnType::kIsFile: - return args.GetReturnValue().Set(i); - case BindingData::FilePathIsFileReturnType::kIsNotFile: @@ -292,11 +300,10 @@ index 73ad5a1a2c092d7f8dac84585fb9b13e76e84e13..039f693de14bec248f93262ad70f2736 - package_initial_file, - *module_base); -} -- + void BindingData::MemoryInfo(MemoryTracker* tracker) const { tracker->TrackField("stats_field_array", stats_field_array); - tracker->TrackField("stats_field_bigint_array", stats_field_bigint_array); -@@ -3355,19 +3223,6 @@ InternalFieldInfoBase* BindingData::Serialize(int index) { +@@ -3448,19 +3306,6 @@ InternalFieldInfoBase* BindingData::Serialize(int index) { return info; } @@ -316,15 +323,15 @@ index 73ad5a1a2c092d7f8dac84585fb9b13e76e84e13..039f693de14bec248f93262ad70f2736 static void CreatePerIsolateProperties(IsolateData* isolate_data, Local target) { Isolate* isolate = isolate_data->isolate(); -@@ -3422,7 +3277,6 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data, - SetMethod(isolate, target, "mkdtemp", Mkdtemp); +@@ -3520,7 +3365,6 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data, + SetMethod(isolate, target, "cpSyncCheckPaths", CpSyncCheckPaths); StatWatcher::CreatePerIsolateProperties(isolate_data, target); - BindingData::CreatePerIsolateProperties(isolate_data, target); target->Set( FIXED_ONE_BYTE_STRING(isolate, "kFsStatsFieldsNumber"), -@@ -3495,7 +3349,6 @@ BindingData* FSReqBase::binding_data() { +@@ -3593,7 +3437,6 @@ BindingData* FSReqBase::binding_data() { void RegisterExternalReferences(ExternalReferenceRegistry* registry) { registry->Register(Access); StatWatcher::RegisterExternalReferences(registry); @@ -333,7 +340,7 @@ index 73ad5a1a2c092d7f8dac84585fb9b13e76e84e13..039f693de14bec248f93262ad70f2736 registry->Register(GetFormatOfExtensionlessFile); registry->Register(Close); diff --git a/src/node_file.h b/src/node_file.h -index 6f1b55284db0f4f8c70081b4834a074c717f3cc9..a969fff32bd156aa9393c1db9eec474eb7432cea 100644 +index bdad1ae25f4892cbbfd8cc30c4d8b4a6f600edbc..5a3c462853aa784d9ef61ff4f63010848c48b92c 100644 --- a/src/node_file.h +++ b/src/node_file.h @@ -86,13 +86,6 @@ class BindingData : public SnapshotableObject { diff --git a/patches/node/fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch b/patches/node/fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch index 391271a50f..0ff052ab11 100644 --- a/patches/node/fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch +++ b/patches/node/fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch @@ -6,10 +6,10 @@ Subject: fix: suppress clang -Wdeprecated-declarations in libuv Should be upstreamed. diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c -index f6ec79cd57b5010ed5fd6829d952bcdacc8b7671..5cda078a55f7825d135a107fa98e1aa3527dd147 100644 +index a96cb915930a30a49ba55fd7d15ea48f0b471f89..3c15f348bd3a9a42afcf0e4d0182d2d6f3d05cb1 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c -@@ -1685,10 +1685,17 @@ int uv_os_uname(uv_utsname_t* buffer) { +@@ -1537,10 +1537,17 @@ int uv_os_uname(uv_utsname_t* buffer) { #ifdef _MSC_VER #pragma warning(suppress : 4996) #endif diff --git a/patches/node/pass_all_globals_through_require.patch b/patches/node/pass_all_globals_through_require.patch index 596b997812..d9d6dc91df 100644 --- a/patches/node/pass_all_globals_through_require.patch +++ b/patches/node/pass_all_globals_through_require.patch @@ -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 c284b39b1ac13eaea8776b7b4f457c084dce5fb8..c794751ecd4448119ce33d661e694f83b3323f03 100644 +index 451b7c2195e7ad3ab0bde95259e054dc431d7de9..d49941881e6cfd8647a6d44a57e0daaf1c874702 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -185,6 +185,13 @@ const { +@@ -182,6 +182,13 @@ const { CHAR_FORWARD_SLASH, } = require('internal/constants'); @@ -23,7 +23,7 @@ index c284b39b1ac13eaea8776b7b4f457c084dce5fb8..c794751ecd4448119ce33d661e694f83 const { isProxy, } = require('internal/util/types'); -@@ -1464,10 +1471,12 @@ Module.prototype._compile = function(content, filename, loadAsESM = false) { +@@ -1541,10 +1548,12 @@ Module.prototype._compile = function(content, filename, format) { this[kIsExecuting] = true; if (inspectorWrapper) { result = inspectorWrapper(compiledWrapper, thisValue, exports, diff --git a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch index f36422f981..5e5b538818 100644 --- a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch +++ b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch @@ -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 12262f40ce123440a9a0f974386cfbe8511f4459..f3c15b61d33bdae44de528e106fcc6f930f1c388 100644 +index f7a62364b6107ab0bad33ea2f745703c746991dc..bab2aaf3db66452216035db594dc3ebdc3606c8b 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -134,6 +134,10 @@ process.domain = null; @@ -21,47 +21,3 @@ index 12262f40ce123440a9a0f974386cfbe8511f4459..f3c15b61d33bdae44de528e106fcc6f9 // process.config is serialized config.gypi const binding = internalBinding('builtins'); -diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index c794751ecd4448119ce33d661e694f83b3323f03..364469160af5e348f8890417de16a63c0d1dca67 100644 ---- a/lib/internal/modules/cjs/loader.js -+++ b/lib/internal/modules/cjs/loader.js -@@ -138,7 +138,7 @@ const { - const assert = require('internal/assert'); - const fs = require('fs'); - const path = require('path'); --const { internalModuleStat } = internalBinding('fs'); -+const internalFsBinding = internalBinding('fs'); - const { safeGetenv } = internalBinding('credentials'); - const { - privateSymbols: { -@@ -233,7 +233,7 @@ function stat(filename) { - const result = statCache.get(filename); - if (result !== undefined) { return result; } - } -- const result = internalModuleStat(filename); -+ const result = internalFsBinding.internalModuleStat(filename); - if (statCache !== null && result >= 0) { - // Only set cache when `internalModuleStat(filename)` succeeds. - statCache.set(filename, result); -diff --git a/lib/internal/modules/package_json_reader.js b/lib/internal/modules/package_json_reader.js -index 88c079d10d116107aa34dc9281f64c799c48c0b5..069f922612777f226127dc44f4091eed30416925 100644 ---- a/lib/internal/modules/package_json_reader.js -+++ b/lib/internal/modules/package_json_reader.js -@@ -12,7 +12,7 @@ const { - const { - ERR_INVALID_PACKAGE_CONFIG, - } = require('internal/errors').codes; --const { internalModuleReadJSON } = internalBinding('fs'); -+const internalFsBinding = internalBinding('fs'); - const { resolve, sep, toNamespacedPath } = require('path'); - const permission = require('internal/process/permission'); - const { kEmptyObject } = require('internal/util'); -@@ -53,7 +53,7 @@ function read(jsonPath, { base, specifier, isESM } = kEmptyObject) { - const { - 0: string, - 1: containsKeys, -- } = internalModuleReadJSON( -+ } = internalFsBinding.internalModuleReadJSON( - toNamespacedPath(jsonPath), - ); - const result = { diff --git a/patches/node/spec_add_iterator_to_global_intrinsics.patch b/patches/node/spec_add_iterator_to_global_intrinsics.patch deleted file mode 100644 index 45f3a8e62c..0000000000 --- a/patches/node/spec_add_iterator_to_global_intrinsics.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Samuel Attard -Date: Thu, 11 Jan 2024 15:14:43 +1300 -Subject: spec: add Iterator to global intrinsics - -Ref: https://chromium-review.googlesource.com/c/v8/v8/+/4266490 - -diff --git a/test/common/globals.js b/test/common/globals.js -index cb7c1629007ecfc6c6a1aae0e6d1e9a50f07d147..5d1c4415eeb09e92d062330afc0aecb1d297b6d3 100644 ---- a/test/common/globals.js -+++ b/test/common/globals.js -@@ -63,6 +63,7 @@ const intrinsics = new Set([ - 'SharedArrayBuffer', - 'Atomics', - 'WebAssembly', -+ 'Iterator', - ]); - - if (global.gc) { diff --git a/patches/node/src_do_not_use_deprecated_v8_api.patch b/patches/node/src_do_not_use_deprecated_v8_api.patch deleted file mode 100644 index 7e2ac1f2eb..0000000000 --- a/patches/node/src_do_not_use_deprecated_v8_api.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: ishell -Date: Mon, 25 Mar 2024 15:45:41 +0100 -Subject: src: do not use deprecated V8 API -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Namely: - - `v8::ObjectTemplate::SetAccessor(v8::Local, ...);` - - `v8::ObjectTemplate::SetNativeDataProperty` with `AccessControl` - -Refs: https://github.com/v8/v8/commit/46c241eb99557fe8205acac5c526650c3847d180 -Refs: https://github.com/v8/v8/commit/6ec883986bd417e2a42ddb960bd9449deb7e4639 -Co-authored-by: Michaël Zasso -PR-URL: https://github.com/nodejs/node/pull/53084 -Reviewed-By: Luigi Pinca -Reviewed-By: Tobias Nießen -Reviewed-By: James M Snell -Reviewed-By: Joyee Cheung -(cherry picked from commit 26d5cafff76d3a096ebfd7d7a6279d4b5b190230) - -diff --git a/src/base_object-inl.h b/src/base_object-inl.h -index da8fed7b3013df10ae02be2070545c74d9a978f0..518b22dabef0974c2e7ecb466669925338524059 100644 ---- a/src/base_object-inl.h -+++ b/src/base_object-inl.h -@@ -132,14 +132,14 @@ v8::EmbedderGraph::Node::Detachedness BaseObject::GetDetachedness() const { - - template - void BaseObject::InternalFieldGet( -- v8::Local property, -+ v8::Local property, - const v8::PropertyCallbackInfo& info) { - info.GetReturnValue().Set( - info.This()->GetInternalField(Field).As()); - } - --template --void BaseObject::InternalFieldSet(v8::Local property, -+template -+void BaseObject::InternalFieldSet(v8::Local property, - v8::Local value, - const v8::PropertyCallbackInfo& info) { - // This could be e.g. value->IsFunction(). -diff --git a/src/base_object.h b/src/base_object.h -index 5968694e8393d8434fb2ffee411dfac4c93aff29..5c16d0d1b32e2d056f4fcfa0e01781292932a0fa 100644 ---- a/src/base_object.h -+++ b/src/base_object.h -@@ -111,10 +111,10 @@ class BaseObject : public MemoryRetainer { - - // Setter/Getter pair for internal fields that can be passed to SetAccessor. - template -- static void InternalFieldGet(v8::Local property, -+ static void InternalFieldGet(v8::Local property, - const v8::PropertyCallbackInfo& info); - template -- static void InternalFieldSet(v8::Local property, -+ static void InternalFieldSet(v8::Local property, - v8::Local value, - const v8::PropertyCallbackInfo& info); - -diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 3e37aa8b0c9696cceb3f3cfab9721f38c74a2fba..78f20de6b127961e9de7b5caaeca702ed7a36e01 100644 ---- a/src/node_builtins.cc -+++ b/src/node_builtins.cc -@@ -11,7 +11,6 @@ namespace node { - namespace builtins { - - using v8::Context; --using v8::DEFAULT; - using v8::EscapableHandleScope; - using v8::Function; - using v8::FunctionCallbackInfo; -@@ -720,7 +719,6 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data, - nullptr, - Local(), - None, -- DEFAULT, - SideEffectType::kHasNoSideEffect); - - target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "builtinIds"), -@@ -728,7 +726,6 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data, - nullptr, - Local(), - None, -- DEFAULT, - SideEffectType::kHasNoSideEffect); - - target->SetNativeDataProperty( -@@ -737,7 +734,6 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data, - nullptr, - Local(), - None, -- DEFAULT, - SideEffectType::kHasNoSideEffect); - - target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "natives"), -@@ -745,7 +741,6 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data, - nullptr, - Local(), - None, -- DEFAULT, - SideEffectType::kHasNoSideEffect); - - SetMethod(isolate, target, "getCacheUsage", BuiltinLoader::GetCacheUsage); -diff --git a/src/node_external_reference.h b/src/node_external_reference.h -index 4e2ad9024020fa0851da41da44afccdf188c7044..c4aba23510872d66b58a1adc88cdd1ee85a86cfe 100644 ---- a/src/node_external_reference.h -+++ b/src/node_external_reference.h -@@ -64,8 +64,6 @@ class ExternalReferenceRegistry { - V(CFunctionWithBool) \ - V(const v8::CFunctionInfo*) \ - V(v8::FunctionCallback) \ -- V(v8::AccessorGetterCallback) \ -- V(v8::AccessorSetterCallback) \ - V(v8::AccessorNameGetterCallback) \ - V(v8::AccessorNameSetterCallback) \ - V(v8::GenericNamedPropertyDefinerCallback) \ diff --git a/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch b/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch index 78b759febc..ef2c934d36 100644 --- a/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch +++ b/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch @@ -16,7 +16,7 @@ patch: (cherry picked from commit 30329d06235a9f9733b1d4da479b403462d1b326) diff --git a/src/env-inl.h b/src/env-inl.h -index d98a32d6ec311459877bc3b0de33cca4766aeda7..9fc934975b015b97ddd84bf3eea5d53144130035 100644 +index 28a15aa741ddd40c664aae641797e7cc2813442f..08fe98e10b7716c694bbc882299fe0ed9e282d73 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -62,31 +62,6 @@ inline uv_loop_t* IsolateData::event_loop() const { @@ -52,10 +52,10 @@ index d98a32d6ec311459877bc3b0de33cca4766aeda7..9fc934975b015b97ddd84bf3eea5d531 return &(wrapper_data_->cppgc_id); } diff --git a/src/env.cc b/src/env.cc -index 38802b1e9acf9b3e99fdc4f39770e896393befe3..e0433e29ca98c42a38d1da6d66085fdea1edde29 100644 +index 665b064091d4cc42a4dc9ee5b0ea9e2f190338ca..4c8cb75945d82544ce2237d94cd1406d15efe424 100644 --- a/src/env.cc +++ b/src/env.cc -@@ -22,6 +22,7 @@ +@@ -23,6 +23,7 @@ #include "util-inl.h" #include "v8-cppgc.h" #include "v8-profiler.h" @@ -63,7 +63,7 @@ index 38802b1e9acf9b3e99fdc4f39770e896393befe3..e0433e29ca98c42a38d1da6d66085fde #include #include -@@ -68,7 +69,6 @@ using v8::TryCatch; +@@ -71,7 +72,6 @@ using v8::TryCatch; using v8::Uint32; using v8::Undefined; using v8::Value; @@ -71,7 +71,7 @@ index 38802b1e9acf9b3e99fdc4f39770e896393befe3..e0433e29ca98c42a38d1da6d66085fde using worker::Worker; int const ContextEmbedderTag::kNodeContextTag = 0x6e6f64; -@@ -530,6 +530,14 @@ void IsolateData::CreateProperties() { +@@ -532,6 +532,14 @@ void IsolateData::CreateProperties() { CreateEnvProxyTemplate(this); } @@ -86,7 +86,7 @@ index 38802b1e9acf9b3e99fdc4f39770e896393befe3..e0433e29ca98c42a38d1da6d66085fde constexpr uint16_t kDefaultCppGCEmbedderID = 0x90de; Mutex IsolateData::isolate_data_mutex_; std::unordered_map> -@@ -567,36 +575,16 @@ IsolateData::IsolateData(Isolate* isolate, +@@ -569,36 +577,16 @@ IsolateData::IsolateData(Isolate* isolate, v8::CppHeap* cpp_heap = isolate->GetCppHeap(); uint16_t cppgc_id = kDefaultCppGCEmbedderID; @@ -130,7 +130,7 @@ index 38802b1e9acf9b3e99fdc4f39770e896393befe3..e0433e29ca98c42a38d1da6d66085fde { // GC could still be run after the IsolateData is destroyed, so we store -@@ -628,11 +616,12 @@ IsolateData::~IsolateData() { +@@ -630,11 +618,12 @@ IsolateData::~IsolateData() { } } @@ -146,10 +146,10 @@ index 38802b1e9acf9b3e99fdc4f39770e896393befe3..e0433e29ca98c42a38d1da6d66085fde void IsolateData::MemoryInfo(MemoryTracker* tracker) const { diff --git a/src/env.h b/src/env.h -index 7cb77fb4f35a60fbda5b868798321ac8b6340bfa..06746554e1d60a9377ff6d7d970220f3fa88e4ac 100644 +index 49ca9c0042ccf22ad1fffa54f05fd443cbc681ba..945535d0dc40f1a32f7e3ecf7d50361e591ba6c8 100644 --- a/src/env.h +++ b/src/env.h -@@ -174,10 +174,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer { +@@ -175,10 +175,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer { uint16_t* embedder_id_for_cppgc() const; uint16_t* embedder_id_for_non_cppgc() const; @@ -161,7 +161,7 @@ index 7cb77fb4f35a60fbda5b868798321ac8b6340bfa..06746554e1d60a9377ff6d7d970220f3 inline MultiIsolatePlatform* platform() const; inline const SnapshotData* snapshot_data() const; diff --git a/src/node.h b/src/node.h -index df3fb3372d6357b5d77b4f683e309b8483998128..01e8a4f2ed905bf5bbb803419012a014c204b460 100644 +index c16204ad2a4787eeffe61eedda254d3a5509df8c..c39f586e9c5e7e9db75d922d244ea8e4d6d56841 100644 --- a/src/node.h +++ b/src/node.h @@ -1561,24 +1561,14 @@ void RegisterSignalHandler(int signal, diff --git a/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch b/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch index 6aa803f630..861bd69338 100644 --- a/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch +++ b/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch @@ -11,6 +11,20 @@ two fields in node.js. branch of Node.js. This patch can be removed when Electron upgrades to a stable Node release that contains the change. -- Charles) +diff --git a/src/crypto/crypto_timing.cc b/src/crypto/crypto_timing.cc +index 3d8ccc77b5952a999c5fe48792259d32b402c460..867a1c4aca54b9d41490d23a5eb55088b7e941cc 100644 +--- a/src/crypto/crypto_timing.cc ++++ b/src/crypto/crypto_timing.cc +@@ -59,7 +59,8 @@ bool FastTimingSafeEqual(Local receiver, + if (a.length() != b.length() || !a.getStorageIfAligned(&data_a) || + !b.getStorageIfAligned(&data_b)) { + TRACK_V8_FAST_API_CALL("crypto.timingSafeEqual.error"); +- options.fallback = true; ++ v8::HandleScope scope(options.isolate); ++ THROW_ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH(options.isolate); + return false; + } + diff --git a/src/histogram.cc b/src/histogram.cc index 4dbdea9be5721486d71a9dda77311b4919d450a3..4aacaa2a5d12533a039b4b96cb7f1fd79063d50f 100644 --- a/src/histogram.cc @@ -25,6 +39,36 @@ index 4dbdea9be5721486d71a9dda77311b4919d450a3..4aacaa2a5d12533a039b4b96cb7f1fd7 return; } HistogramBase* histogram; +diff --git a/src/node_file.cc b/src/node_file.cc +index b565beae625d970ba92ab667a145d8897d4e8a6e..31c2fe82299d6905855c4efffeea4a4d161a88d5 100644 +--- a/src/node_file.cc ++++ b/src/node_file.cc +@@ -1049,23 +1049,10 @@ static int32_t FastInternalModuleStat( + const FastOneByteString& input, + // NOLINTNEXTLINE(runtime/references) This is V8 api. + FastApiCallbackOptions& options) { +- // This needs a HandleScope which needs an isolate. +- Isolate* isolate = Isolate::TryGetCurrent(); +- if (!isolate) { +- options.fallback = true; +- return -1; +- } +- +- HandleScope scope(isolate); +- Environment* env = Environment::GetCurrent(recv->GetCreationContextChecked()); ++ Environment* env = Environment::GetCurrent(options.isolate); ++ HandleScope scope(env->isolate()); + + auto path = std::filesystem::path(input.data, input.data + input.length); +- if (UNLIKELY(!env->permission()->is_granted( +- env, permission::PermissionScope::kFileSystemRead, path.string()))) { +- options.fallback = true; +- return -1; +- } +- + switch (std::filesystem::status(path).type()) { + case std::filesystem::file_type::directory: + return 1; diff --git a/src/node_wasi.cc b/src/node_wasi.cc index ad1da44a01f437c97e06a3857eebd2edcebc83da..7123278e1a0942b61a76e9b1e7464eb8b5064079 100644 --- a/src/node_wasi.cc diff --git a/patches/node/src_update_default_v8_platform_to_override_functions_with_location.patch b/patches/node/src_update_default_v8_platform_to_override_functions_with_location.patch deleted file mode 100644 index 8d576cc657..0000000000 --- a/patches/node/src_update_default_v8_platform_to_override_functions_with_location.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Etienne Pierre-Doray -Date: Mon, 11 Dec 2023 04:13:38 -0500 -Subject: src: update default V8 platform to override functions with location - -Xref: https://chromium-review.googlesource.com/c/v8/v8/+/4514946 -Xref: https://chromium-review.googlesource.com/c/v8/v8/+/4336198 - -Backported from https://github.com/nodejs/node-v8/commit/f66b996030e94a7e4874820a53475338e1df4fe3 - -diff --git a/src/node_platform.cc b/src/node_platform.cc -index 97cf6cb840bab5016e485b0dd90b3e4e1d8686c9..00ca9757bc4d0cdeb03a3f32be3ef19077cb7969 100644 ---- a/src/node_platform.cc -+++ b/src/node_platform.cc -@@ -501,17 +501,22 @@ bool PerIsolatePlatformData::FlushForegroundTasksInternal() { - return did_work; - } - --void NodePlatform::CallOnWorkerThread(std::unique_ptr task) { -+void NodePlatform::PostTaskOnWorkerThreadImpl( -+ v8::TaskPriority priority, -+ std::unique_ptr task, -+ const v8::SourceLocation& location) { - worker_thread_task_runner_->PostTask(std::move(task)); - } - --void NodePlatform::CallDelayedOnWorkerThread(std::unique_ptr task, -- double delay_in_seconds) { -+void NodePlatform::PostDelayedTaskOnWorkerThreadImpl( -+ v8::TaskPriority priority, -+ std::unique_ptr task, -+ double delay_in_seconds, -+ const v8::SourceLocation& location) { - worker_thread_task_runner_->PostDelayedTask(std::move(task), - delay_in_seconds); - } - -- - IsolatePlatformDelegate* NodePlatform::ForIsolate(Isolate* isolate) { - Mutex::ScopedLock lock(per_isolate_mutex_); - auto data = per_isolate_[isolate]; -@@ -533,8 +538,10 @@ bool NodePlatform::FlushForegroundTasks(Isolate* isolate) { - return per_isolate->FlushForegroundTasksInternal(); - } - --std::unique_ptr NodePlatform::CreateJob( -- v8::TaskPriority priority, std::unique_ptr job_task) { -+std::unique_ptr NodePlatform::CreateJobImpl( -+ v8::TaskPriority priority, -+ std::unique_ptr job_task, -+ const v8::SourceLocation& location) { - return v8::platform::NewDefaultJobHandle( - this, priority, std::move(job_task), NumberOfWorkerThreads()); - } -diff --git a/src/node_platform.h b/src/node_platform.h -index 1062f3b1b9c386a7bde8dca366c6f008bb183ab7..77cb5e6e4f891c510cdaf7fd6175a1f00d9bc420 100644 ---- a/src/node_platform.h -+++ b/src/node_platform.h -@@ -147,17 +147,23 @@ class NodePlatform : public MultiIsolatePlatform { - - // v8::Platform implementation. - int NumberOfWorkerThreads() override; -- void CallOnWorkerThread(std::unique_ptr task) override; -- void CallDelayedOnWorkerThread(std::unique_ptr task, -- double delay_in_seconds) override; -+ void PostTaskOnWorkerThreadImpl(v8::TaskPriority priority, -+ std::unique_ptr task, -+ const v8::SourceLocation& location) override; -+ void PostDelayedTaskOnWorkerThreadImpl( -+ v8::TaskPriority priority, -+ std::unique_ptr task, -+ double delay_in_seconds, -+ const v8::SourceLocation& location) override; - bool IdleTasksEnabled(v8::Isolate* isolate) override; - double MonotonicallyIncreasingTime() override; - double CurrentClockTimeMillis() override; - v8::TracingController* GetTracingController() override; - bool FlushForegroundTasks(v8::Isolate* isolate) override; -- std::unique_ptr CreateJob( -+ std::unique_ptr CreateJobImpl( - v8::TaskPriority priority, -- std::unique_ptr job_task) override; -+ std::unique_ptr job_task, -+ const v8::SourceLocation& location) override; - - void RegisterIsolate(v8::Isolate* isolate, uv_loop_t* loop) override; - void RegisterIsolate(v8::Isolate* isolate, diff --git a/patches/node/src_use_new_v8_api_to_define_stream_accessor.patch b/patches/node/src_use_new_v8_api_to_define_stream_accessor.patch deleted file mode 100644 index 3688d4d252..0000000000 --- a/patches/node/src_use_new_v8_api_to_define_stream_accessor.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Igor Sheludko -Date: Tue, 30 Apr 2024 15:22:06 +0200 -Subject: src: use new V8 API to define stream accessor -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Define XxxStream.prototype.onread as an accessor in JavaScript sense. - -Previously it was defined via soon-to-be-deprecated -`v8::ObjectTemplate::SetAccessor(..)` which used to call setter even -for property stores via stream object. - -The replacement V8 API `v8::ObjectTemplate::SetNativeDataProperty(..)` -defines a properly behaving data property and thus a store to a stream -object will not trigger the "onread" setter callback. - -In order to preserve the desired behavior of storing the value in the -receiver's internal field the "onread" property should be defined as -a proper JavaScript accessor. - -PR-URL: https://github.com/nodejs/node/pull/53084 -Refs: https://github.com/v8/v8/commit/46c241eb99557fe8205acac5c526650c3847d180 -Refs: https://github.com/v8/v8/commit/6ec883986bd417e2a42ddb960bd9449deb7e4639 -Reviewed-By: Luigi Pinca -Reviewed-By: Tobias Nießen -Reviewed-By: James M Snell -Reviewed-By: Joyee Cheung -(cherry picked from commit bd151552ef35b0eed415eb1c50d30dafd341cee8) - -diff --git a/src/base_object-inl.h b/src/base_object-inl.h -index 518b22dabef0974c2e7ecb466669925338524059..61f30b3cfbdb0f3d21fe8e93dc97c55162b69a69 100644 ---- a/src/base_object-inl.h -+++ b/src/base_object-inl.h -@@ -132,19 +132,18 @@ v8::EmbedderGraph::Node::Detachedness BaseObject::GetDetachedness() const { - - template - void BaseObject::InternalFieldGet( -- v8::Local property, -- const v8::PropertyCallbackInfo& info) { -- info.GetReturnValue().Set( -- info.This()->GetInternalField(Field).As()); -+ const v8::FunctionCallbackInfo& args) { -+ args.GetReturnValue().Set( -+ args.This()->GetInternalField(Field).As()); - } - - template --void BaseObject::InternalFieldSet(v8::Local property, -- v8::Local value, -- const v8::PropertyCallbackInfo& info) { -+void BaseObject::InternalFieldSet( -+ const v8::FunctionCallbackInfo& args) { -+ v8::Local value = args[0]; - // This could be e.g. value->IsFunction(). - CHECK(((*value)->*typecheck)()); -- info.This()->SetInternalField(Field, value); -+ args.This()->SetInternalField(Field, value); - } - - bool BaseObject::has_pointer_data() const { -diff --git a/src/base_object.h b/src/base_object.h -index 5c16d0d1b32e2d056f4fcfa0e01781292932a0fa..ce6277dec5a2b9313ecd3699b39ec17585d5adc5 100644 ---- a/src/base_object.h -+++ b/src/base_object.h -@@ -111,12 +111,9 @@ class BaseObject : public MemoryRetainer { - - // Setter/Getter pair for internal fields that can be passed to SetAccessor. - template -- static void InternalFieldGet(v8::Local property, -- const v8::PropertyCallbackInfo& info); -+ static void InternalFieldGet(const v8::FunctionCallbackInfo& args); - template -- static void InternalFieldSet(v8::Local property, -- v8::Local value, -- const v8::PropertyCallbackInfo& info); -+ static void InternalFieldSet(const v8::FunctionCallbackInfo& args); - - // This is a bit of a hack. See the override in async_wrap.cc for details. - virtual bool IsDoneInitializing() const; -diff --git a/src/stream_base.cc b/src/stream_base.cc -index d2649ea0a649bb2f6c6becf1891c0b6d773c1a62..9d855c2992492d3394d9f8af4e53781027a2dd83 100644 ---- a/src/stream_base.cc -+++ b/src/stream_base.cc -@@ -492,6 +492,29 @@ Local StreamBase::GetObject() { - return GetAsyncWrap()->object(); - } - -+void StreamBase::AddAccessor(v8::Isolate* isolate, -+ v8::Local signature, -+ enum v8::PropertyAttribute attributes, -+ v8::Local t, -+ JSMethodFunction* getter, -+ JSMethodFunction* setter, -+ v8::Local string) { -+ Local getter_templ = -+ NewFunctionTemplate(isolate, -+ getter, -+ signature, -+ ConstructorBehavior::kThrow, -+ SideEffectType::kHasNoSideEffect); -+ Local setter_templ = -+ NewFunctionTemplate(isolate, -+ setter, -+ signature, -+ ConstructorBehavior::kThrow, -+ SideEffectType::kHasSideEffect); -+ t->PrototypeTemplate()->SetAccessorProperty( -+ string, getter_templ, setter_templ, attributes); -+} -+ - void StreamBase::AddMethod(Isolate* isolate, - Local signature, - enum PropertyAttribute attributes, -@@ -561,11 +584,14 @@ void StreamBase::AddMethods(IsolateData* isolate_data, - JSMethod<&StreamBase::WriteString>); - t->PrototypeTemplate()->Set(FIXED_ONE_BYTE_STRING(isolate, "isStreamBase"), - True(isolate)); -- t->PrototypeTemplate()->SetAccessor( -- FIXED_ONE_BYTE_STRING(isolate, "onread"), -- BaseObject::InternalFieldGet, -- BaseObject::InternalFieldSet); -+ AddAccessor(isolate, -+ sig, -+ static_cast(DontDelete | DontEnum), -+ t, -+ BaseObject::InternalFieldGet, -+ BaseObject::InternalFieldSet, -+ FIXED_ONE_BYTE_STRING(isolate, "onread")); - } - - void StreamBase::RegisterExternalReferences( -diff --git a/src/stream_base.h b/src/stream_base.h -index 62a8928e144ad6aa67eeccdbc46d44da22887fb8..ccbd769ceaf3c1e024defb3104e601d037c98b6a 100644 ---- a/src/stream_base.h -+++ b/src/stream_base.h -@@ -413,6 +413,13 @@ class StreamBase : public StreamResource { - EmitToJSStreamListener default_listener_; - - void SetWriteResult(const StreamWriteResult& res); -+ static void AddAccessor(v8::Isolate* isolate, -+ v8::Local sig, -+ enum v8::PropertyAttribute attributes, -+ v8::Local t, -+ JSMethodFunction* getter, -+ JSMethodFunction* setter, -+ v8::Local str); - static void AddMethod(v8::Isolate* isolate, - v8::Local sig, - enum v8::PropertyAttribute attributes, diff --git a/patches/node/src_use_supported_api_to_get_stalled_tla_messages.patch b/patches/node/src_use_supported_api_to_get_stalled_tla_messages.patch deleted file mode 100644 index c4c302dc66..0000000000 --- a/patches/node/src_use_supported_api_to_get_stalled_tla_messages.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= -Date: Mon, 11 Mar 2024 09:27:11 +0000 -Subject: src: use supported API to get stalled TLA messages - -Refs: https://github.com/v8/v8/commit/23e3b6f650162ed2b332e55aa802adb8f41b50f2 - -diff --git a/src/module_wrap.cc b/src/module_wrap.cc -index 9bbb8ab908d8d992abb43254860d51f57f56387b..92edfc6fc6401edd3685a0137eac25d9e37566f6 100644 ---- a/src/module_wrap.cc -+++ b/src/module_wrap.cc -@@ -587,11 +587,10 @@ void ModuleWrap::EvaluateSync(const FunctionCallbackInfo& args) { - - if (module->IsGraphAsync()) { - CHECK(env->options()->print_required_tla); -- auto stalled = module->GetStalledTopLevelAwaitMessage(isolate); -- if (stalled.size() != 0) { -- for (auto pair : stalled) { -- Local message = std::get<1>(pair); -- -+ auto stalled_messages = -+ std::get<1>(module->GetStalledTopLevelAwaitMessages(isolate)); -+ if (stalled_messages.size() != 0) { -+ for (auto& message : stalled_messages) { - std::string reason = "Error: unexpected top-level await at "; - std::string info = - FormatErrorMessage(isolate, context, "", message, true); diff --git a/patches/node/support_v8_sandboxed_pointers.patch b/patches/node/support_v8_sandboxed_pointers.patch index abeae7e10d..40624c1ca8 100644 --- a/patches/node/support_v8_sandboxed_pointers.patch +++ b/patches/node/support_v8_sandboxed_pointers.patch @@ -7,7 +7,7 @@ This refactors several allocators to allocate within the V8 memory cage, allowing them to be compatible with the V8_SANDBOXED_POINTERS feature. diff --git a/src/api/environment.cc b/src/api/environment.cc -index e0bf37f09dceb93af58990438ab577a9d4b843e8..b9098d102b40adad7fafcc331ac62870617019b9 100644 +index 5fc1b6f2446d7c786024eb60800e2edab613dcd1..f59abcb21d64b910d8d42eb23c03109f62558813 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -101,6 +101,14 @@ MaybeLocal PrepareStackTraceCallback(Local context, @@ -25,11 +25,49 @@ index e0bf37f09dceb93af58990438ab577a9d4b843e8..b9098d102b40adad7fafcc331ac62870 void* NodeArrayBufferAllocator::Allocate(size_t size) { void* ret; if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers) +diff --git a/src/crypto/crypto_dh.cc b/src/crypto/crypto_dh.cc +index 33ffbbb85d05f5356183e3aa1ca23707c5629b5d..008d212ebe25b0022020379aa08963c12828940c 100644 +--- a/src/crypto/crypto_dh.cc ++++ b/src/crypto/crypto_dh.cc +@@ -51,6 +51,25 @@ void DiffieHellman::MemoryInfo(MemoryTracker* tracker) const { + namespace { + MaybeLocal DataPointerToBuffer(Environment* env, + ncrypto::DataPointer&& data) { ++#if defined(V8_ENABLE_SANDBOX) ++ std::unique_ptr backing; ++ if (data.size() > 0) { ++ std::unique_ptr allocator(ArrayBuffer::Allocator::NewDefaultAllocator()); ++ void* v8_data = allocator->Allocate(data.size()); ++ CHECK(v8_data); ++ memcpy(v8_data, data.get(), data.size()); ++ backing = ArrayBuffer::NewBackingStore( ++ v8_data, ++ data.size(), ++ [](void* data, size_t length, void*) { ++ std::unique_ptr allocator(ArrayBuffer::Allocator::NewDefaultAllocator()); ++ allocator->Free(data, length); ++ }, nullptr); ++ } else { ++ NoArrayBufferZeroFillScope no_zero_fill_scope(env->isolate_data()); ++ backing = v8::ArrayBuffer::NewBackingStore(env->isolate(), data.size()); ++ } ++#else + auto backing = ArrayBuffer::NewBackingStore( + data.get(), + data.size(), +@@ -59,6 +78,7 @@ MaybeLocal DataPointerToBuffer(Environment* env, + }, + nullptr); + data.release(); ++#endif + + auto ab = ArrayBuffer::New(env->isolate(), std::move(backing)); + return Buffer::New(env, ab, 0, ab->ByteLength()).FromMaybe(Local()); diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc -index 63d971e1fe6b861e29c12f04563701b01fdfb976..f39652a6f5196531cd78ce74e91076b1b9e970ca 100644 +index ee81048caab4ccfe26ea9e677782c9c955d162a9..643c9d31dc2737faa2ec51684ffceb35a1014a58 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc -@@ -348,10 +348,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept { +@@ -326,10 +326,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept { return *this; } @@ -66,7 +104,7 @@ index 63d971e1fe6b861e29c12f04563701b01fdfb976..f39652a6f5196531cd78ce74e91076b1 std::unique_ptr ptr = ArrayBuffer::NewBackingStore( allocated_data_, size(), -@@ -363,10 +388,11 @@ std::unique_ptr ByteSource::ReleaseToBackingStore() { +@@ -341,10 +366,11 @@ std::unique_ptr ByteSource::ReleaseToBackingStore() { data_ = nullptr; size_ = 0; return ptr; @@ -79,7 +117,7 @@ index 63d971e1fe6b861e29c12f04563701b01fdfb976..f39652a6f5196531cd78ce74e91076b1 return ArrayBuffer::New(env->isolate(), std::move(store)); } -@@ -703,6 +729,16 @@ namespace { +@@ -641,6 +667,16 @@ namespace { // in which case this has the same semantics as // using OPENSSL_malloc. However, if the secure heap is // initialized, SecureBuffer will automatically use it. @@ -96,7 +134,7 @@ index 63d971e1fe6b861e29c12f04563701b01fdfb976..f39652a6f5196531cd78ce74e91076b1 void SecureBuffer(const FunctionCallbackInfo& args) { CHECK(args[0]->IsUint32()); Environment* env = Environment::GetCurrent(args); -@@ -724,6 +760,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -662,6 +698,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { Local buffer = ArrayBuffer::New(env->isolate(), store); args.GetReturnValue().Set(Uint8Array::New(buffer, 0, len)); } @@ -105,10 +143,10 @@ index 63d971e1fe6b861e29c12f04563701b01fdfb976..f39652a6f5196531cd78ce74e91076b1 void SecureHeapUsed(const FunctionCallbackInfo& args) { #ifndef OPENSSL_IS_BORINGSSL diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h -index 4ba261014695cf1aa8eb53b21a2873f4c4ea8e43..b695d131bcdc331974f544924138bb5eedc50c9f 100644 +index 922e77091d72172ed6cfc5e8477901e3608396c5..16a236c69caed6d60248c7973531a95adc8f2edb 100644 --- a/src/crypto/crypto_util.h +++ b/src/crypto/crypto_util.h -@@ -285,7 +285,7 @@ class ByteSource { +@@ -268,7 +268,7 @@ class ByteSource { // Creates a v8::BackingStore that takes over responsibility for // any allocated data. The ByteSource will be reset with size = 0 // after being called. @@ -117,11 +155,44 @@ index 4ba261014695cf1aa8eb53b21a2873f4c4ea8e43..b695d131bcdc331974f544924138bb5e v8::Local ToArrayBuffer(Environment* env); +diff --git a/src/crypto/crypto_x509.cc b/src/crypto/crypto_x509.cc +index af2f953f0388dbce326b0c519de3883552f8f009..7fb34057a486914dd886ec4d3d23be90cccb4fea 100644 +--- a/src/crypto/crypto_x509.cc ++++ b/src/crypto/crypto_x509.cc +@@ -174,6 +174,19 @@ MaybeLocal ToV8Value(Local context, const BIOPointer& bio) { + MaybeLocal ToBuffer(Environment* env, BIOPointer* bio) { + if (bio == nullptr || !*bio) return {}; + BUF_MEM* mem = *bio; ++#if defined(V8_ENABLE_SANDBOX) ++ std::unique_ptr allocator(ArrayBuffer::Allocator::NewDefaultAllocator()); ++ void* v8_data = allocator->Allocate(mem->length); ++ CHECK(v8_data); ++ memcpy(v8_data, mem->data, mem->length); ++ std::unique_ptr backing = ArrayBuffer::NewBackingStore( ++ v8_data, ++ mem->length, ++ [](void* data, size_t length, void*) { ++ std::unique_ptr allocator(ArrayBuffer::Allocator::NewDefaultAllocator()); ++ allocator->Free(data, length); ++ }, nullptr); ++#else + auto backing = ArrayBuffer::NewBackingStore( + mem->data, + mem->length, +@@ -181,6 +194,8 @@ MaybeLocal ToBuffer(Environment* env, BIOPointer* bio) { + BIOPointer free_me(static_cast(data)); + }, + bio->release()); ++#endif ++ + auto ab = ArrayBuffer::New(env->isolate(), std::move(backing)); + Local ret; + if (!Buffer::New(env, ab, 0, ab->ByteLength()).ToLocal(&ret)) return {}; diff --git a/src/node_i18n.cc b/src/node_i18n.cc -index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e8778cb98623 100644 +index 43bb68351bf0a68285e464601013bbdbd5d5df5f..4126bbff080548c91154a6dcc437359c82a6c771 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc -@@ -106,7 +106,7 @@ namespace { +@@ -107,7 +107,7 @@ namespace { template MaybeLocal ToBufferEndian(Environment* env, MaybeStackBuffer* buf) { @@ -130,7 +201,7 @@ index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e877 if (ret.IsEmpty()) return ret; -@@ -183,7 +183,7 @@ MaybeLocal TranscodeLatin1ToUcs2(Environment* env, +@@ -184,7 +184,7 @@ MaybeLocal TranscodeLatin1ToUcs2(Environment* env, return {}; } @@ -139,7 +210,7 @@ index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e877 } MaybeLocal TranscodeFromUcs2(Environment* env, -@@ -228,7 +228,7 @@ MaybeLocal TranscodeUcs2FromUtf8(Environment* env, +@@ -229,7 +229,7 @@ MaybeLocal TranscodeUcs2FromUtf8(Environment* env, return {}; } @@ -148,7 +219,7 @@ index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e877 } MaybeLocal TranscodeUtf8FromUcs2(Environment* env, -@@ -252,7 +252,7 @@ MaybeLocal TranscodeUtf8FromUcs2(Environment* env, +@@ -253,7 +253,7 @@ MaybeLocal TranscodeUtf8FromUcs2(Environment* env, return {}; } @@ -158,7 +229,7 @@ index 2aa7cd98ecc179519a6bb1932dafa86a38bda4f5..79376bef2e674f05fd95380dd419e877 constexpr const char* EncodingName(const enum encoding encoding) { diff --git a/src/node_internals.h b/src/node_internals.h -index 6264f23d54d6028bb0158f12a9296ba67a846358..613300215766aeb108219b0d1c3b95ee02db964f 100644 +index fe2d25decd883085e4c3f368ab4acc01a7f66f6e..bcd5c87afcff9c56429443363c63fc8079521451 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -117,7 +117,9 @@ v8::Maybe InitializePrimordials(v8::Local context); diff --git a/patches/node/test_formally_mark_some_tests_as_flaky.patch b/patches/node/test_formally_mark_some_tests_as_flaky.patch index 79b02f4e85..5b01232074 100644 --- a/patches/node/test_formally_mark_some_tests_as_flaky.patch +++ b/patches/node/test_formally_mark_some_tests_as_flaky.patch @@ -7,7 +7,7 @@ Instead of disabling the tests, flag them as flaky so they still run but don't cause CI failures on flakes. diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status -index 79a953df7da64b7d7580e099a5cc5160e7842999..94616df356cab50c8ef4099e7863f5986deed377 100644 +index 24e1a74886bad536dc08df75fbdb0508e4e1420a..7f3be73474557788050a9110b0e29e602b7d6397 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -5,6 +5,16 @@ prefix parallel diff --git a/patches/node/test_make_test-node-output-v8-warning_generic.patch b/patches/node/test_make_test-node-output-v8-warning_generic.patch index 97df457cbd..85e434f823 100644 --- a/patches/node/test_make_test-node-output-v8-warning_generic.patch +++ b/patches/node/test_make_test-node-output-v8-warning_generic.patch @@ -14,7 +14,7 @@ meaningless. Fix it for now by replacing the process.argv0 basename instead. Some form of fix for this should be upstreamed. diff --git a/test/parallel/test-node-output-v8-warning.mjs b/test/parallel/test-node-output-v8-warning.mjs -index 8e497739d21c70d5c792f43c268746a200916063..cad1910e020b15775ee16122bc9d310680fed687 100644 +index 309e904c49b7124b64831293e0473a5d35249081..6636144f5074811f95bbe53a62718c8084088bdc 100644 --- a/test/parallel/test-node-output-v8-warning.mjs +++ b/test/parallel/test-node-output-v8-warning.mjs @@ -2,11 +2,18 @@ import '../common/index.mjs'; @@ -33,10 +33,10 @@ index 8e497739d21c70d5c792f43c268746a200916063..cad1910e020b15775ee16122bc9d3106 + return str.replaceAll(`${baseName} --`, '* --'); +} + - describe('v8 output', { concurrency: true }, () => { + describe('v8 output', { concurrency: !process.env.TEST_PARALLEL }, () => { function normalize(str) { return str.replaceAll(snapshot.replaceWindowsPaths(process.cwd()), '') -@@ -15,10 +22,10 @@ describe('v8 output', { concurrency: true }, () => { +@@ -15,10 +22,10 @@ describe('v8 output', { concurrency: !process.env.TEST_PARALLEL }, () => { .replaceAll('*test*', '*') .replaceAll(/.*?\*fixtures\*v8\*/g, '(node:*) V8: *') // Replace entire path before fixtures/v8 .replaceAll('*fixtures*v8*', '*') diff --git a/patches/node/test_match_wpt_streams_transferable_transform-stream-members_any_js.patch b/patches/node/test_match_wpt_streams_transferable_transform-stream-members_any_js.patch deleted file mode 100644 index 6a0a9f4b9d..0000000000 --- a/patches/node/test_match_wpt_streams_transferable_transform-stream-members_any_js.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Tue, 16 Jan 2024 19:39:10 +0100 -Subject: test: match wpt/streams/transferable/transform-stream-members.any.js - to upstream - -All four of this calls should fail - see third_party/blink/web_tests/external/wpt/streams/transferable/transform-stream-members.any-expected.txt - -diff --git a/test/wpt/status/streams.json b/test/wpt/status/streams.json -index 5425c86bba85079a44745779d998337aaa063df1..775661cd59b14132c9a811e448792ea02198f949 100644 ---- a/test/wpt/status/streams.json -+++ b/test/wpt/status/streams.json -@@ -60,7 +60,9 @@ - "fail": { - "expected": [ - "Transferring [object TransformStream],[object ReadableStream] should fail", -- "Transferring [object TransformStream],[object WritableStream] should fail" -+ "Transferring [object TransformStream],[object WritableStream] should fail", -+ "Transferring [object ReadableStream],[object TransformStream] should fail", -+ "Transferring [object WritableStream],[object TransformStream] should fail" - ] - } - }, diff --git a/patches/node/test_update_v8-stats_test_for_v8_12_6.patch b/patches/node/test_update_v8-stats_test_for_v8_12_6.patch index 1e0ac6eaca..671fcb14ed 100644 --- a/patches/node/test_update_v8-stats_test_for_v8_12_6.patch +++ b/patches/node/test_update_v8-stats_test_for_v8_12_6.patch @@ -6,7 +6,7 @@ Subject: test: update v8-stats test for V8 12.6 Refs: https://github.com/v8/v8/commit/e30e228ee6e034de49a40af0173113198a19b497 diff --git a/test/parallel/test-v8-stats.js b/test/parallel/test-v8-stats.js -index 2366cbf716c11851bb3a759dce5db47d616516dc..9d2971ba9411bb98107f6a9acc8a07ec438b76e5 100644 +index bb954165f42c9de3db66bc5fdcac647654ad71ea..07be833e6e749a2bb68490c935c6791c178d126f 100644 --- a/test/parallel/test-v8-stats.js +++ b/test/parallel/test-v8-stats.js @@ -48,6 +48,8 @@ const expectedHeapSpaces = [ @@ -16,5 +16,5 @@ index 2366cbf716c11851bb3a759dce5db47d616516dc..9d2971ba9411bb98107f6a9acc8a07ec + 'shared_trusted_large_object_space', + 'shared_trusted_space', 'trusted_large_object_space', - 'trusted_space' + 'trusted_space', ]; diff --git a/patches/node/win_almost_fix_race_detecting_esrch_in_uv_kill.patch b/patches/node/win_almost_fix_race_detecting_esrch_in_uv_kill.patch new file mode 100644 index 0000000000..4a210d885a --- /dev/null +++ b/patches/node/win_almost_fix_race_detecting_esrch_in_uv_kill.patch @@ -0,0 +1,70 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Santiago Gimeno +Date: Tue, 5 Mar 2024 14:54:59 +0100 +Subject: win: almost fix race detecting ESRCH in uv_kill + +It might happen that only using `WaitForSingleObject()` with timeout 0 +could return WAIT_TIMEOUT as the process might not have been signaled +yet. To improve things, first use `GetExitCodeProcess()` and check +that `status` is not `STILL_ACTIVE`. Then, to cover for the case that the exit +code was actually `STILL_ACTIVE` use `WaitForSingleObject()`. This could +still be prone to the race condition but only for that case. + +diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c +index 4e94dee90e13eede63d8e97ddc9992726f874ea9..f46f34289e8e7d3a2af914d89e6164b751a3e47d 100644 +--- a/deps/uv/src/win/process.c ++++ b/deps/uv/src/win/process.c +@@ -1308,16 +1308,34 @@ static int uv__kill(HANDLE process_handle, int signum) { + /* Unconditionally terminate the process. On Windows, killed processes + * normally return 1. */ + int err; ++ DWORD status; + + if (TerminateProcess(process_handle, 1)) + return 0; + +- /* If the process already exited before TerminateProcess was called,. ++ /* If the process already exited before TerminateProcess was called, + * TerminateProcess will fail with ERROR_ACCESS_DENIED. */ + err = GetLastError(); +- if (err == ERROR_ACCESS_DENIED && +- WaitForSingleObject(process_handle, 0) == WAIT_OBJECT_0) { +- return UV_ESRCH; ++ if (err == ERROR_ACCESS_DENIED) { ++ /* First check using GetExitCodeProcess() with status different from ++ * STILL_ACTIVE (259). This check can be set incorrectly by the process, ++ * though that is uncommon. */ ++ if (GetExitCodeProcess(process_handle, &status) && ++ status != STILL_ACTIVE) { ++ return UV_ESRCH; ++ } ++ ++ /* But the process could have exited with code == STILL_ACTIVE, use then ++ * WaitForSingleObject with timeout zero. This is prone to a race ++ * condition as it could return WAIT_TIMEOUT because the handle might ++ * not have been signaled yet.That would result in returning the wrong ++ * error code here (UV_EACCES instead of UV_ESRCH), but we cannot fix ++ * the kernel synchronization issue that TerminateProcess is ++ * inconsistent with WaitForSingleObject with just the APIs available to ++ * us in user space. */ ++ if (WaitForSingleObject(process_handle, 0) == WAIT_OBJECT_0) { ++ return UV_ESRCH; ++ } + } + + return uv_translate_sys_error(err); +@@ -1325,6 +1343,14 @@ static int uv__kill(HANDLE process_handle, int signum) { + + case 0: { + /* Health check: is the process still alive? */ ++ DWORD status; ++ ++ if (!GetExitCodeProcess(process_handle, &status)) ++ return uv_translate_sys_error(GetLastError()); ++ ++ if (status != STILL_ACTIVE) ++ return UV_ESRCH; ++ + switch (WaitForSingleObject(process_handle, 0)) { + case WAIT_OBJECT_0: + return UV_ESRCH; diff --git a/patches/node/win_process_avoid_assert_after_spawning_store_app_4152.patch b/patches/node/win_process_avoid_assert_after_spawning_store_app_4152.patch deleted file mode 100644 index ff3ed47f1d..0000000000 --- a/patches/node/win_process_avoid_assert_after_spawning_store_app_4152.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jameson Nash -Date: Mon, 2 Oct 2023 15:15:18 +0200 -Subject: win,process: avoid assert after spawning Store app (#4152) - -Make sure this handle is functional. The Windows kernel seems to have a -bug that if the first use of AssignProcessToJobObject is for a Windows -Store program, subsequent attempts to use the handle with fail with -INVALID_PARAMETER (87). This is possilby because all uses of the handle -must be for the same Terminal Services session. We can ensure it is -tied to our current session now by adding ourself to it. We could -remove ourself afterwards, but there doesn't seem to be a reason to. - -Secondly, we start the process suspended so that we can make sure we -added it to the job control object before it does anything itself (such -as launch more jobs or exit). - -Fixes: https://github.com/JuliaLang/julia/issues/51461 - -diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c -index 3e451e2291d6ed200ec258e874becbbea22bbc27..a71a08bdd60166ef1d4ef490ff3e083b44188852 100644 ---- a/deps/uv/src/win/process.c -+++ b/deps/uv/src/win/process.c -@@ -105,6 +105,21 @@ static void uv__init_global_job_handle(void) { - &info, - sizeof info)) - uv_fatal_error(GetLastError(), "SetInformationJobObject"); -+ -+ -+ if (!AssignProcessToJobObject(uv_global_job_handle_, GetCurrentProcess())) { -+ /* Make sure this handle is functional. The Windows kernel has a bug that -+ * if the first use of AssignProcessToJobObject is for a Windows Store -+ * program, subsequent attempts to use the handle with fail with -+ * INVALID_PARAMETER (87). This is possibly because all uses of the handle -+ * must be for the same Terminal Services session. We can ensure it is tied -+ * to our current session now by adding ourself to it. We could remove -+ * ourself afterwards, but there doesn't seem to be a reason to. -+ */ -+ DWORD err = GetLastError(); -+ if (err != ERROR_ACCESS_DENIED) -+ uv_fatal_error(err, "AssignProcessToJobObject"); -+ } - } - - -@@ -1102,6 +1117,7 @@ int uv_spawn(uv_loop_t* loop, - * breakaway. - */ - process_flags |= DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP; -+ process_flags |= CREATE_SUSPENDED; - } - - if (!CreateProcessW(application_path, -@@ -1119,11 +1135,6 @@ int uv_spawn(uv_loop_t* loop, - goto done; - } - -- /* Spawn succeeded. Beyond this point, failure is reported asynchronously. */ -- -- process->process_handle = info.hProcess; -- process->pid = info.dwProcessId; -- - /* If the process isn't spawned as detached, assign to the global job object - * so windows will kill it when the parent process dies. */ - if (!(options->flags & UV_PROCESS_DETACHED)) { -@@ -1146,6 +1157,19 @@ int uv_spawn(uv_loop_t* loop, - } - } - -+ if (process_flags & CREATE_SUSPENDED) { -+ if (ResumeThread(info.hThread) == ((DWORD)-1)) { -+ err = GetLastError(); -+ TerminateProcess(info.hProcess, 1); -+ goto done; -+ } -+ } -+ -+ /* Spawn succeeded. Beyond this point, failure is reported asynchronously. */ -+ -+ process->process_handle = info.hProcess; -+ process->pid = info.dwProcessId; -+ - /* Set IPC pid to all IPC pipes. */ - for (i = 0; i < options->stdio_count; i++) { - const uv_stdio_container_t* fdopt = &options->stdio[i]; diff --git a/patches/sqlite/.patches b/patches/sqlite/.patches new file mode 100644 index 0000000000..ce35559581 --- /dev/null +++ b/patches/sqlite/.patches @@ -0,0 +1 @@ +fix_rename_sqlite_win32_exports_to_avoid_conflicts_with_node_js.patch diff --git a/patches/sqlite/fix_rename_sqlite_win32_exports_to_avoid_conflicts_with_node_js.patch b/patches/sqlite/fix_rename_sqlite_win32_exports_to_avoid_conflicts_with_node_js.patch new file mode 100644 index 0000000000..0978319495 --- /dev/null +++ b/patches/sqlite/fix_rename_sqlite_win32_exports_to_avoid_conflicts_with_node_js.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Sun, 27 Oct 2024 21:01:11 +0100 +Subject: fix: rename sqlite win32 exports to avoid conflicts with Node.js + +As of https://github.com/nodejs/node/pull/53752, a number of symbols +exported by SQLite are now exported by Node.js. This change renames +the exported symbols in SQLite to avoid conflicts with Node.js. + +This should be upstreamed to SQLite. + +diff --git a/amalgamation/rename_exports.h b/amalgamation/rename_exports.h +index b1c485159a624ea1bfbec603aabc58074721e72a..8eb71ae67acc3e0ad17bae2e87e85bf12c10b9af 100644 +--- a/amalgamation/rename_exports.h ++++ b/amalgamation/rename_exports.h +@@ -367,6 +367,15 @@ + #define sqlite3session_patchset chrome_sqlite3session_patchset // Lines 11449-11453 + #define sqlite3session_patchset_strm chrome_sqlite3session_patchset_strm // Lines 12728-12732 + #define sqlite3session_table_filter chrome_sqlite3session_table_filter // Lines 11219-11226 ++#define sqlite3_win32_write_debug chrome_sqlite3_win32_write_debug ++#define sqlite3_win32_sleep chrome_sqlite3_win32_sleep ++#define sqlite3_win32_is_nt chrome_sqlite3_win32_is_nt ++#define sqlite3_win32_utf8_to_unicode chrome_sqlite3_win32_utf8_to_unicode ++#define sqlite3_win32_unicode_to_utf8 chrome_sqlite3_win32_unicode_to_utf8 ++#define sqlite3_win32_mbcs_to_utf8 chrome_sqlite3_win32_mbcs_to_utf8 ++#define sqlite3_win32_utf8_to_mbcs_v2 chrome_sqlite3_win32_utf8_to_mbcs_v2 ++#define sqlite3_win32_utf8_to_mbcs chrome_sqlite3_win32_utf8_to_mbcs ++#define sqlite3_win32_mbcs_to_utf8_v2 chrome_sqlite3_win32_mbcs_to_utf8_v2 + + #endif // THIRD_PARTY_SQLITE_AMALGAMATION_RENAME_EXPORTS_H_ + diff --git a/patches/v8/.patches b/patches/v8/.patches index 280a34b936..9f1a7025d5 100644 --- a/patches/v8/.patches +++ b/patches/v8/.patches @@ -1,2 +1,3 @@ chore_allow_customizing_microtask_policy_per_context.patch deps_add_v8_object_setinternalfieldfornodecore.patch +revert_fastapi_promote_deprecation_of_fastapitypedarray.patch diff --git a/patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch b/patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch index 45bc89904c..404c738fd6 100644 --- a/patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch +++ b/patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch @@ -46,7 +46,7 @@ index 3e57ae8efe33f326ef0e5d609c311d4be5b8afd6..dc521d39c2280dfc3217e97c1e413b2b V8_INLINE static void* GetAlignedPointerFromInternalField( const BasicTracedReference& object, int index) { diff --git a/src/api/api.cc b/src/api/api.cc -index 6fb8d2c72d7bd895ef3157b6fb9a53522a06c983..9ba0614f13b5ab372674dbbacb5b0b705b317fdc 100644 +index 68987a5e5484e5ea7c33c4512bfbe9b1ad4443c7..b2b713621e4ff1b23f4b0225c14ae63020bcaade 100644 --- a/src/api/api.cc +++ b/src/api/api.cc @@ -6407,14 +6407,33 @@ Local v8::Object::SlowGetInternalField(int index) { diff --git a/patches/v8/revert_fastapi_promote_deprecation_of_fastapitypedarray.patch b/patches/v8/revert_fastapi_promote_deprecation_of_fastapitypedarray.patch new file mode 100644 index 0000000000..693d34fcac --- /dev/null +++ b/patches/v8/revert_fastapi_promote_deprecation_of_fastapitypedarray.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Sanders +Date: Wed, 30 Oct 2024 21:40:17 -0700 +Subject: Revert "[fastapi] Promote deprecation of FastApiTypedArray" + +This reverts commit 22b9e934bbbc2f026ed2c3a97a72d9f3ec890a68. + +Revert this until Node.js decides how to proceed and then pick up their fix. + +Refs: https://github.com/nodejs/node/issues/55452 +Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5956408 + +diff --git a/include/v8-fast-api-calls.h b/include/v8-fast-api-calls.h +index 70ecc5847ecba39e3102105ca8cb2b356588f714..18466688cf90cbb5db2880febbfb768ae68f8377 100644 +--- a/include/v8-fast-api-calls.h ++++ b/include/v8-fast-api-calls.h +@@ -337,7 +337,7 @@ struct FastApiTypedArrayBase { + }; + + template +-struct V8_DEPRECATED( ++struct V8_DEPRECATE_SOON( + "When an API function expects a TypedArray as a parameter, the type in the " + "signature should be `v8::Local` instead of " + "FastApiTypedArray<>. The API function then has to type-check the " diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index e14cf2394a..e967f2e10c 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -1,12 +1,14 @@ [ "abort/test-abort-backtrace", "es-module/test-vm-compile-function-lineoffset", + "parallel/test-async-context-frame", "parallel/test-bootstrap-modules", "parallel/test-child-process-fork-exec-path", "parallel/test-code-cache", "parallel/test-cluster-primary-error", "parallel/test-cluster-primary-kill", "parallel/test-crypto-aes-wrap", + "parallel/test-crypto-authenticated", "parallel/test-crypto-authenticated-stream", "parallel/test-crypto-des3-wrap", "parallel/test-crypto-dh-group-setters", @@ -35,6 +37,7 @@ "parallel/test-inspector-port-zero-cluster", "parallel/test-inspector-tracing-domain", "parallel/test-module-loading-globalpaths", + "parallel/test-module-print-timing", "parallel/test-openssl-ca-options", "parallel/test-process-versions", "parallel/test-process-get-builtin", @@ -60,6 +63,7 @@ "parallel/test-snapshot-incompatible", "parallel/test-snapshot-namespaced-builtin", "parallel/test-snapshot-net", + "parallel/test-snapshot-reproducible", "parallel/test-snapshot-typescript", "parallel/test-snapshot-umd", "parallel/test-snapshot-warning", diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index 8db8d80c14..782357ac37 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -183,7 +183,7 @@ int NodeMain() { const std::vector args = ElectronCommandLine::AsUtf8(); ExitIfContainsDisallowedFlags(args); - std::unique_ptr result = + std::shared_ptr result = node::InitializeOncePerProcess( args, {node::ProcessInitializationFlags::kNoInitializeV8, diff --git a/shell/browser/api/electron_api_menu.h b/shell/browser/api/electron_api_menu.h index 352d9cccbb..c861bd97a3 100644 --- a/shell/browser/api/electron_api_menu.h +++ b/shell/browser/api/electron_api_menu.h @@ -13,6 +13,7 @@ #include "shell/browser/ui/electron_menu_model.h" #include "shell/common/gin_helper/constructible.h" #include "shell/common/gin_helper/pinnable.h" +#include "ui/base/mojom/menu_source_type.mojom-forward.h" namespace gin { class Arguments; @@ -83,7 +84,7 @@ class Menu : public gin::Wrappable, int x, int y, int positioning_item, - ui::MenuSourceType source_type, + ui::mojom::MenuSourceType source_type, base::OnceClosure callback) = 0; virtual void ClosePopupAt(int32_t window_id) = 0; virtual std::u16string GetAcceleratorTextAtForTesting(int index) const; diff --git a/shell/browser/api/electron_api_menu_mac.h b/shell/browser/api/electron_api_menu_mac.h index 2f8939c2c9..679bff8784 100644 --- a/shell/browser/api/electron_api_menu_mac.h +++ b/shell/browser/api/electron_api_menu_mac.h @@ -26,7 +26,7 @@ class MenuMac : public Menu { int x, int y, int positioning_item, - ui::MenuSourceType source_type, + ui::mojom::MenuSourceType source_type, base::OnceClosure callback) override; void PopupOnUI(const base::WeakPtr& native_window, int32_t window_id, diff --git a/shell/browser/api/electron_api_menu_mac.mm b/shell/browser/api/electron_api_menu_mac.mm index 0aa2d17c62..7ea23ffd91 100644 --- a/shell/browser/api/electron_api_menu_mac.mm +++ b/shell/browser/api/electron_api_menu_mac.mm @@ -51,7 +51,7 @@ void MenuMac::PopupAt(BaseWindow* window, int x, int y, int positioning_item, - ui::MenuSourceType source_type, + ui::mojom::MenuSourceType source_type, base::OnceClosure callback) { NativeWindow* native_window = window->window(); if (!native_window) diff --git a/shell/browser/api/electron_api_menu_views.cc b/shell/browser/api/electron_api_menu_views.cc index 51aae3c591..dd5a543c96 100644 --- a/shell/browser/api/electron_api_menu_views.cc +++ b/shell/browser/api/electron_api_menu_views.cc @@ -23,7 +23,7 @@ void MenuViews::PopupAt(BaseWindow* window, int x, int y, int positioning_item, - ui::MenuSourceType source_type, + ui::mojom::MenuSourceType source_type, base::OnceClosure callback) { auto* native_window = static_cast(window->window()); if (!native_window) diff --git a/shell/browser/api/electron_api_menu_views.h b/shell/browser/api/electron_api_menu_views.h index a4984bd59a..7759f07a89 100644 --- a/shell/browser/api/electron_api_menu_views.h +++ b/shell/browser/api/electron_api_menu_views.h @@ -25,7 +25,7 @@ class MenuViews : public Menu { int x, int y, int positioning_item, - ui::MenuSourceType source_type, + ui::mojom::MenuSourceType source_type, base::OnceClosure callback) override; void ClosePopupAt(int32_t window_id) override; diff --git a/shell/browser/api/electron_api_protocol.cc b/shell/browser/api/electron_api_protocol.cc index 896570a402..fdbea2c848 100644 --- a/shell/browser/api/electron_api_protocol.cc +++ b/shell/browser/api/electron_api_protocol.cc @@ -162,7 +162,7 @@ void RegisterSchemesAsPrivileged(gin_helper::ErrorThrower thrower, } } - const auto AppendSchemesToCmdLine = [](const char* switch_name, + const auto AppendSchemesToCmdLine = [](const std::string_view switch_name, std::vector schemes) { if (schemes.empty()) return; diff --git a/shell/browser/api/electron_api_session.cc b/shell/browser/api/electron_api_session.cc index 7cef82c969..8d980f67a5 100644 --- a/shell/browser/api/electron_api_session.cc +++ b/shell/browser/api/electron_api_session.cc @@ -18,7 +18,6 @@ #include "base/files/file_util.h" #include "base/scoped_observation.h" #include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" #include "base/uuid.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/predictors/preconnect_manager.h" @@ -89,6 +88,7 @@ #include "shell/common/node_includes.h" #include "shell/common/node_util.h" #include "shell/common/options_switches.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/blink/public/common/storage_key/storage_key.h" #include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h" #include "ui/base/l10n/l10n_util.h" @@ -1234,8 +1234,8 @@ void Session::Preconnect(const gin_helper::Dictionary& options, if (num_sockets_to_preconnect < kMinSocketsToPreconnect || num_sockets_to_preconnect > kMaxSocketsToPreconnect) { args->ThrowTypeError( - base::StringPrintf("numSocketsToPreconnect is outside range [%d,%d]", - kMinSocketsToPreconnect, kMaxSocketsToPreconnect)); + absl::StrFormat("numSocketsToPreconnect is outside range [%d,%d]", + kMinSocketsToPreconnect, kMaxSocketsToPreconnect)); return; } } @@ -1357,8 +1357,8 @@ v8::Local Session::ClearData(gin_helper::ErrorThrower thrower, // Opaque origins cannot be used with this API if (origin.opaque()) { thrower.ThrowError( - base::StringPrintf("Invalid origin: '%s'", - origin_url.possibly_invalid_spec().c_str())); + absl::StrFormat("Invalid origin: '%s'", + origin_url.possibly_invalid_spec().c_str())); return v8::Undefined(isolate); } diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index fb8d3ff541..48304f67bc 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -1344,7 +1344,7 @@ content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent( } void WebContents::ContentsZoomChange(bool zoom_in) { - Emit("zoom-changed", zoom_in ? "in" : "out"); + Emit("zoom-changed", std::string_view{zoom_in ? "in" : "out"}); } Profile* WebContents::GetProfile() { diff --git a/shell/browser/api/electron_api_web_contents_view.cc b/shell/browser/api/electron_api_web_contents_view.cc index 639fdecf77..6bc59fd7b6 100644 --- a/shell/browser/api/electron_api_web_contents_view.cc +++ b/shell/browser/api/electron_api_web_contents_view.cc @@ -115,8 +115,9 @@ void WebContentsView::WebContentsDestroyed() { void WebContentsView::OnViewAddedToWidget(views::View* observed_view) { DCHECK_EQ(observed_view, view()); views::Widget* widget = view()->GetWidget(); - auto* native_window = static_cast( - widget->GetNativeWindowProperty(electron::kElectronNativeWindowKey)); + auto* native_window = + static_cast(widget->GetNativeWindowProperty( + electron::kElectronNativeWindowKey.c_str())); if (!native_window) return; // We don't need to call SetOwnerWindow(nullptr) in OnViewRemovedFromWidget @@ -130,7 +131,7 @@ void WebContentsView::OnViewRemovedFromWidget(views::View* observed_view) { DCHECK_EQ(observed_view, view()); views::Widget* widget = view()->GetWidget(); auto* native_window = static_cast( - widget->GetNativeWindowProperty(kElectronNativeWindowKey)); + widget->GetNativeWindowProperty(kElectronNativeWindowKey.c_str())); if (!native_window) return; native_window->RemoveDraggableRegionProvider(this); diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index f56fc8ac10..621c6e578f 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -532,12 +532,16 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches( if (process_type == ::switches::kUtilityProcess || process_type == ::switches::kRendererProcess) { // Copy following switches to child process. - static const char* const kCommonSwitchNames[] = { - switches::kStandardSchemes, switches::kEnableSandbox, - switches::kSecureSchemes, switches::kBypassCSPSchemes, - switches::kCORSSchemes, switches::kFetchSchemes, - switches::kServiceWorkerSchemes, switches::kStreamingSchemes, - switches::kCodeCacheSchemes}; + static constexpr std::array kCommonSwitchNames = { + switches::kStandardSchemes.c_str(), + switches::kEnableSandbox.c_str(), + switches::kSecureSchemes.c_str(), + switches::kBypassCSPSchemes.c_str(), + switches::kCORSSchemes.c_str(), + switches::kFetchSchemes.c_str(), + switches::kServiceWorkerSchemes.c_str(), + switches::kStreamingSchemes.c_str(), + switches::kCodeCacheSchemes.c_str()}; command_line->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(), kCommonSwitchNames); if (process_type == ::switches::kUtilityProcess || @@ -1668,7 +1672,7 @@ ElectronBrowserClient::CreateURLLoaderThrottles( const base::RepeatingCallback& wc_getter, content::NavigationUIData* navigation_ui_data, content::FrameTreeNodeId frame_tree_node_id, - absl::optional navigation_id) { + std::optional navigation_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); std::vector> result; diff --git a/shell/browser/extensions/api/management/electron_management_api_delegate.cc b/shell/browser/extensions/api/management/electron_management_api_delegate.cc index 6f0c725068..b49a305812 100644 --- a/shell/browser/extensions/api/management/electron_management_api_delegate.cc +++ b/shell/browser/extensions/api/management/electron_management_api_delegate.cc @@ -9,7 +9,6 @@ #include #include -#include "base/strings/stringprintf.h" #include "chrome/common/extensions/extension_metrics.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" #include "chrome/common/webui_url_constants.h" @@ -24,6 +23,7 @@ #include "extensions/common/api/management.h" #include "extensions/common/extension.h" #include "services/data_decoder/public/cpp/data_decoder.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/blink/public/mojom/manifest/display_mode.mojom.h" namespace { @@ -202,7 +202,7 @@ GURL ElectronManagementAPIDelegate::GetIconURL( int icon_size, ExtensionIconSet::Match match, bool grayscale) const { - GURL icon_url(base::StringPrintf( + GURL icon_url(absl::StrFormat( "%s%s/%d/%d%s", chrome::kChromeUIExtensionIconURL, extension->id().c_str(), icon_size, static_cast(match), grayscale ? "?grayscale=true" : "")); diff --git a/shell/browser/extensions/api/scripting/scripting_api.cc b/shell/browser/extensions/api/scripting/scripting_api.cc index f940a5bede..015d6f17bc 100644 --- a/shell/browser/extensions/api/scripting/scripting_api.cc +++ b/shell/browser/extensions/api/scripting/scripting_api.cc @@ -10,7 +10,6 @@ #include "base/containers/contains.h" #include "base/json/json_writer.h" #include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/types/optional_util.h" #include "chrome/common/extensions/api/scripting.h" @@ -44,6 +43,7 @@ #include "extensions/common/utils/content_script_utils.h" #include "extensions/common/utils/extension_types_utils.h" #include "shell/browser/api/electron_api_web_contents.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" namespace extensions { @@ -335,7 +335,7 @@ bool CollectFramesForInjection(const api::scripting::InjectionTarget& target, ExtensionApiFrameIdMap::DocumentIdFromString(id); if (!document_id) { - *error_out = base::StringPrintf("Invalid document id %s", id.c_str()); + *error_out = absl::StrFormat("Invalid document id %s", id.c_str()); return false; } @@ -346,9 +346,8 @@ bool CollectFramesForInjection(const api::scripting::InjectionTarget& target, // If the frame was not found or it matched another tab reject this // request. if (!frame || content::WebContents::FromRenderFrameHost(frame) != tab) { - *error_out = - base::StringPrintf("No document with id %s in tab with id %d", - id.c_str(), target.tab_id); + *error_out = absl::StrFormat("No document with id %s in tab with id %d", + id.c_str(), target.tab_id); return false; } @@ -368,8 +367,8 @@ bool CollectFramesForInjection(const api::scripting::InjectionTarget& target, content::RenderFrameHost* frame = ExtensionApiFrameIdMap::GetRenderFrameHostById(tab, frame_id); if (!frame) { - *error_out = base::StringPrintf("No frame with id %d in tab with id %d", - frame_id, target.tab_id); + *error_out = absl::StrFormat("No frame with id %d in tab with id %d", + frame_id, target.tab_id); return false; } frames.insert(frame); @@ -392,7 +391,7 @@ bool CanAccessTarget(const PermissionsData& permissions, std::string* error_out) { auto* contents = electron::api::WebContents::FromID(target.tab_id); if (!contents) { - *error_out = base::StringPrintf("No tab with id: %d", target.tab_id); + *error_out = absl::StrFormat("No tab with id: %d", target.tab_id); return false; } @@ -631,7 +630,7 @@ ExtensionFunction::ResponseAction ScriptingExecuteScriptFunction::Run() { args_expression = base::JoinString(string_args, ","); } - std::string code_to_execute = base::StringPrintf( + std::string code_to_execute = absl::StrFormat( "(%s)(%s)", injection_.func->c_str(), args_expression.c_str()); std::vector sources; diff --git a/shell/browser/file_system_access/file_system_access_permission_context.cc b/shell/browser/file_system_access/file_system_access_permission_context.cc index 4addf43708..6e8d360982 100644 --- a/shell/browser/file_system_access/file_system_access_permission_context.cc +++ b/shell/browser/file_system_access/file_system_access_permission_context.cc @@ -165,8 +165,10 @@ bool ShouldBlockAccessToPath(const base::FilePath& path, ChromeFileSystemAccessPermissionContext::kBlockedPaths) { if (key == ChromeFileSystemAccessPermissionContext::kNoBasePathKey) { rules.emplace_back(base::FilePath{rule_path}, type); - } else if (base::FilePath path; base::PathService::Get(key, &path)) { - rules.emplace_back(rule_path ? path.Append(rule_path) : path, type); + } else if (base::FilePath block_path; + base::PathService::Get(key, &block_path)) { + rules.emplace_back(rule_path ? block_path.Append(rule_path) : block_path, + type); } } diff --git a/shell/browser/hid/hid_chooser_context.cc b/shell/browser/hid/hid_chooser_context.cc index fa52c2f452..539b7c700f 100644 --- a/shell/browser/hid/hid_chooser_context.cc +++ b/shell/browser/hid/hid_chooser_context.cc @@ -10,7 +10,6 @@ #include "base/command_line.h" #include "base/containers/contains.h" #include "base/containers/map_util.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/grit/generated_resources.h" @@ -29,6 +28,7 @@ #include "shell/common/gin_converters/hid_device_info_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/blink/public/common/permissions/permission_utils.h" #include "ui/base/l10n/l10n_util.h" @@ -39,9 +39,6 @@ namespace electron { -const char kHidDeviceNameKey[] = "name"; -const char kHidGuidKey[] = "guid"; - HidChooserContext::HidChooserContext(ElectronBrowserContext* context) : browser_context_(context) {} @@ -59,7 +56,7 @@ std::u16string HidChooserContext::DisplayNameFromDeviceInfo( const device::mojom::HidDeviceInfo& device) { if (device.product_name.empty()) { auto device_id_string = base::ASCIIToUTF16( - base::StringPrintf("%04X:%04X", device.vendor_id, device.product_id)); + absl::StrFormat("%04X:%04X", device.vendor_id, device.product_id)); return l10n_util::GetStringFUTF16(IDS_HID_CHOOSER_ITEM_WITHOUT_NAME, device_id_string); } diff --git a/shell/browser/hid/hid_chooser_context.h b/shell/browser/hid/hid_chooser_context.h index a9852961b4..1f3892934a 100644 --- a/shell/browser/hid/hid_chooser_context.h +++ b/shell/browser/hid/hid_chooser_context.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "base/containers/queue.h" @@ -35,9 +36,8 @@ namespace electron { class ElectronBrowserContext; -extern const char kHidDeviceNameKey[]; -extern const char kHidGuidKey[]; -extern const char kHidProductIdKey[]; +inline constexpr std::string_view kHidDeviceNameKey = "name"; +inline constexpr std::string_view kHidGuidKey = "guid"; // Manages the internal state and connection to the device service for the // Human Interface Device (HID) chooser UI. diff --git a/shell/browser/hid/hid_chooser_controller.cc b/shell/browser/hid/hid_chooser_controller.cc index d7e229232f..b95cf28270 100644 --- a/shell/browser/hid/hid_chooser_controller.cc +++ b/shell/browser/hid/hid_chooser_controller.cc @@ -25,6 +25,7 @@ #include "shell/common/gin_converters/hid_device_info_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/node_util.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/blink/public/mojom/devtools/console_message.mojom.h" #include "third_party/blink/public/mojom/hid/hid.mojom.h" #include "ui/base/l10n/l10n_util.h" @@ -277,7 +278,7 @@ bool HidChooserController::DisplayDevice( AddMessageToConsole( blink::mojom::ConsoleMessageLevel::kInfo, - base::StringPrintf( + absl::StrFormat( "Chooser dialog is not displaying a FIDO HID device: vendorId=%d, " "productId=%d, name='%s', serial='%s'", device.vendor_id, device.product_id, device.product_name.c_str(), @@ -288,12 +289,12 @@ bool HidChooserController::DisplayDevice( if (device.is_excluded_by_blocklist) { AddMessageToConsole( blink::mojom::ConsoleMessageLevel::kInfo, - base::StringPrintf( - "Chooser dialog is not displaying a device excluded by " - "the HID blocklist: vendorId=%d, " - "productId=%d, name='%s', serial='%s'", - device.vendor_id, device.product_id, device.product_name.c_str(), - device.serial_number.c_str())); + absl::StrFormat("Chooser dialog is not displaying a device excluded by " + "the HID blocklist: vendorId=%d, " + "productId=%d, name='%s', serial='%s'", + device.vendor_id, device.product_id, + device.product_name.c_str(), + device.serial_number.c_str())); return false; } diff --git a/shell/browser/native_window.cc b/shell/browser/native_window.cc index 625bfb8314..d1d46bd99b 100644 --- a/shell/browser/native_window.cc +++ b/shell/browser/native_window.cc @@ -91,8 +91,6 @@ gfx::Size GetExpandedWindowSize(const NativeWindow* window, gfx::Size size) { } // namespace -const char kElectronNativeWindowKey[] = "__ELECTRON_NATIVE_WINDOW__"; - NativeWindow::NativeWindow(const gin_helper::Dictionary& options, NativeWindow* parent) : widget_(std::make_unique()), parent_(parent) { diff --git a/shell/browser/native_window.h b/shell/browser/native_window.h index 6f521722e5..b89123a106 100644 --- a/shell/browser/native_window.h +++ b/shell/browser/native_window.h @@ -10,11 +10,13 @@ #include #include #include +#include #include #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" +#include "base/strings/cstring_view.h" #include "base/supports_user_data.h" #include "content/public/browser/desktop_media_id.h" #include "content/public/browser/web_contents_user_data.h" @@ -44,7 +46,8 @@ class PersistentDictionary; namespace electron { -extern const char kElectronNativeWindowKey[]; +inline constexpr base::cstring_view kElectronNativeWindowKey = + "__ELECTRON_NATIVE_WINDOW__"; class ElectronMenuModel; class BackgroundThrottlingSource; diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 45eef7e744..af548f4261 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -132,7 +132,7 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, bool resizable = true; options.Get(options::kResizable, &resizable); options.Get(options::kZoomToPageWidth, &zoom_to_page_width_); - options.Get(options::kSimpleFullScreen, &always_simple_fullscreen_); + options.Get(options::kSimpleFullscreen, &always_simple_fullscreen_); options.GetOptional(options::kTrafficLightPosition, &traffic_light_position_); options.Get(options::kVisualEffectState, &visual_effect_state_); @@ -203,7 +203,7 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, params.native_widget = new ElectronNativeWidgetMac(this, windowType, styleMask, widget()); widget()->Init(std::move(params)); - widget()->SetNativeWindowProperty(kElectronNativeWindowKey, this); + widget()->SetNativeWindowProperty(kElectronNativeWindowKey.c_str(), this); SetCanResize(resizable); window_ = static_cast( widget()->GetNativeWindow().GetNativeNSWindow()); diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 12617c1db7..1d2d8a3da4 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -310,7 +310,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, #endif widget()->Init(std::move(params)); - widget()->SetNativeWindowProperty(kElectronNativeWindowKey, this); + widget()->SetNativeWindowProperty(kElectronNativeWindowKey.c_str(), this); SetCanResize(resizable_); bool fullscreen = false; diff --git a/shell/browser/net/electron_url_loader_factory.cc b/shell/browser/net/electron_url_loader_factory.cc index 9e12172166..d6925d893f 100644 --- a/shell/browser/net/electron_url_loader_factory.cc +++ b/shell/browser/net/electron_url_loader_factory.cc @@ -11,7 +11,6 @@ #include "base/containers/fixed_flat_map.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/stringprintf.h" #include "base/uuid.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" @@ -34,6 +33,7 @@ #include "shell/common/gin_converters/net_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h" #include "shell/common/node_includes.h" @@ -117,9 +117,9 @@ network::mojom::URLResponseHeadPtr ToResponseHead( int status_code = net::HTTP_OK; dict.Get("statusCode", &status_code); head->headers = base::MakeRefCounted( - base::StringPrintf("HTTP/1.1 %d %s", status_code, - net::GetHttpReasonPhrase( - static_cast(status_code)))); + absl::StrFormat("HTTP/1.1 %d %s", status_code, + net::GetHttpReasonPhrase( + static_cast(status_code)))); dict.Get("charset", &head->charset); bool has_mime_type = dict.Get("mimeType", &head->mime_type); diff --git a/shell/browser/net/proxying_url_loader_factory.cc b/shell/browser/net/proxying_url_loader_factory.cc index 3bef7f74c9..10a0016e82 100644 --- a/shell/browser/net/proxying_url_loader_factory.cc +++ b/shell/browser/net/proxying_url_loader_factory.cc @@ -11,7 +11,6 @@ #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/strings/string_split.h" -#include "base/strings/stringprintf.h" #include "content/public/browser/browser_context.h" #include "extensions/browser/extension_navigation_ui_data.h" #include "net/base/completion_repeating_callback.h" @@ -25,6 +24,7 @@ #include "services/network/public/mojom/url_response_head.mojom.h" #include "shell/browser/net/asar/asar_url_loader.h" #include "shell/common/options_switches.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "url/origin.h" namespace electron { @@ -400,7 +400,7 @@ void ProxyingURLLoaderFactory::InProgressRequest:: net::SiteForCookies::FromUrl(redirect_url_); auto head = network::mojom::URLResponseHead::New(); - std::string headers = base::StringPrintf( + std::string headers = absl::StrFormat( "HTTP/1.1 %i Internal Redirect\n" "Location: %s\n" "Non-Authoritative-Reason: WebRequest API\n\n", diff --git a/shell/browser/net/proxying_websocket.cc b/shell/browser/net/proxying_websocket.cc index d1d8587bac..75f922fa5e 100644 --- a/shell/browser/net/proxying_websocket.cc +++ b/shell/browser/net/proxying_websocket.cc @@ -8,11 +8,11 @@ #include "base/functional/bind.h" #include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/extension_navigation_ui_data.h" #include "net/base/ip_endpoint.h" #include "services/network/public/mojom/url_response_head.mojom.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" namespace electron { @@ -139,7 +139,7 @@ void ProxyingWebSocket::OnConnectionEstablished( } response_->headers = - base::MakeRefCounted(base::StringPrintf( + base::MakeRefCounted(absl::StrFormat( "HTTP/%d.%d %d %s", handshake_response_->http_version.major_value(), handshake_response_->http_version.minor_value(), handshake_response_->status_code, diff --git a/shell/browser/osr/osr_web_contents_view.h b/shell/browser/osr/osr_web_contents_view.h index c66a95ddc5..50f24b9033 100644 --- a/shell/browser/osr/osr_web_contents_view.h +++ b/shell/browser/osr/osr_web_contents_view.h @@ -75,6 +75,7 @@ class OffScreenWebContentsView : public content::WebContentsView, void UpdateWindowControlsOverlay(const gfx::Rect& bounding_rect) override {} content::BackForwardTransitionAnimationManager* GetBackForwardTransitionAnimationManager() override; + void DestroyBackForwardTransitionAnimationManager() override {} #if BUILDFLAG(IS_MAC) bool CloseTabAfterEventTrackingIfNeeded() override; diff --git a/shell/browser/serial/serial_chooser_context.cc b/shell/browser/serial/serial_chooser_context.cc index c082d4f5f5..9d30e96f21 100644 --- a/shell/browser/serial/serial_chooser_context.cc +++ b/shell/browser/serial/serial_chooser_context.cc @@ -23,20 +23,6 @@ namespace electron { -constexpr char kPortNameKey[] = "name"; -constexpr char kTokenKey[] = "token"; -constexpr char kBluetoothDevicePathKey[] = "bluetooth_device_path"; -#if BUILDFLAG(IS_WIN) -constexpr char kDeviceInstanceIdKey[] = "device_instance_id"; -#else -constexpr char kVendorIdKey[] = "vendor_id"; -constexpr char kProductIdKey[] = "product_id"; -constexpr char kSerialNumberKey[] = "serial_number"; -#if BUILDFLAG(IS_MAC) -constexpr char kUsbDriverKey[] = "usb_driver"; -#endif // BUILDFLAG(IS_MAC) -#endif // BUILDFLAG(IS_WIN) - namespace { std::string EncodeToken(const base::UnguessableToken& token) { diff --git a/shell/browser/serial/serial_chooser_context.h b/shell/browser/serial/serial_chooser_context.h index 59eb98f4ee..0dbeb15dc8 100644 --- a/shell/browser/serial/serial_chooser_context.h +++ b/shell/browser/serial/serial_chooser_context.h @@ -7,6 +7,7 @@ #include #include +#include #include #include "base/memory/raw_ptr.h" @@ -35,16 +36,20 @@ namespace electron { class ElectronBrowserContext; +inline constexpr std::string_view kPortNameKey = "name"; +inline constexpr std::string_view kTokenKey = "token"; +inline constexpr std::string_view kBluetoothDevicePathKey = + "bluetooth_device_path"; #if BUILDFLAG(IS_WIN) -extern const char kDeviceInstanceIdKey[]; +inline constexpr std::string_view kDeviceInstanceIdKey = "device_instance_id"; #else -extern const char kVendorIdKey[]; -extern const char kProductIdKey[]; -extern const char kSerialNumberKey[]; -#if BUILDFLAG(IS_MAC) -extern const char kUsbDriverKey[]; -#endif // BUILDFLAG(IS_MAC) +inline constexpr std::string_view kVendorIdKey = "vendor_id"; +inline constexpr std::string_view kProductIdKey = "product_id"; +inline constexpr std::string_view kSerialNumberKey = "serial_number"; #endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_MAC) +inline constexpr std::string_view kUsbDriverKey = "usb_driver"; +#endif // BUILDFLAG(IS_MAC) class SerialChooserContext : public KeyedService, public device::mojom::SerialPortManagerClient { diff --git a/shell/browser/serial/serial_chooser_controller.cc b/shell/browser/serial/serial_chooser_controller.cc index 736442f8f9..4677481982 100644 --- a/shell/browser/serial/serial_chooser_controller.cc +++ b/shell/browser/serial/serial_chooser_controller.cc @@ -9,7 +9,6 @@ #include "base/containers/contains.h" #include "base/functional/bind.h" -#include "base/strings/stringprintf.h" #include "content/public/browser/web_contents.h" #include "device/bluetooth/public/cpp/bluetooth_uuid.h" #include "services/device/public/cpp/bluetooth/bluetooth_utils.h" @@ -22,6 +21,7 @@ #include "shell/common/gin_converters/content_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/promise.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "ui/base/l10n/l10n_util.h" namespace gin { @@ -38,10 +38,10 @@ struct Converter { dict.Set("displayName", *port->display_name); } if (port->has_vendor_id) { - dict.Set("vendorId", base::StringPrintf("%u", port->vendor_id)); + dict.Set("vendorId", absl::StrFormat("%u", port->vendor_id)); } if (port->has_product_id) { - dict.Set("productId", base::StringPrintf("%u", port->product_id)); + dict.Set("productId", absl::StrFormat("%u", port->product_id)); } if (port->serial_number && !port->serial_number->empty()) { dict.Set("serialNumber", *port->serial_number); diff --git a/shell/browser/ui/inspectable_web_contents.cc b/shell/browser/ui/inspectable_web_contents.cc index fa1b054f46..d70e9765c7 100644 --- a/shell/browser/ui/inspectable_web_contents.cc +++ b/shell/browser/ui/inspectable_web_contents.cc @@ -16,7 +16,6 @@ #include "base/metrics/histogram.h" #include "base/strings/pattern.h" #include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/timer/timer.h" #include "base/uuid.h" @@ -52,6 +51,7 @@ #include "shell/browser/ui/inspectable_web_contents_view_delegate.h" #include "shell/common/application_info.h" #include "shell/common/platform_util.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/blink/public/common/logging/logging_utils.h" #include "third_party/blink/public/common/page/page_zoom.h" #include "ui/display/display.h" @@ -137,16 +137,15 @@ double GetNextZoomLevel(double level, bool out) { } GURL GetRemoteBaseURL() { - return GURL(base::StringPrintf("%s%s/%s/", - kChromeUIDevToolsRemoteFrontendBase, - kChromeUIDevToolsRemoteFrontendPath, - content::GetChromiumGitRevision().c_str())); + return GURL(absl::StrFormat("%s%s/%s/", kChromeUIDevToolsRemoteFrontendBase, + kChromeUIDevToolsRemoteFrontendPath, + content::GetChromiumGitRevision().c_str())); } GURL GetDevToolsURL(bool can_dock) { - auto url_string = base::StringPrintf(kChromeUIDevToolsURL, - GetRemoteBaseURL().spec().c_str(), - can_dock ? "true" : ""); + auto url_string = + absl::StrFormat(kChromeUIDevToolsURL, GetRemoteBaseURL().spec().c_str(), + can_dock ? "true" : ""); return GURL(url_string); } @@ -632,7 +631,7 @@ void InspectableWebContents::InspectedURLChanged(const std::string& url) { if (managed_devtools_web_contents_) { if (devtools_title_.empty()) { view_->SetTitle( - base::UTF8ToUTF16(base::StringPrintf(kTitleFormat, url.c_str()))); + base::UTF8ToUTF16(absl::StrFormat(kTitleFormat, url.c_str()))); } } } @@ -1032,7 +1031,7 @@ void InspectableWebContents::DidFinishNavigation( // most likely bug in chromium. base::ReplaceFirstSubstringAfterOffset(&it->second, 0, "var chrome", "var chrome = window.chrome "); - auto script = base::StringPrintf( + auto script = absl::StrFormat( "%s(\"%s\")", it->second.c_str(), base::Uuid::GenerateRandomV4().AsLowercaseString().c_str()); // Invoking content::DevToolsFrontendHost::SetupExtensionsAPI(frame, script); diff --git a/shell/browser/ui/views/global_menu_bar_x11.cc b/shell/browser/ui/views/global_menu_bar_x11.cc index 2f6eb08327..4ec560251e 100644 --- a/shell/browser/ui/views/global_menu_bar_x11.cc +++ b/shell/browser/ui/views/global_menu_bar_x11.cc @@ -8,11 +8,11 @@ #include #include "base/functional/bind.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "shell/browser/native_window_views.h" #include "shell/browser/ui/electron_menu_model.h" #include "shell/browser/ui/views/global_menu_bar_registrar_x11.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/accelerators/menu_label_accelerator_util_linux.h" @@ -166,7 +166,7 @@ std::string GetMenuModelStatus(ElectronMenuModel* model) { int status = model->GetTypeAt(i) | (model->IsVisibleAt(i) << 3) | (model->IsEnabledAt(i) << 4) | (model->IsItemCheckedAt(i) << 5); - ret += base::StringPrintf( + ret += absl::StrFormat( "%s-%X\n", base::UTF16ToUTF8(model->GetLabelAt(i)).c_str(), status); } return ret; @@ -194,8 +194,7 @@ GlobalMenuBarX11::~GlobalMenuBarX11() { // static std::string GlobalMenuBarX11::GetPathForWindow(x11::Window window) { - return base::StringPrintf("/com/canonical/menu/%X", - static_cast(window)); + return absl::StrFormat("/com/canonical/menu/%X", static_cast(window)); } void GlobalMenuBarX11::SetMenu(ElectronMenuModel* menu_model) { diff --git a/shell/browser/ui/views/menu_bar.cc b/shell/browser/ui/views/menu_bar.cc index ec55d1a161..970d79da3c 100644 --- a/shell/browser/ui/views/menu_bar.cc +++ b/shell/browser/ui/views/menu_bar.cc @@ -8,6 +8,7 @@ #include "shell/browser/native_window.h" #include "shell/browser/ui/views/submenu_button.h" +#include "ui/base/mojom/menu_source_type.mojom.h" #include "ui/color/color_provider.h" #include "ui/native_theme/common_theme.h" #include "ui/views/background.h" @@ -196,9 +197,10 @@ void MenuBar::ButtonPressed(size_t id, const ui::Event& event) { // Deleted in MenuDelegate::OnMenuClosed auto* menu_delegate = new MenuDelegate(this); - menu_delegate->RunMenu( - menu_model_->GetSubmenuModelAt(id), source, - event.IsKeyEvent() ? ui::MENU_SOURCE_KEYBOARD : ui::MENU_SOURCE_MOUSE); + menu_delegate->RunMenu(menu_model_->GetSubmenuModelAt(id), source, + event.IsKeyEvent() + ? ui::mojom::MenuSourceType::kKeyboard + : ui::mojom::MenuSourceType::kMouse); menu_delegate->AddObserver(this); } diff --git a/shell/browser/ui/views/menu_delegate.cc b/shell/browser/ui/views/menu_delegate.cc index 895fc0e0c5..2d7ca15f2a 100644 --- a/shell/browser/ui/views/menu_delegate.cc +++ b/shell/browser/ui/views/menu_delegate.cc @@ -10,6 +10,7 @@ #include "content/public/browser/browser_thread.h" #include "shell/browser/ui/views/menu_bar.h" #include "shell/browser/ui/views/menu_model_adapter.h" +#include "ui/base/mojom/menu_source_type.mojom.h" #include "ui/views/controls/button/menu_button.h" #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/menu_runner.h" @@ -23,14 +24,14 @@ MenuDelegate::~MenuDelegate() = default; void MenuDelegate::RunMenu(ElectronMenuModel* model, views::Button* button, - ui::MenuSourceType source_type) { + ui::mojom::MenuSourceType source_type) { gfx::Point screen_loc; views::View::ConvertPointToScreen(button, &screen_loc); // Subtract 1 from the height to make the popup flush with the button border. gfx::Rect bounds(screen_loc.x(), screen_loc.y(), button->width(), button->height() - 1); - if (source_type == ui::MENU_SOURCE_KEYBOARD) { + if (source_type == ui::mojom::MenuSourceType::kKeyboard) { hold_first_switch_ = true; } diff --git a/shell/browser/ui/views/menu_delegate.h b/shell/browser/ui/views/menu_delegate.h index 036a124a5a..4655aaa8a6 100644 --- a/shell/browser/ui/views/menu_delegate.h +++ b/shell/browser/ui/views/menu_delegate.h @@ -36,7 +36,7 @@ class MenuDelegate : public views::MenuDelegate { void RunMenu(ElectronMenuModel* model, views::Button* button, - ui::MenuSourceType source_type); + ui::mojom::MenuSourceType source_type); class Observer { public: diff --git a/shell/browser/ui/win/notify_icon.cc b/shell/browser/ui/win/notify_icon.cc index 6666ea4447..beaca1675b 100644 --- a/shell/browser/ui/win/notify_icon.cc +++ b/shell/browser/ui/win/notify_icon.cc @@ -10,6 +10,7 @@ #include "base/strings/string_util_win.h" #include "base/strings/utf_string_conversions.h" #include "shell/browser/ui/win/notify_icon_host.h" +#include "ui/base/mojom/menu_source_type.mojom.h" #include "ui/display/screen.h" #include "ui/display/win/screen_win.h" #include "ui/gfx/geometry/point.h" @@ -227,7 +228,7 @@ void NotifyIcon::PopUpContextMenu(const gfx::Point& pos, } menu_runner_->RunMenuAt(nullptr, nullptr, rect, views::MenuAnchorPosition::kTopLeft, - ui::MENU_SOURCE_MOUSE); + ui::mojom::MenuSourceType::kMouse); } void NotifyIcon::CloseContextMenu() { diff --git a/shell/common/application_info.cc b/shell/common/application_info.cc index c1a1f0f763..8540ba1f00 100644 --- a/shell/common/application_info.cc +++ b/shell/common/application_info.cc @@ -6,12 +6,12 @@ #include "base/i18n/rtl.h" #include "base/no_destructor.h" -#include "base/strings/stringprintf.h" #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_version.h" #include "content/public/common/user_agent.h" #include "electron/electron_version.h" #include "shell/browser/browser.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" namespace electron { @@ -42,7 +42,7 @@ std::string GetApplicationUserAgent() { user_agent = "Chrome/" CHROME_VERSION_STRING " " ELECTRON_PRODUCT_NAME "/" ELECTRON_VERSION_STRING; } else { - user_agent = base::StringPrintf( + user_agent = absl::StrFormat( "%s/%s Chrome/%s " ELECTRON_PRODUCT_NAME "/" ELECTRON_VERSION_STRING, name.c_str(), browser->GetVersion().c_str(), CHROME_VERSION_STRING); } diff --git a/shell/common/color_util.cc b/shell/common/color_util.cc index adddbf22bb..d8b169a4e4 100644 --- a/shell/common/color_util.cc +++ b/shell/common/color_util.cc @@ -7,8 +7,8 @@ #include #include -#include "base/strings/stringprintf.h" #include "content/public/common/color_parser.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" namespace { @@ -48,12 +48,12 @@ SkColor ParseCSSColor(const std::string& color_string) { } std::string ToRGBHex(SkColor color) { - return base::StringPrintf("#%02X%02X%02X", SkColorGetR(color), - SkColorGetG(color), SkColorGetB(color)); + return absl::StrFormat("#%02X%02X%02X", SkColorGetR(color), + SkColorGetG(color), SkColorGetB(color)); } std::string ToRGBAHex(SkColor color, bool include_hash) { - std::string color_str = base::StringPrintf( + std::string color_str = absl::StrFormat( "%02X%02X%02X%02X", SkColorGetR(color), SkColorGetG(color), SkColorGetB(color), SkColorGetA(color)); if (include_hash) { diff --git a/shell/common/gin_converters/content_converter.cc b/shell/common/gin_converters/content_converter.cc index 8629ce98c2..888e848576 100644 --- a/shell/common/gin_converters/content_converter.cc +++ b/shell/common/gin_converters/content_converter.cc @@ -48,9 +48,9 @@ static_assert(std::size(MenuSourceTypes) == static_cast(ui::mojom::MenuSourceType::kMaxValue) + 1); // static -v8::Local Converter::ToV8( +v8::Local Converter::ToV8( v8::Isolate* isolate, - const ui::MenuSourceType& in) { + const ui::mojom::MenuSourceType& in) { for (auto const& [key, val] : MenuSourceTypes) if (in == val) return StringToV8(isolate, key); @@ -58,9 +58,10 @@ v8::Local Converter::ToV8( } // static -bool Converter::FromV8(v8::Isolate* isolate, - v8::Local val, - ui::MenuSourceType* out) { +bool Converter::FromV8( + v8::Isolate* isolate, + v8::Local val, + ui::mojom::MenuSourceType* out) { return FromV8WithLookup(isolate, val, MenuSourceTypes, out); } diff --git a/shell/common/gin_converters/content_converter.h b/shell/common/gin_converters/content_converter.h index 760fe41971..2fa5f7f118 100644 --- a/shell/common/gin_converters/content_converter.h +++ b/shell/common/gin_converters/content_converter.h @@ -13,7 +13,7 @@ #include "third_party/blink/public/common/permissions/permission_utils.h" #include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h" #include "third_party/blink/public/mojom/permissions/permission_status.mojom-forward.h" -#include "ui/base/ui_base_types.h" +#include "ui/base/mojom/menu_source_type.mojom-forward.h" namespace content { struct ContextMenuParams; @@ -44,12 +44,12 @@ struct Converter { }; template <> -struct Converter { +struct Converter { static v8::Local ToV8(v8::Isolate* isolate, - const ui::MenuSourceType& val); + const ui::mojom::MenuSourceType& val); static bool FromV8(v8::Isolate* isolate, v8::Local val, - ui::MenuSourceType* out); + ui::mojom::MenuSourceType* out); }; template <> diff --git a/shell/common/gin_converters/serial_port_info_converter.h b/shell/common/gin_converters/serial_port_info_converter.h index 26a4b81190..4bd4587b19 100644 --- a/shell/common/gin_converters/serial_port_info_converter.h +++ b/shell/common/gin_converters/serial_port_info_converter.h @@ -22,9 +22,9 @@ struct Converter { if (port->display_name && !port->display_name->empty()) dict.Set("displayName", *port->display_name); if (port->has_vendor_id) - dict.Set("vendorId", base::StringPrintf("%u", port->vendor_id)); + dict.Set("vendorId", absl::StrFormat("%u", port->vendor_id)); if (port->has_product_id) - dict.Set("productId", base::StringPrintf("%u", port->product_id)); + dict.Set("productId", absl::StrFormat("%u", port->product_id)); if (port->serial_number && !port->serial_number->empty()) dict.Set("serialNumber", *port->serial_number); #if BUILDFLAG(IS_MAC) diff --git a/shell/common/gin_converters/std_converter.h b/shell/common/gin_converters/std_converter.h index eb6d4c1874..96ffb82818 100644 --- a/shell/common/gin_converters/std_converter.h +++ b/shell/common/gin_converters/std_converter.h @@ -54,14 +54,6 @@ struct Converter { } }; -template <> -struct Converter { - static v8::Local ToV8(v8::Isolate* isolate, const char* val) { - return v8::String::NewFromUtf8(isolate, val, v8::NewStringType::kNormal) - .ToLocalChecked(); - } -}; - template <> struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const char* val) { @@ -70,12 +62,10 @@ struct Converter { } }; -template -struct Converter { - static v8::Local ToV8(v8::Isolate* isolate, const char* val) { - return v8::String::NewFromUtf8(isolate, val, v8::NewStringType::kNormal, - n - 1) - .ToLocalChecked(); +template +struct Converter { + static v8::Local ToV8(v8::Isolate* isolate, const char (&val)[N]) { + return v8::String::NewFromUtf8Literal(isolate, val); } }; diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index b2b94d89e0..5a0aaa6e96 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -568,7 +568,7 @@ void NodeBindings::Initialize(v8::Local context) { if (!fuses::IsNodeOptionsEnabled()) process_flags |= node::ProcessInitializationFlags::kDisableNodeOptionsEnv; - std::unique_ptr result = + std::shared_ptr result = node::InitializeOncePerProcess( args, static_cast(process_flags)); diff --git a/shell/common/options_switches.cc b/shell/common/options_switches.cc deleted file mode 100644 index 918d5faf36..0000000000 --- a/shell/common/options_switches.cc +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) 2013 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#include "shell/common/options_switches.h" - -namespace electron { - -namespace options { - -const char kTitle[] = "title"; -const char kIcon[] = "icon"; -const char kFrame[] = "frame"; -const char kShow[] = "show"; -const char kCenter[] = "center"; -const char kX[] = "x"; -const char kY[] = "y"; -const char kWidth[] = "width"; -const char kHeight[] = "height"; -const char kMinWidth[] = "minWidth"; -const char kMinHeight[] = "minHeight"; -const char kMaxWidth[] = "maxWidth"; -const char kMaxHeight[] = "maxHeight"; -const char kResizable[] = "resizable"; -const char kMovable[] = "movable"; -const char kMinimizable[] = "minimizable"; -const char kMaximizable[] = "maximizable"; -const char kFullScreenable[] = "fullscreenable"; -const char kClosable[] = "closable"; -const char kFullscreen[] = "fullscreen"; -const char kTrafficLightPosition[] = "trafficLightPosition"; -const char kRoundedCorners[] = "roundedCorners"; - -// The color to use as the theme and symbol colors respectively for Window -// Controls Overlay if enabled on Windows. -const char kOverlayButtonColor[] = "color"; -const char kOverlaySymbolColor[] = "symbolColor"; - -// The custom height for Window Controls Overlay. -const char kOverlayHeight[] = "height"; - -// whether to keep the window out of mission control -const char kHiddenInMissionControl[] = "hiddenInMissionControl"; -// Whether the window should show in taskbar. -const char kSkipTaskbar[] = "skipTaskbar"; - -// Start with the kiosk mode, see Opera's page for description: -// http://www.opera.com/support/mastering/kiosk/ -const char kKiosk[] = "kiosk"; - -const char kSimpleFullScreen[] = "simpleFullscreen"; - -// Make windows stays on the top of all other windows. -const char kAlwaysOnTop[] = "alwaysOnTop"; - -// Enable the NSView to accept first mouse event. -const char kAcceptFirstMouse[] = "acceptFirstMouse"; - -// Whether window size should include window frame. -const char kUseContentSize[] = "useContentSize"; - -// Whether window zoom should be to page width. -const char kZoomToPageWidth[] = "zoomToPageWidth"; - -// The requested title bar style for the window -const char kTitleBarStyle[] = "titleBarStyle"; - -// Tabbing identifier for the window if native tabs are enabled on macOS. -const char kTabbingIdentifier[] = "tabbingIdentifier"; - -// The menu bar is hidden unless "Alt" is pressed. -const char kAutoHideMenuBar[] = "autoHideMenuBar"; - -// Enable window to be resized larger than screen. -const char kEnableLargerThanScreen[] = "enableLargerThanScreen"; - -// Forces to use dark theme on Linux. -const char kDarkTheme[] = "darkTheme"; - -// Whether the window should be transparent. -const char kTransparent[] = "transparent"; - -// Window type hint. -const char kType[] = "type"; - -// Disable auto-hiding cursor. -const char kDisableAutoHideCursor[] = "disableAutoHideCursor"; - -// Default browser window background color. -const char kBackgroundColor[] = "backgroundColor"; - -// Whether the window should have a shadow. -const char kHasShadow[] = "hasShadow"; - -// Browser window opacity -const char kOpacity[] = "opacity"; - -// Whether the window can be activated. -const char kFocusable[] = "focusable"; - -// The WebPreferences. -const char kWebPreferences[] = "webPreferences"; - -// Add a vibrancy effect to the browser window -const char kVibrancyType[] = "vibrancy"; - -// Add a vibrancy effect to the browser window. -const char kBackgroundMaterial[] = "backgroundMaterial"; - -// Specify how the material appearance should reflect window activity state on -// macOS. -const char kVisualEffectState[] = "visualEffectState"; - -// The factor of which page should be zoomed. -const char kZoomFactor[] = "zoomFactor"; - -// Script that will be loaded by guest WebContents before other scripts. -const char kPreloadScript[] = "preload"; - -// Enable the node integration. -const char kNodeIntegration[] = "nodeIntegration"; - -// Enable context isolation of Electron APIs and preload script -const char kContextIsolation[] = "contextIsolation"; - -// Web runtime features. -const char kExperimentalFeatures[] = "experimentalFeatures"; - -// Enable the rubber banding effect. -const char kScrollBounce[] = "scrollBounce"; - -// Enable blink features. -const char kEnableBlinkFeatures[] = "enableBlinkFeatures"; - -// Disable blink features. -const char kDisableBlinkFeatures[] = "disableBlinkFeatures"; - -// Enable the node integration in WebWorker. -const char kNodeIntegrationInWorker[] = "nodeIntegrationInWorker"; - -// Enable the web view tag. -const char kWebviewTag[] = "webviewTag"; - -const char kCustomArgs[] = "additionalArguments"; - -const char kPlugins[] = "plugins"; - -const char kSandbox[] = "sandbox"; - -const char kWebSecurity[] = "webSecurity"; - -const char kAllowRunningInsecureContent[] = "allowRunningInsecureContent"; - -const char kOffscreen[] = "offscreen"; - -const char kUseSharedTexture[] = "useSharedTexture"; - -const char kNodeIntegrationInSubFrames[] = "nodeIntegrationInSubFrames"; - -// Disable window resizing when HTML Fullscreen API is activated. -const char kDisableHtmlFullscreenWindowResize[] = - "disableHtmlFullscreenWindowResize"; - -// Enables JavaScript support. -const char kJavaScript[] = "javascript"; - -// Enables image support. -const char kImages[] = "images"; - -// Make TextArea elements resizable. -const char kTextAreasAreResizable[] = "textAreasAreResizable"; - -// Enables WebGL support. -const char kWebGL[] = "webgl"; - -// Whether dragging and dropping a file or link onto the page causes a -// navigation. -const char kNavigateOnDragDrop[] = "navigateOnDragDrop"; - -const char kHiddenPage[] = "hiddenPage"; - -#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER) -const char kSpellcheck[] = "spellcheck"; -#endif - -const char kEnablePreferredSizeMode[] = "enablePreferredSizeMode"; - -const char ktitleBarOverlay[] = "titleBarOverlay"; - -} // namespace options - -namespace switches { - -// Enable chromium sandbox. -const char kEnableSandbox[] = "enable-sandbox"; - -// Disable HTTP cache. -const char kDisableHttpCache[] = "disable-http-cache"; - -// The list of standard schemes. -const char kStandardSchemes[] = "standard-schemes"; - -// Register schemes to handle service worker. -const char kServiceWorkerSchemes[] = "service-worker-schemes"; - -// Register schemes as secure. -const char kSecureSchemes[] = "secure-schemes"; - -// Register schemes as bypassing CSP. -const char kBypassCSPSchemes[] = "bypasscsp-schemes"; - -// Register schemes as support fetch API. -const char kFetchSchemes[] = "fetch-schemes"; - -// Register schemes as CORS enabled. -const char kCORSSchemes[] = "cors-schemes"; - -// Register schemes as streaming responses. -const char kStreamingSchemes[] = "streaming-schemes"; - -// Register schemes as supporting V8 code cache. -const char kCodeCacheSchemes[] = "code-cache-schemes"; - -// The browser process app model ID -const char kAppUserModelId[] = "app-user-model-id"; - -// The application path -const char kAppPath[] = "app-path"; - -// The command line switch versions of the options. -const char kScrollBounce[] = "scroll-bounce"; - -// Command switch passed to renderer process to control nodeIntegration. -const char kNodeIntegrationInWorker[] = "node-integration-in-worker"; - -// Widevine options -// Path to Widevine CDM binaries. -const char kWidevineCdmPath[] = "widevine-cdm-path"; -// Widevine CDM version. -const char kWidevineCdmVersion[] = "widevine-cdm-version"; - -// Forces the maximum disk space to be used by the disk cache, in bytes. -const char kDiskCacheSize[] = "disk-cache-size"; - -// Ignore the limit of 6 connections per host. -const char kIgnoreConnectionsLimit[] = "ignore-connections-limit"; - -// Whitelist containing servers for which Integrated Authentication is enabled. -const char kAuthServerWhitelist[] = "auth-server-whitelist"; - -// Whitelist containing servers for which Kerberos delegation is allowed. -const char kAuthNegotiateDelegateWhitelist[] = - "auth-negotiate-delegate-whitelist"; - -// If set, include the port in generated Kerberos SPNs. -const char kEnableAuthNegotiatePort[] = "enable-auth-negotiate-port"; - -// If set, NTLM v2 is disabled for POSIX platforms. -const char kDisableNTLMv2[] = "disable-ntlm-v2"; - -} // namespace switches - -} // namespace electron diff --git a/shell/common/options_switches.h b/shell/common/options_switches.h index 6b99e9e79d..d6b95fb3c4 100644 --- a/shell/common/options_switches.h +++ b/shell/common/options_switches.h @@ -5,127 +5,289 @@ #ifndef ELECTRON_SHELL_COMMON_OPTIONS_SWITCHES_H_ #define ELECTRON_SHELL_COMMON_OPTIONS_SWITCHES_H_ -#include "electron/buildflags/buildflags.h" +#include + +#include "base/strings/cstring_view.h" namespace electron { namespace options { -extern const char kTitle[]; -extern const char kIcon[]; -extern const char kFrame[]; -extern const char kShow[]; -extern const char kCenter[]; -extern const char kX[]; -extern const char kY[]; -extern const char kWidth[]; -extern const char kHeight[]; -extern const char kMinWidth[]; -extern const char kMinHeight[]; -extern const char kMaxWidth[]; -extern const char kMaxHeight[]; -extern const char kResizable[]; -extern const char kMovable[]; -extern const char kMinimizable[]; -extern const char kMaximizable[]; -extern const char kFullScreenable[]; -extern const char kClosable[]; -extern const char kHiddenInMissionControl[]; -extern const char kFullscreen[]; -extern const char kSkipTaskbar[]; -extern const char kKiosk[]; -extern const char kSimpleFullScreen[]; -extern const char kAlwaysOnTop[]; -extern const char kAcceptFirstMouse[]; -extern const char kUseContentSize[]; -extern const char kZoomToPageWidth[]; -extern const char kTitleBarStyle[]; -extern const char kTabbingIdentifier[]; -extern const char kAutoHideMenuBar[]; -extern const char kEnableLargerThanScreen[]; -extern const char kDarkTheme[]; -extern const char kTransparent[]; -extern const char kType[]; -extern const char kDisableAutoHideCursor[]; -extern const char kBackgroundColor[]; -extern const char kHasShadow[]; -extern const char kOpacity[]; -extern const char kFocusable[]; -extern const char kWebPreferences[]; -extern const char kVibrancyType[]; -extern const char kBackgroundMaterial[]; -extern const char kVisualEffectState[]; -extern const char kTrafficLightPosition[]; -extern const char kRoundedCorners[]; -extern const char ktitleBarOverlay[]; -extern const char kOverlayButtonColor[]; -extern const char kOverlaySymbolColor[]; -extern const char kOverlayHeight[]; +inline constexpr std::string_view kTitle = "title"; +inline constexpr std::string_view kIcon = "icon"; +inline constexpr std::string_view kFrame = "frame"; +inline constexpr std::string_view kShow = "show"; +inline constexpr std::string_view kCenter = "center"; +inline constexpr std::string_view kX = "x"; +inline constexpr std::string_view kY = "y"; +inline constexpr std::string_view kWidth = "width"; +inline constexpr std::string_view kHeight = "height"; +inline constexpr std::string_view kMinWidth = "minWidth"; +inline constexpr std::string_view kMinHeight = "minHeight"; +inline constexpr std::string_view kMaxWidth = "maxWidth"; +inline constexpr std::string_view kMaxHeight = "maxHeight"; +inline constexpr std::string_view kResizable = "resizable"; +inline constexpr std::string_view kMovable = "movable"; +inline constexpr std::string_view kMinimizable = "minimizable"; +inline constexpr std::string_view kMaximizable = "maximizable"; +inline constexpr std::string_view kFullScreenable = "fullscreenable"; +inline constexpr std::string_view kClosable = "closable"; -// WebPreferences. -extern const char kZoomFactor[]; -extern const char kPreloadScript[]; -extern const char kNodeIntegration[]; -extern const char kContextIsolation[]; -extern const char kExperimentalFeatures[]; -extern const char kScrollBounce[]; -extern const char kEnableBlinkFeatures[]; -extern const char kDisableBlinkFeatures[]; -extern const char kNodeIntegrationInWorker[]; -extern const char kWebviewTag[]; -extern const char kCustomArgs[]; -extern const char kPlugins[]; -extern const char kSandbox[]; -extern const char kWebSecurity[]; -extern const char kAllowRunningInsecureContent[]; -extern const char kOffscreen[]; -extern const char kUseSharedTexture[]; -extern const char kNodeIntegrationInSubFrames[]; -extern const char kDisableHtmlFullscreenWindowResize[]; -extern const char kJavaScript[]; -extern const char kImages[]; -extern const char kTextAreasAreResizable[]; -extern const char kWebGL[]; -extern const char kNavigateOnDragDrop[]; -extern const char kEnablePreferredSizeMode[]; +// whether to keep the window out of mission control +inline constexpr std::string_view kHiddenInMissionControl = + "hiddenInMissionControl"; -extern const char kHiddenPage[]; +inline constexpr std::string_view kFullscreen = "fullscreen"; -#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER) -extern const char kSpellcheck[]; -#endif +// Whether the window should show in taskbar. +inline constexpr std::string_view kSkipTaskbar = "skipTaskbar"; +// Start with the kiosk mode, see Opera's page for description: +// http://www.opera.com/support/mastering/kiosk/ +inline constexpr std::string_view kKiosk = "kiosk"; + +inline constexpr std::string_view kSimpleFullscreen = "simpleFullscreen"; + +// Make windows stays on the top of all other windows. +inline constexpr std::string_view kAlwaysOnTop = "alwaysOnTop"; + +// Enable the NSView to accept first mouse event. +inline constexpr std::string_view kAcceptFirstMouse = "acceptFirstMouse"; + +// Whether window size should include window frame. +inline constexpr std::string_view kUseContentSize = "useContentSize"; + +// Whether window zoom should be to page width. +inline constexpr std::string_view kZoomToPageWidth = "zoomToPageWidth"; + +// The requested title bar style for the window +inline constexpr std::string_view kTitleBarStyle = "titleBarStyle"; + +// Tabbing identifier for the window if native tabs are enabled on macOS. +inline constexpr std::string_view kTabbingIdentifier = "tabbingIdentifier"; + +// The menu bar is hidden unless "Alt" is pressed. +inline constexpr std::string_view kAutoHideMenuBar = "autoHideMenuBar"; + +// Enable window to be resized larger than screen. +inline constexpr std::string_view kEnableLargerThanScreen = + "enableLargerThanScreen"; + +// Forces to use dark theme on Linux. +inline constexpr std::string_view kDarkTheme = "darkTheme"; + +// Whether the window should be transparent. +inline constexpr std::string_view kTransparent = "transparent"; + +// Window type hint. +inline constexpr std::string_view kType = "type"; + +// Disable auto-hiding cursor. +inline constexpr std::string_view kDisableAutoHideCursor = + "disableAutoHideCursor"; + +// Default browser window background color. +inline constexpr std::string_view kBackgroundColor = "backgroundColor"; + +// Whether the window should have a shadow. +inline constexpr std::string_view kHasShadow = "hasShadow"; + +// Browser window opacity +inline constexpr std::string_view kOpacity = "opacity"; + +// Whether the window can be activated. +inline constexpr std::string_view kFocusable = "focusable"; + +// The WebPreferences. +inline constexpr std::string_view kWebPreferences = "webPreferences"; + +// Add a vibrancy effect to the browser window +inline constexpr std::string_view kVibrancyType = "vibrancy"; + +// Add a vibrancy effect to the browser window. +inline constexpr std::string_view kBackgroundMaterial = "backgroundMaterial"; + +// Specify how the material appearance should reflect window activity state on +// macOS. +inline constexpr std::string_view kVisualEffectState = "visualEffectState"; + +inline constexpr std::string_view kTrafficLightPosition = + "trafficLightPosition"; +inline constexpr std::string_view kRoundedCorners = "roundedCorners"; + +inline constexpr std::string_view ktitleBarOverlay = "titleBarOverlay"; + +// The color to use as the theme and symbol colors respectively for Window +// Controls Overlay if enabled on Windows. +inline constexpr std::string_view kOverlayButtonColor = "color"; +inline constexpr std::string_view kOverlaySymbolColor = "symbolColor"; + +// The custom height for Window Controls Overlay. +inline constexpr std::string_view kOverlayHeight = "height"; + +/// WebPreferences. + +// The factor of which page should be zoomed. +inline constexpr std::string_view kZoomFactor = "zoomFactor"; + +// Script that will be loaded by guest WebContents before other scripts. +inline constexpr std::string_view kPreloadScript = "preload"; + +// Enable the node integration. +inline constexpr std::string_view kNodeIntegration = "nodeIntegration"; + +// Enable context isolation of Electron APIs and preload script +inline constexpr std::string_view kContextIsolation = "contextIsolation"; + +// Web runtime features. +inline constexpr std::string_view kExperimentalFeatures = + "experimentalFeatures"; + +// Enable the rubber banding effect. +inline constexpr std::string_view kScrollBounce = "scrollBounce"; + +// Enable blink features. +inline constexpr std::string_view kEnableBlinkFeatures = "enableBlinkFeatures"; + +// Disable blink features. +inline constexpr std::string_view kDisableBlinkFeatures = + "disableBlinkFeatures"; + +// Enable the node integration in WebWorker. +inline constexpr std::string_view kNodeIntegrationInWorker = + "nodeIntegrationInWorker"; + +// Enable the web view tag. +inline constexpr std::string_view kWebviewTag = "webviewTag"; + +inline constexpr std::string_view kCustomArgs = "additionalArguments"; + +inline constexpr std::string_view kPlugins = "plugins"; + +inline constexpr std::string_view kSandbox = "sandbox"; + +inline constexpr std::string_view kWebSecurity = "webSecurity"; + +inline constexpr std::string_view kAllowRunningInsecureContent = + "allowRunningInsecureContent"; + +inline constexpr std::string_view kOffscreen = "offscreen"; + +inline constexpr std::string_view kUseSharedTexture = "useSharedTexture"; + +inline constexpr std::string_view kNodeIntegrationInSubFrames = + "nodeIntegrationInSubFrames"; + +// Disable window resizing when HTML Fullscreen API is activated. +inline constexpr std::string_view kDisableHtmlFullscreenWindowResize = + "disableHtmlFullscreenWindowResize"; + +// Enables JavaScript support. +inline constexpr std::string_view kJavaScript = "javascript"; + +// Enables image support. +inline constexpr std::string_view kImages = "images"; + +// Make TextArea elements resizable. +inline constexpr std::string_view kTextAreasAreResizable = + "textAreasAreResizable"; + +// Enables WebGL support. +inline constexpr std::string_view kWebGL = "webgl"; + +// Whether dragging and dropping a file or link onto the page causes a +// navigation. +inline constexpr std::string_view kNavigateOnDragDrop = "navigateOnDragDrop"; + +inline constexpr std::string_view kEnablePreferredSizeMode = + "enablePreferredSizeMode"; + +inline constexpr std::string_view kHiddenPage = "hiddenPage"; + +inline constexpr std::string_view kSpellcheck = "spellcheck"; } // namespace options // Following are actually command line switches, should be moved to other files. namespace switches { -extern const char kEnableSandbox[]; -extern const char kDisableHttpCache[]; -extern const char kStandardSchemes[]; -extern const char kServiceWorkerSchemes[]; -extern const char kSecureSchemes[]; -extern const char kBypassCSPSchemes[]; -extern const char kFetchSchemes[]; -extern const char kCORSSchemes[]; -extern const char kStreamingSchemes[]; -extern const char kCodeCacheSchemes[]; -extern const char kAppUserModelId[]; -extern const char kAppPath[]; +// Implementation detail: base::cstring_view used for switches because +// base::CommandLine::CopySwitchesFrom() still needs C-style strings. +// These constants can migrate to std::string_view if that function does. -extern const char kScrollBounce[]; -extern const char kNodeIntegrationInWorker[]; +// Enable chromium sandbox. +inline constexpr base::cstring_view kEnableSandbox = "enable-sandbox"; -extern const char kWidevineCdmPath[]; -extern const char kWidevineCdmVersion[]; +// Disable HTTP cache. +inline constexpr base::cstring_view kDisableHttpCache = "disable-http-cache"; + +// The list of standard schemes. +inline constexpr base::cstring_view kStandardSchemes = "standard-schemes"; + +// Register schemes to handle service worker. +inline constexpr base::cstring_view kServiceWorkerSchemes = + "service-worker-schemes"; + +// Register schemes as secure. +inline constexpr base::cstring_view kSecureSchemes = "secure-schemes"; + +// Register schemes as bypassing CSP. +inline constexpr base::cstring_view kBypassCSPSchemes = "bypasscsp-schemes"; + +// Register schemes as support fetch API. +inline constexpr base::cstring_view kFetchSchemes = "fetch-schemes"; + +// Register schemes as CORS enabled. +inline constexpr base::cstring_view kCORSSchemes = "cors-schemes"; + +// Register schemes as streaming responses. +inline constexpr base::cstring_view kStreamingSchemes = "streaming-schemes"; + +// Register schemes as supporting V8 code cache. +inline constexpr base::cstring_view kCodeCacheSchemes = "code-cache-schemes"; + +// The browser process app model ID +inline constexpr base::cstring_view kAppUserModelId = "app-user-model-id"; + +// The application path +inline constexpr base::cstring_view kAppPath = "app-path"; + +// The command line switch versions of the options. +inline constexpr base::cstring_view kScrollBounce = "scroll-bounce"; + +// Command switch passed to renderer process to control nodeIntegration. +inline constexpr base::cstring_view kNodeIntegrationInWorker = + "node-integration-in-worker"; + +// Widevine options +// Path to Widevine CDM binaries. +inline constexpr base::cstring_view kWidevineCdmPath = "widevine-cdm-path"; +// Widevine CDM version. +inline constexpr base::cstring_view kWidevineCdmVersion = + "widevine-cdm-version"; + +// Forces the maximum disk space to be used by the disk cache, in bytes. +inline constexpr base::cstring_view kDiskCacheSize = "disk-cache-size"; + +// Ignore the limit of 6 connections per host. +inline constexpr base::cstring_view kIgnoreConnectionsLimit = + "ignore-connections-limit"; + +// Whitelist containing servers for which Integrated Authentication is enabled. +inline constexpr base::cstring_view kAuthServerWhitelist = + "auth-server-whitelist"; + +// Whitelist containing servers for which Kerberos delegation is allowed. +inline constexpr base::cstring_view kAuthNegotiateDelegateWhitelist = + "auth-negotiate-delegate-whitelist"; + +// If set, include the port in generated Kerberos SPNs. +inline constexpr base::cstring_view kEnableAuthNegotiatePort = + "enable-auth-negotiate-port"; + +// If set, NTLM v2 is disabled for POSIX platforms. +inline constexpr base::cstring_view kDisableNTLMv2 = "disable-ntlm-v2"; -extern const char kDiskCacheSize[]; -extern const char kIgnoreConnectionsLimit[]; -extern const char kAuthServerWhitelist[]; -extern const char kAuthNegotiateDelegateWhitelist[]; -extern const char kEnableAuthNegotiatePort[]; -extern const char kDisableNTLMv2[]; } // namespace switches } // namespace electron diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index 30d18c8d07..f187895afd 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -11,7 +11,6 @@ #include "base/command_line.h" #include "base/strings/string_split.h" -#include "base/strings/stringprintf.h" #include "components/network_hints/renderer/web_prescient_networking_impl.h" #include "content/common/buildflags.h" #include "content/public/common/content_constants.h" @@ -36,6 +35,7 @@ #include "shell/renderer/content_settings_observer.h" #include "shell/renderer/electron_api_service_impl.h" #include "shell/renderer/electron_autofill_agent.h" +#include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/common/web_preferences/web_preferences.h" @@ -112,8 +112,9 @@ void SetIsWebView(v8::Isolate* isolate, v8::Local object) { dict.SetHidden("isWebView", true); } -std::vector ParseSchemesCLISwitch(base::CommandLine* command_line, - const char* switch_name) { +std::vector ParseSchemesCLISwitch( + base::CommandLine* command_line, + const std::string_view switch_name) { std::string custom_schemes = command_line->GetSwitchValueASCII(switch_name); return base::SplitString(custom_schemes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); @@ -204,8 +205,8 @@ RendererClientBase* RendererClientBase::Get() { void RendererClientBase::BindProcess(v8::Isolate* isolate, gin_helper::Dictionary* process, content::RenderFrame* render_frame) { - auto context_id = base::StringPrintf( - "%s-%" PRId64, renderer_client_id_.c_str(), ++next_context_id_); + auto context_id = absl::StrFormat("%s-%" PRId64, renderer_client_id_.c_str(), + ++next_context_id_); process->SetReadOnly("isMainFrame", render_frame->IsMainFrame()); process->SetReadOnly("contextIsolated", diff --git a/spec/api-utility-process-spec.ts b/spec/api-utility-process-spec.ts index b17a6f70a8..9e2dad10df 100644 --- a/spec/api-utility-process-spec.ts +++ b/spec/api-utility-process-spec.ts @@ -510,7 +510,8 @@ describe('utilityProcess module', () => { expect(output).to.equal(result); }); - it('does not inherit parent env when custom env is provided', async () => { + // TODO(codebytere): figure out why this is failing in ASAN- builds on Linux. + ifit(!process.env.IS_ASAN)('does not inherit parent env when custom env is provided', async () => { const appProcess = childProcess.spawn(process.execPath, [path.join(fixturesPath, 'env-app'), '--create-custom-env'], { env: { FROM: 'parent', diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index a8cea93bbe..3370a01b4a 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -97,7 +97,7 @@ describe('chrome extensions', () => { const warning = await new Promise(resolve => { process.on('warning', resolve); }); - const malformedHost = /Permission 'malformed_host' is unknown or URL pattern is malformed/; + const malformedHost = /URL pattern 'malformed_host' is malformed/; expect(warning).to.match(malformedHost); }); diff --git a/spec/fixtures/native-addon/external-ab/binding.cc b/spec/fixtures/native-addon/external-ab/binding.cc index 277e13f97e..df1d52546c 100644 --- a/spec/fixtures/native-addon/external-ab/binding.cc +++ b/spec/fixtures/native-addon/external-ab/binding.cc @@ -1,5 +1,4 @@ #include -#undef NAPI_VERSION #include #include diff --git a/spec/lib/events-helpers.ts b/spec/lib/events-helpers.ts index 2eca91da38..ead2cb5539 100644 --- a/spec/lib/events-helpers.ts +++ b/spec/lib/events-helpers.ts @@ -20,4 +20,5 @@ export const emittedUntil = async (emitter: NodeJS.EventEmitter, eventName: stri for await (const args of on(emitter, eventName)) { if (untilFn(...args)) { return args; } } + return []; }; diff --git a/yarn.lock b/yarn.lock index b7ad6caee8..cac51c4a3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -997,12 +997,12 @@ dependencies: undici-types "~6.19.2" -"@types/node@^20.9.0": - version "20.9.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298" - integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw== +"@types/node@^22.7.7": + version "22.7.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.7.tgz#6cd9541c3dccb4f7e8b141b491443f4a1570e307" + integrity sha512-SRxCrrg9CL/y54aiMCG3edPKdprgMVGDXjA3gB8UmmBW5TcXzRUYAh8EWzTnSJFAd1rgImPELza+A3bJ+qxz8Q== dependencies: - undici-types "~5.26.4" + undici-types "~6.19.2" "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -4199,11 +4199,6 @@ lint-staged@^10.2.11: string-argv "0.3.1" stringify-object "^3.3.0" -lint@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/lint/-/lint-1.1.2.tgz#35ed064f322547c331358d899868664968ba371f" - integrity sha1-Ne0GTzIlR8MxNY2JmGhmSWi6Nx8= - listr2@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/listr2/-/listr2-2.2.0.tgz#cb88631258abc578c7fb64e590fe5742f28e4aac" @@ -7047,14 +7042,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -7446,11 +7434,6 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - undici-types@~6.19.2: version "6.19.8" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"